MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
mf6coremodule Module Reference

Core MODFLOW 6 module. More...

Functions/Subroutines

subroutine mf6run
 Main controller.
subroutine mf6initialize ()
 Initialize a simulation.
logical(lgp) function mf6update ()
 Run a time step.
subroutine mf6finalize ()
 Finalize the simulation.
subroutine print_info ()
 print initial message
subroutine create_lstfile ()
 Set up mfsim list file output logging.
subroutine static_input_load ()
 Create simulation input context.
subroutine simulation_df ()
 Define the simulation.
subroutine simulation_ar ()
 Simulation allocate and read.
subroutine connections_cr ()
 Create the model connections from the exchanges.
subroutine mf6preparetimestep ()
 Read and prepare time step.
subroutine mf6dotimestep ()
 Run time step.
subroutine sim_step_retry (finishedtrying)
 Rerun time step.
logical(lgp) function mf6finalizetimestep ()
 Finalize time step.

Variables

class(runcontroltype), pointer run_ctrl => null()
 the run controller for this simulation

Detailed Description

This module contains the core components for MODFLOW 6. This module is used by the stand-alone executable and the share object versions of MODFLOW 6.

Function/Subroutine Documentation

◆ connections_cr()

subroutine mf6coremodule::connections_cr

This will upgrade the numerical exchanges in the solution, whenever the configuration requires this, to Connection objects. Currently we anticipate:

GWF-GWF => GwfGwfConnection GWT-GWT => GwtGwtConecction

Definition at line 451 of file mf6core.f90.

453 use simvariablesmodule, only: iout
454 use versionmodule, only: idevelopmode
455 integer(I4B) :: isol
456 type(ConnectionBuilderType) :: connectionBuilder
457 class(BaseSolutionType), pointer :: sol => null()
458 integer(I4B) :: status
459 character(len=16) :: envvar
460
461 write (iout, '(/a)') 'PROCESSING MODEL CONNECTIONS'
462
463 if (baseexchangelist%Count() == 0) then
464 ! if this is not a coupled simulation in any way,
465 ! then we will not need model connections
466 return
467 end if
468
469 if (idevelopmode == 1) then
470 call get_environment_variable('DEV_ALWAYS_USE_IFMOD', &
471 value=envvar, status=status)
472 if (status == 0 .and. envvar == '1') then
473 connectionbuilder%dev_always_ifmod = .true.
474 write (iout, '(/a)') "Development option: forcing interface model"
475 end if
476 end if
477
478 do isol = 1, basesolutionlist%Count()
479 sol => getbasesolutionfromlist(basesolutionlist, isol)
480 call connectionbuilder%processSolution(sol)
481 end do
482
483 write (iout, '(a)') 'END OF MODEL CONNECTIONS'
This module contains simulation variables.
integer(i4b) iout
file unit number for simulation output
This module contains version information.
Definition version.f90:7
integer(i4b), parameter idevelopmode
Definition version.f90:19
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_lstfile()

subroutine mf6coremodule::create_lstfile

This subroutine creates the mfsim list file and writes the header.

Definition at line 267 of file mf6core.f90.

268 use constantsmodule, only: linelength
273 character(len=LINELENGTH) :: line
274 !
275 ! -- Open simulation list file
276 iout = getunit()
277 !
278 if (nr_procs > 1) then
280 end if
281 !
282 call openfile(iout, 0, simlstfile, 'LIST', filstat_opt='REPLACE')
283 !
284 ! -- write simlstfile to stdout
285 write (line, '(2(1x,A))') 'Writing simulation list file:', &
286 trim(adjustl(simlstfile))
287 !
288 call write_message(line)
This module contains simulation constants.
Definition Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition Constants.f90:45
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.
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:212
integer(i4b) nr_procs
character(len=linelength) simlstfile
simulation listing file name
integer(i4b) proc_id
subroutine write_listfile_header(iout, cmodel_type, write_sys_command, write_kind_info)
Write program header.
Definition version.f90:103
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mf6dotimestep()

