59 character(len=LENMEMPATH) :: memory_path
60 character(len=LINELENGTH) :: fname
61 character(len=16) :: solver_mode
64 integer(I4B),
pointer :: id
65 integer(I4B),
pointer :: iu
66 real(dp),
pointer :: ttform
67 real(dp),
pointer :: ttsoln
68 integer(I4B),
pointer :: isymmetric => null()
69 integer(I4B),
pointer :: neq => null()
70 integer(I4B),
pointer :: matrix_offset => null()
75 real(dp),
dimension(:),
pointer,
contiguous :: rhs => null()
76 real(dp),
dimension(:),
pointer,
contiguous :: x => null()
77 integer(I4B),
dimension(:),
pointer,
contiguous :: active => null()
78 real(dp),
dimension(:),
pointer,
contiguous :: xtemp => null()
82 real(dp),
pointer :: theta => null()
83 real(dp),
pointer :: akappa => null()
84 real(dp),
pointer :: gamma => null()
85 real(dp),
pointer :: amomentum => null()
86 real(dp),
pointer :: breduc => null()
87 real(dp),
pointer :: btol => null()
88 real(dp),
pointer :: res_lim => null()
89 real(dp),
pointer :: dvclose => null()
90 real(dp),
pointer :: bigchold => null()
91 real(dp),
pointer :: bigch => null()
92 real(dp),
pointer :: relaxold => null()
93 real(dp),
pointer :: res_prev => null()
94 real(dp),
pointer :: res_new => null()
95 integer(I4B),
pointer :: icnvg => null()
96 integer(I4B),
pointer :: itertot_timestep => null()
97 integer(I4B),
pointer :: iouttot_timestep => null()
98 integer(I4B),
pointer :: itertot_sim => null()
99 integer(I4B),
pointer :: mxiter => null()
100 integer(I4B),
pointer :: linsolver => null()
101 integer(I4B),
pointer :: nonmeth => null()
102 integer(I4B),
pointer :: numtrack => null()
103 integer(I4B),
pointer :: iprims => null()
104 integer(I4B),
pointer :: ibflag => null()
105 integer(I4B),
dimension(:, :),
pointer,
contiguous :: lrch => null()
106 real(dp),
dimension(:),
pointer,
contiguous :: hncg => null()
107 real(dp),
dimension(:),
pointer,
contiguous :: dxold => null()
108 real(dp),
dimension(:),
pointer,
contiguous :: deold => null()
109 real(dp),
dimension(:),
pointer,
contiguous :: wsave => null()
110 real(dp),
dimension(:),
pointer,
contiguous :: hchold => null()
113 character(len=31),
dimension(:),
pointer,
contiguous :: caccel => null()
114 integer(I4B),
pointer :: icsvouterout => null()
115 integer(I4B),
pointer :: icsvinnerout => null()
116 integer(I4B),
pointer :: nitermax => null()
117 integer(I4B),
pointer :: convnmod => null()
118 integer(I4B),
dimension(:),
pointer,
contiguous :: convmodstart => null()
125 integer(I4B),
pointer :: idv_scale => null()
126 real(dp),
pointer :: dscale => null()
129 integer(I4B),
pointer :: iallowptc => null()
130 integer(I4B),
pointer :: iptcopt => null()
131 integer(I4B),
pointer :: iptcout => null()
132 real(dp),
pointer :: l2norm0 => null()
133 real(dp),
pointer :: ptcdel => null()
134 real(dp),
pointer :: ptcdel0 => null()
135 real(dp),
pointer :: ptcexp => null()
138 integer(I4B) :: tmr_prep_solve
139 integer(I4B) :: tmr_solve
140 integer(I4B) :: tmr_final_solve
141 integer(I4B) :: tmr_formulate
142 integer(I4B) :: tmr_linsolve
143 integer(I4B) :: tmr_flows
144 integer(I4B) :: tmr_budgets
145 character(len=24) :: id_postfix
148 real(dp),
pointer :: atsfrac => null()
161 class(*),
pointer :: synchronize_ctx => null()
224 integer(I4B) :: stage
225 class(*),
pointer :: ctx
244 character(len=*),
intent(in) :: filename
245 integer(I4B),
intent(in) :: id
247 integer(I4B) :: inunit
249 character(len=LENSOLUTIONNAME) :: solutionname
253 write (solutionname,
'(a, i0)')
'SLN_', id
255 num_sol%name = solutionname
257 allocate (num_sol%modellist)
258 allocate (num_sol%exchangelist)
260 call num_sol%allocate_scalars()
269 inquire (file=filename, number=inunit)
271 if (inunit < 0) inunit =
getunit()
273 write (
iout,
'(/a,a)')
' Creating solution: ', num_sol%name
277 call num_sol%parser%Initialize(num_sol%iu,
iout)
294 call mem_allocate(this%ttform,
'TTFORM', this%memory_path)
295 call mem_allocate(this%ttsoln,
'TTSOLN', this%memory_path)
296 call mem_allocate(this%isymmetric,
'ISYMMETRIC', this%memory_path)
298 call mem_allocate(this%matrix_offset,
'MATRIX_OFFSET', this%memory_path)
299 call mem_allocate(this%dvclose,
'DVCLOSE', this%memory_path)
300 call mem_allocate(this%bigchold,
'BIGCHOLD', this%memory_path)
301 call mem_allocate(this%bigch,
'BIGCH', this%memory_path)
302 call mem_allocate(this%relaxold,
'RELAXOLD', this%memory_path)
303 call mem_allocate(this%res_prev,
'RES_PREV', this%memory_path)
304 call mem_allocate(this%res_new,
'RES_NEW', this%memory_path)
305 call mem_allocate(this%icnvg,
'ICNVG', this%memory_path)
306 call mem_allocate(this%itertot_timestep,
'ITERTOT_TIMESTEP', this%memory_path)
307 call mem_allocate(this%iouttot_timestep,
'IOUTTOT_TIMESTEP', this%memory_path)
308 call mem_allocate(this%itertot_sim,
'INNERTOT_SIM', this%memory_path)
309 call mem_allocate(this%mxiter,
'MXITER', this%memory_path)
310 call mem_allocate(this%linsolver,
'LINSOLVER', this%memory_path)
311 call mem_allocate(this%nonmeth,
'NONMETH', this%memory_path)
312 call mem_allocate(this%iprims,
'IPRIMS', this%memory_path)
313 call mem_allocate(this%theta,
'THETA', this%memory_path)
314 call mem_allocate(this%akappa,
'AKAPPA', this%memory_path)
315 call mem_allocate(this%gamma,
'GAMMA', this%memory_path)
316 call mem_allocate(this%amomentum,
'AMOMENTUM', this%memory_path)
317 call mem_allocate(this%breduc,
'BREDUC', this%memory_path)
319 call mem_allocate(this%res_lim,
'RES_LIM', this%memory_path)
320 call mem_allocate(this%numtrack,
'NUMTRACK', this%memory_path)
321 call mem_allocate(this%ibflag,
'IBFLAG', this%memory_path)
322 call mem_allocate(this%icsvouterout,
'ICSVOUTEROUT', this%memory_path)
323 call mem_allocate(this%icsvinnerout,
'ICSVINNEROUT', this%memory_path)
324 call mem_allocate(this%nitermax,
'NITERMAX', this%memory_path)
325 call mem_allocate(this%convnmod,
'CONVNMOD', this%memory_path)
326 call mem_allocate(this%iallowptc,
'IALLOWPTC', this%memory_path)
327 call mem_allocate(this%iptcopt,
'IPTCOPT', this%memory_path)
328 call mem_allocate(this%iptcout,
'IPTCOUT', this%memory_path)
329 call mem_allocate(this%l2norm0,
'L2NORM0', this%memory_path)
330 call mem_allocate(this%ptcdel,
'PTCDEL', this%memory_path)
331 call mem_allocate(this%ptcdel0,
'PTCDEL0', this%memory_path)
332 call mem_allocate(this%ptcexp,
'PTCEXP', this%memory_path)
333 call mem_allocate(this%atsfrac,
'ATSFRAC', this%memory_path)
334 call mem_allocate(this%idv_scale,
'IDV_SCALE', this%memory_path)
335 call mem_allocate(this%dscale,
'DSCALE', this%memory_path)
345 this%bigchold =
dzero
347 this%relaxold =
dzero
348 this%res_prev =
dzero
350 this%itertot_timestep = 0
351 this%iouttot_timestep = 0
360 this%amomentum =
dzero
366 this%icsvouterout = 0
367 this%icsvinnerout = 0
398 this%convnmod = this%modellist%Count()
401 call mem_allocate(this%active, this%neq,
'IACTIVE', this%memory_path)
402 call mem_allocate(this%xtemp, this%neq,
'XTEMP', this%memory_path)
403 call mem_allocate(this%dxold, this%neq,
'DXOLD', this%memory_path)
404 call mem_allocate(this%hncg, 0,
'HNCG', this%memory_path)
405 call mem_allocate(this%lrch, 3, 0,
'LRCH', this%memory_path)
406 call mem_allocate(this%wsave, 0,
'WSAVE', this%memory_path)
407 call mem_allocate(this%hchold, 0,
'HCHOLD', this%memory_path)
408 call mem_allocate(this%deold, 0,
'DEOLD', this%memory_path)
409 call mem_allocate(this%convmodstart, this%convnmod + 1,
'CONVMODSTART', &
414 this%xtemp(i) =
dzero
415 this%dxold(i) =
dzero
421 this%convmodstart(1) = ieq
422 do i = 1, this%modellist%Count()
425 this%convmodstart(i + 1) = ieq
447 integer(I4B),
allocatable,
dimension(:) :: rowmaxnnz
448 integer(I4B) :: ncol, irow_start, irow_end
449 integer(I4B) :: mod_offset
452 do i = 1, this%modellist%Count()
454 call mp%set_idsoln(this%id)
455 this%neq = this%neq + mp%neq
460 this%solver_mode =
'PETSC'
462 this%solver_mode =
'IMS'
466 allocate (this%linear_settings)
470 this%system_matrix => this%linear_solver%create_matrix()
471 this%vec_x => this%system_matrix%create_vec_mm(this%neq,
'X', &
473 this%x => this%vec_x%get_array()
474 this%vec_rhs => this%system_matrix%create_vec_mm(this%neq,
'RHS', &
476 this%rhs => this%vec_rhs%get_array()
478 call this%vec_rhs%get_ownership_range(irow_start, irow_end)
479 ncol = this%vec_rhs%get_size()
483 this%matrix_offset = irow_start - 1
484 do i = 1, this%modellist%Count()
491 call this%allocate_arrays()
494 allocate (this%cnvg_summary)
495 call this%cnvg_summary%init(this%modellist%Count(), this%convmodstart, &
499 do i = 1, this%modellist%Count()
501 call mp%set_xptr(this%x, this%matrix_offset,
'X', this%name)
502 call mp%set_rhsptr(this%rhs, this%matrix_offset,
'RHS', this%name)
503 call mp%set_iboundptr(this%active, this%matrix_offset,
'IBOUND', this%name)
507 allocate (rowmaxnnz(this%neq))
511 call this%sparse%init(this%neq, ncol, rowmaxnnz)
512 this%sparse%offset = this%matrix_offset
513 deallocate (rowmaxnnz)
516 call this%sln_connect()
519 write (this%id_postfix,
'(a,i0,a)')
" (", this%id,
")"
520 this%tmr_prep_solve = -1
522 this%tmr_final_solve = -1
523 this%tmr_formulate = -1
524 this%tmr_linsolve = -1
526 this%tmr_budgets = -1
546 character(len=linelength) :: keyword
547 character(len=linelength) :: fname
548 character(len=linelength) :: msg
550 integer(I4B) :: ifdparam, mxvl, npp
552 logical(LGP) :: isfound, endOfBlock
555 character(len=*),
parameter :: fmtcsvout = &
556 "(4x, 'CSV OUTPUT WILL BE SAVED TO FILE: ', a, &
557 &/4x, 'OPENED ON UNIT: ', I7)"
558 character(len=*),
parameter :: fmtptcout = &
559 "(4x, 'PTC OUTPUT WILL BE SAVED TO FILE: ', a, &
560 &/4x, 'OPENED ON UNIT: ', I7)"
561 character(len=*),
parameter :: fmterrasym = &
562 "(a,' **',a,'** PRODUCES AN ASYMMETRIC COEFFICIENT MATRIX, BUT THE &
563 &CONJUGATE GRADIENT METHOD WAS SELECTED. USE BICGSTAB INSTEAD. ')"
566 WRITE (
iout, 1) this%iu
567 00001
FORMAT(1x, /1x,
'IMS -- ITERATIVE MODEL SOLUTION PACKAGE, VERSION 6', &
568 ', 4/28/2017', /, 9x,
'INPUT READ FROM UNIT', i5)
577 call this%parser%GetBlock(
'OPTIONS', isfound, ierr, &
578 supportopenclose=.true., blockrequired=.false.)
582 write (
iout,
'(/1x,a)')
'PROCESSING IMS OPTIONS'
584 call this%parser%GetNextLine(endofblock)
586 call this%parser%GetStringCaps(keyword)
587 select case (keyword)
588 case (
'PRINT_OPTION')
589 call this%parser%GetStringCaps(keyword)
590 if (keyword .eq.
'NONE')
then
592 else if (keyword .eq.
'SUMMARY')
then
594 else if (keyword .eq.
'ALL')
then
597 write (errmsg,
'(3a)') &
598 'Unknown IMS print option (', trim(keyword),
').'
602 call this%parser%GetStringCaps(keyword)
603 if (keyword .eq.
'SIMPLE')
then
606 else if (keyword .eq.
'MODERATE')
then
609 else if (keyword .eq.
'COMPLEX')
then
613 write (errmsg,
'(3a)') &
614 'Unknown IMS COMPLEXITY option (', trim(keyword),
').'
617 case (
'CSV_OUTER_OUTPUT')
618 call this%parser%GetStringCaps(keyword)
619 if (keyword ==
'FILEOUT')
then
620 call this%parser%GetString(fname)
621 if (nr_procs > 1)
then
622 call append_processor_id(fname, proc_id)
625 call openfile(this%icsvouterout,
iout, fname,
'CSV_OUTER_OUTPUT', &
626 filstat_opt=
'REPLACE')
627 write (
iout, fmtcsvout) trim(fname), this%icsvouterout
629 write (errmsg,
'(a)')
'Optional CSV_OUTER_OUTPUT '// &
630 'keyword must be followed by FILEOUT'
633 case (
'CSV_INNER_OUTPUT')
634 call this%parser%GetStringCaps(keyword)
635 if (keyword ==
'FILEOUT')
then
636 call this%parser%GetString(fname)
637 if (nr_procs > 1)
then
638 call append_processor_id(fname, proc_id)
641 call openfile(this%icsvinnerout,
iout, fname,
'CSV_INNER_OUTPUT', &
642 filstat_opt=
'REPLACE')
643 write (
iout, fmtcsvout) trim(fname), this%icsvinnerout
645 write (errmsg,
'(a)')
'Optional CSV_INNER_OUTPUT '// &
646 'keyword must be followed by FILEOUT'
650 call this%parser%GetStringCaps(keyword)
651 select case (keyword)
662 this%iallowptc = ival
663 write (
iout,
'(3x,A)')
'PSEUDO-TRANSIENT CONTINUATION DISABLED FOR'// &
664 ' '//trim(adjustl(msg))//
' STRESS-PERIOD(S)'
665 case (
'ATS_OUTER_MAXIMUM_FRACTION')
666 rval = this%parser%GetDouble()
668 write (errmsg,
'(a,G0)')
'Value for ATS_OUTER_MAXIMUM_FRAC must be &
669 &between 0 and 0.5. Found ', rval
673 write (
iout,
'(3x,A,G0)')
'ADAPTIVE TIME STEP SETTING FOUND. FRACTION &
674 &OF OUTER MAXIMUM USED TO INCREASE OR DECREASE TIME STEP SIZE IS ',&
682 call this%parser%DevOpt()
684 write (
iout,
'(1x,A)')
'PSEUDO-TRANSIENT CONTINUATION ENABLED'
685 case (
'DEV_PTC_OUTPUT')
686 call this%parser%DevOpt()
688 call this%parser%GetStringCaps(keyword)
689 if (keyword ==
'FILEOUT')
then
690 call this%parser%GetString(fname)
691 if (nr_procs > 1)
then
692 call append_processor_id(fname, proc_id)
696 filstat_opt=
'REPLACE')
697 write (
iout, fmtptcout) trim(fname), this%iptcout
699 write (errmsg,
'(a)') &
700 'Optional PTC_OUTPUT keyword must be followed by FILEOUT'
703 case (
'DEV_PTC_OPTION')
704 call this%parser%DevOpt()
707 write (
iout,
'(1x,A)') &
708 'PSEUDO-TRANSIENT CONTINUATION USES BNORM AND L2NORM TO '// &
710 case (
'DEV_PTC_EXPONENT')
711 call this%parser%DevOpt()
712 rval = this%parser%GetDouble()
713 if (rval <=
dzero)
then
714 write (errmsg,
'(a)')
'PTC_EXPONENT must be > 0.'
719 write (
iout,
'(1x,A,1x,g15.7)') &
720 'PSEUDO-TRANSIENT CONTINUATION EXPONENT', this%ptcexp
722 case (
'DEV_PTC_DEL0')
723 call this%parser%DevOpt()
724 rval = this%parser%GetDouble()
725 if (rval <=
dzero)
then
726 write (errmsg,
'(a)')
'IMS sln_ar: PTC_DEL0 must be > 0.'
731 write (
iout,
'(1x,A,1x,g15.7)') &
732 'PSEUDO-TRANSIENT CONTINUATION INITIAL TIMESTEP', this%ptcdel0
735 write (errmsg,
'(a,2(1x,a))') &
736 'Unknown IMS option (', trim(keyword),
').'
740 write (
iout,
'(1x,a)')
'END OF IMS OPTIONS'
742 write (
iout,
'(1x,a)')
'NO IMS OPTION BLOCK DETECTED.'
745 00021
FORMAT(1x,
'SIMPLE OPTION:', /, &
746 1x,
'DEFAULT SOLVER INPUT VALUES FOR FAST SOLUTIONS')
747 00023
FORMAT(1x,
'MODERATE OPTION:', /, 1x,
'DEFAULT SOLVER', &
748 ' INPUT VALUES REFLECT MODERATELY NONLINEAR MODEL')
749 00025
FORMAT(1x,
'COMPLEX OPTION:', /, 1x,
'DEFAULT SOLVER', &
750 ' INPUT VALUES REFLECT STRONGLY NONLINEAR MODEL')
754 call this%sln_setouter(ifdparam)
757 call this%parser%GetBlock(
'NONLINEAR', isfound, ierr, &
758 supportopenclose=.true., blockrequired=.false.)
762 write (
iout,
'(/1x,a)')
'PROCESSING IMS NONLINEAR'
764 call this%parser%GetNextLine(endofblock)
766 call this%parser%GetStringCaps(keyword)
768 select case (keyword)
769 case (
'OUTER_DVCLOSE')
770 this%dvclose = this%parser%GetDouble()
771 case (
'OUTER_MAXIMUM')
772 this%mxiter = this%parser%GetInteger()
773 case (
'UNDER_RELAXATION')
774 call this%parser%GetStringCaps(keyword)
776 if (keyword ==
'NONE')
then
778 else if (keyword ==
'SIMPLE')
then
780 else if (keyword ==
'COOLEY')
then
782 else if (keyword ==
'DBD')
then
785 write (errmsg,
'(3a)') &
786 'Unknown UNDER_RELAXATION specified (', trim(keyword),
').'
790 case (
'LINEAR_SOLVER')
791 call this%parser%GetStringCaps(keyword)
793 if (keyword .eq.
'DEFAULT' .or. &
794 keyword .eq.
'LINEAR')
then
797 write (errmsg,
'(3a)') &
798 'Unknown LINEAR_SOLVER specified (', trim(keyword),
').'
801 this%linsolver = ival
802 case (
'UNDER_RELAXATION_THETA')
803 this%theta = this%parser%GetDouble()
804 case (
'UNDER_RELAXATION_KAPPA')
805 this%akappa = this%parser%GetDouble()
806 case (
'UNDER_RELAXATION_GAMMA')
807 this%gamma = this%parser%GetDouble()
808 case (
'UNDER_RELAXATION_MOMENTUM')
809 this%amomentum = this%parser%GetDouble()
810 case (
'BACKTRACKING_NUMBER')
811 this%numtrack = this%parser%GetInteger()
812 IF (this%numtrack > 0) this%ibflag = 1
813 case (
'BACKTRACKING_TOLERANCE')
814 this%btol = this%parser%GetDouble()
815 case (
'BACKTRACKING_REDUCTION_FACTOR')
816 this%breduc = this%parser%GetDouble()
817 case (
'BACKTRACKING_RESIDUAL_LIMIT')
818 this%res_lim = this%parser%GetDouble()
820 write (errmsg,
'(3a)') &
821 'Unknown IMS NONLINEAR keyword (', trim(keyword),
').'
825 write (
iout,
'(1x,a)')
'END OF IMS NONLINEAR DATA'
827 if (ifdparam .EQ. 0)
then
828 write (errmsg,
'(a)')
'NO IMS NONLINEAR block detected.'
833 if (this%theta <
dem3)
then
838 if (this%nonmeth < 1)
then
843 if (this%mxiter <= 0)
then
844 write (errmsg,
'(a)')
'Outer iteration number must be > 0.'
849 if (this%nonmeth > 0)
then
850 WRITE (
iout, *)
'**UNDER-RELAXATION WILL BE USED***'
852 elseif (this%nonmeth == 0)
then
853 WRITE (
iout, *)
'***UNDER-RELAXATION WILL NOT BE USED***'
856 WRITE (errmsg,
'(a)') &
857 'Incorrect value for variable NONMETH was specified.'
862 if (this%nonmeth == 1)
then
863 if (this%gamma == 0)
then
864 WRITE (errmsg,
'(a)') &
865 'GAMMA must be greater than zero if SIMPLE under-relaxation is used.'
870 if (this%solver_mode ==
'PETSC')
then
875 call this%linear_settings%init(this%memory_path)
876 call this%linear_settings%preset_config(ifdparam)
877 call this%linear_settings%read_from_file(this%parser,
iout)
878 call this%linear_settings%check_settings()
880 if (this%linear_settings%ilinmeth ==
cg_method)
then
886 if (this%solver_mode ==
"IMS")
then
887 allocate (this%imslinear)
888 WRITE (
iout, *)
'***IMS LINEAR SOLVER WILL BE USED***'
889 call this%imslinear%imslinear_allocate(this%name,
iout, this%iprims, &
890 this%mxiter, this%neq, &
891 this%system_matrix, this%rhs, &
892 this%x, this%linear_settings)
895 else if (this%solver_mode ==
"PETSC")
then
896 call this%linear_solver%initialize(this%system_matrix, &
897 this%linear_settings, &
902 write (errmsg,
'(a)') &
903 'Incorrect value for linear solution method specified.'
908 if (this%isymmetric == 1)
then
909 write (
iout,
'(1x,a,/)')
'A symmetric matrix will be solved'
911 write (
iout,
'(1x,a,/)')
'An asymmetric matrix will be solved'
916 if (this%isymmetric == 1)
then
919 do i = 1, this%modellist%Count()
921 if (mp%get_iasym() /= 0)
then
922 write (errmsg, fmterrasym)
'MODEL', trim(adjustl(mp%name))
928 do i = 1, this%exchangelist%Count()
930 if (cp%get_iasym() /= 0)
then
931 write (errmsg, fmterrasym)
'EXCHANGE', trim(adjustl(cp%name))
940 this%idv_scale = this%sln_get_idvscale()
942 if (this%idv_scale > 0)
then
943 write (
iout,
'(2(1x,a,/),1x,a,/,6x,a,/)') &
944 'X and RHS will be scaled to avoid very large positive or negative', &
945 'dependent variable values in the model IMS package.', &
946 'NOTE: Specified outer and inner DVCLOSE values in the model IMS &
947 &package',
'will be relative closure criteria.'
948 else if (this%idv_scale < 0)
then
949 write (errmsg,
'(2(a,1x))') &
950 'dependent_variable_scaling must be specified for all models in', &
951 'the solution and can only be used with GWT and GWE models. '
959 WRITE (
iout, 9002) this%dvclose, this%mxiter, &
960 this%iprims, this%nonmeth, this%linsolver
963 9002
FORMAT(1x,
'OUTER ITERATION CONVERGENCE CRITERION (DVCLOSE) = ', e15.6, &
964 /1x,
'MAXIMUM NUMBER OF OUTER ITERATIONS (MXITER) = ', i0, &
965 /1x,
'SOLVER PRINTOUT INDEX (IPRIMS) = ', i0, &
966 /1x,
'NONLINEAR ITERATION METHOD (NONLINMETH) = ', i0, &
967 /1x,
'LINEAR SOLUTION METHOD (LINMETH) = ', i0)
969 if (this%nonmeth == 1)
then
970 write (
iout, 9003) this%gamma
971 else if (this%nonmeth == 2)
then
972 write (
iout, 9004) this%gamma
973 else if (this%nonmeth == 3)
then
974 write (
iout, 9005) this%theta, this%akappa, this%gamma, this%amomentum
978 if (this%numtrack /= 0)
write (
iout, 9006) this%numtrack, this%btol, &
979 this%breduc, this%res_lim
982 9003
FORMAT(1x,
'UNDER-RELAXATION FACTOR (GAMMA) = ', e15.6)
983 9004
FORMAT(1x,
'UNDER-RELAXATION PREVIOUS HISTORY FACTOR (GAMMA) = ', e15.6)
984 9005
FORMAT(1x,
'UNDER-RELAXATION WEIGHT REDUCTION FACTOR (THETA) = ', e15.6, &
985 /1x,
'UNDER-RELAXATION WEIGHT INCREASE INCREMENT (KAPPA) = ', e15.6, &
986 /1x,
'UNDER-RELAXATION PREVIOUS HISTORY FACTOR (GAMMA) = ', e15.6, &
987 /1x,
'UNDER-RELAXATION MOMENTUM TERM (AMOMENTUM) = ', e15.6)
990 9006
FORMAT(1x,
'MAXIMUM NUMBER OF BACKTRACKS (NUMTRACK) = ', i0, &
991 /1x,
'BACKTRACKING TOLERANCE FACTOR (BTOL) = ', e15.6, &
992 /1x,
'BACKTRACKING REDUCTION FACTOR (BREDUC) = ', e15.6, &
993 /1x,
'BACKTRACKING RESIDUAL LIMIT (RES_LIM) = ', e15.6)
997 call this%imslinear%imslinear_summary(this%mxiter)
999 call this%linear_solver%print_summary()
1005 call this%parser%StoreErrorUnit()
1010 call mem_reallocate(this%lrch, 3, this%mxiter,
'LRCH', this%name)
1013 if (this%nonmeth == 3)
then
1018 this%wsave(i) =
dzero
1019 this%hchold(i) =
dzero
1020 this%deold(i) =
dzero
1027 if (this%iprims == 2 .or. this%icsvinnerout > 0)
then
1028 this%nitermax = this%linear_settings%iter1 * this%mxiter
1033 allocate (this%caccel(this%nitermax))
1037 call this%cnvg_summary%reinit(this%nitermax)
1042 call this%parser%StoreErrorUnit()
1046 call this%parser%Clear()
1061 integer(I4B) :: idir
1062 real(DP) :: delt_temp
1063 real(DP) :: fact_lower
1064 real(DP) :: fact_upper
1070 if (this%atsfrac > dzero)
then
1072 fact_lower = this%mxiter * this%atsfrac
1073 fact_upper = this%mxiter - fact_lower
1074 if (this%iouttot_timestep < int(fact_lower))
then
1077 else if (this%iouttot_timestep > int(fact_upper))
then
1087 this%memory_path, idir=idir)
1103 if (
kper == 1 .and.
kstp == 1)
then
1104 call this%writeCSVHeader()
1108 call this%writePTCInfoToFile(
kper)
1112 this%itertot_timestep = 0
1113 this%iouttot_timestep = 0
1140 write (
iout,
'(//1x,a,1x,a,1x,a)') &
1141 'Solution', trim(adjustl(this%name)),
'summary'
1142 write (
iout,
"(1x,70('-'))")
1143 write (
iout,
'(1x,a,1x,g0,1x,a)') &
1144 'Total formulate time: ', this%ttform,
'seconds'
1145 write (
iout,
'(1x,a,1x,g0,1x,a,/)') &
1146 'Total solution time: ', this%ttsoln,
'seconds'
1163 call this%imslinear%imslinear_da()
1164 deallocate (this%imslinear)
1168 call this%modellist%Clear()
1169 call this%exchangelist%Clear()
1170 deallocate (this%modellist)
1171 deallocate (this%exchangelist)
1173 call this%system_matrix%destroy()
1174 deallocate (this%system_matrix)
1175 call this%vec_x%destroy()
1176 deallocate (this%vec_x)
1177 call this%vec_rhs%destroy()
1178 deallocate (this%vec_rhs)
1182 deallocate (this%caccel)
1185 if (
associated(this%innertab))
then
1186 call this%innertab%table_da()
1187 deallocate (this%innertab)
1188 nullify (this%innertab)
1192 if (
associated(this%outertab))
then
1193 call this%outertab%table_da()
1194 deallocate (this%outertab)
1195 nullify (this%outertab)
1210 call this%cnvg_summary%destroy()
1211 deallocate (this%cnvg_summary)
1214 call this%linear_solver%destroy()
1215 deallocate (this%linear_solver)
1218 call this%linear_settings%destroy()
1219 deallocate (this%linear_settings)
1273 subroutine sln_ca(this, isgcnvg, isuppress_output)
1276 integer(I4B),
intent(inout) :: isgcnvg
1277 integer(I4B),
intent(in) :: isuppress_output
1280 character(len=LINELENGTH) :: line
1281 character(len=LINELENGTH) :: fmt
1283 integer(I4B) :: kiter
1286 call this%prepareSolve()
1290 line =
'mode="validation" -- Skipping matrix assembly and solution.'
1292 do im = 1, this%modellist%Count()
1294 call mp%model_message(line, fmt=fmt)
1298 outerloop:
do kiter = 1, this%mxiter
1301 call this%solve(kiter, isuppress_output)
1304 if (this%icnvg == 1)
then
1311 call this%finalizeSolve(kiter, isgcnvg, isuppress_output)
1327 if (this%icsvouterout > 0)
then
1328 write (this%icsvouterout,
'(*(G0,:,","))') &
1329 'total_inner_iterations',
'totim',
'kper',
'kstp',
'nouter', &
1330 'inner_iterations',
'solution_outer_dvmax', &
1331 'solution_outer_dvmax_model',
'solution_outer_dvmax_package', &
1332 'solution_outer_dvmax_node'
1336 if (this%icsvinnerout > 0)
then
1337 write (this%icsvinnerout,
'(*(G0,:,","))', advance=
'NO') &
1338 'total_inner_iterations',
'totim',
'kper',
'kstp',
'nouter', &
1339 'ninner',
'solution_inner_dvmax',
'solution_inner_dvmax_model', &
1340 'solution_inner_dvmax_node'
1341 write (this%icsvinnerout,
'(*(G0,:,","))', advance=
'NO') &
1342 '',
'solution_inner_rmax',
'solution_inner_rmax_model', &
1343 'solution_inner_rmax_node'
1346 write (this%icsvinnerout,
'(*(G0,:,","))', advance=
'NO') &
1347 '',
'solution_inner_alpha'
1348 if (this%imslinear%ilinmeth == 2)
then
1349 write (this%icsvinnerout,
'(*(G0,:,","))', advance=
'NO') &
1350 '',
'solution_inner_omega'
1355 do im = 1, this%modellist%Count()
1357 write (this%icsvinnerout,
'(*(G0,:,","))', advance=
'NO') &
1358 '', trim(adjustl(mp%name))//
'_inner_dvmax', &
1359 trim(adjustl(mp%name))//
'_inner_dvmax_node', &
1360 trim(adjustl(mp%name))//
'_inner_rmax', &
1361 trim(adjustl(mp%name))//
'_inner_rmax_node'
1364 write (this%icsvinnerout,
'(a)')
''
1376 integer(I4B),
intent(in) :: kper
1378 integer(I4B) :: n, im, iallowptc, iptc
1383 do im = 1, this%modellist%Count()
1387 if (this%iallowptc < 0)
then
1395 iallowptc = this%iallowptc
1398 if (iallowptc > 0)
then
1400 call mp%model_ptcchk(iptc)
1407 write (
iout,
'(//)')
1410 write (
iout,
'(1x,a,1x,i0,1x,3a)') &
1411 'PSEUDO-TRANSIENT CONTINUATION WILL BE APPLIED TO MODEL', im,
'("', &
1412 trim(adjustl(mp%name)),
'") DURING THIS TIME STEP'
1433 call g_prof%start(
"Prepare solve"//this%id_postfix, this%tmr_prep_solve)
1439 do ic = 1, this%exchangelist%Count()
1445 do im = 1, this%modellist%Count()
1454 call g_prof%stop(this%tmr_prep_solve)
1468 subroutine solve(this, kiter, isuppress_output)
1473 integer(I4B),
intent(in) :: kiter
1474 integer(I4B),
intent(in) :: isuppress_output
1478 character(len=LINELENGTH) :: title
1479 character(len=LINELENGTH) :: tag
1480 character(len=LENPAKLOC) :: cmod
1481 character(len=LENPAKLOC) :: cpak
1482 character(len=LENPAKLOC) :: cpakout
1483 character(len=LENPAKLOC) :: strh
1484 character(len=25) :: cval
1485 character(len=7) :: cmsg
1487 integer(I4B) :: im, m_idx, model_id
1488 integer(I4B) :: icsv0
1489 integer(I4B) :: kcsv0
1490 integer(I4B) :: ntabrows
1491 integer(I4B) :: ntabcols
1492 integer(I4B) :: i0, i1
1493 integer(I4B) :: itestmat, n
1494 integer(I4B) :: iter
1495 integer(I4B) :: inewtonur
1496 integer(I4B) :: locmax_nur
1497 integer(I4B) :: iend
1498 integer(I4B) :: icnvgmod
1499 integer(I4B) :: iptc
1500 integer(I4B) :: node_user
1501 integer(I4B) :: ipak
1502 integer(I4B) :: ipos0
1503 integer(I4B) :: ipos1
1504 real(DP) :: dxmax_nur
1505 real(DP) :: dxold_max
1510 real(DP) :: outer_hncg
1513 call g_prof%start(
"Solve"//this%id_postfix, this%tmr_solve)
1517 icsv0 = max(1, this%itertot_sim + 1)
1518 kcsv0 = max(1, this%itertot_timestep + 1)
1521 if (this%iprims > 0)
then
1522 if (.not.
associated(this%outertab))
then
1528 if (this%numtrack > 0)
then
1529 ntabcols = ntabcols + 4
1533 title = trim(this%memory_path)//
' OUTER ITERATION SUMMARY'
1534 call table_cr(this%outertab, this%name, title)
1535 call this%outertab%table_df(ntabrows, ntabcols,
iout, &
1537 tag =
'OUTER ITERATION STEP'
1538 call this%outertab%initialize_column(tag, 25, alignment=
tableft)
1539 tag =
'OUTER ITERATION'
1540 call this%outertab%initialize_column(tag, 10, alignment=
tabright)
1541 tag =
'INNER ITERATION'
1542 call this%outertab%initialize_column(tag, 10, alignment=
tabright)
1543 if (this%numtrack > 0)
then
1544 tag =
'BACKTRACK FLAG'
1545 call this%outertab%initialize_column(tag, 10, alignment=
tabright)
1546 tag =
'BACKTRACK ITERATIONS'
1547 call this%outertab%initialize_column(tag, 10, alignment=
tabright)
1548 tag =
'INCOMING RESIDUAL'
1549 call this%outertab%initialize_column(tag, 15, alignment=
tabright)
1550 tag =
'OUTGOING RESIDUAL'
1551 call this%outertab%initialize_column(tag, 15, alignment=
tabright)
1553 tag =
'MAXIMUM CHANGE'
1554 call this%outertab%initialize_column(tag, 15, alignment=
tabright)
1555 tag =
'STEP SUCCESS'
1556 call this%outertab%initialize_column(tag, 7, alignment=
tabright)
1557 tag =
'MAXIMUM CHANGE MODEL-(CELLID) OR MODEL-PACKAGE-(NUMBER)'
1558 call this%outertab%initialize_column(tag, 34, alignment=
tabright)
1563 if (this%numtrack > 0)
then
1564 call this%sln_backtracking(mp, cp, kiter)
1568 call g_prof%start(
"Formulate", this%tmr_formulate)
1571 call this%sln_buildsystem(kiter, inewton=1)
1574 call this%sln_calc_ptc(iptc, ptcf)
1577 do im = 1, this%modellist%Count()
1579 call mp%model_nr(kiter, this%system_matrix, 1)
1582 call g_prof%stop(this%tmr_formulate)
1585 if (this%idv_scale /= 0)
then
1586 call this%sln_maxval(this%neq, this%x, this%dscale)
1592 call g_prof%start(
"Linear solve", this%tmr_linsolve)
1593 call this%sln_ls(kiter,
kstp,
kper, iter, iptc, ptcf)
1594 call g_prof%stop(this%tmr_linsolve)
1600 this%itertot_timestep = this%itertot_timestep + iter
1601 this%iouttot_timestep = this%iouttot_timestep + 1
1602 this%itertot_sim = this%itertot_sim + iter
1608 if (itestmat /= 0)
then
1609 open (99, file=
'sol_MF6.TXT')
1610 WRITE (99, *)
'MATRIX SOLUTION FOLLOWS'
1611 WRITE (99,
'(10(I8,G15.4))') (n, this%x(n), n=1, this%NEQ)
1618 call this%sln_get_dxmax(this%hncg(kiter), this%lrch(1, kiter))
1619 if (this%icnvg /= 0)
then
1621 if (this%sln_has_converged(this%hncg(kiter)))
then
1627 if (this%icnvg == 0)
then
1635 if (kiter == this%mxiter)
then
1640 if (this%iprims > 0)
then
1642 call this%sln_get_loc(this%lrch(1, kiter), strh)
1645 call this%outertab%add_term(cval)
1646 call this%outertab%add_term(kiter)
1647 call this%outertab%add_term(iter)
1648 if (this%numtrack > 0)
then
1649 call this%outertab%add_term(
' ')
1650 call this%outertab%add_term(
' ')
1651 call this%outertab%add_term(
' ')
1652 call this%outertab%add_term(
' ')
1654 call this%outertab%add_term(this%hncg(kiter))
1655 call this%outertab%add_term(cmsg)
1656 call this%outertab%add_term(trim(strh))
1660 do ic = 1, this%exchangelist%Count()
1662 call cp%exg_cc(this%icnvg)
1666 icnvgmod = this%icnvg
1670 do im = 1, this%modellist%Count()
1672 call mp%get_mcellid(0, cmod)
1673 call mp%model_cc(this%itertot_sim, kiter, iend, icnvgmod, &
1676 ipos0 = index(cpak,
'-', back=.true.)
1677 ipos1 = len_trim(cpak)
1678 write (cpakout,
'(a,a,"-(",i0,")",a)') &
1679 trim(cmod), cpak(1:ipos0 - 1), ipak, cpak(ipos0:ipos1)
1686 if (this%icnvg == 1)
then
1687 this%icnvg = this%sln_package_convergence(dpak, cpakout, iend)
1690 if (this%iprims > 0)
then
1692 if (this%icnvg /= 1)
then
1697 if (len_trim(cpakout) > 0)
then
1700 call this%outertab%add_term(cval)
1701 call this%outertab%add_term(kiter)
1702 call this%outertab%add_term(
' ')
1703 if (this%numtrack > 0)
then
1704 call this%outertab%add_term(
' ')
1705 call this%outertab%add_term(
' ')
1706 call this%outertab%add_term(
' ')
1707 call this%outertab%add_term(
' ')
1709 call this%outertab%add_term(dpak)
1710 call this%outertab%add_term(cmsg)
1711 call this%outertab%add_term(cpakout)
1717 if (this%icnvg /= 1)
then
1718 if (this%nonmeth > 0)
then
1719 call this%sln_underrelax(kiter, this%hncg(kiter), this%neq, &
1720 this%active, this%x, this%xtemp)
1722 call this%sln_calcdx(this%neq, this%active, &
1723 this%x, this%xtemp, this%dxold)
1730 do im = 1, this%modellist%Count()
1732 i0 = mp%moffset + 1 - this%matrix_offset
1733 i1 = i0 + mp%neq - 1
1734 call mp%model_nur(mp%neq, this%x(i0:i1), this%xtemp(i0:i1), &
1735 this%dxold(i0:i1), inewtonur, dxmax_nur, locmax_nur)
1739 inewtonur = this%sln_sync_newtonur_flag(inewtonur)
1742 if (inewtonur /= 0)
then
1746 call this%sln_maxval(this%neq, this%dxold, dxold_max)
1749 if (this%sln_nur_has_converged(dxold_max, this%hncg(kiter)))
then
1755 call this%sln_get_dxmax(this%hncg(kiter), this%lrch(1, kiter))
1759 if (this%iprims > 0)
then
1760 cval =
'Newton under-relaxation'
1762 call this%sln_get_loc(this%lrch(1, kiter), strh)
1765 call this%outertab%add_term(cval)
1766 call this%outertab%add_term(kiter)
1767 call this%outertab%add_term(iter)
1768 if (this%numtrack > 0)
then
1769 call this%outertab%add_term(
' ')
1770 call this%outertab%add_term(
' ')
1771 call this%outertab%add_term(
' ')
1772 call this%outertab%add_term(
' ')
1774 call this%outertab%add_term(this%hncg(kiter))
1775 call this%outertab%add_term(cmsg)
1776 call this%outertab%add_term(trim(strh))
1783 if (this%icsvouterout > 0)
then
1786 outer_hncg = this%hncg(kiter)
1789 if (abs(outer_hncg) > abs(dpak))
then
1792 call this%sln_get_nodeu(this%lrch(1, kiter), m_idx, node_user)
1796 else if (outer_hncg ==
dzero .and. dpak ==
dzero)
then
1806 ipos0 = index(cmod,
'_')
1807 read (cmod(1:ipos0 - 1), *) model_id
1809 ipos0 = index(cpak,
'-', back=.true.)
1810 cpakout = cpak(1:ipos0 - 1)
1813 write (this%icsvouterout,
'(*(G0,:,","))') &
1815 outer_hncg, model_id, trim(cpakout), node_user
1819 if (this%icsvinnerout > 0)
then
1820 call this%csv_convergence_summary(this%icsvinnerout,
totim,
kper,
kstp, &
1821 kiter, iter, icsv0, kcsv0)
1825 if (this%idv_scale /= 0)
then
1830 call g_prof%stop(this%tmr_solve)
1832 end subroutine solve
1844 integer(I4B),
intent(in) :: kiter
1845 integer(I4B),
intent(inout) :: isgcnvg
1846 integer(I4B),
intent(in) :: isuppress_output
1848 integer(I4B) :: ic, im
1852 character(len=*),
parameter :: fmtnocnvg = &
1853 "(1X,'Solution ', i0, ' did not converge for stress period ', i0, &
1854 &' and time step ', i0)"
1855 character(len=*),
parameter :: fmtcnvg = &
1856 "(1X, I0, ' CALLS TO NUMERICAL SOLUTION ', 'IN TIME STEP ', I0, &
1857 &' STRESS PERIOD ',I0,/1X,I0,' TOTAL ITERATIONS')"
1860 call g_prof%start(
"Finalize solve"//this%id_postfix, this%tmr_final_solve)
1864 if (this%iprims > 0)
then
1865 call this%outertab%finalize_table()
1871 if (this%icnvg /= 0)
then
1872 if (this%iprims > 0)
then
1873 write (
iout, fmtcnvg) kiter,
kstp,
kper, this%itertot_timestep
1882 if (this%iprims == 2)
then
1885 do im = 1, this%modellist%Count()
1887 call this%convergence_summary(mp%iout, im, this%itertot_timestep)
1891 call this%convergence_summary(
iout, this%convnmod + 1, &
1892 this%itertot_timestep)
1896 if (this%icnvg == 0) isgcnvg = 0
1898 call g_prof%start(
"Calculate flows", this%tmr_flows)
1902 do im = 1, this%modellist%Count()
1904 call mp%model_cq(this%icnvg, isuppress_output)
1908 do ic = 1, this%exchangelist%Count()
1910 call cp%exg_cq(isgcnvg, isuppress_output, this%id)
1913 call g_prof%stop(this%tmr_flows)
1914 call g_prof%start(
"Calculate budgets", this%tmr_budgets)
1918 do im = 1, this%modellist%Count()
1920 call mp%model_bd(this%icnvg, isuppress_output)
1924 do ic = 1, this%exchangelist%Count()
1926 call cp%exg_bd(isgcnvg, isuppress_output, this%id)
1930 call g_prof%stop(this%tmr_budgets)
1931 call g_prof%stop(this%tmr_final_solve)
1938 integer(I4B),
intent(in) :: kiter
1939 integer(I4B),
intent(in) :: inewton
1941 integer(I4B) :: im, ic
1946 call this%sln_reset()
1949 do im = 1, this%modellist%Count()
1951 call mp%model_reset()
1959 do ic = 1, this%exchangelist%Count()
1961 call cp%exg_cf(kiter)
1965 do im = 1, this%modellist%Count()
1967 call mp%model_cf(kiter)
1975 do ic = 1, this%exchangelist%Count()
1977 call cp%exg_fc(kiter, this%system_matrix, this%rhs, inewton)
1981 do im = 1, this%modellist%Count()
1983 call mp%model_fc(kiter, this%system_matrix, inewton)
1998 integer(I4B),
intent(in) :: iu
1999 integer(I4B),
intent(in) :: im
2000 integer(I4B),
intent(in) :: itertot_timestep
2002 character(len=LINELENGTH) :: title
2003 character(len=LINELENGTH) :: tag
2004 character(len=LENPAKLOC) :: loc_dvmax_str
2005 character(len=LENPAKLOC) :: loc_rmax_str
2006 integer(I4B) :: ntabrows
2007 integer(I4B) :: ntabcols
2008 integer(I4B) :: iinner
2010 integer(I4B) :: iouter
2013 integer(I4B) :: locdv
2014 integer(I4B) :: locdr
2026 if (.not.
associated(this%innertab))
then
2030 ntabrows = itertot_timestep
2034 title = trim(this%memory_path)//
' INNER ITERATION SUMMARY'
2035 call table_cr(this%innertab, this%name, title)
2036 call this%innertab%table_df(ntabrows, ntabcols, iu)
2037 tag =
'TOTAL ITERATION'
2038 call this%innertab%initialize_column(tag, 10, alignment=
tabright)
2039 tag =
'OUTER ITERATION'
2040 call this%innertab%initialize_column(tag, 10, alignment=
tabright)
2041 tag =
'INNER ITERATION'
2042 call this%innertab%initialize_column(tag, 10, alignment=
tabright)
2043 tag =
'MAXIMUM CHANGE'
2044 call this%innertab%initialize_column(tag, 15, alignment=
tabright)
2045 tag =
'MAXIMUM CHANGE MODEL-(CELLID)'
2047 tag =
'MAXIMUM RESIDUAL'
2048 call this%innertab%initialize_column(tag, 15, alignment=
tabright)
2049 tag =
'MAXIMUM RESIDUAL MODEL-(CELLID)'
2054 call this%innertab%set_maxbound(itertot_timestep)
2055 call this%innertab%set_iout(iu)
2060 do k = 1, itertot_timestep
2061 iinner = this%cnvg_summary%itinner(k)
2062 if (iinner <= i0)
then
2065 if (im > this%convnmod)
then
2068 do j = 1, this%convnmod
2069 if (abs(this%cnvg_summary%convdvmax(j, k)) > abs(dv))
then
2070 locdv = this%cnvg_summary%convlocdv(j, k)
2071 dv = this%cnvg_summary%convdvmax(j, k)
2073 if (abs(this%cnvg_summary%convrmax(j, k)) > abs(res))
then
2074 locdr = this%cnvg_summary%convlocr(j, k)
2075 res = this%cnvg_summary%convrmax(j, k)
2079 locdv = this%cnvg_summary%convlocdv(im, k)
2080 locdr = this%cnvg_summary%convlocr(im, k)
2081 dv = this%cnvg_summary%convdvmax(im, k)
2082 res = this%cnvg_summary%convrmax(im, k)
2084 call this%sln_get_loc(locdv, loc_dvmax_str)
2085 call this%sln_get_loc(locdr, loc_rmax_str)
2088 call this%innertab%add_term(k)
2089 call this%innertab%add_term(iouter)
2090 call this%innertab%add_term(iinner)
2091 call this%innertab%add_term(dv)
2092 call this%innertab%add_term(adjustr(trim(loc_dvmax_str)))
2093 call this%innertab%add_term(res)
2094 call this%innertab%add_term(adjustr(trim(loc_rmax_str)))
2107 niter, istart, kstart)
2112 integer(I4B),
intent(in) :: iu
2113 real(DP),
intent(in) :: totim
2114 integer(I4B),
intent(in) :: kper
2115 integer(I4B),
intent(in) :: kstp
2116 integer(I4B),
intent(in) :: kouter
2117 integer(I4B),
intent(in) :: niter
2118 integer(I4B),
intent(in) :: istart
2119 integer(I4B),
intent(in) :: kstart
2121 integer(I4B) :: itot
2122 integer(I4B) :: m_idx, j, k
2123 integer(I4B) :: kpos
2124 integer(I4B) :: loc_dvmax
2125 integer(I4B) :: loc_rmax
2126 integer(I4B) :: model_id, node_user
2136 kpos = kstart + k - 1
2137 write (iu,
'(*(G0,:,","))', advance=
'NO') &
2138 itot, totim, kper, kstp, kouter, k
2143 do j = 1, this%convnmod
2144 if (abs(this%cnvg_summary%convdvmax(j, kpos)) > abs(dvmax))
then
2145 loc_dvmax = this%cnvg_summary%convlocdv(j, kpos)
2146 dvmax = this%cnvg_summary%convdvmax(j, kpos)
2148 if (abs(this%cnvg_summary%convrmax(j, kpos)) > abs(rmax))
then
2149 loc_rmax = this%cnvg_summary%convlocr(j, kpos)
2150 rmax = this%cnvg_summary%convrmax(j, kpos)
2155 if (dvmax ==
dzero) loc_dvmax = 0
2156 if (rmax ==
dzero) loc_rmax = 0
2159 if (loc_dvmax > 0)
then
2160 call this%sln_get_nodeu(loc_dvmax, m_idx, node_user)
2162 model_id = num_mod%id
2167 write (iu,
'(*(G0,:,","))', advance=
'NO')
'', dvmax, model_id, node_user
2170 if (loc_rmax > 0)
then
2171 call this%sln_get_nodeu(loc_rmax, m_idx, node_user)
2173 model_id = num_mod%id
2178 write (iu,
'(*(G0,:,","))', advance=
'NO')
'', rmax, model_id, node_user
2182 write (iu,
'(*(G0,:,","))', advance=
'NO') &
2183 '', trim(adjustl(this%caccel(kpos)))
2188 do j = 1, this%cnvg_summary%convnmod
2189 loc_dvmax = this%cnvg_summary%convlocdv(j, kpos)
2190 dvmax = this%cnvg_summary%convdvmax(j, kpos)
2191 loc_rmax = this%cnvg_summary%convlocr(j, kpos)
2192 rmax = this%cnvg_summary%convrmax(j, kpos)
2195 if (loc_dvmax > 0)
then
2196 call this%sln_get_nodeu(loc_dvmax, m_idx, node_user)
2200 write (iu,
'(*(G0,:,","))', advance=
'NO')
'', dvmax, node_user
2203 if (loc_rmax > 0)
then
2204 call this%sln_get_nodeu(loc_rmax, m_idx, node_user)
2208 write (iu,
'(*(G0,:,","))', advance=
'NO')
'', rmax, node_user
2213 write (iu,
'(a)')
''
2235 character(len=*),
intent(in) :: filename
2237 integer(I4B) :: inunit
2239 select type (spm => this%system_matrix)
2242 open (unit=inunit, file=filename, status=
'unknown')
2243 write (inunit, *)
'ia'
2244 write (inunit, *) spm%ia
2245 write (inunit, *)
'ja'
2246 write (inunit, *) spm%ja
2247 write (inunit, *)
'amat'
2248 write (inunit, *) spm%amat
2249 write (inunit, *)
'rhs'
2250 write (inunit, *) this%rhs
2251 write (inunit, *)
'x'
2252 write (inunit, *) this%x
2288 models => this%modellist
2305 select type (exchange)
2316 type(
listtype),
pointer :: exchanges
2318 exchanges => this%exchangelist
2343 do im = 1, this%modellist%Count()
2345 call mp%model_ac(this%sparse)
2352 do ic = 1, this%exchangelist%Count()
2354 call cp%exg_ac(this%sparse)
2359 call this%sparse%sort()
2360 call this%system_matrix%init(this%sparse, this%name)
2361 call this%sparse%destroy()
2366 do im = 1, this%modellist%Count()
2368 call mp%model_mc(this%system_matrix)
2372 do ic = 1, this%exchangelist%Count()
2374 call cp%exg_mc(this%system_matrix)
2389 call this%system_matrix%zero_entries()
2390 call this%vec_rhs%zero_entries()
2399 subroutine sln_ls(this, kiter, kstp, kper, in_iter, iptc, ptcf)
2402 integer(I4B),
intent(in) :: kiter
2403 integer(I4B),
intent(in) :: kstp
2404 integer(I4B),
intent(in) :: kper
2405 integer(I4B),
intent(inout) :: in_iter
2406 integer(I4B),
intent(inout) :: iptc
2407 real(DP),
intent(in) :: ptcf
2409 logical(LGP) :: lsame
2411 integer(I4B) :: irow_glo
2412 integer(I4B) :: itestmat
2413 integer(I4B) :: ipos
2414 integer(I4B) :: icol_s
2415 integer(I4B) :: icol_e
2416 integer(I4B) :: jcol
2417 integer(I4B) :: iptct
2418 integer(I4B) :: iallowptc
2424 character(len=50) :: fname
2425 character(len=*),
parameter :: fmtfname =
"('mf6mat_', i0, '_', i0, &
2426 &'_', i0, '_', i0, '.txt')"
2429 do ieq = 1, this%neq
2432 irow_glo = ieq + this%matrix_offset
2435 this%xtemp(ieq) = this%x(ieq)
2439 if (this%active(ieq) > 0)
then
2441 adiag = abs(this%system_matrix%get_diag_value(irow_glo))
2442 if (adiag <
dem15)
then
2443 call this%system_matrix%set_diag_value(irow_glo, diagval)
2444 this%rhs(ieq) = this%rhs(ieq) + diagval * this%x(ieq)
2448 call this%system_matrix%set_diag_value(irow_glo,
done)
2449 call this%system_matrix%zero_row_offdiag(irow_glo)
2450 this%rhs(ieq) = this%x(ieq)
2456 do ieq = 1, this%neq
2457 if (this%active(ieq) > 0)
then
2458 icol_s = this%system_matrix%get_first_col_pos(ieq)
2459 icol_e = this%system_matrix%get_last_col_pos(ieq)
2460 do ipos = icol_s, icol_e
2461 jcol = this%system_matrix%get_column(ipos)
2462 if (jcol == ieq) cycle
2463 if (this%active(jcol) < 0)
then
2464 this%rhs(ieq) = this%rhs(ieq) - &
2465 (this%system_matrix%get_value_pos(ipos) * &
2467 call this%system_matrix%set_value_pos(ipos,
dzero)
2479 if (this%iallowptc < 0)
then
2488 iallowptc = this%iallowptc
2492 iptct = iptc * iallowptc
2496 if (iptct /= 0)
then
2497 call this%sln_l2norm(l2norm)
2500 if (kiter == 1)
then
2501 if (kper > 1 .or. kstp > 1)
then
2502 if (l2norm <= this%l2norm0)
then
2507 lsame =
is_close(l2norm, this%l2norm0)
2513 iptct = iptc * iallowptc
2514 if (iptct /= 0)
then
2515 if (kiter == 1)
then
2516 if (this%iptcout > 0)
then
2517 write (this%iptcout,
'(A10,6(1x,A15))')
'OUTER ITER', &
2518 ' PTCDEL',
' L2NORM0',
' L2NORM', &
2519 ' RHSNORM',
' 1/PTCDEL',
' RHSNORM/L2NORM'
2521 if (this%ptcdel0 >
dzero)
then
2522 this%ptcdel = this%ptcdel0
2524 if (this%iptcopt == 0)
then
2527 this%ptcdel =
done / ptcf
2530 do ieq = 1, this%neq
2531 if (this%active(ieq) .gt. 0)
then
2532 bnorm = bnorm + this%rhs(ieq) * this%rhs(ieq)
2536 this%ptcdel = bnorm / l2norm
2540 if (l2norm >
dzero)
then
2541 this%ptcdel = this%ptcdel * (this%l2norm0 / l2norm)**this%ptcexp
2546 if (this%ptcdel >
dzero)
then
2547 ptcval =
done / this%ptcdel
2552 do ieq = 1, this%neq
2553 irow_glo = ieq + this%matrix_offset
2554 if (this%active(ieq) > 0)
then
2555 diagval = abs(this%system_matrix%get_diag_value(irow_glo))
2556 bnorm = bnorm + this%rhs(ieq) * this%rhs(ieq)
2557 call this%system_matrix%add_diag_value(irow_glo, -ptcval)
2558 this%rhs(ieq) = this%rhs(ieq) - ptcval * this%x(ieq)
2562 if (this%iptcout > 0)
then
2563 write (this%iptcout,
'(i10,5(1x,e15.7),1(1x,f15.6))') &
2564 kiter, this%ptcdel, this%l2norm0, l2norm, bnorm, &
2565 ptcval, bnorm / l2norm
2567 this%l2norm0 = l2norm
2574 if (itestmat == 1)
then
2575 write (fname, fmtfname) this%id, kper, kstp, kiter
2576 print *,
'Saving amat to: ', trim(adjustl(fname))
2579 open (itestmat, file=trim(adjustl(fname)))
2580 write (itestmat, *)
'NODE, RHS, AMAT FOLLOW'
2581 do ieq = 1, this%neq
2582 irow_glo = ieq + this%matrix_offset
2583 icol_s = this%system_matrix%get_first_col_pos(irow_glo)
2584 icol_e = this%system_matrix%get_last_col_pos(irow_glo)
2585 write (itestmat,
'(*(G0,:,","))') &
2588 (this%system_matrix%get_column(ipos), ipos=icol_s, icol_e), &
2589 (this%system_matrix%get_value_pos(ipos), ipos=icol_s, icol_e)
2600 call this%imslinear%imslinear_apply(this%icnvg, kstp, kiter, in_iter, &
2601 this%nitermax, this%convnmod, &
2602 this%convmodstart, this%caccel, &
2605 call this%linear_solver%solve(kiter, this%vec_rhs, &
2606 this%vec_x, this%cnvg_summary)
2607 in_iter = this%linear_solver%iteration_number
2608 this%icnvg = this%linear_solver%is_converged
2621 integer(I4B),
intent(in) :: ifdparam
2624 select case (ifdparam)
2632 this%amomentum =
dzero
2636 this%res_lim =
dzero
2644 this%akappa = 0.0001d0
2646 this%amomentum =
dzero
2650 this%res_lim =
dzero
2658 this%akappa = 0.0001d0
2660 this%amomentum =
dzero
2664 this%res_lim = 0.002d0
2680 integer(I4B),
intent(in) :: kiter
2682 character(len=7) :: cmsg
2684 integer(I4B) :: btflag
2685 integer(I4B) :: ibflag
2686 integer(I4B) :: ibtcnt
2694 call this%sln_buildsystem(kiter, inewton=0)
2698 if (kiter == 1)
then
2699 call this%sln_l2norm(this%res_prev)
2700 resin = this%res_prev
2703 call this%sln_l2norm(this%res_new)
2704 resin = this%res_new
2708 if (this%res_new > this%res_prev * this%btol)
then
2711 btloop:
do nb = 1, this%numtrack
2714 call this%sln_backtracking_xupdate(btflag)
2717 if (btflag == 0)
then
2725 call this%sln_buildsystem(kiter, inewton=0)
2729 call this%sln_l2norm(this%res_new)
2732 if (nb == this%numtrack)
then
2736 if (this%res_new < this%res_prev * this%btol)
then
2740 if (this%res_new < this%res_lim)
then
2746 this%res_prev = this%res_new
2750 if (this%iprims > 0)
then
2751 if (ibtcnt > 0)
then
2758 call this%outertab%add_term(
'Backtracking')
2759 call this%outertab%add_term(kiter)
2760 call this%outertab%add_term(
' ')
2761 if (this%numtrack > 0)
then
2762 call this%outertab%add_term(ibflag)
2763 call this%outertab%add_term(ibtcnt)
2764 call this%outertab%add_term(resin)
2765 call this%outertab%add_term(this%res_prev)
2767 call this%outertab%add_term(
' ')
2768 call this%outertab%add_term(cmsg)
2769 call this%outertab%add_term(
' ')
2782 integer(I4B),
intent(inout) :: bt_flag
2784 bt_flag = this%get_backtracking_flag()
2787 if (bt_flag > 0)
then
2788 call this%apply_backtracking()
2797 integer(I4B) :: bt_flag
2802 real(dp) :: dx_abs_max
2810 if (this%active(n) < 1) cycle
2811 dx = this%x(n) - this%xtemp(n)
2813 if (dx_abs > dx_abs_max) dx_abs_max = dx_abs
2817 if (this%breduc * dx_abs_max >= this%dvclose)
then
2827 integer(I4B) :: idv_scale
2833 do i = 1, this%modellist%Count()
2835 if (mp%get_idv_scale() /= 0)
then
2838 if (idv_scale == 1)
then
2855 if (this%active(n) < 1) cycle
2856 delx = this%breduc * (this%x(n) - this%xtemp(n))
2857 this%x(n) = this%xtemp(n) + delx
2880 vec_resid => this%system_matrix%create_vec(this%neq)
2881 call this%sln_calc_residual(vec_resid)
2884 l2norm = vec_resid%norm2()
2887 call vec_resid%destroy()
2888 deallocate (vec_resid)
2899 integer(I4B),
intent(in) :: nsize
2900 real(DP),
dimension(nsize),
intent(in) :: v
2901 real(DP),
intent(inout) :: vmax
2913 if (denom ==
dzero)
then
2918 dnorm = abs(d) / denom
2919 if (dnorm >
done)
then
2933 integer(I4B),
intent(in) :: neq
2934 integer(I4B),
dimension(neq),
intent(in) :: active
2935 real(DP),
dimension(neq),
intent(in) :: x
2936 real(DP),
dimension(neq),
intent(in) :: xtemp
2937 real(DP),
dimension(neq),
intent(inout) :: dx
2944 if (active(n) < 1)
then
2947 dx(n) = x(n) - xtemp(n)
2956 integer(I4B) :: iptc
2967 vec_resid => this%system_matrix%create_vec(this%neq)
2968 call this%sln_calc_residual(vec_resid)
2971 do im = 1, this%modellist%Count()
2973 call mp%model_ptc(vec_resid, iptc, ptcf)
2977 call vec_resid%destroy()
2978 deallocate (vec_resid)
2990 call this%system_matrix%multiply(this%vec_x, vec_resid)
2992 call vec_resid%axpy(-1.0_dp, this%vec_rhs)
2995 if (this%active(n) < 1)
then
2996 call vec_resid%set_value_local(n, 0.0_dp)
3010 integer(I4B),
intent(in) :: kiter
3011 real(DP),
intent(in) :: bigch
3012 integer(I4B),
intent(in) :: neq
3013 integer(I4B),
dimension(neq),
intent(in) :: active
3014 real(DP),
dimension(neq),
intent(inout) :: x
3015 real(DP),
dimension(neq),
intent(in) :: xtemp
3026 if (this%nonmeth == 1)
then
3030 if (active(n) < 1) cycle
3033 delx = x(n) - xtemp(n)
3034 this%dxold(n) = delx
3037 x(n) = xtemp(n) + this%gamma * delx
3041 else if (this%nonmeth == 2)
then
3047 if (kiter == 1)
then
3049 this%relaxold =
done
3050 this%bigchold = bigch
3054 es = this%bigch / (this%bigchold * this%relaxold)
3056 if (es < -
done)
then
3062 this%relaxold = relax
3065 this%bigchold = (
done - this%gamma) * this%bigch + this%gamma * &
3069 if (relax <
done)
then
3073 if (active(n) < 1) cycle
3076 delx = x(n) - xtemp(n)
3077 this%dxold(n) = delx
3078 x(n) = xtemp(n) + relax * delx
3083 else if (this%nonmeth == 3)
then
3087 if (active(n) < 1) cycle
3090 delx = x(n) - xtemp(n)
3093 if (kiter == 1)
then
3094 this%wsave(n) =
done
3095 this%hchold(n) =
dem20
3096 this%deold(n) =
dzero
3103 if (this%deold(n) * delx <
dzero)
then
3104 ww = this%theta * this%wsave(n)
3107 ww = this%wsave(n) + this%akappa
3113 if (kiter == 1)
then
3114 this%hchold(n) = delx
3116 this%hchold(n) = (
done - this%gamma) * delx + &
3117 this%gamma * this%hchold(n)
3121 this%deold(n) = delx
3122 this%dxold(n) = delx
3126 if (kiter > 4) amom = this%amomentum
3127 delx = delx * ww + amom * this%hchold(n)
3128 x(n) = xtemp(n) + delx
3143 real(DP),
intent(inout) :: hncg
3144 integer(I4B),
intent(inout) :: lrch
3158 if (this%active(n) < 1) cycle
3159 hdif = this%x(n) - this%xtemp(n)
3161 if (ahdif > abigch)
then
3176 logical(LGP) :: has_converged
3178 has_converged = .false.
3179 if (abs(max_dvc) <= this%dvclose)
then
3180 has_converged = .true.
3190 real(dp),
intent(in) :: dpak
3191 character(len=LENPAKLOC),
intent(in) :: cpakout
3192 integer(I4B),
intent(in) :: iend
3194 integer(I4B) :: ivalue
3196 if (abs(dpak) > this%dvclose)
then
3201 'PACKAGE (', trim(cpakout),
') CAUSED CONVERGENCE FAILURE'
3213 integer(I4B),
intent(in) :: inewtonur
3215 integer(I4B) :: ivalue
3224 result(has_converged)
3226 real(dp),
intent(in) :: dxold_max
3227 real(dp),
intent(in) :: hncg
3228 logical(LGP) :: has_converged
3230 has_converged = .false.
3231 if (abs(dxold_max) <= this%dvclose .and. &
3232 abs(hncg) <= this%dvclose)
then
3233 has_converged = .true.
3245 integer(I4B),
intent(in) :: nodesln
3246 character(len=*),
intent(inout) :: str
3250 integer(I4B) :: istart
3251 integer(I4B) :: iend
3252 integer(I4B) :: noder
3253 integer(I4B) :: nglo
3262 nglo = nodesln + this%matrix_offset
3265 do i = 1, this%modellist%Count()
3269 call mp%get_mrange(istart, iend)
3270 if (nglo >= istart .and. nglo <= iend)
then
3271 noder = nglo - istart + 1
3272 call mp%get_mcellid(noder, str)
3286 integer(I4B),
intent(in) :: nodesln
3287 integer(I4B),
intent(inout) :: im
3288 integer(I4B),
intent(inout) :: nodeu
3292 integer(I4B) :: istart
3293 integer(I4B) :: iend
3294 integer(I4B) :: noder, nglo
3300 nglo = nodesln + this%matrix_offset
3303 do i = 1, this%modellist%Count()
3307 call mp%get_mrange(istart, iend)
3308 if (nglo >= istart .and. nglo <= iend)
then
3309 noder = nglo - istart + 1
3310 call mp%get_mnodeu(noder, nodeu)
3324 class(*),
pointer,
intent(inout) :: obj
3332 if (.not.
associated(obj))
return
3348 type(
listtype),
intent(inout) :: list
3349 integer(I4B),
intent(in) :: idx
3353 class(*),
pointer :: obj
3355 obj => list%GetItem(idx)
subroutine, public addbasesolutiontolist(list, solution)
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ tabright
right justified table column
@ tableft
left justified table column
@ mvalidate
validation mode - do not run time steps
@ mnormal
normal output mode
real(dp), parameter dem20
real constant 1e-20
real(dp), parameter dep3
real constant 1000
integer(i4b), parameter lensolutionname
maximum length of the solution name
real(dp), parameter dep6
real constant 1000000
real(dp), parameter donethird
real constant 1/3
real(dp), parameter dnodata
real no data constant
integer(i4b), parameter lenpakloc
maximum length of a package location
real(dp), parameter dep20
real constant 1e20
real(dp), parameter dem1
real constant 1e-1
real(dp), parameter dhalf
real constant 1/2
real(dp), parameter dem3
real constant 1e-3
real(dp), parameter dem4
real constant 1e-4
real(dp), parameter dem6
real constant 1e-6
real(dp), parameter dzero
real constant zero
real(dp), parameter dprec
real constant machine precision
real(dp), parameter dem15
real constant 1e-15
real(dp), parameter dem2
real constant 1e-2
real(dp), parameter dtwo
real constant 2
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter dthree
real constant 3
real(dp), parameter done
real constant 1
subroutine pstop(status, message)
Stop the program, optionally specifying an error status code.
subroutine, public ims_misc_dvscale(IOPT, NEQ, DSCALE, X, B)
@ brief Scale X and RHS
subroutine allocate_scalars(this)
@ brief Allocate and initialize scalars
integer(i4b), parameter, public cg_method
This module defines variable data types.
class(linearsolverbasetype) function, pointer, public create_linear_solver(solver_mode, sln_name)
Factory method to create the linear solver object.
type(listtype), public basesolutionlist
pure logical function, public is_close(a, b, rtol, atol, symmetric)
Check if a real value is approximately equal to another.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
Store and issue logging messages to output units.
subroutine, public write_message(text, iunit, fmt, skipbefore, skipafter, advance)
Write a message to an output unit.
class(numericalexchangetype) function, pointer, public getnumericalexchangefromlist(list, idx)
Retrieve a specific numerical exchange from a list.
subroutine, public addnumericalexchangetolist(list, exchange)
Add numerical exchange to a list.
subroutine, public addnumericalmodeltolist(list, model)
class(numericalmodeltype) function, pointer, public getnumericalmodelfromlist(list, idx)
subroutine convergence_summary(this, iu, im, itertot_timestep)
@ brief Solution convergence summary
subroutine sln_get_nodeu(this, nodesln, im, nodeu)
@ brief Get user node number
integer(i4b) function sln_sync_newtonur_flag(this, inewtonur)
Synchronize Newton Under-relaxation flag.
subroutine save(this, filename)
@ brief Save solution data to a file
subroutine sln_backtracking_xupdate(this, bt_flag)
@ brief Backtracking update of the dependent variable
logical(lgp) function sln_nur_has_converged(this, dxold_max, hncg)
Custom convergence check for when Newton UR has been applied.
logical(lgp) function sln_has_converged(this, max_dvc)
integer(i4b), parameter petsc_solver
integer(i4b) function sln_package_convergence(this, dpak, cpakout, iend)
Check package convergence.
type(listtype) function, pointer get_exchanges(this)
Returns a pointer to the list of exchanges in this solution.
subroutine sln_l2norm(this, l2norm)
@ brief Calculate the solution L-2 norm for all active cells using
subroutine sln_connect(this)
@ brief Assign solution connections
subroutine sln_get_loc(this, nodesln, str)
@ brief Get cell location string
subroutine apply_backtracking(this)
Update x with backtracking.
subroutine writecsvheader(this)
@ brief CSV header
integer(i4b) function sln_get_idvscale(this)
Check if dependent variable scalining should be applied for this solution,.
subroutine sln_buildsystem(this, kiter, inewton)
subroutine sln_maxval(this, nsize, v, vmax)
@ brief Get the maximum value from a vector
subroutine sln_calc_residual(this, vec_resid)
Calculate the current residual vector r = A*x - b,.
subroutine sln_backtracking(this, mp, cp, kiter)
@ brief Perform backtracking
subroutine sln_calc_ptc(this, iptc, ptcf)
Calculate pseudo-transient continuation factor.
subroutine sln_underrelax(this, kiter, bigch, neq, active, x, xtemp)
@ brief Under-relaxation
class(numericalsolutiontype) function, pointer, public castasnumericalsolutionclass(obj)
@ brief Cast a object as a Numerical Solution
type(listtype) function, pointer get_models(this)
Get a list of models.
subroutine finalizesolve(this, kiter, isgcnvg, isuppress_output)
@ brief finalize a solution
subroutine sln_setouter(this, ifdparam)
@ brief Set default Picard iteration variables
subroutine sln_ls(this, kiter, kstp, kper, in_iter, iptc, ptcf)
@ brief Solve the linear system of equations
subroutine sln_calcdx(this, neq, active, x, xtemp, dx)
@ brief Calculate dependent-variable change
integer(i4b), parameter ims_solver
subroutine csv_convergence_summary(this, iu, totim, kper, kstp, kouter, niter, istart, kstart)
@ brief Solution convergence CSV summary
subroutine sln_reset(this)
@ brief Reset the solution
class(numericalsolutiontype) function, pointer, public getnumericalsolutionfromlist(list, idx)
@ brief Get a numerical solution
subroutine allocate_arrays(this)
@ brief Allocate arrays
integer(i4b) function get_backtracking_flag(this)
Check if backtracking should be applied for this solution,.
subroutine preparesolve(this)
@ brief prepare to solve
subroutine writeptcinfotofile(this, kper)
@ brief PTC header
subroutine add_exchange(this, exchange)
Add exchange.
subroutine add_model(this, mp)
@ brief Add a model
subroutine, public create_numerical_solution(num_sol, filename, id)
@ brief Create a new solution
subroutine sln_get_dxmax(this, hncg, lrch)
@ brief Determine maximum dependent-variable change
type(profilertype), public g_prof
the global timer object (to reduce trivial lines of code)
subroutine print(this, output_unit)
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public deprecation_warning(cblock, cvar, cver, endmsg, iunit)
Store deprecation warning message.
integer(i4b), parameter, public stg_bfr_exg_ad
before exchange advance (per solution)
integer(i4b), parameter, public stg_bfr_exg_cf
before exchange calculate (per solution)
integer(i4b), parameter, public stg_bfr_exg_fc
before exchange formulate (per solution)
integer(i4b), parameter, public stg_bfr_exg_ac
before exchange add connections (per solution)
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=linelength) simulation_mode
integer(i4b) iout
file unit number for simulation output
integer(i4b) isim_mode
simulation mode
subroutine, public table_cr(this, name, title)
real(dp), pointer, public totim
time relative to start of simulation
class(atstype), pointer, public ats
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
subroutine, public code_timer(it, t1, ts)
Get end time and calculate elapsed time.
This module contains version information.
integer(i4b), parameter idevelopmode
Highest level model type. All models extend this parent type.
This structure stores the generic convergence info for a solution.
Abstract type for linear solver.
A generic heterogeneous doubly-linked list.