[mpas-developers] namelist-defined dimensions

Michael Duda duda at ucar.edu
Mon May 24 14:43:49 MDT 2010


Hi, Developers.

Toward our goal of moving the initialization step out of the model
and into a separate program (still possibly a 'core' within the
MPAS framework), we'll need to be able to allocate fields
according dimension sizes specified at run-time.  For example, if
we have an initialization program that reads only horizontal grid
information, but fills in 3d atmospheric or oceanic fields, we
might like the number of vertical levels to be specifiable in the
namelist. Currently, however, dimensions must be defined in the
netCDF input file (with the special exception of nVertLevels,
which can be expanded to a size specifiable at compile time using
the -DEXPAND_LEVELS flag in the Makefile).

I've modified a copy of MPAS that allows one to dimension fields
according to namlist parameters; as is currently the case, though,
the outer-most (least quickly varying) dimension must be one of
nCells, nEdges, nVertices, nVertLevels, or nVertLevelsP1. With the
modified code, one can specify in the Registry file, for example:

   namelist integer   dimensions     config_nx        10

   dim nx namelist:config_nx

   var real    foo ( nx nCells ) ro foo - -

where the dimension nx will take on whatever value is specified by
the namelist parameter config_nx, which has a default value of 10.
This is accomplished with the addition of the prefix 'namelist:'
to the registry syntax for dimension specifications.

The changes to enable this functionality are contained within the
files registry_types.h, gen_inc.c, and parse.c in the src/registry
directory. I've placed a checked out copy of the MPAS code with
these changes in
http://www.mmm.ucar.edu/people/duda/files/mpas/new_code/mpas_nldim.tar.gz
for review. If anyone has any comments or suggestions for
improvement, please let me know. If the changes look good and are
working for others, I'll add them back into the repository trunk.

Cheers,
Michael


More information about the mpas-developers mailing list