#152: Time mean over area fractions which vary with time
-----------------------------+------------------------------
  Reporter:  martin.juckes   |      Owner:  cf-conventions@…
      Type:  enhancement     |     Status:  new
  Priority:  medium          |  Milestone:
 Component:  cf-conventions  |    Version:
Resolution:                  |   Keywords:
-----------------------------+------------------------------
Description changed by martin.juckes:

Old description:

> Following a discussion on the mailing list, I'd like to propose adding a
> new example to the CF Convention document to illustrate the use of
> cell_methods to specify different mean quantities when using a mask which
> is time varying (e.g. sea_ice). The qualifier `where` has been introduced
> into the `cell_methods` to specify masked spatial operations, e.g. `area:
> mean where sea_ice` to represent a spatial mean over sea ice. The current
> convention does not explicitly comment on whether the `where` construct
> can be used with other dimensions. For the CMIP6 data request there is a
> requirement to specify the temporal mean of quantities averaged over sea
> ice, and the spatial extent of the sea ice is generally varying in time.
>
> The proposal is to make it clear that use of `where` for non-spatial
> dimensions is allowed by adding examples in section 7. It is also
> necessary to provide these examples to clarify the subtle differences
> implied by different formulations of the `cell_methods` statement.
>
> == Replace text of section 7.3.3 ==
>
> By default, the statistical method indicated by cell_methods is assumed
> to have been evaluated over the entire horizontal area of the cell.
> Sometimes, however, it is useful to limit consideration to only a portion
> of a cell (e.g. a mean over the sea-ice area). The portion concerned is
> constant in time in some cases, but it could be time-varying. Grid cell
> “portions” that can be considered are only those permitted to be
> associated with the   `standard_name` of `area_type`. There are two
> options for indicating when a quantity represents a portion of a cell.
>
> The first method can be used for the common case that the cell_method
> applies to a single area-type. In this case, the cell_methods attribute
> may include a string of the form `name: method where type`. Here name
> could, for example, be area and type may be any of the strings permitted
> for a variable with a standard_name of area_type. As an example, if the
> method is `area: mean where sea_ice`, then the data would represent a
> mean over only the sea ice portion of the grid cell. When this first
> option is adopted, none of the variables in the netCDF file should be
> given a name identical to the string that names the `area_type`.  This
> restriction is imposed so that it will be clear that the metadata should
> not be interpreted following the second option (described in the next
> paragraph), which takes precedence.
> The second method for indicating that a statistic applies to only a
> portion of a cell is more general because it can reference multiple area-
> types.  This may be needed when a variable has a dimension that ranges
> across various area types.  In this case, the cell_methods entry is of
> the form `name: method where typevar`. Here `typevar` is a string-valued
> auxiliary coordinate variable or string-valued scalar coordinate variable
> (see Section 6.1, "Labels") with a `standard_name` of `area_type`. The
> variable `typevar` contains the name(s) of the selected portion(s) of the
> grid cell to which the method is applied. This method provides a
> convenient way to store output from land surface models, for example,
> since they deal with many area types within each surface gridbox (e.g.,
> vegetation, bare_ground, snow, etc.).
>
> == Clarification at start of section 7.3.3 (not needed if above is
> accepted) ==
>
> ''Add a clarification after this sentence in the first paragraph of 7.3.3
> "Sometimes, however, it is useful to limit consideration to only a
> portion of a cell (e.g. a mean over the sea-ice area)", to introduce the
> idea of time-varying area fractions:''
>
> The portion concerned is constant in time in many cases, but it could be
> time-varying.
>
> == New example for time-varying area fractions ==
>
> ''The following new example and explanatry text should be added in
> section 7.3.3:''
>
> Example 7.8: Time mean over area fractions which vary with time
>
> {{{
> float simple_mean(lat,lon):
>    simple_mean:cell_methods: area: mean where sea_ice time: mean
>
> float weighted_mean(lat,lon):
>    weighted_mean:cell_methods: area: time: mean where sea_ice
>
> float partial_mean(lat,lon):
>    partial_mean:cell_methods: area: mean where sea_ice over sea time:
> mean
> }}}
>
> When the area fraction is varying with time, there are several different
> ways in which a time mean can be formulated. Three of these are
> illustrated in this example. Suppose, for instance, we are averaging over
> three time steps and the data at one grid point is -10, -6, -2 with area
> fractions .75, .50, .25. The values of the simple_mean, weighted_mean and
> partial mean are, respectively, (-10 -6 -2)/3 = -6, (-10*.75 - 6*.5
> -2*.25)/(.75+.5+.25) = -7.33 , and (-10*.75 - 6*.5 -2*.25)/3 = -3.667.
> The partial mean provides the contribution to the mean over the entire
> grid from a specified area type. The simple mean is weighting each time
> period equally, while the weighted mean provides equal weighting to each
> unit area of `sea_ice`.
>
> In example 7.8, `time` could be replaced by any other coordinate over
> which an average is taken, such as an ensemble index.