subroutine mf6coremodule::mf6dotimestep

This subroutine runs a single time step for the simulation. Steps include:

  • formulate the system of equations for each model and exchange
  • solve each solution

Definition at line 624 of file mf6core.f90.

625 ! -- modules
626 use kindmodule, only: i4b
631 ! -- local variables
632 class(SolutionGroupType), pointer :: sgp => null()
633 integer(I4B) :: isg
634 logical :: finishedTrying
635
636 ! start timer
637 call g_prof%start("Do time step", g_prof%tmr_do_tstp)
638
639 ! -- By default, the solution groups will be solved once, and
640 ! may fail. But if adaptive stepping is active, then
641 ! the solution groups may be solved over and over with
642 ! progressively smaller time steps to see if convergence
643 ! can be obtained.
645 retryloop: do
646
647 if (ifailedstepretry > 0) then
648 ! timeseries advance
649 call idm_ts_advance()
650 end if
651
652 do isg = 1, solutiongrouplist%Count()
654 call sgp%sgp_ca()
655 end do
656
657 call sim_step_retry(finishedtrying)
658 if (finishedtrying) exit retryloop
660
661 end do retryloop
662
663 ! stop timer
664 call g_prof%stop(g_prof%tmr_do_tstp)
665
This module contains the IdmLoadModule.
Definition IdmLoad.f90:7
subroutine, public idm_ts_advance()
advance package dynamic data for period steps
Definition IdmLoad.f90:62
This module defines variable data types.
Definition kind.f90:8
type(listtype), public solutiongrouplist
Definition mf6lists.f90:22
integer(i4b) ifailedstepretry
current retry for this time step
class(solutiongrouptype) function, pointer, public getsolutiongroupfromlist(list, idx)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mf6finalize()

subroutine mf6coremodule::mf6finalize

This subroutine finalizes a simulation. Steps include:

  • final processing
  • deallocate memory

Definition at line 145 of file mf6core.f90.

