[Mitgcm-support] RE: #ifdef's versus useRUNTIMEOPTION - please read...

mitgcm-support at dev.mitgcm.org mitgcm-support at dev.mitgcm.org
Wed Jul 9 15:50:54 EDT 2003


This is fine but we also need to do better
on modularity and on putting things in
packages. For example find_alpha.F now
contains multiple different blocks that are
not that interdependent. A better design
would have been to modify find_alpha to be
be a routine that only switches between
   call find_alpha_linear
   call find_alpha_poly3
   call fo_eos_find_alpha_unesco
   call fo_eos_find_alpha_mdj....

based on an #ifdef ALLOW_flag.
**and** to have put jmd,unesco,mdjwf in a full_ocean_eos
package. I won't want people to go to the extremes that
Christian went to (!) but the way in which the
various equations of state has been added is not
great.

 find_rho is a bit better, but it would be nice to
have kept the various advanced formulae in pkg subdirectories.
I has assumed that this would happen as part of the tidying
up when everything was working, but it doesn't appear like that
is going on.

 finally .... the package policy was an ALLOW_FOO CPP option
and a useFoo runtime flag. There seem to be many other ad-hoc
CPP flags in the main branch e.g.
 ENABLE_MULTIDIM_ADVECTION
 EXCLUDE_MONITOR
 EXACT_CONSERV
 NONLLIN_FRSURF

 talking of modularity couldn't we split
 thermodynamics.F up a bit - and SINGLE_LAYER_MODE is
 a dumb feature. If instead someone had taken the time to
 split thermo up then a sinlge_layer package that left only
 the mom bits would have been easy to write an clear 
 to follow etc....

 Generally some of the code is getting very messy and it
 looks to be getting worse at the moment! Too many things are not
 getting done using the package approach.
 

Chris

-----Original Message-----
From: Patrick Heimbach [mailto:heimbach at MIT.EDU]
Sent: Thursday, November 14, 2002 11:35 AM
To: support at mitgcm.org
Subject: #ifdef's versus useRUNTIMEOPTION - please read...


I know some people are not very fond of #ifdef's.
However, keeping all options runtime options in the code
also means, keeping all options runtime for the adjoint,
and consequenlty more dependencies and more redundant
common blocks for all possible cases.

Therefore, I think we should think about adding more #ifdef's
for those cases which you won't easily change at runtime anyways.
In particular, this affects
- buoyancyrelation
- equationOfState

-Patrick

-- 
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Patrick Heimbach     Massachusetts Institute of Technology
FON: +1/617/253-5259                    EAPS, Room 54-1518
FAX: +1/617/253-4464               77 Massachusetts Avenue
mailto:heimbach at mit.edu                 Cambridge MA 02139
http://www.mit.edu/~heimbach/                       U.S.A.





More information about the MITgcm-support mailing list