42 character(len=LENMEMPATH) :: memorypath
45 integer(I4B),
pointer :: id
46 integer(I4B),
pointer :: iu
47 real(dp),
pointer :: ttsoln
48 integer(I4B),
pointer :: icnvg => null()
87 character(len=*),
intent(in) :: filename
88 integer(I4B),
intent(in) :: id
90 integer(I4B) :: inunit
92 character(len=LENSOLUTIONNAME) :: solutionname
96 write (solutionname,
'(a, i0)')
'SLN_', id
97 exp_sol%name = solutionname
99 allocate (exp_sol%modellist)
100 allocate (exp_sol%exchangelist)
101 call exp_sol%allocate_scalars()
108 inquire (file=filename, number=inunit)
109 if (inunit < 0) inunit =
getunit()
111 write (
iout,
'(/a,a/)')
' Creating explicit solution (EMS): ', exp_sol%name
115 call exp_sol%parser%Initialize(exp_sol%iu,
iout)
125 call mem_allocate(this%ttsoln,
'TTSOLN', this%memoryPath)
144 call this%parser%Clear()
174 call this%modellist%Clear()
175 deallocate (this%modellist)
176 call this%exchangelist%Clear()
177 deallocate (this%exchangelist)
187 subroutine sln_ca(this, isgcnvg, isuppress_output)
190 integer(I4B),
intent(inout) :: isgcnvg
191 integer(I4B),
intent(in) :: isuppress_output
194 character(len=LINELENGTH) :: line
195 character(len=LINELENGTH) :: fmt
197 integer(I4B) :: kiter
201 call this%prepareSolve()
205 line =
'mode="validation" -- Skipping assembly and solution.'
207 do im = 1, this%modellist%Count()
209 call mp%model_message(line, fmt=fmt)
214 call this%solve(kiter)
217 call this%finalizeSolve(kiter, isgcnvg, isuppress_output)
231 do i = 1, this%exchangelist%Count()
237 do i = 1, this%modellist%Count()
250 integer(I4B),
intent(in) :: kiter
254 logical :: any_pending
262 do im = 1, this%modellist%Count()
264 call mp%model_solve()
268 any_pending = .false.
269 do im = 1, this%modellist%Count()
271 if (mp%has_pending())
then
276 if (.not. any_pending)
exit
287 integer(I4B),
intent(in) :: kiter
288 integer(I4B),
intent(inout) :: isgcnvg
289 integer(I4B),
intent(in) :: isuppress_output
295 do im = 1, this%modellist%Count()
297 call mp%model_cq(this%icnvg, isuppress_output)
301 do im = 1, this%modellist%Count()
303 call mp%model_bd(this%icnvg, isuppress_output)
308 subroutine save(this, filename)
310 character(len=*),
intent(in) :: filename
311 integer(I4B) :: inunit
313 open (unit=inunit, file=filename, status=
'unknown')
314 write (inunit, *)
'The save routine currently writes nothing'
334 models => this%modellist
341 class(*),
pointer :: obj
343 call this%exchangelist%Add(obj)
349 type(
listtype),
pointer :: exchanges
350 exchanges => this%exchangelist
class(baseexchangetype) function, pointer, public getbaseexchangefromlist(list, idx)
Retrieve a specific BaseExchangeType object from a list.
subroutine, public addbasesolutiontolist(list, solution)
This module contains block parser methods.
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 lensolutionname
maximum length of the solution name
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenmempath
maximum length of the memory path
Models that solve themselves.
class(explicitmodeltype) function, pointer, public getexplicitmodelfromlist(list, idx)
@ brief Get generic object from list and return as explicit model
subroutine, public addexplicitmodeltolist(list, model)
@ brief Add explicit model to a generic list
Explicit solutions for solving explicit models.
subroutine preparesolve(this)
Prepare to solve.
type(listtype) function, pointer get_models(this)
Get a pointer to a list of models in the solution.
subroutine, public create_explicit_solution(exp_sol, filename, id)
Create a new solution.
subroutine add_model(this, mp)
Add explicit model to list.
subroutine add_exchange(this, exchange)
Add exchange to list of exchanges.
type(listtype) function, pointer get_exchanges(this)
Get list of exchanges.
subroutine save(this, filename)
Save output.
subroutine finalizesolve(this, kiter, isgcnvg, isuppress_output)
Finalize solve.
subroutine allocate_scalars(this)
Allocate scalars.
This module defines variable data types.
type(listtype), public basesolutionlist
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains simulation variables.
integer(i4b) iout
file unit number for simulation output
integer(i4b) isim_mode
simulation mode
subroutine, public code_timer(it, t1, ts)
Get end time and calculate elapsed time.
Highest level model type. All models extend this parent type.
Base type for models that solve themselves.
Manages and solves explicit models.
A generic heterogeneous doubly-linked list.