146 ! -- modules
147 use, intrinsic :: iso_fortran_env, only: output_unit
148 use listsmodule, only: lists_da
150 use tdismodule, only: tdis_da
151 use idmloadmodule, only: idm_da
152 use sourceloadmodule, only: export_da
153 use simvariablesmodule, only: iout
154 ! -- local variables
155 integer(I4B) :: im
156 integer(I4B) :: ic
157 integer(I4B) :: is
158 integer(I4B) :: isg
159 class(SolutionGroupType), pointer :: sgp => null()
160 class(BaseSolutionType), pointer :: sp => null()
161 class(BaseModelType), pointer :: mp => null()
162 class(BaseExchangeType), pointer :: ep => null()
163 class(SpatialModelConnectionType), pointer :: mc => null()
164 integer(I4B) :: tmr_dealloc
165
166 ! start timer
167 call g_prof%start("Finalize", g_prof%tmr_finalize)
168
169 !
170 ! -- FINAL PROCESSING (FP)
171 ! -- Final processing for each model
172 do im = 1, basemodellist%Count()
173 mp => getbasemodelfromlist(basemodellist, im)
174 call mp%model_fp()
175 end do
176 !
177 ! -- Final processing for each exchange
178 do ic = 1, baseexchangelist%Count()
179 ep => getbaseexchangefromlist(baseexchangelist, ic)
180 call ep%exg_fp()
181 end do
182 !
183 ! -- Final processing for each solution
184 do is = 1, basesolutionlist%Count()
185 sp => getbasesolutionfromlist(basesolutionlist, is)
186 call sp%sln_fp()
187 end do
188
189 ! start timer for deallocation
190 tmr_dealloc = -1
191 call g_prof%start("Deallocate", tmr_dealloc)
192
193 !
194 ! -- DEALLOCATE (DA)
195 ! -- Deallocate tdis
196 call tdis_da()
197 !
198 ! -- Deallocate for each model
199 do im = 1, basemodellist%Count()
200 mp => getbasemodelfromlist(basemodellist, im)
201 call mp%model_da()
202 deallocate (mp)
203 end do
204 !
205 ! -- Deallocate for each exchange
206 do ic = 1, baseexchangelist%Count()
207 ep => getbaseexchangefromlist(baseexchangelist, ic)
208 call ep%exg_da()
209 deallocate (ep)
210 end do
211 !
212 ! -- Deallocate for each connection
213 do ic = 1, baseconnectionlist%Count()
214 mc => get_smc_from_list(baseconnectionlist, ic)
215 call mc%exg_da()
216 deallocate (mc)
217 end do
218 !
219 ! -- Deallocate for each solution
220 do is = 1, basesolutionlist%Count()
221 sp => getbasesolutionfromlist(basesolutionlist, is)
222 call sp%sln_da()
223 deallocate (sp)
224 end do
225 !
226 ! -- Deallocate solution group and simulation variables
227 do isg = 1, solutiongrouplist%Count()
228 sgp => getsolutiongroupfromlist(solutiongrouplist, isg)
229 call sgp%sgp_da()
230 deallocate (sgp)
231 end do
232 !
233 call idm_da(iout)
234 call export_da()
235 call simulation_da()
236 call lists_da()
237
238 ! stop timer
239 call g_prof%stop(tmr_dealloc)
240
241 ! finish gently (No calls after this)
242 ! timer is stopped inside because this call does not return
243 call run_ctrl%finish()
244
subroutine, public idm_da(iout)
idm deallocate routine
Definition IdmLoad.f90:74
type(listtype), public basemodellist
Definition mf6lists.f90:16
type(listtype), public baseexchangelist
Definition mf6lists.f90:25
type(listtype), public baseconnectionlist
Definition mf6lists.f90:28
type(listtype), public basesolutionlist
Definition mf6lists.f90:19
subroutine, public lists_da()
Definition mf6lists.f90:34
subroutine, public simulation_da()
Deallocate simulation variables.
This module contains the SourceLoadModule.
Definition SourceLoad.F90:8
subroutine, public export_da()
deallocate model export objects and list
subroutine, public tdis_da()
Deallocate memory.
Definition tdis.f90:345
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mf6finalizetimestep()

logical(lgp) function mf6coremodule::mf6finalizetimestep

This function finalizes a single time step for the simulation and writes output for the time step. Steps include:

  • write output for each model
  • write output for each exchange
  • write output for each solutions
  • perform a final convergence check and whether the simulation can continue if convergence was not achieved
Returns
hasConverged boolean indicating if convergence was achieved for the time step

Definition at line 713 of file mf6core.f90.

