Appearance
adam_run_library
ADAM, the generic driver of an application: realms of the application's type, the forest, the run.
Every application's main program did the same (issue #80 P3, §5(f)): read the input file name (default input.ini), detect a forest manifest, allocate one realm (single input) or one per manifest realm, point the forest at them and simulate. run_forest does it for any realm type, given a prototype of it:
fortran
program adam_flume_cpu
use :: adam_run_library, only : run_forest
use :: adam_flume_cpu_object, only : flume_cpu_object
implicit none
type(flume_cpu_object) :: prototype !< The realm type to run (only its type is used).
call run_forest(prototype=prototype)
endprogram adam_flume_cpuSource: src/lib/common/adam_run_library.F90
Dependencies
Contents
Subroutines
run_forest
Run the application whose realm type is the dynamic type of prototype: one realm for a single input file, one per realm of a forest manifest (the first command-line argument, default input.ini).
Each realm is a scalar of its own, allocated through the forest's pointer with mold=prototype (default-initialized, the prototype's values are not copied): there is no array of class(realm_object), which nvfortran indexes wrongly (issue #96), and, as the program-scope arrays they replace, the realms are never deallocated, so no finalization or device free runs after the forest has finalized MPI.
fortran
subroutine run_forest(prototype)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
prototype | class(realm_object) | in | A realm of the type to run. |
Call graph