[MITgcm-devel] netcdf units in diagnostics pkg
Martin Losch
Martin.Losch at awi.de
Fri May 23 09:05:22 EDT 2008
Hi Ed (and others),
thanks for your explanations.
everything is clear for 1D coordinate variables according to the
COARDS or CF-conventions (name of variable=name of dimension ->
coordinate variable).
what about 2D/3D coordinate variables? how do applications (such as
ferret) recognize these? according to the CF-1.0 conventions, <http://
cf-pcmdi.llnl.gov/documents/cf-conventions/1.0/cf-
conventions.html#id2888361>, we need to add an "coordinates"-
attributes to a variable, so UVEL:coordinates="XG,YC" and then the
coordinate arrays need to be in the file as well.
For the obvious reasons I am not up-to-date with the latest decisions
on this netcdf stuff (and probably Ed isn't either). What's the
status here? How complicated is it to actually includes these arrays
and attributes?
The time dimension is another issue and does not follow any conventions
I now learned from <http://cf-pcmdi.llnl.gov/documents/cf-conventions/
1.0/cf-conventions.html> that "missing_value" is now deprecated.
Should we simply replace it by a _FillValue (that's really trivial at
this point).
Vertical coordinates in diagnostics: I agree, it looks very
complicated, but shouldn't it be worked out anyway? Again, it's hard
to discuss the details via email, and I assume that Ed does not have
enough time to really go into this, but the current code (within
"NEEDS_WORK" ifdefs seem like a good starting point to have
reasonable vertical coordinates at least for the "regular" variables
that are on scalar points, UVEL/VVEL/WVEL-like or 2D variables such
as ETAN, SI_Fract, etc.
Couldn't I just start using these coordinates Z* for the variables
that make sense and not define any coordinates for those variables
where it does not make sense?
Martin
On 22 May 2008, at 21:15, Ed Hill wrote:
> On Thu, 22 May 2008 12:08:05 +0200 Martin Losch <Martin.Losch at awi.de>
> wrote:
>
>> Hi there,
>>
>> the careful reader of the cvs-logs will have noticed that I have
>> tried to implement the missing_value attribute for diagnostics
>> output ... and that I have not been overly successful. For now,
>> everything is within ifdefs and not very pretty, there is one
>> missing value per output stream and if not set it defaults to the
>> value of getcon('UNDEF') (it took me long to figure out where the
>> number 1D15 came from!).
>> If this implementation is satisfactory, I can remove the ifdefs and
>> have this stuff turned on by default, if not, I would ask you to
>> come up with (feasible) suggestion, as both the mnc and the
>> diagnostics packages are extremely complicated to understand and to
>> modify and I can use all the help I can get.
>>
>> I have also started to look at some of the other issues raised in
>> this thread and immediately I have a few questions (probably to Ed,
>> if he has time to listen, please not at 3am :-).
>> for 1. contrary to my previous observation there are coordinate
>> variables Xp1(Xp1) and Yp1(Yp1). Honestly, I don't understand the
>> comments that go with the code for the vertical coordinate variables
>> (DIAG_MNC_COORD_NEEDSWORK), so I'll leave this to someone who knows,
>> but I did add the call to MNC_CW_VATTR_MISSING to this part of the
>> code. for 2. Ed, could you point to the place where I can add
>> attributes to the coordinate variables?
>
>
> Hi Martin,
>
> Its approx 3pm local time so I assume its OK to respond now. :-)
>
> First, lets say a few things about coordinate variables. Coordinate
> variables may be either 1D (running "along" a particular dimension) or
> 2D/3D (e.g., to represent curvilinear grids). And, typically,
> coordinate variables need to be either exactly the same size or rank
> (for 2D/3D) or the same length (for 1D) as the variables they
> represent. If coordinate variables do not have a 1:1 size
> correspondence with other variables then it causes problems for most
> of the tools that (try to) use them.
>
> So its been a while since I've looked at diagnostics and MNC. As I
> remember it, the creation of vertical coordinate variables for is a
> pain. The reason is they don't all lie on the same grid. Some
> diagnostics variables are defined on the "regular" model (dynamics)
> grid and some are defined on a "physics" or other grid -- which may
> have a completely different number of elements, physical
> location/meaning/etc.
>
> Next, there is the issue of sub-grid location. That is, quantities
> that exist on the *same* grid can be defined on the bottoms, the
> centers, or the tops of the grid cells. And the ones defined at the
> cell top or bottom faces may be "special" -- that is, they may or may
> not exist for some (e.g., ocean surface, ocean floor) of the grid
> cells.
>
> So what does the above mean? To the best of my understanding, it
> means
> a one-size-fits-all coordinate variable strategy is probably not going
> to work. You will need to designate different coordinate variables
> for
> different diagnostic quantities. The code you see in MNC is my
> unfinished attempt to:
>
> 0) enumerate all the different types of grid quantities:
>
> - "regular" dynamics grid, physics grid, other...
> - cell-bottom-face, cell-centered, cell-top-face
> - all cells, all-but-bottom, all-but-top,
> all-except-the-top-and-the-bottom
>
> 1) then define one or more vertical coordinate variables (to
> be written to each netcdf file) so we can match each possible
> combination described in (0).
>
> Does that make sense?
>
> To the best of my recollection, the outcome of our (Jean-Michel,
> Andrea, and me) discussions about coordinate variables can be
> summarized as:
>
> *IFF* the diagnostics package can supply enough information
> (that is, either the actual values or a set of rules that
> can be used to compute the values) to exactly specify the
> both the total number and the vertical locations of all the
> diagnostic quantities, THEN someone could implement a
> consistent set of coordinate variables within the netcdf
> diagnostics output files.
>
> As far as I can remember, the diagnostics package did not contain
> enough information to implement coordinate variables for all the
> diagnostic types. But that was almost two years ago. Perhaps the
> situation has improved?
>
> Or, perhaps you'll be happy to have vertical coordinate variables for
> just a subset of all the diagnostics quantities...?
>
> Ed
>
> ps -- Sorry for the long email. If I had more time to write
> then it could have been condensed... :-)
>
>
> --
> Edward H. Hill III, PhD | ed at eh3.com | http://eh3.com/
More information about the MITgcm-devel
mailing list