NAME: get_gridparams
PURPOSE:
1) extract from a NetCDF file the longitude, latidude, and their dimensions
and make sure it is 1D or 2D arrays
or 2) given longitude and latitude arrays get their dimensions and make sure
they are 1D or 2D arrays
CATEGORY:for interpolations tools
CALLING SEQUENCE:
1) get_gridparams, file, lonname, latname, lon, lat, jpi, jpj, n_dimensions
or
2) get_gridparams, lon, lat, jpi, jpj, n_dimensions
INPUTS:
1)
file: the name of the netcdf file
loname: the name of the variable that contains the longitude in the NetCDF file
latname: the name of the variable that contains the latitude in the NetCDF file
or
2) lon and lat: 1d or 2D arrays defining longitudes and latitudes.
Note that these arrays are also outputs and can therefore be modified.
KEYWORD PARAMETERS: none
OUTPUTS:
lon the variable that will contain the longitudes
lat the variable that will contain the latitudes
jpi the number of points in the longitudinal direction
jpj the number of points in the latitudinal direction
n_dimensions: 1 or 2 to specify if lon and lat should be 1D (jpi or jpj)
arrays or 2D arrays (jpi,jpj). Note that of n_dimensions = 1, then the
grid must be regular (each longitudes must be the same for all latitudes
and each latitudes should be the sae for all longitudes).
COMMON BLOCKS: none
SIDE EFFECTS: ?
RESTRICTIONS: ?
EXAMPLE:
1) ncdf_get_gridparams, 'coordinates_ORCA_R05.nc', 'glamt', 'gphit' $
, olon, olat, jpio, jpjo, 2
2) ncdf_get_gridparams, olon, olat, jpio, jpjo, 2
MODIFICATION HISTORY: