1 |
C $Header: /u/gcmpack/models/MITgcmUV/eesupp/inc/CPP_EEMACROS.h,v 1.4 2001/05/29 14:01:35 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
CBOP |
5 |
C !ROUTINE: CPP_EEMACROS.h |
6 |
C !INTERFACE: |
7 |
C include "CPP_EEMACROS.h " |
8 |
C !DESCRIPTION: |
9 |
C *==========================================================* |
10 |
C | CPP_EEMACROS.h |
11 |
C *==========================================================* |
12 |
C | C preprocessor "execution environment" supporting |
13 |
C | macros. Use this file to define macros for simplifying |
14 |
C | execution environment in which a model runs - as opposed |
15 |
C | to the dynamical problem the model solves. |
16 |
C *==========================================================* |
17 |
CEOP |
18 |
|
19 |
#ifndef _CPP_EEMACROS_H_ |
20 |
#define _CPP_EEMACROS_H_ |
21 |
|
22 |
C In general the following convention applies: |
23 |
C ALLOW - indicates an feature will be included but it may |
24 |
C CAN have a run-time flag to allow it to be switched |
25 |
C on and off. |
26 |
C If ALLOW or CAN directives are "undef'd" this generally |
27 |
C means that the feature will not be available i.e. it |
28 |
C will not be included in the compiled code and so no |
29 |
C run-time option to use the feature will be available. |
30 |
C |
31 |
C ALWAYS - indicates the choice will be fixed at compile time |
32 |
C so no run-time option will be present |
33 |
|
34 |
C Flag used to indicate which flavour of multi-threading |
35 |
C compiler directives to use. Only set one of these. |
36 |
C USE_SOLARIS_THREADING - Takes directives for SUN Workshop |
37 |
C compiler. |
38 |
C USE_KAP_THREADING - Takes directives for Kuck and |
39 |
C Associates multi-threading compiler |
40 |
C ( used on Digital platforms ). |
41 |
C USE_IRIX_THREADING - Takes directives for SGI MIPS |
42 |
C Pro Fortran compiler. |
43 |
C USE_EXEMPLAR_THREADING - Takes directives for HP SPP series |
44 |
C compiler. |
45 |
C USE_C90_THREADING - Takes directives for CRAY/SGI C90 |
46 |
C system F90 compiler. |
47 |
#ifdef TARGET_SUN |
48 |
#define USE_SOLARIS_THREADING |
49 |
#endif |
50 |
|
51 |
#ifdef TARGET_DEC |
52 |
#define USE_KAP_THREADING |
53 |
#endif |
54 |
|
55 |
#ifdef TARGET_SGI |
56 |
#define USE_IRIX_THREADING |
57 |
#endif |
58 |
|
59 |
#ifdef TARGET_HP |
60 |
#define USE_EXEMPLAR_THREADING |
61 |
#endif |
62 |
|
63 |
#ifdef TARGET_CRAY_VECTOR |
64 |
#define USE_C90_THREADING |
65 |
#endif |
66 |
|
67 |
C-- Define the mapping for the _BARRIER macro |
68 |
C On some systems low-level hardware support can be accessed through |
69 |
C compiler directives here. |
70 |
#define _BARRIER CALL BARRIER(myThid) |
71 |
|
72 |
C-- Define the mapping for the BEGIN_CRIT() and END_CRIT() macros. |
73 |
C On some systems we simply execute this section only using the |
74 |
C master thread i.e. its not really a critical section. We can |
75 |
C do this because we do not use critical sections in any critical |
76 |
C sections of our code! |
77 |
#define _BEGIN_CRIT(a) _BEGIN_MASTER(a) |
78 |
#define _END_CRIT(a) _END_MASTER(a) |
79 |
|
80 |
C-- Define the mapping for the BEGIN_MASTER_SECTION() and |
81 |
C END_MASTER_SECTION() macros. These are generally implemented by |
82 |
C simply choosing a particular thread to be "the master" and have |
83 |
C it alone execute the BEGIN_MASTER..., END_MASTER.. sections. |
84 |
#define _BEGIN_MASTER(a) IF ( a .EQ. 1 ) THEN |
85 |
#define _END_MASTER(a) ENDIF |
86 |
|
87 |
C-- Control storage of floating point operands |
88 |
C On many systems it improves performance only to use |
89 |
C 8-byte precision for time stepped variables. |
90 |
C Constant in time terms ( geometric factors etc.. ) |
91 |
C can use 4-byte precision, reducing memory utilisation and |
92 |
C boosting performance because of a smaller working |
93 |
C set size. However, on vector CRAY systems this degrades |
94 |
C performance. |
95 |
#ifdef REAL4_IS_SLOW |
96 |
#define _RS Real*8 |
97 |
#define RS_IS_REAL8 |
98 |
#define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R8 ( a, b) |
99 |
#define _GLOBAL_MAX_R4(a,b) CALL GLOBAL_MAX_R8 ( a, b ) |
100 |
#else |
101 |
#define _RS Real*4 |
102 |
#define RS_IS_REAL4 |
103 |
#define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R4 ( a, b ) |
104 |
#define _GLOBAL_MAX_R4(a,b) CALL GLOBAL_MAX_R4 ( a, b ) |
105 |
#endif |
106 |
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_RS ( a, b ) |
107 |
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_RS ( a, b ) |
108 |
|
109 |
#define _RL Real*8 |
110 |
#define _EXCH_XY_R8(a,b) CALL EXCH_XY_RL ( a, b ) |
111 |
#define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_RL ( a, b ) |
112 |
#define _GLOBAL_SUM_R8(a,b) CALL GLOBAL_SUM_R8 ( a, b ) |
113 |
#define _GLOBAL_MAX_R8(a,b) CALL GLOBAL_MAX_R8 ( a, b ) |
114 |
|
115 |
#define _EXCH_XY_RS(a,b) CALL EXCH_XY_RS ( a, b ) |
116 |
#define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_RS ( a, b ) |
117 |
#define _EXCH_XY_RL(a,b) CALL EXCH_XY_RL ( a, b ) |
118 |
#define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_RL ( a, b ) |
119 |
|
120 |
C-- Control use of JAM routines for Artic network |
121 |
C These invoke optimized versions of "exchange" and "sum" that |
122 |
C utilize the programmable aspect of Artic cards. |
123 |
#ifdef LETS_MAKE_JAM |
124 |
#define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R8_JAM ( a, b) |
125 |
#define _EXCH_XY_R4(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
126 |
#define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
127 |
#define _EXCH_XY_R8(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
128 |
#define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
129 |
#define _GLOBAL_SUM_R8(a,b) CALL GLOBAL_SUM_R8_JAM ( a, b ) |
130 |
|
131 |
#define _EXCH_XY_RS(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
132 |
#define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
133 |
#define _EXCH_XY_RL(a,b) CALL EXCH_XY_R8_JAM ( a, b ) |
134 |
#define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_R8_JAM ( a, b ) |
135 |
#endif |
136 |
|
137 |
C-- Control use of "double" precision constants. |
138 |
C Use D0 where it means REAL*8 but not where it means REAL*16 |
139 |
#ifdef REAL_D0_IS_16BYTES |
140 |
#define D0 |
141 |
#endif |
142 |
|
143 |
C-- Substitue for 1.D variables |
144 |
C Sun compilers do not use 8-byte precision for literals |
145 |
C unless .Dnn is specified. CRAY vector machines use 16-byte |
146 |
C precision when they see .Dnn which runs very slowly! |
147 |
#ifdef REAL_D0_IS_16BYTES |
148 |
#define _d |
149 |
#define _F64( a ) a |
150 |
#endif |
151 |
#ifndef REAL_D0_IS_16BYTES |
152 |
#define _d D |
153 |
#define _F64( a ) DFLOAT( a ) |
154 |
#endif |
155 |
|
156 |
#endif /* _CPP_EEMACROS_H_ */ |