Functions

Vertical Coordinates

Coordinates axes

These functions help with the definition and reading of latitude and longitude coordinate variables and dimensions. More...

Functions

int nccf_def_lvl (int ncid, const char *name, size_t len, nc_type xtype, const char *units, int positive_up, const char *standard_name, const char *formula_terms, int cdm_axis_type, int *lvl_dimidp, int *lvl_varidp)
 Define a coordinate variable and dimension with all the CF recommended attribute accessories for a vertical level.
int nccf_inq_lvl (int ncid, char *name, size_t *lenp, nc_type *xtypep, size_t *ft_lenp, char *formula_terms, int *positive_upp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about a vertical dimension and coordinate variable.
int nccf_def_lvl_atm_ln (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Define a vertical coordinate for atmosphere natural log pressure.
int nccf_def_ft_atm_ln (int ncid, int varid, int pref_varid)
 Define formula terms for atmosphere natural log pressure.
int nccf_inq_lvl_atm_ln (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *pref_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about atmosphere natural log pressure coordinate.
int nccf_def_lvl_vert (int ncid, int lvl_type, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Create a unitless vertical dimension/variable from appendix D of the CF standard.
int nccf_def_lvl_sigma (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Define a vertical sigma coordinate dimension.
int nccf_def_ft_sigma (int ncid, int lvl_varid, int ps_varid, int p0_varid)
 Define formula terms attribute for atmosphere sigma coordinate variable.
int nccf_inq_lvl_vert (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *lvl_typep, int *lvl_dimidp, int *lvl_varidp)
 Inquire about a level dimension and coordinate variable.
int nccf_inq_lvl_sigma (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *ps_varidp, int *ptop_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about atmospheric sigma coordinate.
int nccf_def_lvl_hybrid_sigma (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Define hybrid sigma pressure coordinate.
int nccf_def_ft_hybrid_sigma (int ncid, int lvl_varid, int a_varid, int b_varid, int ps_varid, int p0_varid)
 Define formula terms attribute for atmosphere hybrid sigma coordinate variable.
int nccf_inq_lvl_hybrid_sigma (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *a_varidp, int *b_varidp, int *ps_varidp, int *p0_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about hybrid sigma coordinate.
int nccf_def_lvl_hybrid_height (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Atmosphere hybrid height coordinate.
int nccf_def_ft_hybrid_height (int ncid, int varid, int a_varid, int b_varid, int orog_varid)
 Define formula terms attribute for atmosphere hybrid height coordinate variable.
int nccf_inq_lvl_hybrid_height (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *a_varidp, int *b_varidp, int *orog_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about atmosphere hybrid_height coordinate.
int nccf_def_lvl_sleve (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Atmosphere smooth level vertical (SLEVE) coordinate.
int nccf_def_ft_sleve (int ncid, int varid, int a_varid, int b1_varid, int b2_varid, int ztop_varid, int zsurf1_varid, int zsurf2_varid)
 Define formula terms attribute for the atmosphere sleve coordinate variable.
int nccf_inq_lvl_sleve (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *a_varidp, int *b1_varidp, int *b2_varidp, int *ztop_varidp, int *zsurf1_varidp, int *zsurf2_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about atmosphere sleve coordinate.
int nccf_def_lvl_ocean_sigma (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Define an ocean sigma coordinate.
int nccf_def_ft_ocean_sigma (int ncid, int varid, int eta_varid, int depth_varid)
 Define the formula terms attribute for the ocean sigma coordinate variable.
int nccf_inq_lvl_ocean_sigma (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *eta_varidp, int *depth_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about ocean sigma coordinate.
int nccf_def_lvl_ocean_s (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Define ocean s-coordinate.
int nccf_def_ft_ocean_s (int ncid, int varid, int eta_varid, int depth_varid, int a_varid, int b_varid, int depth_c_varid)
 Define the formula terms attribute for the ocean sigma coordinate variable.
int nccf_inq_lvl_ocean_s (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *eta_varidp, int *depth_varidp, int *a_varidp, int *b_varidp, int *depth_c_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about ocean_s coordinate.
int nccf_def_lvl_ocean_sigma_z (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Define ocean sigma over z coordinate.
int nccf_def_ft_ocean_sigma_z (int ncid, int varid, int eta_varid, int depth_varid, int depth_c_varid, int nsigma_varid, int zlev_varid)
 Define formula terms for the ocean sigma z coordinate.
int nccf_inq_lvl_ocean_sigma_z (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *eta_varidp, int *depth_varidp, int *depth_c_varidp, int *nsigma_varidp, int *zlev_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about atmosphere ocean_sigma_z coordinate.
int nccf_def_lvl_ocean_dbl_sigma (int ncid, const char *name, nc_type xtype, size_t len, int *lvl_dimidp, int *lvl_varidp)
 Define ocean double sigma coordinate.
int nccf_def_ft_ocean_dbl_sigma (int ncid, int varid, int depth_varid, int z1_varid, int z2_varid, int a_varid, int href_varid, int k_c_varid)
 Define formula terms for ocean double sigma coordinate.
int nccf_inq_lvl_ocean_dbl_sigma (int ncid, char *name, nc_type *xtypep, size_t *lenp, int *depth_varidp, int *z1_varidp, int *z2_varidp, int *a_varidp, int *href_varidp, int *k_c_varidp, int *lvl_dimidp, int *lvl_varidp)
 Inquire about the ocean double sigma coordinate.

Detailed Description

These functions help with the definition and reading of latitude and longitude coordinate variables and dimensions.


Function Documentation

int nccf_def_ft_atm_ln ( int  ncid,
int  varid,
int  pref_varid 
)

Define formula terms for atmosphere natural log pressure.

Parameters:
ncidThe ncid of the file.
varidThe ID of the variable.
pref_varid
Returns:
0 for success, error code otherwise.

Definition at line 937 of file cfcvars.c.

int nccf_def_ft_hybrid_height ( int  ncid,
int  varid,
int  a_varid,
int  b_varid,
int  orog_varid 
)

Define formula terms attribute for atmosphere hybrid height coordinate variable.

Parameters:
ncidThe ncid of the file.
varidThe varid of the vertical coordinate variable.
a_varidThe variable ID of the a variable.
b_varidThe variable ID of the b variable.
orog_varidThe variable ID of the orog variable.
Returns:
0 for success, error code otherwise.

Definition at line 1559 of file cfcvars.c.

int nccf_def_ft_hybrid_sigma ( int  ncid,
int  lvl_varid,
int  a_varid,
int  b_varid,
int  ps_varid,
int  p0_varid 
)

Define formula terms attribute for atmosphere hybrid sigma coordinate variable.

Parameters:
ncidThe ncid of the file.
lvl_varidThe varid of the vertical coordinate variable.
a_varidThe variable ID of the a variable.
b_varidThe variable ID of the b variable.
ps_varidThe variable ID of the ps variable.
p0_varidThe variable ID of the ptop variable.
Returns:
0 for success, error code otherwise.

Definition at line 1338 of file cfcvars.c.

int nccf_def_ft_ocean_dbl_sigma ( int  ncid,
int  varid,
int  depth_varid,
int  z1_varid,
int  z2_varid,
int  a_varid,
int  href_varid,
int  k_c_varid 
)

Define formula terms for ocean double sigma coordinate.

Parameters:
ncidThe ncid of the file.
varidThe varid of the vertical coordinate variable.
depth_varidThe variable ID of the depth variable.
z1_varidThe variable ID of the z1 variable.
z2_varidThe variable ID of the z2 variable.
a_varidThe variable ID of the a variable.
href_varidThe variable ID of the href variable.
k_c_varidThe variable ID of the k_c variable.
Returns:
0 for success, error code otherwise.

Definition at line 2279 of file cfcvars.c.

int nccf_def_ft_ocean_s ( int  ncid,
int  varid,
int  eta_varid,
int  depth_varid,
int  a_varid,
int  b_varid,
int  depth_c_varid 
)

Define the formula terms attribute for the ocean sigma coordinate variable.

Parameters:
ncidThe ncid of the file.
varidThe varid of the vertical coordinate variable.
eta_varidThe variable ID of the eta variable.
depth_varidThe variable ID of the depth variable.
a_varidThe variable ID of the a variable.
b_varidThe variable ID of the b variable.
depth_c_varidThe variable ID of the depth_c variable.
Returns:
0 for success, error code otherwise.

Definition at line 1972 of file cfcvars.c.

int nccf_def_ft_ocean_sigma ( int  ncid,
int  varid,
int  eta_varid,
int  depth_varid 
)

Define the formula terms attribute for the ocean sigma coordinate variable.

Parameters:
ncidThe ncid of the file.
varidThe varid of the vertical coordinate variable.
eta_varidThe variable ID of the eta variable.
depth_varidThe variable ID of the depth variable.
Returns:
0 for success, error code otherwise.

Definition at line 1841 of file cfcvars.c.

int nccf_def_ft_ocean_sigma_z ( int  ncid,
int  varid,
int  eta_varid,
int  depth_varid,
int  depth_c_varid,
int  nsigma_varid,
int  zlev_varid 
)

Define formula terms for the ocean sigma z coordinate.

Parameters:
ncidThe ncid of the file.
varidThe varid of the vertical coordinate variable.
eta_varidThe variable ID of the eta variable.
depth_varidThe variable ID of the depth variable.
depth_c_varidThe variable ID of the depth_c variable.
nsigma_varidThe variable ID of the nsigma variable.
zlev_varidThe variable ID of the zlev variable.
Returns:
0 for success, error code otherwise.

Definition at line 2122 of file cfcvars.c.

int nccf_def_ft_sigma ( int  ncid,
int  lvl_varid,
int  ps_varid,
int  p0_varid 
)

Define formula terms attribute for atmosphere sigma coordinate variable.

Parameters:
ncidThe ncid of the file.
lvl_varidThe variable ID of the level.
ps_varidThe variable ID of the ps variable.
p0_varidThe variable ID of the p0 variable.
Returns:
0 for success, error code otherwise.

Definition at line 1086 of file cfcvars.c.

int nccf_def_ft_sleve ( int  ncid,
int  varid,
int  a_varid,
int  b1_varid,
int  b2_varid,
int  ztop_varid,
int  zsurf1_varid,
int  zsurf2_varid 
)

Define formula terms attribute for the atmosphere sleve coordinate variable.

Parameters:
ncidThe ncid of the file.
varidThe varid of the vertical coordinate variable.
a_varidThe variable ID of the a variable.
b1_varidThe variable ID of the b1 variable.
b2_varidThe variable ID of the b2 variable.
ztop_varidThe variable ID of the ztop variable.
zsurf1_varidThe variable ID of the zsurf1 variable.
zsurf2_varidThe variable ID of the zsurf2 variable.
Returns:
0 for success, error code otherwise.

Definition at line 1697 of file cfcvars.c.

int nccf_def_lvl ( int  ncid,
const char *  name,
size_t  len,
nc_type  xtype,
const char *  units,
int  positive_up,
const char *  standard_name,
const char *  formula_terms,
int  cdm_axis_type,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Define a coordinate variable and dimension with all the CF recommended attribute accessories for a vertical level.

Parameters:
ncidThe ncid of the file.
nameThe name of the coordinate dimension and variable.
lenThe length of this coordinate dimension and variable.
xtypeThe type of this coordinate variable.
unitsIf non-NULL, a string which will be written as the ``units'' attribute on the coordinate variable.
positive_upSet to 0 and the attribute ``positive'' to ``down''. Set to any other value to get ``up''.
standard_nameIf non-NULL, a string which will be written as the ``standard_name'' attribute on the coordinate variable.
formula_termsIf non-NULL, a string which will be written as the ``formula_terms'' attribute on the coordinate variable.
cdm_axis_typeCDM axis type.
lvl_dimidpIf non-NULL, nccf_def_lvl will write the dimension ID of the netCDF dimension for the level here.
lvl_varidpIf non-NULL, nccf_def_lvl will write the variable ID of the netCDF coordinate variable for the level here.
Returns:
0 for success, error code otherwise.

Definition at line 578 of file cfcvars.c.

int nccf_def_lvl_atm_ln ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Define a vertical coordinate for atmosphere natural log pressure.

Atmosphere natural log pressure coordinate

standard_name = 'atmosphere_ln_pressure_coordinate'

Definition:

p(k) = p0 * exp(-lev(k))

where p(k) is the pressure at gridpoint (k), p0 is a reference pressure, lev(k) is the dimensionless coordinate at vertical gridpoint (k).

The format for the formula_terms attribute is

formula_terms = 'p0: var1 lev: var2'

Parameters:
ncidThe ncid of the file.
namethe name of the dimension and variable.
xtypeThe type of this coordinate variable.
lenThe length of this coordinate dimension.
lvl_dimidpIf non-NULL, nccf_def_longitude will write the dimension ID of the netCDF dimension for the longitude here.
lvl_varidpIf non-NULL, nccf_def_longitude will write the variable ID of the netCDF coordinate variable for the longitude here.
Returns:
0 for success, error code otherwise.

Definition at line 916 of file cfcvars.c.

int nccf_def_lvl_hybrid_height ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Atmosphere hybrid height coordinate.

standard_name = 'atmosphere_hybrid_height_coordinate'

Definition: z(n,k,j,i) = a(k) + b(k)*orog(n,j,i)

where z(n,k,j,i) is the height above the geoid (approximately mean sea level) at gridpoint (k,j,i) and time (n), orog(n,j,i) is the height of the surface above the geoid at (j,i) and time (n), and a(k) and b(k) are the coordinates which define hybrid height level k. a(k) has the dimensions of height and b(k) is dimensionless.

The format for the formula_terms attribute is formula_terms = 'a: var1 b: var2 orog: var3'

There is no dimensionless hybrid height coordinate. The hybrid height is best approximated as a(k) if a level-dependent constant is needed.

Parameters:
ncidThe ncid of the file.
nameThe name of the coordinate dimension and variable.
xtypeThe type of this coordinate variable.
lenThe length of this coordinate dimension and variable.
lvl_dimidpIf non-NULL, the function will write the dimension ID of the netCDF dimension for the level here.
lvl_varidpIf non-NULL, the function will write the variable ID of the netCDF coordinate variable for the level here.
Returns:
0 for success, error code otherwise.

Definition at line 1533 of file cfcvars.c.

int nccf_def_lvl_hybrid_sigma ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Define hybrid sigma pressure coordinate.

standard_name = 'atmosphere_hybrid_sigma_pressure_coordinate'

Definition:

p(n,k,j,i) = a(k)*p0 + b(k)*ps(n,j,i)

or

p(n,k,j,i) = ap(k) + b(k)*ps(n,j,i)

where p(n,k,j,i) is the pressure at gridpoint (n,k,j,i), a(k) or ap(k) and b(k) are components of the hybrid coordinate at level k, p0 is a reference pressure, and ps(n,j,i) is the surface pressure at horizontal gridpoint (j,i) and time (n). The choice of whether a(k) or ap(k) is used depends on model formulation; the former is a dimensionless fraction, the latter a pressure value. In both formulations, b(k) is a dimensionless fraction.

The format for the formula_terms attribute is

formula_terms = 'a: var1 b: var2 ps: var3 p0: var4'

where a is replaced by ap if appropriate.

The hybrid sigma-pressure coordinate for level k is defined as a(k)+b(k) or ap(k)/p0+b(k), as appropriate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, the name of this vertical level dimension (and variable) will be written here.
xtypeIf non-NULL, the type of the coordinate variable will be written here.
lenIf non-NULL, the length of the level dimension will be written here by nccf_inq_lvl.
lvl_dimidpIf non-NULL, the dimid of the level dimension will be written here.
lvl_varidpIf non-NULL, the varid of the level coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 1310 of file cfcvars.c.

int nccf_def_lvl_ocean_dbl_sigma ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Define ocean double sigma coordinate.

standard_name = 'ocean_double_sigma_coordinate'

Definition:

for k <= k_c

z(k,j,i)= sigma(k)*f(j,i)

for k > k_c

z(k,j,i)= f(j,i) + (sigma(k)-1)*(depth(j,i)-f(j,i))

f(j,i)= 0.5*(z1+ z2) + 0.5*(z1-z2)* tanh(2*a/(z1-z2)*(depth(j,i)-href))

where z(k,j,i) is height, positive upwards, relative to ocean datum (e.g. mean sea level) at gridpoint (k,j,i), sigma(k) is the dimensionless coordinate at vertical gridpoint (k) for k <= k_c, and depth(j,i) is the distance from ocean datum to sea floor (positive value) at horizontal gridpoint (j,i). z1, z2, a, and href are constants.

The format for the formula_terms attribute is:

formula_terms = 'sigma: var1 depth: var2 z1: var3 z2: var4 a: var5 href: var6 k_c: var7'

Parameters:
ncidThe ncid of the file.
nameThe name of the coordinate dimension and variable.
xtypeThe type of this coordinate variable.
lenThe length of this coordinate dimension and variable.
lvl_dimidpIf non-NULL, the function will write the dimension ID of the netCDF dimension for the level here.
lvl_varidpIf non-NULL, the function will write the variable ID of the netCDF coordinate variable for the level here.
Returns:
0 for success, error code otherwise.

Definition at line 2248 of file cfcvars.c.

int nccf_def_lvl_ocean_s ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Define ocean s-coordinate.

standard_name = 'ocean_s_coordinate'

z(n,k,j,i) = eta(n,j,i)*(1+s(k)) + depth_c*s(k) + (depth(j,i)-depth_c)*C(k)

C(k) = (1-b)*sinh(a*s(k))/sinh(a) + b*[tanh(a*(s(k)+0.5))/(2*tanh(0.5*a)) - 0.5]

where z(n,k,j,i) is height, positive upwards, relative to ocean datum (e.g. mean sea level) at gridpoint (n,k,j,i), eta(n,j,i) is the height of the ocean surface, positive upwards, relative to ocean datum at gridpoint (n,j,i), s(k) is the dimensionless coordinate at vertical gridpoint (k), and depth(j,i) is the distance from ocean datum to sea floor (positive value) at horizontal gridpoint (j,i). The constants a, b, and depth_c control the stretching.

The format for the formula_terms attribute is

formula_terms = 's: var1 eta: var2 depth: var3 a: var4 b: var5 depth_c: var6'

Parameters:
ncidThe ncid of the file.
nameThe name of the coordinate dimension and variable.
xtypeThe type of this coordinate variable.
lenThe length of this coordinate dimension and variable.
lvl_dimidpIf non-NULL, the function will write the dimension ID of the netCDF dimension for the level here.
lvl_varidpIf non-NULL, the function will write the variable ID of the netCDF coordinate variable for the level here.
Returns:
0 for success, error code otherwise.

Definition at line 1942 of file cfcvars.c.

int nccf_def_lvl_ocean_sigma ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Define an ocean sigma coordinate.

standard_name = 'ocean_sigma_coordinate'

Definition: z(n,k,j,i) = eta(n,j,i) + sigma(k) * (depth(j,i)+eta(n,j,i))

where z(n,k,j,i) is height, positive upwards, relative to ocean datum (e.g. mean sea level) at gridpoint (n,k,j,i), eta(n,j,i) is the height of the ocean surface, positive upwards, relative to ocean datum at gridpoint (n,j,i), sigma(k) is the dimensionless coordinate at vertical gridpoint (k), and depth(j,i) is the distance from ocean datum to sea floor (positive value) at horizontal gridpoint (j,i).

The format for the formula_terms attribute is formula_terms = 'sigma: var1 eta: var2 depth: var3'

Parameters:
ncidThe ncid of the file.
nameThe name of the coordinate dimension and variable.
xtypeThe type of this coordinate variable.
lenThe length of this coordinate dimension and variable.
lvl_dimidpIf non-NULL, the function will write the dimension ID of the netCDF dimension for the level here.
lvl_varidpIf non-NULL, the function will write the variable ID of the netCDF coordinate variable for the level here.
Returns:
0 for success, error code otherwise.

Definition at line 1817 of file cfcvars.c.

int nccf_def_lvl_ocean_sigma_z ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Define ocean sigma over z coordinate.

standard_name = 'ocean_sigma_z_coordinate'

for k <= nsigma: z(n,k,j,i) = eta(n,j,i) + sigma(k)*(min(depth_c,depth(j,i))+eta(n,j,i))

for k > nsigma: z(n,k,j,i) = zlev(k)

where z(n,k,j,i) is height, positive upwards, relative to ocean datum (e.g. mean sea level) at gridpoint (n,k,j,i), eta(n,j,i) is the height of the ocean surface, positive upwards, relative to ocean datum at gridpoint (n,j,i), sigma(k) is the dimensionless coordinate at vertical gridpoint (k) for k <= nsigma, and depth(j,i) is the distance from ocean datum to sea floor (positive value) at horizontal gridpoint (j,i). Above depth depth_c there are nsigma layers.

The format for the formula_terms attribute is

formula_terms = 'sigma: var1 eta: var2 depth: var3 depth_c: var4 nsigma: var5 zlev: var6'

Parameters:
ncidThe ncid of the file.
nameThe name of the coordinate dimension and variable.
xtypeThe type of this coordinate variable.
lenThe length of this coordinate dimension and variable.
lvl_dimidpIf non-NULL, the function will write the dimension ID of the netCDF dimension for the level here.
lvl_varidpIf non-NULL, the function will write the variable ID of the netCDF coordinate variable for the level here.
Returns:
0 for success, error code otherwise.

Definition at line 2092 of file cfcvars.c.

int nccf_def_lvl_sigma ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Define a vertical sigma coordinate dimension.

From the CF doc:

Atmosphere sigma coordinate: float lev(lev) ; lev:long_name = 'sigma at layer midpoints' ; lev:positive = 'down' ; lev:standard_name = 'atmosphere_sigma_coordinate' ; lev:formula_terms = 'sigma: lev ps: PS ptop: PTOP' ;

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, the name of this vertical level dimension (and variable) will be written here.
xtypeIf non-NULL, the type of the coordinate variable will be written here.
lenIf non-NULL, the length of the level dimension will be written here by nccf_inq_lvl.
lvl_dimidpIf non-NULL, the dimid of the level dimension will be written here.
lvl_varidpIf non-NULL, the varid of the level coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 1065 of file cfcvars.c.

int nccf_def_lvl_sleve ( int  ncid,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Atmosphere smooth level vertical (SLEVE) coordinate.

standard_name = 'atmosphere_sleve_coordinate'

Definition: z(n,k,j,i) = a(k)*ztop + b1(k)*zsurf1(n,j,i) + b2(k)*zsurf2(n,j,i)

where z(n,k,j,i) is the height above the geoid (approximately mean sea level) at gridpoint (k,j,i) and time (n), ztop is the height of the top of the model, and a(k), b1(k) and b2(k) are the dimensionless coordinates which define hybrid height level k. zsurf1(n,j,i) and zsurf2(n,j,i) are respectively the large and small scale parts of the topography. See Schaer et al [SCH02] for details.

The format for the formula_terms attribute is

formula_terms = 'a: var1 b1: var2 b2: var3 ztop: var4 zsurf1: var5 zsurf2: var6'

The hybrid height coordinate for level k is defined as a(k)*ztop.

Parameters:
ncidThe ncid of the file.
nameThe name of the coordinate dimension and variable.
xtypeThe type of this coordinate variable.
lenThe length of this coordinate dimension and variable.
lvl_dimidpIf non-NULL, the function will write the dimension ID of the netCDF dimension for the level here.
lvl_varidpIf non-NULL, the function will write the variable ID of the netCDF coordinate variable for the level here.
Returns:
0 for success, error code otherwise.

Definition at line 1665 of file cfcvars.c.

int nccf_def_lvl_vert ( int  ncid,
int  lvl_type,
const char *  name,
nc_type  xtype,
size_t  len,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Create a unitless vertical dimension/variable from appendix D of the CF standard.

Parameters:
ncidThe ncid of the file.
lvl_typeOne of: CF_VERT_ATM_LN, CF_VERT_SIGMA, CF_VERT_HYBRID_SIGMA, CF_VERT_HYBRID_HEIGHT, CF_VERT_SLEVE, CF_VERT_OCEAN_SIGMA, CF_VERT_OCEAN_S, CF_VERT_OCEAN_SIGMA_Z, CF_VERT_OCEAN_DBL_SIGMA.
nameThe name of the coordinate dimension and variable.
xtypeThe type of this coordinate variable.
lenThe length of this coordinate dimension and variable.
lvl_dimidpIf non-NULL, the function will write the dimension ID of the netCDF dimension for the level here.
lvl_varidpIf non-NULL, the function will write the variable ID of the netCDF coordinate variable for the level here.
Returns:
0 for success, error code otherwise.

Definition at line 1021 of file cfcvars.c.

int nccf_inq_lvl ( int  ncid,
char *  name,
size_t *  lenp,
nc_type *  xtypep,
size_t *  ft_lenp,
char *  formula_terms,
int *  positive_upp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about a vertical dimension and coordinate variable.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, the name of this vertical level dimension (and variable) will be written here.
lenpIf non-NULL, the length of the level dimension will be written here by nccf_inq_lvl.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
ft_lenpIf non-NULL, the length of the value of the ``formula_terms'' attribute will be written here by ft_lenp. If there is no ``formula_terms'' attribute, zero will be written.
formula_termsIf non-NULL, the value of the formula terms attribute will be copied here.
positive_uppIf non-NULL, a one will be written here if the ``positive'' attribute of this coordinate variable is ``up'', a zero will be written if it is ``down''.
lvl_dimidpIf non-NULL, the dimid of the level dimension will be written here.
lvl_varidpIf non-NULL, the varid of the level coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 626 of file cfcvars.c.

int nccf_inq_lvl_atm_ln ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  pref_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about atmosphere natural log pressure coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL the name of the time dimension and variable will be copied here.
xtypepIf non-NULL, the type of the coordinate variable will be copied here.
lenpIf non-NULL, the length of the time dimension will be copied here by nccf_inq_time.
pref_varidpIf non-NULL, the varid of the pref variable will be copied here.
lvl_dimidpIf non-NULL, the dimid of the vertical dimension will be copied here.
lvl_varidpIf non-NULL, the varid of the vertical coordinate variable will be copied here.
Returns:
0 for success, error code otherwise.

Definition at line 973 of file cfcvars.c.

int nccf_inq_lvl_hybrid_height ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  a_varidp,
int *  b_varidp,
int *  orog_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about atmosphere hybrid_height coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, this pointer gets the name of the coordinate variable and dimension.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
lenpIf non-NULL, the length of the coordinate dimension will be written here.
a_varidpIf non-NULL, the variable ID of the a variable will be written here.
b_varidpIf non-NULL, the variable ID of the b variable will be written here.
orog_varidpIf non-NULL, the variable ID of the orog variable will be written here.
lvl_dimidpIf non-NULL, the dimid of the coordinate dimension will be written here.
lvl_varidpIf non-NULL, the varid of the coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 1602 of file cfcvars.c.

int nccf_inq_lvl_hybrid_sigma ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  a_varidp,
int *  b_varidp,
int *  ps_varidp,
int *  p0_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about hybrid sigma coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, this pointer gets the name of the coordinate variable and dimension.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
lenpIf non-NULL, the length of the coordinate dimension will be written here.
a_varidpIf non-NULL, the variable ID of the a variable will be written here.
b_varidpIf non-NULL, the variable ID of the b variable will be written here.
ps_varidpIf non-NULL, the variable ID of the ps variable will be written here.
p0_varidpIf non-NULL, the variable ID of the ptop variable will be written here.
lvl_dimidpIf non-NULL, the dimid of the coordinate dimension will be written here.
lvl_varidpIf non-NULL, the varid of the coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 1470 of file cfcvars.c.

int nccf_inq_lvl_ocean_dbl_sigma ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  depth_varidp,
int *  z1_varidp,
int *  z2_varidp,
int *  a_varidp,
int *  href_varidp,
int *  k_c_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about the ocean double sigma coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, this pointer gets the name of the coordinate variable and dimension.
xtypepIf non-NULL, the type of the coordinate variable will be copied here.
lenpIf non-NULL, the length of the coordinate dimension will be copied here.
depth_varidpIf non-NULL, the variable ID of the depth variable will be copied here.
z1_varidpIf non-NULL, the variable ID of the z1 variable will be copied here.
z2_varidpIf non-NULL, the variable ID of the z2 variable will be copied here.
a_varidpIf non-NULL, the variable ID of the a variable will be copied here.
href_varidpIf non-NULL, the variable ID of the href variable will be copied here.
k_c_varidpIf non-NULL, the variable ID of the k_c variable will be copied here.
lvl_dimidpIf non-NULL, the dimid of the coordinate dimension will be copied here.
lvl_varidpIf non-NULL, the varid of the coordinate variable will be copied here.
Returns:
0 for success, error code otherwise.

Definition at line 2335 of file cfcvars.c.

int nccf_inq_lvl_ocean_s ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  eta_varidp,
int *  depth_varidp,
int *  a_varidp,
int *  b_varidp,
int *  depth_c_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about ocean_s coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, this pointer gets the name of the coordinate variable and dimension.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
lenpIf non-NULL, the length of the coordinate dimension will be written here.
eta_varidpIf non-NULL, the variable ID of the eta variable will be written here.
depth_varidpIf non-NULL, the variable ID of the depth variable will be written here.
a_varidpIf non-NULL, the variable ID of the a variable will be written here.
b_varidpIf non-NULL, the variable ID of the b variable will be written here.
depth_c_varidpIf non-NULL, the variable ID of the depth_c variable will be written here.
lvl_dimidpIf non-NULL, the dimid of the coordinate dimension will be written here.
lvl_varidpIf non-NULL, the varid of the coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 2024 of file cfcvars.c.

int nccf_inq_lvl_ocean_sigma ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  eta_varidp,
int *  depth_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about ocean sigma coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, this pointer gets the name of the coordinate variable and dimension.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
lenpIf non-NULL, the length of the coordinate dimension will be written here.
eta_varidpIf non-NULL, the variable ID of the eta variable will be written here.
depth_varidpIf non-NULL, the variable ID of the depth variable will be written here.
lvl_dimidpIf non-NULL, the dimid of the coordinate dimension will be written here.
lvl_varidpIf non-NULL, the varid of the coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 1880 of file cfcvars.c.

int nccf_inq_lvl_ocean_sigma_z ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  eta_varidp,
int *  depth_varidp,
int *  depth_c_varidp,
int *  nsigma_varidp,
int *  zlev_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about atmosphere ocean_sigma_z coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, this pointer gets the name of the coordinate variable and dimension.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
lenpIf non-NULL, the length of the coordinate dimension will be written here.
eta_varidpIf non-NULL, the variable ID of the eta variable will be written here.
depth_varidpIf non-NULL, the variable ID of the depth variable will be written here.
depth_c_varidpIf non-NULL, the variable ID of the depth_c variable will be written here.
nsigma_varidpIf non-NULL, the variable ID of the nsigma variable will be written here.
zlev_varidpIf non-NULL, the variable ID of the zlev variable will be written here.
lvl_dimidpIf non-NULL, the dimid of the coordinate dimension will be written here.
lvl_varidpIf non-NULL, the varid of the coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 2174 of file cfcvars.c.

int nccf_inq_lvl_sigma ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  ps_varidp,
int *  ptop_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about atmospheric sigma coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, this pointer gets the name of the coordinate variable and dimension.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
lenpIf non-NULL, the length of the coordinate dimension will be written here.
ps_varidpIf non-NULL, the variable ID of the ps variable will be written here.
ptop_varidpIf non-NULL, the variable ID of the ptop variable will be written here.
lvl_dimidpIf non-NULL, the dimid of the coordinate dimension will be written here.
lvl_varidpIf non-NULL, the varid of the coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 1240 of file cfcvars.c.

int nccf_inq_lvl_sleve ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  a_varidp,
int *  b1_varidp,
int *  b2_varidp,
int *  ztop_varidp,
int *  zsurf1_varidp,
int *  zsurf2_varidp,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about atmosphere sleve coordinate.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, this pointer gets the name of the coordinate variable and dimension.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
lenpIf non-NULL, the length of the coordinate dimension will be written here.
a_varidpIf non-NULL, the variable ID of the a variable will be written here.
b1_varidpIf non-NULL, the variable ID of the b1 variable will be written here.
b2_varidpIf non-NULL, the variable ID of the b2 variable will be written here.
ztop_varidpIf non-NULL, the variable ID of the ztop variable will be written here.
zsurf1_varidpIf non-NULL, the variable ID of the zsurf1 variable will be written here.
zsurf2_varidpIf non-NULL, the variable ID of the zsurf2 variable will be written here.
lvl_dimidpIf non-NULL, the dimid of the coordinate dimension will be written here.
lvl_varidpIf non-NULL, the varid of the coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 1751 of file cfcvars.c.

int nccf_inq_lvl_vert ( int  ncid,
char *  name,
nc_type *  xtypep,
size_t *  lenp,
int *  lvl_typep,
int *  lvl_dimidp,
int *  lvl_varidp 
)

Inquire about a level dimension and coordinate variable.

Parameters:
ncidThe ncid of the file.
nameIf non-NULL, the name of this vertical level dimension (and variable) will be written here.
xtypepIf non-NULL, the type of the coordinate variable will be written here.
lenpIf non-NULL, the length of the level dimension will be written here.
lvl_typepIf non-NULL, the type of vertical dimension will be written here, one of CF_VERT_ATM_LN, CF_VERT_SIGMA, CF_VERT_HYBRID_SIGMA, CF_VERT_HYBRID_HEIGHT, CF_VERT_SLEVE, CF_VERT_OCEAN_SIGMA, CF_VERT_OCEAN_S, CF_VERT_OCEAN_SIGMA_Z, CF_VERT_OCEAN_DBL_SIGMA.
lvl_dimidpIf non-NULL, the dimid of the level dimension will be written here.
lvl_varidpIf non-NULL, the varid of the level coordinate variable will be written here.
Returns:
0 for success, error code otherwise.

Definition at line 1124 of file cfcvars.c.

 All Classes Files Functions Defines

Generated on Tue Mar 1 2011 06:36:59 for libCF. LibCF is a Unidata library.