[Mitgcm-support] RE: Global Files / MIT Model

mitgcm-support at dev.mitgcm.org mitgcm-support at dev.mitgcm.org
Wed Jul 9 15:47:36 EDT 2003


Chris, 
I have put my netCDF code in our public ftp folder at
ftp://ftp.soc.soton.ac.uk/pub/jods/mitgcm

I've put some details to get you going below.
Hope it's useful,
John


Some notes...
At present the netCDF routines I have just replaced write_state, which now calls 
mnc_writestate to do the work. Although it would be quite easy to sort out 
checkpoints, I haven't done that yet.

I haven't really tested the reading capability, though I think all of it is in 
place.  

Also, at the moment, there is a process / barrier loop in mnc_writestate, rather 
than in the lower level mNC_WRITEFIELD. This was done to limit the required 
number of barriers ( one per process instead of one per field for each process). 
I guess there's a trade off here between ideal coding convention and speed.

It needs extra code for cartesian grids in mnc_new_file.  

The ncroutines.F file is rather large, you may want to fsplit it first.

You will need the netCDF libraries (libnetcdf.a) & include file (netcdf.inc) 
from the standard distribution.

There are several kludges, especially with determining the grid shape in 
mnc_new_file - you probably know a better way to get the axis sizes than I used.

At the moment the file is created by the master (process) and then each process 
fills it's bit of data in sequentially.  Each write checks for the existence of 
the field it is trying to write, checks it's dimensions, and then fills it in.  
The extra checks aren't really necessary and could be removed for speed.

It only writes global netCDF files.

You can select between one dump per file or multiple dumps per file - change 
DumpsPerFile in NCROUTINES.h . This could be read as part of a namelist and 
doesn't have to be a parameter.
   
Most of the subroutines / global names are prefixed with mnc. 

At one time I had the idea that an input file/field could be specified as a 
filename like 'ancfile.cdf:fieldname' ie a filename and fieldname deliminated by 
a colon, hence the getfilefield S/R, but I never got round to sorting it out 
properly.




More information about the MITgcm-support mailing list