MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
mf6core.f90
Go to the documentation of this file.
1 !> @brief Core MODFLOW 6 module
2 !!
3 !! This module contains the core components for MODFLOW 6. This module
4 !! is used by the stand-alone executable and the share object versions
5 !! of MODFLOW 6.
6 !!
7 !<
9  use kindmodule, only: i4b, lgp
20  use simstagesmodule
21  implicit none
22 
23  class(runcontroltype), pointer :: run_ctrl => null() !< the run controller for this simulation
24 
25 contains
26 
27  !> @brief Main controller
28  !!
29  !! This subroutine is the main controller for MODFLOW 6.
30  !!
31  !<
32  subroutine mf6run
33  ! -- modules
35  use tdismodule, only: endofsimulation
36  ! -- local
37  logical(LGP) :: hasConverged
38  !
39  ! -- parse any command line arguments
41  !
42  ! initialize simulation
43  call mf6initialize()
44  !
45  ! -- time loop
46  do while (.not. endofsimulation)
47 
48  ! perform a time step
49  hasconverged = mf6update()
50 
51  ! if not converged, break
52  if (.not. hasconverged) exit
53 
54  end do
55  !
56  ! -- finalize simulation
57  call mf6finalize()
58 
59  end subroutine mf6run
60 
61  !> @brief Initialize a simulation
62  !!
63  !! This subroutine initializes a MODFLOW 6 simulation. The subroutine:
64  !! - creates the simulation
65  !! - defines
66  !! - allocates and reads static data
67  !!
68  !<
69  subroutine mf6initialize()
70  ! -- modules
73  use sourceloadmodule, only: export_cr
74 
75  ! -- get the run controller for sequential or parallel builds
77  call run_ctrl%start()
78 
79  ! -- print info and start timer
80  call print_info()
81 
82  ! -- create mfsim.lst
83  call create_lstfile()
84 
85  ! -- load input context
86  call static_input_load()
87 
88  ! -- create
89  call simulation_cr()
90 
91  ! -- define
92  call simulation_df()
93 
94  ! -- allocate and read
95  call simulation_ar()
96 
97  ! -- create model exports
98  call export_cr()
99 
100  end subroutine mf6initialize
101 
102  !> @brief Run a time step
103  !!
104  !! This function runs a single time step to completion.
105  !!
106  !! @return hasConverged boolean indicating if convergence was achieved for the time step
107  !!
108  !<
109  function mf6update() result(hasConverged)
110  ! -- return variable
111  logical(LGP) :: hasconverged
112  !
113  ! -- prepare timestep
114  call mf6preparetimestep()
115  !
116  ! -- do timestep
117  call mf6dotimestep()
118  !
119  ! -- after timestep
120  hasconverged = mf6finalizetimestep()
121  !
122  end function mf6update
123 
124  !> @brief Finalize the simulation
125  !!
126  !! This subroutine finalizes a simulation. Steps include:
127  !! - final processing
128  !! - deallocate memory
129  !!
130  !<
131  subroutine mf6finalize()
132  ! -- modules
133  use, intrinsic :: iso_fortran_env, only: output_unit
134  use listsmodule, only: lists_da
136  use tdismodule, only: tdis_da
137  use idmloadmodule, only: idm_da
138  use sourceloadmodule, only: export_da
139  use simvariablesmodule, only: iout
140  ! -- local variables
141  integer(I4B) :: im
142  integer(I4B) :: ic
143  integer(I4B) :: is
144  integer(I4B) :: isg
145  class(solutiongrouptype), pointer :: sgp => null()
146  class(basesolutiontype), pointer :: sp => null()
147  class(basemodeltype), pointer :: mp => null()
148  class(baseexchangetype), pointer :: ep => null()
149  class(spatialmodelconnectiontype), pointer :: mc => null()
150  !
151  !
152  ! -- FINAL PROCESSING (FP)
153  ! -- Final processing for each model
154  do im = 1, basemodellist%Count()
155  mp => getbasemodelfromlist(basemodellist, im)
156  call mp%model_fp()
157  end do
158  !
159  ! -- Final processing for each exchange
160  do ic = 1, baseexchangelist%Count()
161  ep => getbaseexchangefromlist(baseexchangelist, ic)
162  call ep%exg_fp()
163  end do
164  !
165  ! -- Final processing for each solution
166  do is = 1, basesolutionlist%Count()
167  sp => getbasesolutionfromlist(basesolutionlist, is)
168  call sp%sln_fp()
169  end do
170  !
171  ! -- DEALLOCATE (DA)
172  ! -- Deallocate tdis
173  call tdis_da()
174  !
175  ! -- Deallocate for each model
176  do im = 1, basemodellist%Count()
177  mp => getbasemodelfromlist(basemodellist, im)
178  call mp%model_da()
179  deallocate (mp)
180  end do
181  !
182  ! -- Deallocate for each exchange
183  do ic = 1, baseexchangelist%Count()
184  ep => getbaseexchangefromlist(baseexchangelist, ic)
185  call ep%exg_da()
186  deallocate (ep)
187  end do
188  !
189  ! -- Deallocate for each connection
190  do ic = 1, baseconnectionlist%Count()
191  mc => get_smc_from_list(baseconnectionlist, ic)
192  call mc%exg_da()
193  deallocate (mc)
194  end do
195  !
196  ! -- Deallocate for each solution
197  do is = 1, basesolutionlist%Count()
198  sp => getbasesolutionfromlist(basesolutionlist, is)
199  call sp%sln_da()
200  deallocate (sp)
201  end do
202  !
203  ! -- Deallocate solution group and simulation variables
204  do isg = 1, solutiongrouplist%Count()
205  sgp => getsolutiongroupfromlist(solutiongrouplist, isg)
206  call sgp%sgp_da()
207  deallocate (sgp)
208  end do
209  !
210  call idm_da(iout)
211  call export_da()
212  call simulation_da()
213  call lists_da()
214  !
215  ! -- finish gently (No calls after this)
216  call run_ctrl%finish()
217  !
218  end subroutine mf6finalize
219 
220  !> @brief print initial message
221  !<
222  subroutine print_info()
223  use simmodule, only: initial_message
224  use timermodule, only: print_start_time
225 
226  ! print initial message
227  call initial_message()
228 
229  ! get start time
230  call print_start_time()
231 
232  end subroutine print_info
233 
234  !> @brief Set up mfsim list file output logging
235  !!
236  !! This subroutine creates the mfsim list file
237  !! and writes the header.
238  !!
239  !<
240  subroutine create_lstfile()
241  use constantsmodule, only: linelength
244  use messagemodule, only: write_message
246  character(len=LINELENGTH) :: line
247  !
248  ! -- Open simulation list file
249  iout = getunit()
250  !
251  if (nr_procs > 1) then
253  end if
254  !
255  call openfile(iout, 0, simlstfile, 'LIST', filstat_opt='REPLACE')
256  !
257  ! -- write simlstfile to stdout
258  write (line, '(2(1x,A))') 'Writing simulation list file:', &
259  trim(adjustl(simlstfile))
260  !
261  call write_message(line)
263  end subroutine create_lstfile
264 
265  !> @brief Create simulation input context
266  !!
267  !! This subroutine creates the simulation input context
268  !!
269  !<
270  subroutine static_input_load()
271  ! -- modules
272  use constantsmodule, only: lenmempath
273  use simvariablesmodule, only: iout
274  use idmloadmodule, only: simnam_load, simtdis_load, &
278  use simvariablesmodule, only: iparamlog
279  !
280  ! -- load simnam input context
281  call simnam_load(iparamlog)
282  !
283  ! -- load tdis to input context
284  call simtdis_load()
285  !
286  ! -- load in scope models
287  call load_models(iout)
288  !
289  ! -- load in scope exchanges
290  call load_exchanges(iout)
291  end subroutine static_input_load
292 
293  !> @brief Define the simulation
294  !!
295  !! This subroutine defined the simulation. Steps include:
296  !! - define each model
297  !! - define each solution
298  !!
299  !<
300  subroutine simulation_df()
301  ! -- modules
302  use idmloadmodule, only: idm_df
303  ! -- local variables
304  integer(I4B) :: im
305  integer(I4B) :: ic
306  integer(I4B) :: is
307  class(basesolutiontype), pointer :: sp => null()
308  class(basemodeltype), pointer :: mp => null()
309  class(baseexchangetype), pointer :: ep => null()
310  class(spatialmodelconnectiontype), pointer :: mc => null()
311 
312  ! -- init virtual data environment
313  call run_ctrl%at_stage(stg_bfr_mdl_df)
314 
315  ! -- Define each model
316  do im = 1, basemodellist%Count()
318  call mp%model_df()
319  end do
320  !
321  ! -- synchronize
322  call run_ctrl%at_stage(stg_aft_mdl_df)
323  !
324  ! -- Define each exchange
325  do ic = 1, baseexchangelist%Count()
327  call ep%exg_df()
328  end do
329  !
330  ! -- synchronize
331  call run_ctrl%at_stage(stg_aft_exg_df)
332  !
333  ! -- when needed, this is where the interface models are
334  ! created and added to the numerical solutions
335  call connections_cr()
336  !
337  ! -- synchronize
338  call run_ctrl%at_stage(stg_aft_con_cr)
339  !
340  ! -- synchronize
341  call run_ctrl%at_stage(stg_bfr_con_df)
342  !
343  ! -- Define each connection
344  do ic = 1, baseconnectionlist%Count()
346  call mc%exg_df()
347  end do
348  !
349  ! -- synchronize
350  call run_ctrl%at_stage(stg_aft_con_df)
351  !
352  ! -- Define each solution
353  do is = 1, basesolutionlist%Count()
355  call sp%sln_df()
356  end do
357 
358  ! idm df
359  call idm_df()
360 
361  end subroutine simulation_df
362 
363  !> @brief Simulation allocate and read
364  !!
365  !! This subroutine allocates and reads static data for the simulation.
366  !! Steps include:
367  !! - allocate and read for each model
368  !! - allocate and read for each exchange
369  !! - allocate and read for each solution
370  !!
371  !<
372  subroutine simulation_ar()
374  ! -- local variables
375  integer(I4B) :: im
376  integer(I4B) :: ic
377  integer(I4B) :: is
378  class(basesolutiontype), pointer :: sp => null()
379  class(basemodeltype), pointer :: mp => null()
380  class(baseexchangetype), pointer :: ep => null()
381  class(spatialmodelconnectiontype), pointer :: mc => null()
382 
383  ! -- Allocate and read each model
384  do im = 1, basemodellist%Count()
386  call mp%model_ar()
387  end do
388  !
389  ! -- Allocate and read each exchange
390  do ic = 1, baseexchangelist%Count()
392  call ep%exg_ar()
393  end do
394  !
395  ! -- Synchronize
396  call run_ctrl%at_stage(stg_bfr_con_ar)
397  !
398  ! -- Allocate and read all model connections
399  do ic = 1, baseconnectionlist%Count()
401  call mc%exg_ar()
402  end do
403  !
404  ! -- Synchronize
405  call run_ctrl%at_stage(stg_aft_con_ar)
406  !
407  ! -- Allocate and read each solution
408  do is = 1, basesolutionlist%Count()
410  call sp%sln_ar()
411  end do
412  !
413  end subroutine simulation_ar
414 
415  !> @brief Create the model connections from the exchanges
416  !!
417  !! This will upgrade the numerical exchanges in the solution,
418  !! whenever the configuration requires this, to Connection
419  !! objects. Currently we anticipate:
420  !!
421  !! GWF-GWF => GwfGwfConnection
422  !! GWT-GWT => GwtGwtConecction
423  !<
424  subroutine connections_cr()
426  use simvariablesmodule, only: iout
427  use versionmodule, only: idevelopmode
428  integer(I4B) :: isol
429  type(connectionbuildertype) :: connectionBuilder
430  class(basesolutiontype), pointer :: sol => null()
431  integer(I4B) :: status
432  character(len=16) :: envvar
433 
434  write (iout, '(/a)') 'PROCESSING MODEL CONNECTIONS'
435 
436  if (baseexchangelist%Count() == 0) then
437  ! if this is not a coupled simulation in any way,
438  ! then we will not need model connections
439  return
440  end if
441 
442  if (idevelopmode == 1) then
443  call get_environment_variable('DEV_ALWAYS_USE_IFMOD', &
444  value=envvar, status=status)
445  if (status == 0 .and. envvar == '1') then
446  connectionbuilder%dev_always_ifmod = .true.
447  write (iout, '(/a)') "Development option: forcing interface model"
448  end if
449  end if
450 
451  do isol = 1, basesolutionlist%Count()
453  call connectionbuilder%processSolution(sol)
454  end do
455 
456  write (iout, '(a)') 'END OF MODEL CONNECTIONS'
457  end subroutine connections_cr
458 
459  !> @brief Read and prepare time step
460  !!
461  !! This subroutine reads and prepares period data for the simulation.
462  !! Steps include:
463  !! - read and prepare for each model
464  !! - read and prepare for each exchange
465  !! - reset convergence flag
466  !! - calculate maximum time step for each model
467  !! - calculate maximum time step for each exchange
468  !! - calculate maximum time step for each solution
469  !! - set time discretization timestep using smallest maximum timestep
470  !!
471  !<
472  subroutine mf6preparetimestep()
473  ! -- modules
474  use kindmodule, only: i4b
477  kstp, kper
482  use simmodule, only: converge_reset
483  use simvariablesmodule, only: isim_mode
484  use idmloadmodule, only: idm_rp
486  ! -- local variables
487  class(basemodeltype), pointer :: mp => null()
488  class(baseexchangetype), pointer :: ep => null()
489  class(spatialmodelconnectiontype), pointer :: mc => null()
490  class(basesolutiontype), pointer :: sp => null()
491  character(len=LINELENGTH) :: line
492  character(len=LINELENGTH) :: fmt
493  integer(I4B) :: im
494  integer(I4B) :: ie
495  integer(I4B) :: ic
496  integer(I4B) :: is
497  !
498  ! -- initialize fmt
499  fmt = "(/,a,/)"
500  !
501  ! -- period update
502  call tdis_set_counters()
503  !
504  ! -- set base line
505  write (line, '(a,i0,a,i0,a)') &
506  'start timestep kper="', kper, '" kstp="', kstp, '" mode="'
507  !
508  ! -- evaluate simulation mode
509  select case (isim_mode)
510  case (mvalidate)
511  line = trim(line)//'validate"'
512  case (mnormal)
513  line = trim(line)//'normal"'
514  end select
515 
516  ! -- load dynamic input
517  call idm_rp()
518 
519  ! -- Read and prepare each model
520  do im = 1, basemodellist%Count()
522  call mp%model_message(line, fmt=fmt)
523  call mp%model_rp()
524  end do
525  !
526  ! -- Synchronize
527  call run_ctrl%at_stage(stg_bfr_exg_rp)
528  !
529  ! -- Read and prepare each exchange
530  do ie = 1, baseexchangelist%Count()
532  call ep%exg_rp()
533  end do
534  !
535  ! -- Read and prepare each connection
536  do ic = 1, baseconnectionlist%Count()
537  mc => get_smc_from_list(baseconnectionlist, ic)
538  call mc%exg_rp()
539  end do
540  !
541  ! -- Synchronize
542  call run_ctrl%at_stage(stg_aft_con_rp)
543  !
544  ! -- reset simulation convergence flag
545  call converge_reset()
546  !
547  ! -- time update for each model
548  do im = 1, basemodellist%Count()
550  call mp%model_dt()
551  end do
552  !
553  ! -- time update for each exchange
554  do ie = 1, baseexchangelist%Count()
556  call ep%exg_dt()
557  end do
558  !
559  ! -- time update for each connection
560  do ic = 1, baseconnectionlist%Count()
561  mc => get_smc_from_list(baseconnectionlist, ic)
562  call mc%exg_dt()
563  end do
564  !
565  ! -- time update for each solution
566  do is = 1, basesolutionlist%Count()
567  sp => getbasesolutionfromlist(basesolutionlist, is)
568  call sp%sln_dt()
569  end do
570  !
571  ! -- update exports
572  call export_post_prepare()
573  !
574  ! -- set time step
575  call tdis_set_timestep()
576 
577  end subroutine mf6preparetimestep
578 
579  !> @brief Run time step
580  !!
581  !! This subroutine runs a single time step for the simulation.
582  !! Steps include:
583  !! - formulate the system of equations for each model and exchange
584  !! - solve each solution
585  !!
586  !<
587  subroutine mf6dotimestep()
588  ! -- modules
589  use kindmodule, only: i4b
590  use listsmodule, only: solutiongrouplist
593  use idmloadmodule, only: idm_ad
594  ! -- local variables
595  class(solutiongrouptype), pointer :: sgp => null()
596  integer(I4B) :: isg
597  logical :: finishedTrying
598 
599  ! -- By default, the solution groups will be solved once, and
600  ! may fail. But if adaptive stepping is active, then
601  ! the solution groups may be solved over and over with
602  ! progressively smaller time steps to see if convergence
603  ! can be obtained.
604  ifailedstepretry = 0
605  retryloop: do
606 
607  ! -- idm advance
608  call idm_ad()
609 
610  do isg = 1, solutiongrouplist%Count()
612  call sgp%sgp_ca()
613  end do
614 
615  call sim_step_retry(finishedtrying)
616  if (finishedtrying) exit retryloop
618 
619  end do retryloop
620 
621  end subroutine mf6dotimestep
622 
623  !> @brief Rerun time step
624  !!
625  !! This subroutine reruns a single time step for the simulation when
626  !! the adaptive time step option is used.
627  !!
628  !<
629  subroutine sim_step_retry(finishedTrying)
630  ! -- modules
631  use kindmodule, only: dp
633  use simmodule, only: converge_reset
634  use tdismodule, only: kstp, kper, delt, tdis_delt_reset
636  ! -- dummy variables
637  logical, intent(out) :: finishedTrying !< boolean that indicates if no
638  ! additional reruns of the time step are required
639  !
640  ! -- Check with ats to reset delt and keep trying
641  finishedtrying = .true.
642  call ats_reset_delt(kstp, kper, laststepfailed, delt, finishedtrying)
643  !
644  if (.not. finishedtrying) then
645  !
646  ! -- Reset delt, which requires updating pertim, totim
647  ! and end of period and simulation indicators
648  call tdis_delt_reset(delt)
649  !
650  ! -- Reset state of the simulation convergence flag
651  call converge_reset()
652 
653  end if
654  end subroutine sim_step_retry
655 
656  !> @brief Finalize time step
657  !!
658  !! This function finalizes a single time step for the simulation
659  !! and writes output for the time step. Steps include:
660  !! - write output for each model
661  !! - write output for each exchange
662  !! - write output for each solutions
663  !! - perform a final convergence check and whether the simulation
664  !! can continue if convergence was not achieved
665  !!
666  !! @return hasConverged boolean indicating if convergence was achieved for the time step
667  !!
668  !<
669  function mf6finalizetimestep() result(hasConverged)
670  ! -- modules
671  use kindmodule, only: i4b
677  use simmodule, only: converge_check
678  use simvariablesmodule, only: isim_mode
680  ! -- return variable
681  logical(LGP) :: hasconverged
682  ! -- local variables
683  class(basesolutiontype), pointer :: sp => null()
684  class(basemodeltype), pointer :: mp => null()
685  class(baseexchangetype), pointer :: ep => null()
686  class(spatialmodelconnectiontype), pointer :: mc => null()
687  character(len=LINELENGTH) :: line
688  character(len=LINELENGTH) :: fmt
689  integer(I4B) :: im
690  integer(I4B) :: ix
691  integer(I4B) :: ic
692  integer(I4B) :: is
693  !
694  ! -- initialize format and line
695  fmt = "(/,a,/)"
696  line = 'end timestep'
697  !
698  ! -- evaluate simulation mode
699  select case (isim_mode)
700  case (mvalidate)
701  !
702  ! -- Write final message for timestep for each model
703  do im = 1, basemodellist%Count()
705  call mp%model_message(line, fmt=fmt)
706  end do
707  case (mnormal)
708  !
709  ! -- Write output and final message for timestep for each model
710  do im = 1, basemodellist%Count()
712  call mp%model_ot()
713  call mp%model_message(line, fmt=fmt)
714  end do
715  !
716  ! -- Write output for each exchange
717  do ix = 1, baseexchangelist%Count()
719  call ep%exg_ot()
720  end do
721  !
722  ! -- Write output for each connection
723  do ic = 1, baseconnectionlist%Count()
724  mc => get_smc_from_list(baseconnectionlist, ic)
725  call mc%exg_ot()
726  end do
727  !
728  ! -- Write output for each solution
729  do is = 1, basesolutionlist%Count()
731  call sp%sln_ot()
732  end do
733  !
734  ! -- update exports
735  call export_post_step()
736  end select
737  !
738  ! -- Check if we're done
739  call converge_check(hasconverged)
740  end function mf6finalizetimestep
741 
742 end module mf6coremodule
subroutine, public ats_reset_delt(kstp, kper, lastStepFailed, delt, finishedTrying)
@ brief Reset time step because failure has occurred
Definition: ats.f90:606
class(baseexchangetype) function, pointer, public getbaseexchangefromlist(list, idx)
Retrieve a specific BaseExchangeType object from a list.
class(basemodeltype) function, pointer, public getbasemodelfromlist(list, idx)
Definition: BaseModel.f90:172
class(basesolutiontype) function, pointer, public getbasesolutionfromlist(list, idx)
subroutine, public getcommandlinearguments()
Get command line arguments.
Definition: comarg.f90:29
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:45
@ mvalidate
validation mode - do not run time steps
Definition: Constants.f90:205
@ mnormal
normal output mode
Definition: Constants.f90:206
integer(i4b), parameter lenmempath
maximum length of the memory path
Definition: Constants.f90:27
This module contains the IdmLoadModule.
Definition: IdmLoad.f90:7
subroutine, public simnam_load(paramlog)
MODFLOW 6 mfsim.nam input load routine.
Definition: IdmLoad.f90:493
subroutine, public idm_da(iout)
idm deallocate routine
Definition: IdmLoad.f90:86
subroutine, public idm_df()
advance package dynamic data for period steps
Definition: IdmLoad.f90:38
subroutine, public simtdis_load()
MODFLOW 6 tdis input load routine.
Definition: IdmLoad.f90:515
subroutine, public idm_rp()
load package dynamic data for period
Definition: IdmLoad.f90:54
subroutine, public idm_ad()
advance package dynamic data for period steps
Definition: IdmLoad.f90:70
subroutine, public load_models(iout)
load model namfiles and model package files
Definition: IdmLoad.f90:247
subroutine, public load_exchanges(iout)
load exchange files
Definition: IdmLoad.f90:326
integer(i4b) function, public getunit()
Get a free unit number.
subroutine, public append_processor_id(name, proc_id)
Append processor id to a string.
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Definition: InputOutput.f90:30
This module defines variable data types.
Definition: kind.f90:8
type(listtype), public basemodellist
Definition: mf6lists.f90:16
type(listtype), public baseexchangelist
Definition: mf6lists.f90:25
type(listtype), public solutiongrouplist
Definition: mf6lists.f90:22
type(listtype), public baseconnectionlist
Definition: mf6lists.f90:28
type(listtype), public basesolutionlist
Definition: mf6lists.f90:19
subroutine, public lists_da()
Definition: mf6lists.f90:34
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.
Definition: Message.f90:2
subroutine, public write_message(text, iunit, fmt, skipbefore, skipafter, advance)
Write a message to an output unit.
Definition: Message.f90:210
Core MODFLOW 6 module.
Definition: mf6core.f90:8
subroutine mf6dotimestep()
Run time step.
Definition: mf6core.f90:588
subroutine mf6run
Main controller.
Definition: mf6core.f90:33
subroutine static_input_load()
Create simulation input context.
Definition: mf6core.f90:271
subroutine mf6preparetimestep()
Read and prepare time step.
Definition: mf6core.f90:473
subroutine simulation_df()
Define the simulation.
Definition: mf6core.f90:301
subroutine simulation_ar()
Simulation allocate and read.
Definition: mf6core.f90:373
class(runcontroltype), pointer run_ctrl
the run controller for this simulation
Definition: mf6core.f90:23
logical(lgp) function mf6update()
Run a time step.
Definition: mf6core.f90:110
subroutine sim_step_retry(finishedTrying)
Rerun time step.
Definition: mf6core.f90:630
subroutine mf6initialize()
Initialize a simulation.
Definition: mf6core.f90:70
logical(lgp) function mf6finalizetimestep()
Finalize time step.
Definition: mf6core.f90:670
subroutine create_lstfile()
Set up mfsim list file output logging.
Definition: mf6core.f90:241
subroutine connections_cr()
Create the model connections from the exchanges.
Definition: mf6core.f90:425
subroutine mf6finalize()
Finalize the simulation.
Definition: mf6core.f90:132
subroutine print_info()
print initial message
Definition: mf6core.f90:223
class(runcontroltype) function, pointer, public create_run_control()
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public converge_reset()
Reset the simulation convergence flag.
Definition: Sim.f90:389
subroutine, public initial_message()
Print the header and initializes messaging.
Definition: Sim.f90:442
subroutine, public converge_check(hasConverged)
Simulation convergence check.
Definition: Sim.f90:402
integer(i4b), parameter, public stg_aft_con_ar
afterr connection allocate read
Definition: SimStages.f90:18
integer(i4b), parameter, public stg_aft_con_df
after connection define
Definition: SimStages.f90:15
integer(i4b), parameter, public stg_aft_mdl_df
after model define
Definition: SimStages.f90:11
integer(i4b), parameter, public stg_bfr_mdl_df
before model define
Definition: SimStages.f90:10
integer(i4b), parameter, public stg_aft_exg_df
after exchange define
Definition: SimStages.f90:12
integer(i4b), parameter, public stg_aft_con_cr
after connection create
Definition: SimStages.f90:13
integer(i4b), parameter, public stg_bfr_exg_rp
before exchange read prepare
Definition: SimStages.f90:19
integer(i4b), parameter, public stg_bfr_con_ar
before connection allocate read
Definition: SimStages.f90:17
integer(i4b), parameter, public stg_aft_con_rp
after connection read prepare
Definition: SimStages.f90:20
integer(i4b), parameter, public stg_bfr_con_df
before connection define
Definition: SimStages.f90:14
subroutine, public simulation_da()
Deallocate simulation variables.
subroutine, public simulation_cr()
Read the simulation name file and initialize the models, exchanges.
This module contains simulation variables.
Definition: SimVariables.f90:9
integer(i4b) ifailedstepretry
current retry for this time step
integer(i4b) nr_procs
integer(i4b) laststepfailed
flag indicating if the last step failed (1) if last step failed; (0) otherwise (set in converge_check...
integer(i4b) iout
file unit number for simulation output
integer(i4b) iparamlog
input (idm) parameter logging to simulation listing file
character(len=linelength) simlstfile
simulation listing file name
integer(i4b) proc_id
integer(i4b) isim_mode
simulation mode
class(solutiongrouptype) function, pointer, public getsolutiongroupfromlist(list, idx)
This module contains the SourceLoadModule.
Definition: SourceLoad.F90:8
subroutine, public export_da()
deallocate model export objects and list
Definition: SourceLoad.F90:385
subroutine, public export_cr()
create model exports list
Definition: SourceLoad.F90:346
subroutine, public export_post_prepare()
model exports post prepare step actions
Definition: SourceLoad.F90:369
subroutine, public export_post_step()
model exports post step actions
Definition: SourceLoad.F90:377
class(spatialmodelconnectiontype) function, pointer, public get_smc_from_list(list, idx)
Get the connection from a list.
logical(lgp), pointer, public endofsimulation
flag indicating end of simulation
Definition: tdis.f90:28
subroutine, public tdis_set_timestep()
Set time step length.
Definition: tdis.f90:153
subroutine, public tdis_set_counters()
Set kstp and kper.
Definition: tdis.f90:91
integer(i4b), pointer, public kstp
current time step number
Definition: tdis.f90:24
subroutine, public tdis_da()
Deallocate memory.
Definition: tdis.f90:345
subroutine, public tdis_delt_reset(deltnew)
Reset delt and update timing variables and indicators.
Definition: tdis.f90:213
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
real(dp), pointer, public delt
length of the current time step
Definition: tdis.f90:29
subroutine, public print_start_time()
Start simulation timer.
Definition: Timer.f90:19
This module contains version information.
Definition: version.f90:7
subroutine write_listfile_header(iout, cmodel_type, write_sys_command, write_kind_info)
@ brief Write program header
Definition: version.f90:98
integer(i4b), parameter idevelopmode
Definition: version.f90:19
Highest level model type. All models extend this parent type.
Definition: BaseModel.f90:13
Class to manage spatial connection of a model to one or more models of the same type....