[MITgcm-devel] exf_set_uv.F
Alistair Adcroft
adcroft at MIT.EDU
Wed Mar 24 15:26:56 EST 2004
Put the dimension in EXF_OPTIONS.h as a CPP macro (like the number of
tracers in PTRACERS.h).
That way it's included where you need it and can be set to 1 with an #ifndef
Don't like including it into SIZE.h...
A.
--
Dr Alistair Adcroft http://www.mit.edu/~adcroft
MIT Climate Modeling Initiative tel: (617) 253-5938
EAPS 54-1523, 77 Massachusetts Ave, Cambridge, MA, USA
-----Original Message-----
From: mitgcm-devel-bounces at mitgcm.org
[mailto:mitgcm-devel-bounces at mitgcm.org] On Behalf Of Patrick Heimbach
Sent: Wednesday, March 24, 2004 11:55 AM
To: mitgcm-devel at mitgcm.org
Subject: [MITgcm-devel] exf_set_uv.F
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.
_______________________________________________
MITgcm-devel mailing list
MITgcm-devel at mitgcm.org http://dev.mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list