714 ! -- modules
715 use kindmodule, only: i4b
721 use simmodule, only: converge_check
724 ! -- return variable
725 logical(LGP) :: hasConverged
726 ! -- local variables
727 class(BaseSolutionType), pointer :: sp => null()
728 class(BaseModelType), pointer :: mp => null()
729 class(BaseExchangeType), pointer :: ep => null()
730 class(SpatialModelConnectionType), pointer :: mc => null()
731 character(len=LINELENGTH) :: line
732 character(len=LINELENGTH) :: fmt
733 integer(I4B) :: im
734 integer(I4B) :: ix
735 integer(I4B) :: ic
736 integer(I4B) :: is
737 !
738 ! -- initialize format and line
739 fmt = "(/,a,/)"
740 line = 'end timestep'
741
742 ! start timer
743 call g_prof%start("Finalize time step", g_prof%tmr_final_tstp)
744
745 !
746 ! -- evaluate simulation mode
747 select case (isim_mode)
748 case (mvalidate)
749 !
750 ! -- Write final message for timestep for each model
751 do im = 1, basemodellist%Count()
753 call mp%model_message(line, fmt=fmt)
754 end do
755 case (mnormal)
756
757 call g_prof%start("Write output", g_prof%tmr_output)
758 !
759 ! -- Write output and final message for timestep for each model
760 do im = 1, basemodellist%Count()
762 call mp%model_ot()
763 call mp%model_message(line, fmt=fmt)
764 end do
765 !
766 ! -- Write output for each exchange
767 do ix = 1, baseexchangelist%Count()
769 call ep%exg_ot()
770 end do
771 !
772 ! -- Write output for each connection
773 do ic = 1, baseconnectionlist%Count()
774 mc => get_smc_from_list(baseconnectionlist, ic)
775 call mc%exg_ot()
776 end do
777 !
778 ! -- Write output for each solution
779 do is = 1, basesolutionlist%Count()
781 call sp%sln_ot()
782 end do
783 !
784 ! -- update exports
785 call g_prof%start("NetCDF export", g_prof%tmr_nc_export)
786 call export_post_step()
787 call g_prof%stop(g_prof%tmr_nc_export)
788
789 call g_prof%stop(g_prof%tmr_output)
790 end select
791 !
792 ! -- Check if we're done
793 call converge_check(hasconverged)
794
795 ! stop timer
796 call g_prof%stop(g_prof%tmr_final_tstp)
797
class(baseexchangetype) function, pointer, public getbaseexchangefromlist(list, idx)
Retrieve a specific BaseExchangeType object from a list.
class(basemodeltype) function, pointer, public getbasemodelfromlist(list, idx)
class(basesolutiontype) function, pointer, public getbasesolutionfromlist(list, idx)
@ mvalidate
validation mode - do not run time steps
@ mnormal
normal output mode
This module contains simulation methods.
Definition Sim.f90:10
subroutine, public converge_check(hasconverged)
Simulation convergence check.
Definition Sim.f90:407
integer(i4b) isim_mode
simulation mode
subroutine, public export_post_step()
model exports post step actions
Highest level model type. All models extend this parent type.
Definition BaseModel.f90:16
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mf6initialize()

subroutine mf6coremodule::mf6initialize

This subroutine initializes a MODFLOW 6 simulation. The subroutine:

  • creates the simulation
  • defines
  • allocates and reads static data

Definition at line 70 of file mf6core.f90.

71 ! -- modules
75
76 call g_prof%pre_init()
77
78 ! -- get the run controller for sequential or parallel builds
79 run_ctrl => create_run_control()
80 call run_ctrl%start()
81
82 ! -- print info and start timer
83 call print_info()
84
85 ! -- create mfsim.lst
86 call create_lstfile()
87
88 ! -- load input context
89 call static_input_load()
90
91 ! init timer and start
92 call g_prof%initialize()
93 call g_prof%start("Initialize", g_prof%tmr_init)
94
95 ! -- create
96 call simulation_cr()
97
98 ! -- define
99 call simulation_df()
100
101 ! -- allocate and read
102 call simulation_ar()
103
104 ! -- create model exports
105 call export_cr()
106
107 ! -- stop the timer
108 call g_prof%stop(g_prof%tmr_init)
109
class(runcontroltype) function, pointer, public create_run_control()
subroutine, public simulation_cr()
Read the simulation name file and initialize the models, exchanges.
subroutine, public export_cr()
create model exports list
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mf6preparetimestep()

subroutine mf6coremodule::mf6preparetimestep

This subroutine reads and prepares period data for the simulation. Steps include:

  • read and prepare for each model
  • read and prepare for each exchange
  • reset convergence flag
  • calculate maximum time step for each model
  • calculate maximum time step for each exchange
  • calculate maximum time step for each solution
  • set time discretization timestep using smallest maximum timestep

Definition at line 499 of file mf6core.f90.

