[MITgcm-devel] exf_set_uv.F

Patrick Heimbach heimbach at MIT.EDU
Wed Mar 24 11:54:46 EST 2004


The placement of 
#ifdef USE_EXF_INTERPOLATION
at the very top of S/R exf_set_uv.F
even before the SUBROUTINE statement
can be problematic on some compilers
or for some optimization levels/options
(e.g. for -of osf1_alpha_f77 )

Our common(?) practise is to put the
#ifdef statement
after the declaration of S/R arguments
which leaves just an empty S/R body.

In the present case there's a problem however,
since an array size MAX_LAT_INC is defined in exf_param.h
which is only used when USE_EXF_INTERPOLATION defined,
but is needed to dimension arrays in S/R arguments.
Thus, default value should be MAX_LAT_INC = 1
and is should be customized in a header file.
(right now it's hard coded to 250 in exf_param.h)
Not sure what a good/clean solution is.

One could be the following in exf_param.h
#ifndef USE_EXF_INTERPOLATION
       integer MAX_LAT_INC
       parameter(MAX_LAT_INC = 1)
#else
c for lat interpolation, arraysize currently set to 250 max data values
       integer MAX_LAT_INC
       parameter(MAX_LAT_INC = 250)
      _RL ustress_lon0, ustress_lon_inc
      _RL ustress_lat0, ustress_lat_inc(MAX_LAT_INC)
...ETC...

Another one would be to have SIZE.h include
#ifdef ALLOW_PKG
# include "PKG_SIZE.h"
#endif

I don't like this array dimension in exf_param.h
Any suggestions?

Cheers
-p.


_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
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-devel mailing list