/[MITgcm]/MITgcm/eesupp/inc/CPP_EEMACROS.h
ViewVC logotype

Annotation of /MITgcm/eesupp/inc/CPP_EEMACROS.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (hide annotations) (download)
Tue Apr 6 21:03:14 2004 UTC (20 years, 1 month ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint57b_post, checkpoint56b_post, checkpoint54d_post, checkpoint54e_post, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint53, checkpoint54f_post, checkpoint55i_post, checkpoint55c_post, checkpoint53d_post, checkpoint57a_post, checkpoint54b_post, checkpoint52m_post, checkpoint55g_post, checkpoint55d_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint55b_post, checkpoint53a_post, checkpoint55f_post, checkpoint53g_post, checkpoint56a_post, checkpoint53f_post, checkpoint52n_post, checkpoint53b_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint55a_post, checkpoint53b_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post
Changes since 1.9: +9 -9 lines
File MIME type: text/plain
R4 fix fixed - chris

1 dimitri 1.10 C $Header: /u/gcmpack/MITgcm/eesupp/inc/CPP_EEMACROS.h,v 1.9 2004/04/06 19:24:34 dimitri Exp $
2 adcroft 1.4 C $Name: $
3    
4 cnh 1.5 CBOP
5     C !ROUTINE: CPP_EEMACROS.h
6     C !INTERFACE:
7     C include "CPP_EEMACROS.h "
8     C !DESCRIPTION:
9     C *==========================================================*
10 dimitri 1.9 C | CPP_EEMACROS.h
11 cnh 1.5 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 adcroft 1.1
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 adcroft 1.4 #define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R8 ( a, b)
99 adcroft 1.1 #define _GLOBAL_MAX_R4(a,b) CALL GLOBAL_MAX_R8 ( a, b )
100 dimitri 1.6 #define _MPI_TYPE_RS MPI_DOUBLE_PRECISION
101 adcroft 1.1 #else
102     #define _RS Real*4
103     #define RS_IS_REAL4
104     #define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R4 ( a, b )
105     #define _GLOBAL_MAX_R4(a,b) CALL GLOBAL_MAX_R4 ( a, b )
106 dimitri 1.6 #define _MPI_TYPE_RS MPI_REAL
107 adcroft 1.1 #endif
108 dimitri 1.10 #define _EXCH_XY_R4(a,b) CALL EXCH_XY_RL ( a, b )
109     #define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_RL ( a, b )
110 adcroft 1.1
111     #define _RL Real*8
112 dimitri 1.10 #define _EXCH_XY_R8(a,b) CALL EXCH_XY_RL ( a, b )
113     #define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_RL ( a, b )
114 adcroft 1.4 #define _GLOBAL_SUM_R8(a,b) CALL GLOBAL_SUM_R8 ( a, b )
115 adcroft 1.1 #define _GLOBAL_MAX_R8(a,b) CALL GLOBAL_MAX_R8 ( a, b )
116 dimitri 1.6 #define _MPI_TYPE_RL MPI_DOUBLE_PRECISION
117 adcroft 1.4
118 dimitri 1.10 #define _EXCH_XY_RS(a,b) CALL EXCH_XY_RL ( a, b )
119     #define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_RL ( a, b )
120     #define _EXCH_XY_RL(a,b) CALL EXCH_XY_RL ( a, b )
121     #define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_RL ( a, b )
122 dimitri 1.9
123     #define _MPI_TYPE_R4 MPI_REAL
124     #ifdef TARGET_SGI
125     #define _MPI_TYPE_R8 MPI_DOUBLE_PRECISION
126     #else
127     #define _MPI_TYPE_R8 MPI_REAL8
128     #endif
129     #define _R4 Real*4
130     #define _R8 Real*8
131 adcroft 1.4
132     C-- Control use of JAM routines for Artic network
133     C These invoke optimized versions of "exchange" and "sum" that
134     C utilize the programmable aspect of Artic cards.
135     #ifdef LETS_MAKE_JAM
136     #define _GLOBAL_SUM_R4(a,b) CALL GLOBAL_SUM_R8_JAM ( a, b)
137     #define _EXCH_XY_R4(a,b) CALL EXCH_XY_R8_JAM ( a, b )
138     #define _EXCH_XYZ_R4(a,b) CALL EXCH_XYZ_R8_JAM ( a, b )
139     #define _EXCH_XY_R8(a,b) CALL EXCH_XY_R8_JAM ( a, b )
140     #define _EXCH_XYZ_R8(a,b) CALL EXCH_XYZ_R8_JAM ( a, b )
141     #define _GLOBAL_SUM_R8(a,b) CALL GLOBAL_SUM_R8_JAM ( a, b )
142    
143     #define _EXCH_XY_RS(a,b) CALL EXCH_XY_R8_JAM ( a, b )
144     #define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_R8_JAM ( a, b )
145     #define _EXCH_XY_RL(a,b) CALL EXCH_XY_R8_JAM ( a, b )
146     #define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_R8_JAM ( a, b )
147     #endif
148 adcroft 1.1
149     C-- Control use of "double" precision constants.
150     C Use D0 where it means REAL*8 but not where it means REAL*16
151     #ifdef REAL_D0_IS_16BYTES
152     #define D0
153     #endif
154    
155     C-- Substitue for 1.D variables
156     C Sun compilers do not use 8-byte precision for literals
157     C unless .Dnn is specified. CRAY vector machines use 16-byte
158     C precision when they see .Dnn which runs very slowly!
159     #ifdef REAL_D0_IS_16BYTES
160 dimitri 1.7 #define _d E
161 adcroft 1.1 #define _F64( a ) a
162     #endif
163     #ifndef REAL_D0_IS_16BYTES
164     #define _d D
165     #define _F64( a ) DFLOAT( a )
166     #endif
167    
168     #endif /* _CPP_EEMACROS_H_ */

  ViewVC Help
Powered by ViewVC 1.1.22