37 logical(LGP) :: hasConverged
52 if (.not. hasconverged)
exit
111 logical(LGP) :: hasconverged
133 use,
intrinsic :: iso_fortran_env, only: output_unit
154 do im = 1, basemodellist%Count()
160 do ic = 1, baseexchangelist%Count()
166 do is = 1, basesolutionlist%Count()
176 do im = 1, basemodellist%Count()
183 do ic = 1, baseexchangelist%Count()
190 do ic = 1, baseconnectionlist%Count()
197 do is = 1, basesolutionlist%Count()
204 do isg = 1, solutiongrouplist%Count()
246 character(len=LINELENGTH) :: line
258 write (line,
'(2(1x,A))')
'Writing simulation list file:', &
431 integer(I4B) :: status
432 character(len=16) :: envvar
434 write (
iout,
'(/a)')
'PROCESSING MODEL CONNECTIONS'
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"
453 call connectionbuilder%processSolution(sol)
456 write (
iout,
'(a)')
'END OF MODEL CONNECTIONS'
491 character(len=LINELENGTH) :: line
492 character(len=LINELENGTH) :: fmt
505 write (line,
'(a,i0,a,i0,a)') &
506 'start timestep kper="',
kper,
'" kstp="',
kstp,
'" mode="'
511 line = trim(line)//
'validate"'
513 line = trim(line)//
'normal"'
522 call mp%model_message(line, fmt=fmt)
536 do ic = 1, baseconnectionlist%Count()
560 do ic = 1, baseconnectionlist%Count()
566 do is = 1, basesolutionlist%Count()
597 logical :: finishedTrying
616 if (finishedtrying)
exit retryloop
637 logical,
intent(out) :: finishedTrying
641 finishedtrying = .true.
644 if (.not. finishedtrying)
then
681 logical(LGP) :: hasconverged
687 character(len=LINELENGTH) :: line
688 character(len=LINELENGTH) :: fmt
696 line =
'end timestep'
705 call mp%model_message(line, fmt=fmt)
713 call mp%model_message(line, fmt=fmt)
723 do ic = 1, baseconnectionlist%Count()
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
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....