500 ! -- modules
501 use kindmodule, only: i4b
504 kstp, kper
509 use simmodule, only: converge_reset
513 ! -- local variables
514 class(BaseModelType), pointer :: mp => null()
515 class(BaseExchangeType), pointer :: ep => null()
516 class(SpatialModelConnectionType), pointer :: mc => null()
517 class(BaseSolutionType), pointer :: sp => null()
518 character(len=LINELENGTH) :: line
519 character(len=LINELENGTH) :: fmt
520 integer(I4B) :: im
521 integer(I4B) :: ie
522 integer(I4B) :: ic
523 integer(I4B) :: is
524
525 ! start timer
526 call g_prof%start("Prepare time step", g_prof%tmr_prep_tstp)
527
528 !
529 ! -- initialize fmt
530 fmt = "(/,a,/)"
531 !
532 ! -- period update
533 call tdis_set_counters()
534 !
535 ! -- set base line
536 write (line, '(a,i0,a,i0,a)') &
537 'start timestep kper="', kper, '" kstp="', kstp, '" mode="'
538 !
539 ! -- evaluate simulation mode
540 select case (isim_mode)
541 case (mvalidate)
542 line = trim(line)//'validate"'
543 case (mnormal)
544 line = trim(line)//'normal"'
545 end select
546
547 ! -- load dynamic input
548 call idm_rp()
549
550 ! -- Read and prepare each model
551 do im = 1, basemodellist%Count()
553 call mp%model_message(line, fmt=fmt)
554 call mp%model_rp()
555 end do
556 !
557 ! -- Synchronize
558 call run_ctrl%at_stage(stg_bfr_exg_rp)
559 !
560 ! -- Read and prepare each exchange
561 do ie = 1, baseexchangelist%Count()
563 call ep%exg_rp()
564 end do
565 !
566 ! -- Read and prepare each connection
567 do ic = 1, baseconnectionlist%Count()
568 mc => get_smc_from_list(baseconnectionlist, ic)
569 call mc%exg_rp()
570 end do
571 !
572 ! -- Synchronize
573 call run_ctrl%at_stage(stg_aft_con_rp)
574 !
575 ! -- reset simulation convergence flag
576 call converge_reset()
577 !
578 ! -- time update for each model
579 do im = 1, basemodellist%Count()
581 call mp%model_dt()
582 end do
583 !
584 ! -- time update for each exchange
585 do ie = 1, baseexchangelist%Count()
587 call ep%exg_dt()
588 end do
589 !
590 ! -- time update for each connection
591 do ic = 1, baseconnectionlist%Count()
592 mc => get_smc_from_list(baseconnectionlist, ic)
593 call mc%exg_dt()
594 end do
595 !
596 ! -- time update for each solution
597 do is = 1, basesolutionlist%Count()
599 call sp%sln_dt()
600 end do
601 !
602 ! -- update exports
604 !
605 ! -- set time step
606 call tdis_set_timestep()
607
608 ! timeseries advance
609 call idm_ts_advance()
610
611 ! stop timer
612 call g_prof%stop(g_prof%tmr_prep_tstp)
613
subroutine, public idm_rp()
load package dynamic data for period
Definition IdmLoad.f90:50
subroutine, public converge_reset()
Reset the simulation convergence flag.
Definition Sim.f90:394
subroutine, public export_post_prepare()
model exports post prepare step actions
subroutine, public tdis_set_timestep()
Set time step length.
Definition tdis.f90:156
subroutine, public tdis_set_counters()
Set kstp and kper.
Definition tdis.f90:96
integer(i4b), pointer, public kstp
current time step number
Definition tdis.f90:27
integer(i4b), pointer, public kper
current stress period number
Definition tdis.f90:26
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mf6run()

subroutine mf6coremodule::mf6run

This subroutine is the main controller for MODFLOW 6.

Definition at line 33 of file mf6core.f90.

34 ! -- modules
37 ! -- local
38 logical(LGP) :: hasConverged
39 !
40 ! -- parse any command line arguments
42 !
43 ! initialize simulation
44 call mf6initialize()
45 !
46 ! -- time loop
47 do while (.not. endofsimulation)
48
49 ! perform a time step
50 hasconverged = mf6update()
51
52 ! if not converged, break
53 if (.not. hasconverged) exit
54
55 end do
56 !
57 ! -- finalize simulation
58 call mf6finalize()
59
subroutine, public getcommandlinearguments()
Get command line arguments.
Definition comarg.f90:29
logical(lgp), pointer, public endofsimulation
flag indicating end of simulation
Definition tdis.f90:31
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mf6update()

