[MITgcm-support] gluemnc
John Pender
jgpender at alaska.edu
Thu Aug 9 16:28:45 EDT 2012
Forgive me if this bug has been reported before.
THE PROBLEM
I have recently been tasked with configuring mult-processor experiments using latitude and longitude for the horizontal grid as per these lines in input/data.
# Gridding parameters
&PARM04
usingCartesianGrid=.FALSE.,
usingSphericalPolarGrid=.TRUE.,
ygOrigin = -55,
xgOrigin = 142,
delXfile='delXvar',
delYfile='delYvar',
delRfile='delZvar',
/
The model is configured to write netcdf files to disk with mnc package. This all takes place without error but the utility script that glues all the files for individual processors into a single netcdf file
MITgcm/utils/scripts/gluemnc
wouldn't work, though it worked fine for a Cartesian horizontal grid.
THE SOLUTION
I don't know why, but ncrcat (which is invoked many times in gluemnc) would not accept the ASCII string in the netcdf header that describes the units for the SphericalPolar horizontal grid
…
double X(X) ;
X:long_name = "longitude of cell center" ;
X:units = "degrees_east" ;
double Yp1(Yp1) ;
Yp1:long_name = "latitude of cell corner" ;
Yp1:units = "degrees_north" ;
...
For reference, when I use a Cartesian grid the header reads like this:
double X(X) ;
X:long_name = "X-coordinate of cell center" ;
X:units = "meters" ;
double Yp1(Yp1) ;
Yp1:long_name = "Y-Coordinate of cell corner" ;
Yp1:units = "meters" ;
and gluemnc runs fine, though with lots of non-fatal warning messages.
Faced with fixing ncrcat or modifying MITgcm I chose the latter. I went to
MITgcm/pkg/mnc
and modified the file
mnc_cw_cvars.F
so that every instance of
degrees_east and degrees_north
is replaced with simpler ASCII strings
dE and dN
It's not so mnemonic, I know, but it does work.
John
More information about the MITgcm-support
mailing list