[Ncep.list.wwatch3.discussion-group] ww3 input redesign
Tim Campbell
tim.campbell at nrlssc.navy.mil
Wed Nov 12 21:05:13 UTC 2014
The proposed redesign of ww3_multi.inp involves replacing the input data
grid definition lines and wave model grid definition lines with Fortran
namelist inputs. The result is a more robust, extensible, and user
friendly input format. In the attached tar file is an implementation of
the proposed approach along with a test input file.
The current approach for specifying the input data grid definition and
the wave model grid definitions in ww3_multi.inp are as follows.
$ -------------------------------------------------------------------- $
$ If there are input data grids defined ( NRINP > 0 ), then these
$ grids are defined first. These grids are defined as if they are wave
$ model grids using the file mod_def.MODID. Each grid is defined on
$ a separate input line with MODID, and eight input flags identifying
$ the presentce of 1) water levels 2) currents 3) winds 4) ice and
$ 5-7) assimilation data as in the file ww3_shel.inp.
$
'input' F F T F F F F
$
$ In this example, we need the file mod_def.input to define the grid
$ and the file wind.input to provide the corresponding wind data.
$
$ -------------------------------------------------------------------- $
$ -------------------------------------------------------------------- $
$ Now each actual wave model grid is defined using 13 parameters to be
$ read fom a single line in the file. Each line contains the following
$ parameters
$ 1) Define the grid with the extension of the mod_def file.
$ 2-8) Define the inputs used by the grids with 8 keywords
$ corresponding to the 8 flags defining the input in the
$ input files. Valid keywords are:
$ 'no' : This input is not used.
$ 'native' : This grid has its own input files, e.g. grid
$ grdX (mod_def.grdX) uses ice.grdX.
$ 'MODID' : Take input from the grid identified by
$ MODID. In the example below, all grids get
$ their wind from wind.input (mod_def.input).
$ 9) Rank number of grid (internally sorted and reassigned).
$ 10) Group number (internally reassigned so that different
$ ranks result in different group numbers.
$ 11-12) Define fraction of communicator (processes) used for this
$ grid.
$ 13) Flag identifying dumping of boundary data used by this
$ grid. If true, the file nest.MODID is generated.
$
'grd1' 'no' 'no' 'input' 'no' 'no' 'no' 'no' 1 1 0.00 1.00 F
'grd2' 'no' 'no' 'input' 'no' 'no' 'no' 'no' 2 1 0.00 1.00 F
'grd3' 'no' 'no' 'input' 'no' 'no' 'no' 'no' 3 1 0.00 1.00 F
$ 'grd1' 'no' 'no' 'input' 'no' 'no' 'no' 'no' 1 1 0.00 0.50 F
$ 'grd2' 'no' 'no' 'input' 'no' 'no' 'no' 'no' 2 1 0.25 0.75 F
$ 'grd3' 'no' 'no' 'input' 'no' 'no' 'no' 'no' 3 1 0.50 1.00 F
$
$ In this example three grids are used requiring the files
$ mod_def.grdN. All files get ther winds from the grid 'input'
$ defined by mod_def.input, and no other inputs are used. In the lines
$ that are commented out, each grid runs on a part of the pool of
$ processes assigned to the computation.
$
$ -------------------------------------------------------------------- $
Where each flag (T or F) in the input grid line and each keyword in each
wave model grid definition line corresponds to a type of input field.
As more input field types are added to the system, the list flags
becomes more cumbersome and error prone.
The proposal is to define Fortran data structures for the input grids
and the model grids and use these data structures in Fortran namelists
for user input. The proposed data structures (input_grid_t and
model_grid_t) are defined at the beginning of test_multi.f90. The
processing of the namelist input is handled by the read_input_grid_nml()
and read_model_grid_nml() subroutines. The test_multi.inp file is a
sample input. The input namelists are input_grid_nml and
model_grid_nml. Some noteworthy items are:
* input of the input grid definitions and the wave model grid
definitions only
need to include those entries for which the user wants a
non-default value;
* the namelist entries do not need to follow any particular order;
* self-documentation is obtained through the use of meaningful
variable names
in the grid data structures
* if a user misspells or otherwise has an entry that is not defined
in the
namelist, then the program will catch the error and report the
offending entry
This proposal currently targets the grid inputs in ww3_multi.inp.
However, the approach of using data structures and namelists is very
general and can be expanded to include most, if not all, of the inputs
in the .inp files. Specifically, we could target the output field
parameter definitions table input.
Cheers,
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prototype_multi_input.tar.gz
Type: application/x-gzip
Size: 3582 bytes
Desc: not available
Url : https://lstsrv.ncep.noaa.gov/pipermail/ncep.list.wwatch3.discussion-group/attachments/20141112/9fe7fb1c/attachment.gz
More information about the Ncep.list.wwatch3.discussion-group
mailing list