[MITgcm-devel] towards better MatLAB post-processing
Jean-Michel Campin
jmc at ocean.mit.edu
Wed Dec 14 19:34:32 EST 2005
Hi,
On Fri, Oct 21, 2005 at 05:09:44PM -0400, Ed Hill wrote:
>
> Hi folks,
>
> Jean-Michel, Andrea, and I (and others!) have discussed MatLAB
> post-processing tools on many occasions and have often agreed
> that the existing tools need improvement. But we haven't all
> agreed what direction(s) to take. In fact, we've had very
> different ideas!
>
> So today, we (JMC, AM, & me) had a "breakthrough" discussion and
> heres the outcome. We think it'll be a lot easier for folks to
> use MNC by writing a better version of rdmnc() that spits out
> data in multiple formats. The idea is:
>
> [res,att] = rdnctiles(FilePatterns, VarNames, Times, flags)
>
.............
>
> 'compact' ::
>
> this format is going to be specified by JMC and it is meant
> to be a compact vector of values that contains every value
> (inc. all corner points) without any redundancies and in a
> specified order (rank/shape)
>
> eg. res = rdnctiles('state*','U',[36000], 'compact')
> size(res.U) --> order specified by JMC
>
Just to summarize what the "compact" form could be:
store any 2D variable in a long vector fld2d(Nb_of_H_gridpts,1)
store any 3D variable in an array of the shape long-vector x Nr :
fld3d(Nb_of_H_gridpts,1,Nr)
(might be interesting to keep this 2nd dimension, even if it's
always 1, so that a 3D field is still stored in a 3.D array)
where Nb_of_H_gridpts is the total number of grid-points in
the horizontal grid.
The ordering (inside this long vector) that I was thinking is:
a) grid-cell center (tracer point):
face(1),face(2), ... ,face(6) (if 6 faces)
and for each face, dimension Fx x Fy:
([1:Fx],1),([1:Fx],2), ... , ([1:Fx],Fy)
(this is just the usual ordering in fortran)
b) grid-cell edges (vector on C-grid) : this is in fact not
different, because the Western U & Southern V edge grid-point
(that are shared by 2 faces) on one face will have to correspond
to an Eastern or Northern edge (not necessary in this order) on the
other face.
In short, the same ordering as for tracers is fine.
c) grid-cell corner (vorticity point) :
The more convenient way would be to start with the same ordering
as for tracers, and to add, at the end, the corners that have not
yet been counted (= "missing corners"), and list them in the same
order as the face they belong to (= the first face where it
appears).
This would give, for a cubed-sphere grid (which has 2 additional
corners c1,c2):
face(1),face(2),face(3),face(4),face(5),face(6),c1,c2
Alternatively we could choose:
face(1),c1,face(2),c2,face(3),face(4),face(5),face(6)
This is inspired by my experience with cubed-sphere grids,
but might not be the best solution for grids with less
corner points than tracer points (case where more than 4 faces
share 1 corner).
That's all.
Jean-Michel
More information about the MITgcm-devel
mailing list