2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
CBOP |
CBOP |
5 |
C !ROUTINE: CPP_EEMACROS.h |
C !ROUTINE: CPP_EEMACROS.h |
6 |
C !INTERFACE: |
C !INTERFACE: |
7 |
C include "CPP_EEMACROS.h " |
C include "CPP_EEMACROS.h " |
8 |
C !DESCRIPTION: |
C !DESCRIPTION: |
9 |
C *==========================================================* |
C *==========================================================* |
10 |
C | CPP_EEMACROS.h |
C | CPP_EEMACROS.h |
11 |
C *==========================================================* |
C *==========================================================* |
12 |
C | C preprocessor "execution environment" supporting |
C | C preprocessor "execution environment" supporting |
13 |
C | macros. Use this file to define macros for simplifying |
C | macros. Use this file to define macros for simplifying |
14 |
C | execution environment in which a model runs - as opposed |
C | execution environment in which a model runs - as opposed |
15 |
C | to the dynamical problem the model solves. |
C | to the dynamical problem the model solves. |
16 |
C *==========================================================* |
C *==========================================================* |
17 |
CEOP |
CEOP |
18 |
|
|
35 |
C compiler directives to use. Only set one of these. |
C compiler directives to use. Only set one of these. |
36 |
C USE_SOLARIS_THREADING - Takes directives for SUN Workshop |
C USE_SOLARIS_THREADING - Takes directives for SUN Workshop |
37 |
C compiler. |
C compiler. |
38 |
C USE_KAP_THREADING - Takes directives for Kuck and |
C USE_KAP_THREADING - Takes directives for Kuck and |
39 |
C Associates multi-threading compiler |
C Associates multi-threading compiler |
40 |
C ( used on Digital platforms ). |
C ( used on Digital platforms ). |
41 |
C USE_IRIX_THREADING - Takes directives for SGI MIPS |
C USE_IRIX_THREADING - Takes directives for SGI MIPS |
78 |
C compiler directives here. |
C compiler directives here. |
79 |
#define _BARRIER CALL BARRIER(myThid) |
#define _BARRIER CALL BARRIER(myThid) |
80 |
|
|
81 |
C-- Define the mapping for the BEGIN_CRIT() and END_CRIT() macros. |
C-- Define the mapping for the BEGIN_CRIT() and END_CRIT() macros. |
82 |
C On some systems we simply execute this section only using the |
C On some systems we simply execute this section only using the |
83 |
C master thread i.e. its not really a critical section. We can |
C master thread i.e. its not really a critical section. We can |
84 |
C do this because we do not use critical sections in any critical |
C do this because we do not use critical sections in any critical |
119 |
C boosting performance because of a smaller working |
C boosting performance because of a smaller working |
120 |
C set size. However, on vector CRAY systems this degrades |
C set size. However, on vector CRAY systems this degrades |
121 |
C performance. |
C performance. |
122 |
|
C- Note: global_sum/max macros were used to switch to JAM routines (obsolete); |
123 |
|
C in addition, since only the R4 & R8 S/R are coded, GLOBAL RS & RL macros |
124 |
|
C enable to call the corresponding R4 or R8 S/R. |
125 |
#ifdef REAL4_IS_SLOW |
#ifdef REAL4_IS_SLOW |
126 |
#define _RS Real*8 |
#define _RS Real*8 |
127 |
#define RS_IS_REAL8 |
#define RS_IS_REAL8 |
128 |
#define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R8 ( a, b) |
#define _GLOBAL_SUM_RS(a,b) CALL GLOBAL_SUM_R8 ( a, b) |
129 |
#define _GLOBAL_MAX_R4(a,b) CALL GLOBAL_MAX_R8 ( a, b ) |
#define _GLOBAL_MAX_RS(a,b) CALL GLOBAL_MAX_R8 ( a, b ) |
130 |
#define _MPI_TYPE_RS MPI_DOUBLE_PRECISION |
#define _MPI_TYPE_RS MPI_DOUBLE_PRECISION |
131 |
#else |
#else |
132 |
#define _RS Real*4 |
#define _RS Real*4 |
133 |
#define RS_IS_REAL4 |
#define RS_IS_REAL4 |
134 |
#define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R4 ( a, b ) |
#define _GLOBAL_SUM_RS(a,b) CALL GLOBAL_SUM_R4 ( a, b ) |
135 |
#define _GLOBAL_MAX_R4(a,b) CALL GLOBAL_MAX_R4 ( a, b ) |
#define _GLOBAL_MAX_RS(a,b) CALL GLOBAL_MAX_R4 ( a, b ) |
136 |
#define _MPI_TYPE_RS MPI_REAL |
#define _MPI_TYPE_RS MPI_REAL |
137 |
#endif |
#endif |
|
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_RL ( a, b ) |
|
|
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_RL ( a, b ) |
|
138 |
|
|
139 |
#define _RL Real*8 |
#define _RL Real*8 |
140 |
#define _EXCH_XY_R8(a,b) CALL EXCH_XY_RL ( a, b ) |
#define RL_IS_REAL8 |
141 |
#define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_RL ( a, b ) |
#define _GLOBAL_SUM_RL(a,b) CALL GLOBAL_SUM_R8 ( a, b ) |
142 |
#define _GLOBAL_SUM_R8(a,b) CALL GLOBAL_SUM_R8 ( a, b ) |
#define _GLOBAL_MAX_RL(a,b) CALL GLOBAL_MAX_R8 ( a, b ) |
|
#define _GLOBAL_MAX_R8(a,b) CALL GLOBAL_MAX_R8 ( a, b ) |
|
143 |
#define _MPI_TYPE_RL MPI_DOUBLE_PRECISION |
#define _MPI_TYPE_RL MPI_DOUBLE_PRECISION |
144 |
|
|
|
#define _EXCH_XY_RS(a,b) CALL EXCH_XY_RL ( a, b ) |
|
|
#define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_RL ( a, b ) |
|
|
#define _EXCH_XY_RL(a,b) CALL EXCH_XY_RL ( a, b ) |
|
|
#define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_RL ( a, b ) |
|
|
|
|
145 |
#define _MPI_TYPE_R4 MPI_REAL |
#define _MPI_TYPE_R4 MPI_REAL |
146 |
#if (defined (TARGET_SGI) || defined (TARGET_AIX) || defined (TARGET_LAM)) |
#if (defined (TARGET_SGI) || defined (TARGET_AIX) || defined (TARGET_LAM)) |
147 |
#define _MPI_TYPE_R8 MPI_DOUBLE_PRECISION |
#define _MPI_TYPE_R8 MPI_DOUBLE_PRECISION |
151 |
#define _R4 Real*4 |
#define _R4 Real*4 |
152 |
#define _R8 Real*8 |
#define _R8 Real*8 |
153 |
|
|
154 |
C-- Control use of JAM routines for Artic network |
C- Note: a) exch macros were used to switch to JAM routines (obsolete) |
155 |
|
C b) exch R4 & R8 macros are not practically used ; if needed, |
156 |
|
C will directly call the corrresponding S/R. |
157 |
|
#define _EXCH_XY_RS(a,b) CALL EXCH_XY_RS ( a, b ) |
158 |
|
#define _EXCH_XY_RL(a,b) CALL EXCH_XY_RL ( a, b ) |
159 |
|
c#define _EXCH_XY_R4(a,b) CALL EXCH_XY_R4 ( a, b ) |
160 |
|
c#define _EXCH_XY_R8(a,b) CALL EXCH_XY_R8 ( a, b ) |
161 |
|
#define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_RS ( a, b ) |
162 |
|
#define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_RL ( a, b ) |
163 |
|
c#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R4 ( a, b ) |
164 |
|
c#define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_R8 ( a, b ) |
165 |
|
|
166 |
|
C-- Control use of JAM routines for Artic network (no longer supported) |
167 |
C These invoke optimized versions of "exchange" and "sum" that |
C These invoke optimized versions of "exchange" and "sum" that |
168 |
C utilize the programmable aspect of Artic cards. |
C utilize the programmable aspect of Artic cards. |
169 |
#ifdef LETS_MAKE_JAM |
#ifdef LETS_MAKE_JAM |
170 |
#define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R8_JAM ( a, b) |
#define _GLOBAL_SUM_RS(a,b) CALL GLOBAL_SUM_R8_JAM ( a, b) |
171 |
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
#define _GLOBAL_SUM_RL(a,b) CALL GLOBAL_SUM_R8_JAM ( a, b ) |
|
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
|
|
#define _EXCH_XY_R8(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
|
|
#define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
|
|
#define _GLOBAL_SUM_R8(a,b) CALL GLOBAL_SUM_R8_JAM ( a, b ) |
|
|
|
|
172 |
#define _EXCH_XY_RS(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
#define _EXCH_XY_RS(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
|
#define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
|
173 |
#define _EXCH_XY_RL(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
#define _EXCH_XY_RL(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
174 |
|
#define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
175 |
#define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
#define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
176 |
#endif |
#endif |
177 |
|
|
178 |
C-- Control use of "double" precision constants. |
C-- Control use of "double" precision constants. |
179 |
C Use D0 where it means REAL*8 but not where it means REAL*16 |
C Use D0 where it means REAL*8 but not where it means REAL*16 |
180 |
#ifdef REAL_D0_IS_16BYTES |
#ifdef REAL_D0_IS_16BYTES |