New description:

 Following a discussion on the mailing list, I'd like to propose adding a
 new example to the CF Convention document to illustrate the use of
 cell_methods to specify different mean quantities when using a mask which
 is time varying (e.g. sea_ice). The qualifier `where` has been introduced
 into the `cell_methods` to specify masked spatial operations, e.g. `area:
 mean where sea_ice` to represent a spatial mean over sea ice. The current
 convention does not explicitly comment on whether the `where` construct
 can be used with other dimensions. For the CMIP6 data request there is a
 requirement to specify the temporal mean of quantities averaged over sea
 ice, and the spatial extent of the sea ice is generally varying in time.

 The proposal is to make it clear that use of `where` for non-spatial
 dimensions is allowed by adding examples in section 7. It is also
 necessary to provide these examples to clarify the subtle differences
 implied by different formulations of the `cell_methods` statement.

 == Replace text of section 7.3.3 (first 3 paragraphs) ==

 By default, the statistical method indicated by cell_methods is assumed to
 have been evaluated over the entire horizontal area of the cell.
 Sometimes, however, it is useful to limit consideration to only a portion
 of a cell (e.g. a mean over the sea-ice area). The portion concerned is
 constant in time in some cases, but it could be time-varying. Grid cell
 “portions” that can be considered are only those permitted to be
 associated with the   `standard_name` of `area_type`. There are two
 options for indicating when a quantity represents a portion of a cell.

 The first method can be used for the common case that the cell_method
 applies to a single area-type. In this case, the cell_methods attribute
 may include a string of the form `name: method where type`. Here name
 could, for example, be area and type may be any of the strings permitted
 for a variable with a standard_name of area_type. As an example, if the
 method is `area: mean where sea_ice`, then the data would represent a mean
 over only the sea ice portion of the grid cell. When this first option is
 adopted, none of the variables in the netCDF file should be given a name
 identical to the string that names the `area_type`.  This restriction is
 imposed so that it will be clear that the metadata should not be
 interpreted following the second option (described in the next paragraph),
 which takes precedence.

 The second method for indicating that a statistic applies to only a
 portion of a cell is more general because it can reference multiple area-
 types.  This may be needed when a variable has a dimension that ranges
 across various area types.  In this case, the cell_methods entry is of the
 form `name: method where typevar`. Here `typevar` is a string-valued
 auxiliary coordinate variable or string-valued scalar coordinate variable
 (see Section 6.1, "Labels") with a `standard_name` of `area_type`. The
 variable `typevar` contains the name(s) of the selected portion(s) of the
 grid cell to which the method is applied. This method provides a
 convenient way to store output from land surface models, for example,
 since they deal with many area types within each surface gridbox (e.g.,
 vegetation, bare_ground, snow, etc.).

 == Caption of example 7.6

 If the method is `mean`, various ways of calculating the mean can be
 distinguished in the `cell_methods` attribute with a string of the form
 `mean where type1 [over type2]`. Here, type1 can be any of the
 possibilities allowed for typevar or type (as specified in the two
 paragraphs preceding above Example). The same options apply to type2,
 except it is not allowed to be the name of an auxiliary coordinate
 variable with a dimension greater than one (ignoring the dimension
 accommodating the maximum string length).

 A cell_methods attribute with a string of the form `area: mean where type1
 over type2` indicates the mean is calculated by integrating over the type1
 portion of the cell and dividing by the area of the type2 portion.  When
 `over type2` is omitted, it is assumed to be the same as type1.

 == Clarification at start of section 7.3.3 (not needed if above is
 accepted) ==

 ''Add a clarification after this sentence in the first paragraph of 7.3.3
 "Sometimes, however, it is useful to limit consideration to only a portion
 of a cell (e.g. a mean over the sea-ice area)", to introduce the idea of
 time-varying area fractions:''

 The portion concerned is constant in time in many cases, but it could be
 time-varying.

 == New example for time-varying area fractions ==

 ''The following new example and explanatry text should be added in section
 7.3.3:''

 Example 7.8: Time mean over area fractions which vary with time

 {{{
 float simple_mean(lat,lon):
    simple_mean:cell_methods: area: mean where sea_ice time: mean

 float weighted_mean(lat,lon):
    weighted_mean:cell_methods: area: time: mean where sea_ice

 float partial_mean(lat,lon):
    partial_mean:cell_methods: area: mean where sea_ice over sea time: mean
 }}}

 When the area fraction is varying with time, there are several different
 ways in which a time mean can be formulated. Three of these are
 illustrated in this example. Suppose, for instance, we are averaging over
 three time steps and the data at one grid point is -10, -6, -2 with area
 fractions .75, .50, .25. The values of the simple_mean, weighted_mean and
 partial mean are, respectively, (-10 -6 -2)/3 = -6, (-10*.75 - 6*.5
 -2*.25)/(.75+.5+.25) = -7.33 , and (-10*.75 - 6*.5 -2*.25)/3 = -3.667. The
 partial mean provides the contribution to the mean over the entire grid
 from a specified area type. The simple mean is weighting each time period
 equally, while the weighted mean provides equal weighting to each unit
 area of `sea_ice`.

 In example 7.8, `time` could be replaced by any other coordinate over
 which an average is taken, such as an ensemble index.

--

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

Reply via email to