[MITgcm-devel] netcdf units in diagnostics pkg

Ed Hill ed at eh3.com
Thu May 22 15:15:25 EDT 2008


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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mitgcm.org/pipermail/mitgcm-devel/attachments/20080522/892d3405/attachment.sig>


More information about the MITgcm-devel mailing list