1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
C |
5 |
C /==========================================================\ |
6 |
C | CPP_EEOPTIONS.h | |
7 |
C |==========================================================| |
8 |
C | C preprocessor "execution environment" supporting | |
9 |
C | flags. Use this file to set flags controlling the | |
10 |
C | execution environment in which a model runs - as opposed | |
11 |
C | to the dynamical problem the model solves. | |
12 |
C | Note: Many options are implemented with both compile time| |
13 |
C | and run-time switches. This allows options to be | |
14 |
C | removed altogether, made optional at run-time or | |
15 |
C | to be permanently enabled. This convention helps | |
16 |
C | with the data-dependence analysis performed by the | |
17 |
C | adjoint model compiler. This data dependency | |
18 |
C | analysis can be upset by runtime switches that it | |
19 |
C | is unable to recoginise as being fixed for the | |
20 |
C | duration of an integration. | |
21 |
C | A reasonable way to use these flags is to | |
22 |
C | set all options as selectable at runtime but then | |
23 |
C | once an experimental configuration has been | |
24 |
C | identified, rebuild the code with the appropriate | |
25 |
C | options set at compile time. | |
26 |
C \==========================================================/ |
27 |
|
28 |
#ifndef _CPP_EEOPTIONS_H_ |
29 |
#define _CPP_EEOPTIONS_H_ |
30 |
|
31 |
C In general the following convention applies: |
32 |
C ALLOW - indicates an feature will be included but it may |
33 |
C CAN have a run-time flag to allow it to be switched |
34 |
C on and off. |
35 |
C If ALLOW or CAN directives are "undef'd" this generally |
36 |
C means that the feature will not be available i.e. it |
37 |
C will not be included in the compiled code and so no |
38 |
C run-time option to use the feature will be available. |
39 |
C |
40 |
C ALWAYS - indicates the choice will be fixed at compile time |
41 |
C so no run-time option will be present |
42 |
|
43 |
C Flag used to indicate whether Fortran formatted write |
44 |
C and read are threadsafe. On SGI the routines can be thread |
45 |
C safe, on Sun it is not possible - if you are unsure then |
46 |
C undef this option. |
47 |
#undef FMTFTN_IO_THREADSAFE |
48 |
|
49 |
C Flag used to indicate which flavour of multi-threading |
50 |
C compiler directives to use. Only set one of these. |
51 |
C USE_SOLARIS_THREADING - Takes directives for SUN Workshop |
52 |
C compiler. |
53 |
C USE_KAP_THREADING - Takes directives for Kuck and |
54 |
C Associates multi-threading compiler |
55 |
C ( used on Digital platforms ). |
56 |
C USE_IRIX_THREADING - Takes directives for SGI MIPS |
57 |
C Pro Fortran compiler. |
58 |
C USE_EXEMPLAR_THREADING - Takes directives for HP SPP series |
59 |
C compiler. |
60 |
C USE_C90_THREADING - Takes directives for CRAY/SGI C90 |
61 |
C system F90 compiler. |
62 |
#ifdef TARGET_SUN |
63 |
#define USE_SOLARIS_THREADING |
64 |
#endif |
65 |
|
66 |
#ifdef TARGET_DEC |
67 |
#define USE_KAP_THREADING |
68 |
#endif |
69 |
|
70 |
#ifdef TARGET_SGI |
71 |
#define USE_IRIX_THREADING |
72 |
#endif |
73 |
|
74 |
#ifdef TARGET_HP |
75 |
#define USE_EXEMPLAR_THREADING |
76 |
#endif |
77 |
|
78 |
#ifdef TARGET_CRAY_VECTOR |
79 |
#define USE_C90_THREADING |
80 |
#endif |
81 |
|
82 |
C-- Define the mapping for the _BARRIER macro |
83 |
C On some systems low-level hardware support can be accessed through |
84 |
C compiler directives here. |
85 |
#define _BARRIER CALL BARRIER(myThid) |
86 |
|
87 |
C-- Define the mapping for the BEGIN_CRIT() and END_CRIT() macros. |
88 |
C On some systems we simply execute this section only using the |
89 |
C master thread i.e. its not really a critical section. We can |
90 |
C do this because we do not use critical sections in any critical |
91 |
C sections of our code! |
92 |
#define _BEGIN_CRIT(a) _BEGIN_MASTER(a) |
93 |
#define _END_CRIT(a) _END_MASTER(a) |
94 |
|
95 |
C-- Define the mapping for the BEGIN_MASTER_SECTION() and |
96 |
C END_MASTER_SECTION() macros. These are generally implemented by |
97 |
C simply choosing a particular thread to be "the master" and have |
98 |
C it alone execute the BEGIN_MASTER..., END_MASTER.. sections. |
99 |
#define _BEGIN_MASTER(a) IF ( a .EQ. 1 ) THEN |
100 |
#define _END_MASTER(a) ENDIF |
101 |
|
102 |
C-- Control MPI based parallel processing |
103 |
#define ALLOW_USE_MPI |
104 |
#define ALWAYS_USE_MPI |
105 |
|
106 |
C-- Hack for switching in JAM based communication |
107 |
C JAM_WITH_TWO_PROCS_PER_NODE option is defined if we want two processes |
108 |
C per node. It goes with a different link-time library so be careful! |
109 |
#undef USE_JAM |
110 |
#ifdef USE_JAM |
111 |
#define USE_JAM_INIT |
112 |
#define USE_JAM_EXCH |
113 |
#define USE_JAM_GSUM |
114 |
#endif |
115 |
#undef JAM_WITH_TWO_PROCS_PER_NODE |
116 |
|
117 |
C-- Control use of communication that might overlap computation. |
118 |
C Under MPI selects/deselects "non-blocking" sends and receives. |
119 |
#define ALLOW_ASYNC_COMMUNICATION |
120 |
#undef ALLOW_ASYNC_COMMUNICATION |
121 |
#undef ALWAYS_USE_ASYNC_COMMUNICATION |
122 |
C-- Control use of communication that is atomic to computation. |
123 |
C Under MPI selects/deselects "blocking" sends and receives. |
124 |
#define ALLOW_SYNC_COMMUNICATION |
125 |
#undef ALWAYS_USE_SYNC_COMMUNICATION |
126 |
|
127 |
C-- Control storage of floating point operands |
128 |
C On many systems it improves performance only to use |
129 |
C 8-byte precision for time stepped variables. |
130 |
C Constant in time terms ( geometric factors etc.. ) |
131 |
C can use 4-byte precision, reducing memory utilisation and |
132 |
C boosting performance because of a smaller working |
133 |
C set size. However, on vector CRAY systems this degrades |
134 |
C performance. |
135 |
#define REAL4_IS_SLOW |
136 |
|
137 |
#ifdef REAL4_IS_SLOW |
138 |
#define real Real*8 |
139 |
#define REAL Real*8 |
140 |
#define _RS Real*8 |
141 |
#define _RL Real*8 |
142 |
#define RS_IS_REAL8 |
143 |
|
144 |
#ifdef USE_JAM |
145 |
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_R8_JAM ( a ) |
146 |
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R8_JAM( a ) |
147 |
#define _GLOBAL_SUM_R8(a,b ) CALL GSUM_R8_JAM( a, b) |
148 |
#else |
149 |
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_R8 ( a, b ) |
150 |
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R8 ( a, b ) |
151 |
#define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R8( a, b ) |
152 |
#endif /* USE_JAM */ |
153 |
|
154 |
#define _GLOBAL_MAX_R4(a,b) CALL GLOBAL_MAX_R8( a, b ) |
155 |
|
156 |
#endif |
157 |
|
158 |
#ifndef REAL4_IS_SLOW |
159 |
#define real Real*4 |
160 |
#define REAL Real*8 |
161 |
#define _RS Real*4 |
162 |
#define _RL Real*8 |
163 |
#define RS_IS_REAL4 |
164 |
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_R4 ( a, b ) |
165 |
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R4 ( a, b ) |
166 |
#define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R4( a, b ) |
167 |
#define _GLOBAL_MAX_R4(a,b) CALL GLOBAL_MAX_R4( a, b ) |
168 |
#endif |
169 |
|
170 |
#ifndef USE_JAM |
171 |
#define _EXCH_XY_R8(a,b) CALL EXCH_XY_R8 ( a, b ) |
172 |
#define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_R8 ( a, b ) |
173 |
#define _GLOBAL_SUM_R8(a,b) CALL GLOBAL_SUM_R8( a, b ) |
174 |
#else /* USE_JAM */ |
175 |
#define _EXCH_XY_R8(a,b) CALL EXCH_XY_R8_JAM ( a ) |
176 |
#define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_R8_JAM ( a ) |
177 |
#define _GLOBAL_SUM_R8(a,b ) CALL GSUM_R8_JAM( a, b) |
178 |
#endif /* USE_JAM */ |
179 |
|
180 |
#define _GLOBAL_MAX_R8(a,b ) CALL GLOBAL_MAX_R8( a, b , c) |
181 |
|
182 |
C-- Control use of "double" precision constants. |
183 |
C Use D0 where it means REAL*8 but not where it means REAL*16 |
184 |
#define D0 d0 |
185 |
#ifdef REAL_D0_IS_16BYTES |
186 |
#define D0 |
187 |
#endif |
188 |
|
189 |
C-- Control XY periodicity in processor to grid mappings |
190 |
C Note: Model code does not need to know whether a domain is |
191 |
C periodic because it has overlap regions for every box. |
192 |
C Model assume that these values have been |
193 |
C filled in some way. |
194 |
#undef ALWAYS_PREVENT_X_PERIODICITY |
195 |
#undef ALWAYS_PREVENT_Y_PERIODICITY |
196 |
#define CAN_PREVENT_X_PERIODICITY |
197 |
#define CAN_PREVENT_Y_PERIODICITY |
198 |
|
199 |
C-- Substitue for 1.D variables |
200 |
C Sun compilers do not use 8-byte precision for literals |
201 |
C unless .Dnn is specified. CRAY vector machines use 16-byte |
202 |
C precision when they see .Dnn which runs very slowly! |
203 |
#ifdef REAL_D0_IS_16BYTES |
204 |
#define _d |
205 |
#define _F64( a ) a |
206 |
#endif |
207 |
#ifndef REAL_D0_IS_16BYTES |
208 |
#define _d D |
209 |
#define _F64( a ) DFLOAT( a ) |
210 |
#endif |
211 |
|
212 |
#endif /* _CPP_EEOPTIONS_H_ */ |