4 Grid data file definition

Grid data files are required by OASIS3-MCT for specific operations, see sections 4 and 5.1. These grid data files can be created by the user before the run or can be written directly at run time by the components with the following routines. If a grid data files does not exist, the corresponding routine will create it; if the grid data file exists, the routine can be used to add grid definition fields but it will not overwrite grid definition fields already existing in the file with the same grid name.

These routines can be called only by one component process to write the whole grid or by each process holding a part of a grid. In the former case, optional argument il_part_id is not needed and the arrays handling the longitudes of the grid points or corners (lon, clon), the latitudes of the grid points or corners (lat, clat), the masks (mask), fracs (frac), and areas (area) of the grid cells need to cover the whole grid; in the later case, the il_part_id returned by oasis_def_partition needs to be provided as input argument and the arrays need to cover only the local partition of the grid.

The field names in the grids.nc, masks.nc, and areas.nc follow a well-defined convention. The fields are normally two-dimensional, and each field name consists of a grid acronym followed by a string that identifies the field. For instance, the center latitudes for the grid torc will be called torc.lat and the center longitudes will be called torc.lon in the netcdf file. The grids.nc file contains the center latitudes (.lat) and longitudes (.lat) as well as the corner latitudes (.cla) and corner longitudes (.clo). The corner fields have a third dimension associated with the number of corners per gridcell. The area.nc file constains the area field (.srf). The masks.nc file contains the mask (.msk) and frac (.frc) fields.

The creation of the different grid data files is completed in the routine oasis_enddef.