Hi Trevor,

This makes sense.  Please note that although memory is cheap on new
parallel machines, there needs to be a balance between recalculation and
memory.  What we have found is that if we are too cavalier about memory
usage, the model will get extremely slow due to memory not fitting on
cache.  This was found when coding the neutral physics scheme as a
straightforward port from mom3.   The original port resulted in neutral
physics costing some 75% of the model!  In mom3, adding neutral physics
increased the cost by double. When recoding to reduce the amount of
memory requirements (a substantial recoding with much reduction in
memory), the neutral physics is now some 30% of the model (depending of
course on numbers of tracers and other details).  The mom4 neutral
physics scheme is therefore less expensive, relative, to that
encountered in mom3. 

So...although it is a call based on no direct testing with the density
module (due to my lack of time), I prefer to keep the double calculation
of sp5 rather than introduce a new three-dimensional array.   I must
admit that we have not maintained a strict policy with mom4 regarding
these issues.  We may find over time more experience allows us to have a
better idea how best to code on cache-based machines. If you wish to
provide some tests with timings, then I will be happy to be converted. 

Thanks,
 Steve

p.s. Glad you will attend the MIT meeting.  Should be fun!


[EMAIL PROTECTED] wrote:
> 
> Hello Steve,
> 
>      One more thing.  Since square roots are expensive, might
> it not make sense to calculate and store the square root of
> salinity immediately salinity is updated each time step,
> then it would be available as sp5(i,j,k) and so would not
> need to be calculated both in the density code and in the
> partical derivative code.  That is, right now it is calculated
> both in the density code and in the partical derivative code,
> and this seems a bit of a waste of computer time.
> 
>     I guess similar (i,j,k) arrays could also be stored for
> p1t1 = p1*t1 and t2 = t1*t1 as well, but these are only simple
> multiplcations that would be saved, not the more expensive
> square roots.
> 
>     I am thinking of attending the z-coordinate modeliing meeting
> at MIT in August.  Might see you there.
> 
>     Trevor

-- 
Dr. Stephen M. Griffies                phone: +1-609-452-6672
Geophysical Fluid Dynamics Laboratory  FAX:   +1-609-987-5063
P.O. Box 308, Forrestal Campus Site B  email: [EMAIL PROTECTED]
Princeton, NJ 08542  USA               http://www.gfdl.noaa.gov
begin:vcard 
n:Griffies;Stephen
x-mozilla-html:FALSE
org:DOC/NOAA/OAR/GFDL
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
title:Physical Scientist
x-mozilla-cpt:;-11168
fn:Stephen Griffies
end:vcard

Reply via email to