# 5.1. Grid

The grid defines the geographical extent of the simulated domain and the spatial discretization.

## 5.1.1. Osmose <= 4.1.0

In Osmose versions prior to 4.1.0, there were several ways to define the Osmose grid, depending on the input format of resource variables. This was controlled by using the grid.java.classname parameter.

### 5.1.1.1. fr.ird.osmose.grid.NcGrid.java

The easiest way to define an Osmose grid is via a NetCDF file, containing the geographical coordinates and a land/sea mask. It is parameterized as follows:

 grid.netcdf.file Name of the NetCDF file grid.var.lat Name of the latitude variable grid.var.lon Name of the longitude variable grid.var.mask Name of the mask variable

Points are considered as masked when the mask values is less equal than 0.

### 5.1.1.2. fr.ird.osmose.grid.ECO3MGrid.java

The ECO3MGrid.java class is very similar to NcGrid.java, excepts it has an additional parameter:

 grid.stride Number of aggregation points

This parameter defines the number of input cells that will be aggregated together to make one osmose cell. For instance, a value of 4 implies that 16 cells of Eco3M grid will be used to make one cell of the Osmose model.

Note that the input values are expected to be double.

### 5.1.1.3. fr.ird.osmose.grid.BFMGrid.java

It is the same as ECO3MGrid.java, except that the input values of longitude, latitude and mask are expected to be float.

### 5.1.1.4. fr.ird.osmose.grid.OriginalGrid

Historically OSMOSE allows to define a regular grid, given a few parameters. Even though it is preferable to use the NetCDF grid definition, here is how a regular grid can be defined:

 grid.ncolumn Number of longitudes grid.nline Number of latitudes grid.lowright.lat Lower right latitude grid.lowright.lon Lower right longitude grid.upleft.lat Upper left latitude grid.upleft.lon Upper right latitude grid.mask.file CSV containing the land-sea mask

The mask file is a CSV with ncolumn and nline. Land takes the value -99, and ocean cell are defined by a 0. Here is an example of a CSV mask file for a 4x4 grid:

Note

The grid.ncolumn and grid.nline have been renamed to grid.nlon and grid.nlat in version 3.3.3

 0 0 0 0 0 0 0 -99 0 0 -99 -99 0 0 -99 -99

## 5.1.2. Osmose >= 4.2.0

From Osmose 4.2.0, only the NcGrid.java class has been kept.

Danger

Therefore, old configurations will need pre-processing in order to run with the most recent Osmose versions

## 5.1.3. Osmose >= 4.3.0

In Osmose >= 4.3, NaN will be considered as land points. Therefore, resource files with filled values over land can be used as a mask file.

Furthermore, an additional optional parameter has been added, grid.var.surf, which provides the name of the cell surface variable (which must be defined in $$m^2$$). I not provided, cell surfaces will be reconstructed from longitude and latitude coordinates.