logical(lgp) function mf6coremodule::mf6update

This function runs a single time step to completion.

Returns
hasConverged boolean indicating if convergence was achieved for the time step

Definition at line 119 of file mf6core.f90.

120 logical(LGP) :: hasConverged
121 ! start timer
122 call g_prof%start("Update", g_prof%tmr_update)
123 !
124 ! -- prepare timestep
125 call mf6preparetimestep()
126 !
127 ! -- do timestep
128 call mf6dotimestep()
129 !
130 ! -- after timestep
131 hasconverged = mf6finalizetimestep()
132
133 ! stop timer
134 call g_prof%stop(g_prof%tmr_update)
135
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_info()

subroutine mf6coremodule::print_info

Definition at line 249 of file mf6core.f90.

250 use simmodule, only: initial_message
252
253 ! print initial message
254 call initial_message()
255
256 ! get start time
257 call print_start_time()
258
subroutine, public initial_message()
Print the header and initializes messaging.
Definition Sim.f90:447
subroutine, public print_start_time()
Start simulation timer.
Definition Timer.f90:19
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sim_step_retry()

subroutine mf6coremodule::sim_step_retry ( logical, intent(out) finishedtrying)

This subroutine reruns a single time step for the simulation when the adaptive time step option is used.

Parameters
[out]finishedtryingboolean that indicates if no

Definition at line 674 of file mf6core.f90.

