38 logical(LGP) :: hasConverged
53 if (.not. hasconverged)
exit
120 logical(LGP) :: hasconverged
147 use,
intrinsic :: iso_fortran_env, only: output_unit
164 integer(I4B) :: tmr_dealloc
172 do im = 1, basemodellist%Count()
178 do ic = 1, baseexchangelist%Count()
184 do is = 1, basesolutionlist%Count()
191 call g_prof%start(
"Deallocate", tmr_dealloc)
199 do im = 1, basemodellist%Count()
206 do ic = 1, baseexchangelist%Count()
213 do ic = 1, baseconnectionlist%Count()
220 do is = 1, basesolutionlist%Count()
227 do isg = 1, solutiongrouplist%Count()
239 call g_prof%stop(tmr_dealloc)
273 character(len=LINELENGTH) :: line
285 write (line,
'(2(1x,A))')
'Writing simulation list file:', &
458 integer(I4B) :: status
459 character(len=16) :: envvar
461 write (
iout,
'(/a)')
'PROCESSING MODEL CONNECTIONS'
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"
480 call connectionbuilder%processSolution(sol)
483 write (
iout,
'(a)')
'END OF MODEL CONNECTIONS'
518 character(len=LINELENGTH) :: line
519 character(len=LINELENGTH) :: fmt
526 call g_prof%start(
"Prepare time step",
g_prof%tmr_prep_tstp)
536 write (line,
'(a,i0,a,i0,a)') &
537 'start timestep kper="',
kper,
'" kstp="',
kstp,
'" mode="'
542 line = trim(line)//
'validate"'
544 line = trim(line)//
'normal"'
553 call mp%model_message(line, fmt=fmt)
567 do ic = 1, baseconnectionlist%Count()
591 do ic = 1, baseconnectionlist%Count()
597 do is = 1, basesolutionlist%Count()
631 logical :: finishedTrying
653 if (finishedtrying)
exit retryloop
677 logical,
intent(out) :: finishedTrying
681 finishedtrying = .true.
684 if (.not. finishedtrying)
then
721 logical(LGP) :: hasconverged
727 character(len=LINELENGTH) :: line
728 character(len=LINELENGTH) :: fmt
736 line =
'end timestep'
739 call g_prof%start(
"Finalize time step",
g_prof%tmr_final_tstp)
749 call mp%model_message(line, fmt=fmt)
759 call mp%model_message(line, fmt=fmt)
769 do ic = 1, baseconnectionlist%Count()
781 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....