[MITgcm-devel] _xyz_ interface S/R

Andrea Molod molod at ocean.mit.edu
Mon Aug 21 11:28:14 EDT 2006


hi jean michel,

just to contribute my 2 cents.....

On Mon, 21 Aug 2006, Jean-Michel Campin wrote:

> Hi folks,
>
> Since there are already few packages (seaice with 3 time-levels arrays,
> land, fizhi-gridalt, and more might come) that use kind of 3-D arrays
> with number of levels (= 3rd dimension) different from Nr, it would
> be useful to have
> - exchanges
> - r/w interface (pkg RW)
> which can deal with those arrays (the "_xy_" and "_xyz_" that
> assumes Nr levels are not enough).
>
> We could either
> - increase the number of S/R (adding other templates)
> or
> - replace the _xyz_ interface S/R with a general 3d version
> (where the 3rd dim is an argument)
>
> I prefer the second solution (just because we have already
> quiet a lot of interface S/R: R4, R8, RL, RS ...) and propose
> to implement it progressively (not removing all the _xyz_ version
> right now), starting with exch2.
> Is it OK ?

i also concur - the 'second solution' sounds much better to me.
i guess i am wondering if a 'wrapper' type of solution might work.
a new routine which takes the 3rd dimension as an argument which
can be called directly wherever we change the calling sequence.
and then have the old routine do nothing more that call this new
one with 'NR' as the argument. that way we can get rid of the
'old' calling sequence slowly. i would ask for one additional
thing in this new routine - that it also take a separate argument
for the SIZE of the third dimension of the array as well as the one
for how many levels to run the do loops for. for exch2 in particlar
i think this leaves us some nice flexibility.

> Further simplification: for exchanges that are not very often used
> (exch_z, exch_uv_agrid) we could have just 1 set of interface S/R
> using also the 3-d version for 2-d fields, with 3rd-dim argument =1.
> The advantage I see: 1 version is easier to maintain, and will
> be tested more often (e.g, exch_uv_agrid_xyz is used only once,
> in fizhi/AtoC.F, and exch_z_xyz is never used).
> What do you think ?

absolutely. agreed on both points.  makes things much easier to deal with 
and makes sure they are tested. lovely.


thanks jean-michel.

andrea




More information about the MITgcm-devel mailing list