38 logical(LGP) :: hasConverged
53 if (.not. hasconverged)
exit
119 logical(LGP) :: hasconverged
146 use,
intrinsic :: iso_fortran_env, only: output_unit
163 integer(I4B) :: tmr_dealloc
171 do im = 1, basemodellist%Count()
177 do ic = 1, baseexchangelist%Count()
183 do is = 1, basesolutionlist%Count()
190 call g_prof%start(
"Deallocate", tmr_dealloc)
198 do im = 1, basemodellist%Count()
205 do ic = 1, baseexchangelist%Count()
212 do ic = 1, baseconnectionlist%Count()
219 do is = 1, basesolutionlist%Count()
226 do isg = 1, solutiongrouplist%Count()
238 call g_prof%stop(tmr_dealloc)
272 character(len=LINELENGTH) :: line
284 write (line,
'(2(1x,A))')
'Writing simulation list file:', &
457 integer(I4B) :: status
458 character(len=16) :: envvar
460 write (
iout,
'(/a)')
'PROCESSING MODEL CONNECTIONS'
469 call get_environment_variable(
'DEV_ALWAYS_USE_IFMOD', &
470 value=envvar, status=status)
471 if (status == 0 .and. envvar ==
'1')
then
472 connectionbuilder%dev_always_ifmod = .true.
473 write (
iout,
'(/a)')
"Development option: forcing interface model"
479 call connectionbuilder%processSolution(sol)
482 write (
iout,
'(a)')
'END OF MODEL CONNECTIONS'
517 character(len=LINELENGTH) :: line
518 character(len=LINELENGTH) :: fmt
525 call g_prof%start(
"Prepare time step",
g_prof%tmr_prep_tstp)
535 write (line,
'(a,i0,a,i0,a)') &
536 'start timestep kper="',
kper,
'" kstp="',
kstp,
'" mode="'
541 line = trim(line)//
'validate"'
543 line = trim(line)//
'normal"'
552 call mp%model_message(line, fmt=fmt)
566 do ic = 1, baseconnectionlist%Count()
590 do ic = 1, baseconnectionlist%Count()
596 do is = 1, basesolutionlist%Count()
630 logical :: finishedTrying
652 if (finishedtrying)
exit retryloop
676 logical,
intent(out) :: finishedTrying
680 finishedtrying = .true.
683 if (.not. finishedtrying)
then
720 logical(LGP) :: hasconverged
726 character(len=LINELENGTH) :: line
727 character(len=LINELENGTH) :: fmt
735 line =
'end timestep'
738 call g_prof%start(
"Finalize time step",
g_prof%tmr_final_tstp)
748 call mp%model_message(line, fmt=fmt)
758 call mp%model_message(line, fmt=fmt)
768 do ic = 1, baseconnectionlist%Count()
780 call g_prof%start(
"NetCDF export",
g_prof%tmr_nc_export)
subroutine, public ats_reset_delt(kstp, kper, lastStepFailed, delt, finishedTrying)
@ brief Reset time step because failure has occurred
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)
subroutine, public getcommandlinearguments()
Get command line arguments.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ mvalidate
validation mode - do not run time steps
@ mnormal
normal output mode
integer(i4b), parameter lenmempath
maximum length of the memory path
This module contains the IdmLoadModule.
subroutine, public simnam_load(paramlog)
MODFLOW 6 mfsim.nam input load routine.
subroutine, public idm_da(iout)
idm deallocate routine
subroutine, public idm_df()
advance package dynamic data for period steps
subroutine, public simtdis_load()
MODFLOW 6 tdis input load routine.
subroutine, public idm_rp()
load package dynamic data for period
subroutine, public idm_ad()
advance package dynamic data for period steps
subroutine, public load_models(iout)
load model namfiles and model package files
subroutine, public load_exchanges(iout)
load exchange files
This module defines variable data types.
type(listtype), public basemodellist
type(listtype), public baseexchangelist
type(listtype), public solutiongrouplist
type(listtype), public baseconnectionlist
type(listtype), public basesolutionlist
subroutine, public lists_da()
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.
subroutine mf6dotimestep()
Run time step.
subroutine mf6run
Main controller.
subroutine static_input_load()
Create simulation input context.
subroutine mf6preparetimestep()
Read and prepare time step.
subroutine simulation_df()
Define the simulation.
subroutine simulation_ar()
Simulation allocate and read.
class(runcontroltype), pointer run_ctrl
the run controller for this simulation
logical(lgp) function mf6update()
Run a time step.
subroutine sim_step_retry(finishedTrying)
Rerun time step.
subroutine mf6initialize()
Initialize a simulation.
logical(lgp) function mf6finalizetimestep()
Finalize time step.
subroutine create_lstfile()
Set up mfsim list file output logging.
subroutine connections_cr()
Create the model connections from the exchanges.
subroutine mf6finalize()
Finalize the simulation.
subroutine print_info()
print initial message
type(profilertype), public g_prof
the global timer object (to reduce trivial lines of code)
class(runcontroltype) function, pointer, public create_run_control()
This module contains simulation methods.
subroutine, public converge_reset()
Reset the simulation convergence flag.
subroutine, public initial_message()
Print the header and initializes messaging.
subroutine, public converge_check(hasConverged)
Simulation convergence check.
integer(i4b), parameter, public stg_aft_con_ar
afterr connection allocate read
integer(i4b), parameter, public stg_aft_con_df
after connection define
integer(i4b), parameter, public stg_aft_mdl_df
after model define
integer(i4b), parameter, public stg_bfr_mdl_df
before model define
integer(i4b), parameter, public stg_aft_exg_df
after exchange define
integer(i4b), parameter, public stg_aft_con_cr
after connection create
integer(i4b), parameter, public stg_bfr_exg_rp
before exchange read prepare
integer(i4b), parameter, public stg_bfr_con_ar
before connection allocate read
integer(i4b), parameter, public stg_aft_con_rp
after connection read prepare
integer(i4b), parameter, public stg_bfr_con_df
before connection define
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.
integer(i4b) ifailedstepretry
current retry for this time step
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) isim_mode
simulation mode
class(solutiongrouptype) function, pointer, public getsolutiongroupfromlist(list, idx)
This module contains the SourceLoadModule.
subroutine, public export_da()
deallocate model export objects and list
subroutine, public export_cr()
create model exports list
subroutine, public export_post_prepare()
model exports post prepare step actions
subroutine, public export_post_step()
model exports post step actions
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
subroutine, public tdis_set_timestep()
Set time step length.
subroutine, public tdis_set_counters()
Set kstp and kper.
integer(i4b), pointer, public kstp
current time step number
subroutine, public tdis_da()
Deallocate memory.
subroutine, public tdis_delt_reset(deltnew)
Reset delt and update timing variables and indicators.
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
subroutine, public print_start_time()
Start simulation timer.
This module contains version information.
subroutine write_listfile_header(iout, cmodel_type, write_sys_command, write_kind_info)
@ brief Write program header
integer(i4b), parameter idevelopmode
Highest level model type. All models extend this parent type.
Class to manage spatial connection of a model to one or more models of the same type....