Open peverwhee opened 3 years ago
If we use a derived type to hold this information for an input variable:
! New module or physics_data.F90?
type, public :: input_data_field_t
character(len=:), allocatable :: standard_name
character(len=:), allocatable :: filename
character(len=:), allocatable :: frequency
character(len=:), allocatable :: file_varnames
logical :: interpolate
end type input_data_field_t
! One of these variables for each input variable, declared and used in a scheme's namelist-reader module.
type(input_data_field_t) :: <stdname>
<stdname>%standard_name = <stdname>
then, we can use syntax that automatically sets <stdname>
:
<stdname>%filename = "<filename>"
<stdname>%frequency = "init"
<stdname>%file_varnames = "<varname1>,<varname2>"
<stdname>%interpolate = .false.
After the namelist processing is complete (read, broadcast, print), add this item to the hash table (located in the same module which contains input_data_field_t
and which will do the reading).
Bonus, add a print
method to input_data_field_t
to ease printing in each namelist-reader module.
We will also need a metadata file (type = module
) for each namelist-reader file with one variable defined for each scheme input that needs to be read from a file.
New namelist variable format:
(driving force for this framework: need orographic data for gravity waves scheme)