next up previous
Next: Partition definition Up: Interfacing a model with Previous: Initialisation


Grid data file definition

The grid data files grids.nc, masks.nc and areas.nc can be created by the user before the run or can be written directly at run time by the master process of each component model (except when OASIS3 is used in ``IPSL'' parallel mode, see section 8.2.1).

If written by the component models, the writing of those grid files is driven by OASIS3 main process. It first checks whether the binary file grids or the netCDF file grids.nc exists (if it is the case, it assumes that areas or areas.nc and masks or masks.nc files exist too), or if writing is needed. If grids or grids.nc exists, it must contain all grid information from all models; the file will not be completed or overwritten even if the following routines are explicitely called. If grids or grids.nc does not exist, each model must write its grid, mask and area definition in the grid data files with the following routines.

The coupler sends the information on whether or not writing is needed to the models following an OASIS3 internal order (below prism_start_grids_writing called by the component master process). If the grid data files already exist in the working directory, nothing happens when the component model calls the prism_write_grid, prism_write_corner, prism_write_ang, prism_write_mask,
prism_write_area routines; the grid information is NOT overwritten in the grid files. If writing is needed, the first model creates the files, writes the data arrays when calling the appropriate routines, and then sends a termination flag to the coupler (below
prism_terminate_grids_writing call). The coupler will then send the starting flag to the next model; this ensures that only one model accesses the files at a time.

This section describes the PSMILe routines to be called by the master process of each component model to write, at run time, the whole grid information to the grid data files. These routines have to be called just after prism_init_comp_proto.

As an example, see the TOYOASIS3 coupled model components that use these routines to write the grid data files (effective if gridswr=1 in the running script run_toyoasis3, see section 8.3).


next up previous
Next: Partition definition Up: Interfacing a model with Previous: Initialisation
Laure Coquart 2013-06-11