4 Grid data file definition
Grid data files (see section 5.1) are required by OASIS3-MCT for specific operations , i.e. grids.nc and masks.nc for
SCRIPR (see section 4.3), and masks.nc and
areas.nc for CONSERV (see section
4.4). 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 (see below) handling the longitudes of the grid points or corners (lon, clon), the latitudes of the grid points or corners (lat, clat), the masks (mask) 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 .
- CALL oasis_start_grids_writing (flag) or
- CALL prism_start_grids_writing (flag)
- flag [INTEGER; OUT]: always 1
Must be called to start the grid writing process.
- CALL oasis_write_grid (cgrid, nx_global, ny_global, lon, lat, il_part_id)
- CALL prism_write_grid (cgrid, nx_global, ny_global, lon, lat, il_part_id)
- cgrid [CHARACTER; IN]: grid name prefix (see
3.3 and 5.1); maximum length of 64 characters (4 are usually used for historical reasons)
- nx_global [INTEGER; IN] : first dimension of the global grid
- ny_global [INTEGER; IN] : second dimension of the global grid (=1 if the grid is expressed as a 1D vector)
- lon [REAL, DIMENSION(nx,ny); IN] : single or double real array of longitudes covering the whole grid (nx=nx_global, ny=ny_global) or only the local partition (degrees East).
- lat [REAL, DIMENSION(nx,ny); IN] : single or double real array of latitudes covering the whole grid (nx=nx_global, ny=ny_global) or only the local partition (degrees North)
- il_part_id [INTEGER, OPTIONAL; IN]: partition ID returned by oasis_def_partition, see 2.2.3; needed if each component task holding a part of a decomposed grid writes its own part of the grid.
Writes the component grid longitudes and latitudes. Longitudes must be
given in degrees East in the interval -360.0 to 720.0. Latitudes
must be given in degrees North in the interval -90.0 to 90.0. Note
that if some grid points overlap, it is recommended to define those
points with the same number (e.g. 90.0 for both, not 450.0 for one
and 90.0 for the other) to ensure automatic detection of overlap by
OASIS3-MCT (which is essential to have a correct conservative
remapping SCRIPR/CONSERV, see section 4.3).
- CALL oasis_write_corner (cgrid, nx_global, ny_global, nc, clon, clat, il_part_id))
- CALL prism_write_corner (cgrid, nx_global, ny_global, nc, clon, clat, il_part_id))
- cgrid , nx_global , ny_global , il_part_id : as for oasis_write_grid
- nc [INTEGER; IN] : number of corners per grid cell
(can be any number)
- clon [REAL, DIMENSION (nx,ny,nc);IN] : single or double real array of corner
longitudes covering the whole grid (nx=nx_global, ny=ny_global) or only the local partition (in degrees_East)
- clat [REAL, DIMENSION (nx,ny,nc);IN] : single or double real array of corner
latitudes covering the whole grid (nx=nx_global, ny=ny_global) or only the local partition (in degrees_North)
Writes the grid cell corner longitudes and latitudes
(counterclockwise sense). Longitudes must be given in degrees East
in the interval -360.0 to 720.0. Latitudes must be given in degrees
North in the interval -90.0 to 90.0. Note also that cells larger
than 180.0 degrees in longitude are not supported. Writing of
corners is optional as corner information is needed only for SCRIPR/CONSERV (see section 4.3). If called,
needs to be called after oasis/prism_write_grid.
- CALL oasis_write_mask (cgrid, nx_global, ny_global, mask, il_part_id)
- CALL prism_write_mask (cgrid, nx_global, ny_global, mask, il_part_id)
- cgrid , nx_global , ny_global , il_part_id : as for oasis_write_grid
- mask [INTEGER, DIMENSION(nx,ny) ;IN] : mask array covering the whole grid (nx=nx_global, ny=ny_global) or only the local partition (be
careful about the OASIS historical convention (!): 0 = not masked,
1 = masked)
Writes the component grid mask.
- CALL oasis_write_area (cgrid, nx_global, ny_global, area, il_part_id)
- CALL prism_write_area (cgrid, nx_global, ny_global, area, il_part_id)
- cgrid , nx_global , ny_global , il_part_id : as for oasis_write_grid
- area [REAL, DIMENSION(nx,ny); IN] : single or double real array of grid cell
areas covering the whole grid (nx=nx_global, ny=ny_global) or only the local partition
Writes of the component grid cell areas. Needed only for CONSERV
operation (see section 4.4).
- CALL prism_terminate_grids_writing() or
- CALL oasis_terminate_grids_writing()
The creation of the different grid data files is effective in the routine
oasis_enddef.