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