#140: Clarifying the role of attributes on boundary variables.
-----------------------------+------------------------------------------
  Reporter:  davidhassell    |      Owner:  cf-conventions@…
      Type:  enhancement     |     Status:  new
  Priority:  medium          |  Milestone:
 Component:  cf-conventions  |    Version:
Resolution:                  |   Keywords:  boundary variable, attribute
-----------------------------+------------------------------------------

Comment (by davidhassell):

 Hello Karl, Jonathan and all,

 It'd be nice to wrap this up! How about this text, which says "feel
 free to put formula_terms on bounds, but if they're not there then
 infer them from the parent parametric coordinate"

     If a parametric coordinate variable with a formula_terms attribute
     (ref section 4.3.2) also has a bounds attribute, then that formula
     must also be associated with the boundary variable, because the
     same `standard_name` describes both variables. The association is
     explicit if the boundary variable also has a `formula_terms`
     attribute defining the same terms (as specified in Appendix D),
     but a different variable must be named for any term which depends
     on the vertical dimension, because the boundary variables have one
     more dimension. If the association is implicit then the
     `formula_terms` attribute is omitted from the boundary variable
     and it is assumed that the `formula_terms` attribute from the
     parametric coordinate variable applies, but for any term which
     depends on the vertical dimension, the named variable is replaced
     with its boundary variable. In this case, such named variables
     must be auxiliary coordinate variables with associated boundary
     variabes.

 Explicit example:

    {{{
  float eta(eta) ;
    eta:long_name = "eta at layer midpoints" ;
    eta:positive = "down" ;
    eta:standard_name = " atmosphere_hybrid_sigma_pressure_coordinate" ;
    eta:formula_terms = "a: a b: b ps: ps p0:p0”;
    eta:bounds="etabnds";
  float etabnds(eta,2);
    etabnds:formula_terms = " a: abnds b: bbnds ps: ps p0:p0" ;
  float a(eta);
    a:long_name = "’a’ coefficient for vertical coordinate (at full
 levels)";
    a:units = ‘Pa’
  float b(eta);
    b:long_name = "’b’ coefficient for vertical coordinate (at full
 levels)";
    b:units = ‘Pa Pa-1’
  float abnds(eta,2);
    abnds:long_name = "’a’ coefficient for vertical coordinate (at half-
 levels)";
  float bbnds(eta,2);
    bbnds:long_name = "’b’ coefficient for vertical coordinate (at half-
 levels)";
  float ps(lat, lon);
    ps.units = 'Pa';
  float p0;
    p0.units = 'Pa';
  float T(eta,lat,lon);
    T:standard_name="air_temperature";
    T:units="K";
 }}}

 Implicit example:
 {{{
  float eta(eta) ;
    eta:long_name = "eta at layer midpoints" ;
    eta:positive = "down" ;
    eta:standard_name = " atmosphere_hybrid_sigma_pressure_coordinate" ;
    eta:formula_terms = "a: a b: b ps: ps p0:p0”;
    eta:bounds="etabnds";
  float etabnds(eta,2);
  float a(eta);
    a:long_name = "’a’ coefficient for vertical coordinate (at full
 levels)";
    a:units = ‘Pa’
    a:bounds = "abnds";
  float b(eta);
    b:long_name = "’b’ coefficient for vertical coordinate (at full
 levels)";
    b:units = ‘Pa Pa-1’
    b:bounds = "bbnds";
  float abnds(eta,2);
  float bbnds(eta,2);
  float ps(lat, lon);
    ps.units = 'Pa';
  float p0;
    p0.units = 'Pa';
  float T(eta,lat,lon);
    T:standard_name="air_temperature";
    T:units="K";
    T:coordinates="a b";
 }}}

 Note also that there is nothing stopping the two methods being
 combined, which the checker would have to look out for. E.g.

 {{{
  float eta(eta) ;
    eta:long_name = "eta at layer midpoints" ;
    eta:positive = "down" ;
    eta:standard_name = " atmosphere_hybrid_sigma_pressure_coordinate" ;
    eta:formula_terms = "a: a b: b ps: ps p0:p0”;
    eta:bounds="etabnds";
  float etabnds(eta,2);
    etabnds:formula_terms = " a: abnds b: bbnds ps: ps p0:p0" ;
  float a(eta);
    a:long_name = "’a’ coefficient for vertical coordinate (at full
 levels)";
    a:units = ‘Pa’
    a.bounds = 'abnds';
  float b(eta);
    b:long_name = "’b’ coefficient for vertical coordinate (at full
 levels)";
    b:units = 'Pa Pa-1';
    b.bounds = 'bbnds';
  float abnds(eta,2);
  float bbnds(eta,2);
  float ps(lat, lon);
    ps.units = 'Pa';
  float p0;
    p0.units = 'Pa';
  float T(eta,lat,lon);
    T:standard_name="air_temperature";
    T:units="K";
    T.coordinates = 'a b';
 }}}

--
Ticket URL: <https://cf-trac.llnl.gov/trac/ticket/140#comment:10>
CF Metadata <http://cf-convention.github.io/>
CF Metadata

Reply via email to