GEOS-ESM / MAPL

MAPL is a foundation layer of the GEOS architecture, whose original purpose is to supplement the Earth System Modeling Framework (ESMF)
https://geos-esm.github.io/MAPL/
Apache License 2.0
27 stars 18 forks source link

Specify positive attribute when creating state fields #2969

Open lizziel opened 3 weeks ago

lizziel commented 3 weeks ago

History outputs from GCHP may have vertical orientation that is either positive 'up' or 'down' depending on the collection. However, positive is always specified as 'down' in the file metadata even when it is actually 'up'. A fix for this could be as follows per discussion with @bena-nasa:

  1. Specify positive attribute as 'up' or 'down' when creating state fields. We need this for exports but it could be for exports, imports, and internal state. This could be optional with 'down' as the default so that nothing needs to change in GEOS.
  2. When writing history files check the positive attribute for all fields in a given collection. Require that all of them are the same, and then include that positive attribute value in the output file. Fail with an error if they are not all the same.
  3. Do not do any special flipping of the arrays based on whether it is specified as 'up' or 'down'. Trust that the user knows what they are doing in handling the flipping during array assignment if needed.
bena-nasa commented 3 weeks ago

@lizziel think will have a PR ready for this into our develop branch Monday.

bena-nasa commented 3 weeks ago

@lizziel PR made https://github.com/GEOS-ESM/MAPL/pull/2975

lizziel commented 2 weeks ago

Thanks @bena-nasa!