675 ! -- modules
676 use kindmodule, only: dp
678 use simmodule, only: converge_reset
680 ! -- dummy variables
681 logical, intent(out) :: finishedTrying !< boolean that indicates if no
682 ! additional reruns of the time step are required
683 !
684 ! -- Check with ats to reset delt and keep trying
685 finishedtrying = .true.
686 call ats%ats_reset_delt(kstp, kper, laststepfailed, delt, finishedtrying)
687 !
688 if (.not. finishedtrying) then
689 !
690 ! -- Reset delt, which requires updating pertim, totim
691 ! and end of period and simulation indicators
693 !
694 ! -- Reset state of the simulation convergence flag
695 call converge_reset()
696
697 end if
integer(i4b) laststepfailed
flag indicating if the last step failed (1) if last step failed; (0) otherwise (set in converge_check...
class(atstype), pointer, public ats
Definition tdis.f90:48
subroutine, public tdis_delt_reset(deltnew)
Reset delt and update timing variables and indicators.
Definition tdis.f90:201
real(dp), pointer, public delt
length of the current time step
Definition tdis.f90:32
Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulation_ar()

subroutine mf6coremodule::simulation_ar

This subroutine allocates and reads static data for the simulation. Steps include:

  • allocate and read for each model
  • allocate and read for each exchange
  • allocate and read for each solution

Definition at line 399 of file mf6core.f90.

401 ! -- local variables
402 integer(I4B) :: im
403 integer(I4B) :: ic
404 integer(I4B) :: is
405 class(BaseSolutionType), pointer :: sp => null()
406 class(BaseModelType), pointer :: mp => null()
407 class(BaseExchangeType), pointer :: ep => null()
408 class(SpatialModelConnectionType), pointer :: mc => null()
409
410 ! -- Allocate and read each model
411 do im = 1, basemodellist%Count()
412 mp => getbasemodelfromlist(basemodellist, im)
413 call mp%model_ar()
414 end do
415 !
416 ! -- Allocate and read each exchange
417 do ic = 1, baseexchangelist%Count()
418 ep => getbaseexchangefromlist(baseexchangelist, ic)
419 call ep%exg_ar()
420 end do
421 !
422 ! -- Synchronize
423 call run_ctrl%at_stage(stg_bfr_con_ar)
424 !
425 ! -- Allocate and read all model connections
426 do ic = 1, baseconnectionlist%Count()
427 mc => get_smc_from_list(baseconnectionlist, ic)
428 call mc%exg_ar()
429 end do
430 !
431 ! -- Synchronize
432 call run_ctrl%at_stage(stg_aft_con_ar)
433 !
434 ! -- Allocate and read each solution
435 do is = 1, basesolutionlist%Count()
436 sp => getbasesolutionfromlist(basesolutionlist, is)
437 call sp%sln_ar()
438 end do
439 !
Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulation_df()

subroutine mf6coremodule::simulation_df

This subroutine defined the simulation. Steps include:

  • define each model
  • define each solution

Definition at line 327 of file mf6core.f90.

328 ! -- modules
329 use idmloadmodule, only: idm_df
330 ! -- local variables
331 integer(I4B) :: im
332 integer(I4B) :: ic
333 integer(I4B) :: is
334 class(BaseSolutionType), pointer :: sp => null()
335 class(BaseModelType), pointer :: mp => null()
336 class(BaseExchangeType), pointer :: ep => null()
337 class(SpatialModelConnectionType), pointer :: mc => null()
338
339 ! -- define input
340 call idm_df()
341
342 ! -- init virtual data environment
343 call run_ctrl%at_stage(stg_bfr_mdl_df)
344
345 ! -- Define each model
346 do im = 1, basemodellist%Count()
347 mp => getbasemodelfromlist(basemodellist, im)
348 call mp%model_df()
349 end do
350 !
351 ! -- synchronize
352 call run_ctrl%at_stage(stg_aft_mdl_df)
353 !
354 ! -- Define each exchange
355 do ic = 1, baseexchangelist%Count()
356 ep => getbaseexchangefromlist(baseexchangelist, ic)
357 call ep%exg_df()
358 end do
359 !
360 ! -- synchronize
361 call run_ctrl%at_stage(stg_aft_exg_df)
362 !
363 ! -- when needed, this is where the interface models are
364 ! created and added to the numerical solutions
365 call connections_cr()
366 !
367 ! -- synchronize
368 call run_ctrl%at_stage(stg_aft_con_cr)
369 !
370 ! -- synchronize
371 call run_ctrl%at_stage(stg_bfr_con_df)
372 !
373 ! -- Define each connection
374 do ic = 1, baseconnectionlist%Count()
375 mc => get_smc_from_list(baseconnectionlist, ic)
376 call mc%exg_df()
377 end do
378 !
379 ! -- synchronize
380 call run_ctrl%at_stage(stg_aft_con_df)
381 !
382 ! -- Define each solution
383 do is = 1, basesolutionlist%Count()
384 sp => getbasesolutionfromlist(basesolutionlist, is)
385 call sp%sln_df()
386 end do
387
subroutine, public idm_df()
advance package dynamic data for period steps
Definition IdmLoad.f90:38
Here is the call graph for this function:
Here is the caller graph for this function:

◆ static_input_load()

subroutine mf6coremodule::static_input_load

This subroutine creates the simulation input context

Definition at line 297 of file mf6core.f90.

298 ! -- modules
299 use constantsmodule, only: lenmempath
300 use simvariablesmodule, only: iout
306 !
307 ! -- load simnam input context
309 !
310 ! -- load tdis to input context
311 call simtdis_load()
312 !
313 ! -- load in scope models
314 call load_models(iout)
315 !
316 ! -- load in scope exchanges
317 call load_exchanges(iout)
integer(i4b), parameter lenmempath
maximum length of the memory path
Definition Constants.f90:27
subroutine, public simnam_load(paramlog)
MODFLOW 6 mfsim.nam input load routine.
Definition IdmLoad.f90:442
subroutine, public simtdis_load()
MODFLOW 6 tdis input load routine.
Definition IdmLoad.f90:457
subroutine, public load_models(iout)
load model namfiles and model package files
Definition IdmLoad.f90:218
subroutine, public load_exchanges(iout)
load exchange files
Definition IdmLoad.f90:285
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
integer(i4b) iparamlog
input (idm) parameter logging to simulation listing file
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ run_ctrl

class(runcontroltype), pointer mf6coremodule::run_ctrl => null()

Definition at line 24 of file mf6core.f90.