Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:37:38 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
3d054304e0 Jean*0001 CBOP
                0002 C     !ROUTINE: CPP_EEOPTIONS.h
                0003 C     !INTERFACE:
                0004 C     include "CPP_EEOPTIONS.h"
7f58e89433 Jean*0005 C
3d054304e0 Jean*0006 C     !DESCRIPTION:
                0007 C     *==========================================================*
                0008 C     | CPP\_EEOPTIONS.h                                         |
                0009 C     *==========================================================*
7f58e89433 Jean*0010 C     | C preprocessor "execution environment" supporting        |
                0011 C     | flags. Use this file to set flags controlling the        |
                0012 C     | execution environment in which a model runs - as opposed |
                0013 C     | to the dynamical problem the model solves.               |
                0014 C     | Note: Many options are implemented with both compile time|
                0015 C     |       and run-time switches. This allows options to be   |
                0016 C     |       removed altogether, made optional at run-time or   |
                0017 C     |       to be permanently enabled. This convention helps   |
                0018 C     |       with the data-dependence analysis performed by the |
                0019 C     |       adjoint model compiler. This data dependency       |
                0020 C     |       analysis can be upset by runtime switches that it  |
                0021 C     |       is unable to recoginise as being fixed for the     |
                0022 C     |       duration of an integration.                        |
                0023 C     |       A reasonable way to use these flags is to          |
                0024 C     |       set all options as selectable at runtime but then  |
                0025 C     |       once an experimental configuration has been        |
                0026 C     |       identified, rebuild the code with the appropriate  |
                0027 C     |       options set at compile time.                       |
3d054304e0 Jean*0028 C     *==========================================================*
                0029 CEOP
7f58e89433 Jean*0030 
                0031 #ifndef _CPP_EEOPTIONS_H_
                0032 #define _CPP_EEOPTIONS_H_
                0033 
                0034 C     In general the following convention applies:
                0035 C     ALLOW  - indicates an feature will be included but it may
                0036 C     CAN      have a run-time flag to allow it to be switched
                0037 C              on and off.
                0038 C              If ALLOW or CAN directives are "undef'd" this generally
                0039 C              means that the feature will not be available i.e. it
                0040 C              will not be included in the compiled code and so no
                0041 C              run-time option to use the feature will be available.
                0042 C
                0043 C     ALWAYS - indicates the choice will be fixed at compile time
                0044 C              so no run-time option will be present
                0045 
3d054304e0 Jean*0046 C--   Flag used to indicate whether Fortran formatted write
7f58e89433 Jean*0047 C     and read are threadsafe. On SGI the routines can be thread
                0048 C     safe, on Sun it is not possible - if you are unsure then
                0049 C     undef this option.
3d054304e0 Jean*0050 #undef FMTFTN_IO_THREAD_SAFE
                0051 
                0052 C--   Flag used to indicate whether Binary write to Local file (i.e.,
                0053 C     a different file for each tile) and read are thread-safe.
                0054 #undef LOCBIN_IO_THREAD_SAFE
                0055 
                0056 C--   Flag to turn off the writing of error message to ioUnit zero
                0057 #undef DISABLE_WRITE_TO_UNIT_ZERO
                0058 
                0059 C--   Flag to turn on checking for errors from all threads and procs
                0060 C     (calling S/R STOP_IF_ERROR) before stopping.
                0061 #define USE_ERROR_STOP
                0062 
                0063 C--   Flag turns off MPI_SEND ready_to_receive polling in the
                0064 C     gather_* subroutines to speed up integrations.
                0065 #undef DISABLE_MPI_READY_TO_RECEIVE
                0066 
                0067 C--   Control MPI based parallel processing
                0068 CXXX We no longer select the use of MPI via this file (CPP_EEOPTIONS.h)
                0069 CXXX To use MPI, use an appropriate genmake2 options file or use
                0070 CXXX genmake2 -mpi .
                0071 CXXX #undef  ALLOW_USE_MPI
                0072 CXXX #undef  ALWAYS_USE_MPI
                0073 
                0074 C--   Control use of communication that might overlap computation.
                0075 C     Under MPI selects/deselects "non-blocking" sends and receives.
                0076 #define ALLOW_ASYNC_COMMUNICATION
                0077 #undef  ALLOW_ASYNC_COMMUNICATION
                0078 #undef  ALWAYS_USE_ASYNC_COMMUNICATION
                0079 C--   Control use of communication that is atomic to computation.
                0080 C     Under MPI selects/deselects "blocking" sends and receives.
                0081 #define ALLOW_SYNC_COMMUNICATION
                0082 #undef  ALWAYS_USE_SYNC_COMMUNICATION
                0083 
                0084 C--   Control storage of floating point operands
                0085 C     On many systems it improves performance only to use
                0086 C     8-byte precision for time stepped variables.
                0087 C     Constant in time terms ( geometric factors etc.. )
                0088 C     can use 4-byte precision, reducing memory utilisation and
                0089 C     boosting performance because of a smaller working
                0090 C     set size. However, on vector CRAY systems this degrades
                0091 C     performance.
                0092 #define REAL4_IS_SLOW
                0093 
                0094 C--   Control use of "double" precision constants.
                0095 C     Use D0 where it means REAL*8 but not where it means REAL*16
                0096 #define D0 d0
                0097 
                0098 C--   Control XY periodicity in processor to grid mappings
                0099 C     Note: Model code does not need to know whether a domain is
                0100 C           periodic because it has overlap regions for every box.
                0101 C           Model assume that these values have been
                0102 C           filled in some way.
                0103 #undef  ALWAYS_PREVENT_X_PERIODICITY
                0104 #undef  ALWAYS_PREVENT_Y_PERIODICITY
                0105 #define CAN_PREVENT_X_PERIODICITY
                0106 #define CAN_PREVENT_Y_PERIODICITY
                0107 
                0108 C--   Alternative formulation of BYTESWAP, faster than
                0109 C     compiler flag -byteswapio on the Altix.
                0110 #undef FAST_BYTESWAP
                0111 
                0112 C--   Alternative way of doing global sum without MPI allreduce call
                0113 C     but instead, explicit MPI send & recv calls.
                0114 #undef GLOBAL_SUM_SEND_RECV
                0115 
                0116 C--   Alternative way of doing global sum on a single CPU
                0117 C     to eliminate tiling-dependent roundoff errors.
                0118 C     Note: This is slow.
                0119 #undef  CG2D_SINGLECPU_SUM
                0120 
                0121 C--- Taken from file "CPP_EEMACROS.h":
7f58e89433 Jean*0122 
                0123 C     Flag used to indicate which flavour of multi-threading
                0124 C     compiler directives to use. Only set one of these.
                0125 C     USE_SOLARIS_THREADING  - Takes directives for SUN Workshop
                0126 C                              compiler.
9274434acc Jean*0127 C     USE_KAP_THREADING      - Takes directives for Kuck and
7f58e89433 Jean*0128 C                              Associates multi-threading compiler
                0129 C                              ( used on Digital platforms ).
                0130 C     USE_IRIX_THREADING     - Takes directives for SGI MIPS
                0131 C                              Pro Fortran compiler.
                0132 C     USE_EXEMPLAR_THREADING - Takes directives for HP SPP series
                0133 C                              compiler.
                0134 C     USE_C90_THREADING      - Takes directives for CRAY/SGI C90
                0135 C                              system F90 compiler.
                0136 #ifdef TARGET_SUN
                0137 #define USE_SOLARIS_THREADING
                0138 #endif
                0139 
                0140 #ifdef TARGET_DEC
                0141 #define USE_KAP_THREADING
                0142 #endif
                0143 
                0144 #ifdef TARGET_SGI
                0145 #define USE_IRIX_THREADING
                0146 #endif
                0147 
                0148 #ifdef TARGET_HP
                0149 #define USE_EXEMPLAR_THREADING
                0150 #endif
                0151 
                0152 #ifdef TARGET_CRAY_VECTOR
                0153 #define USE_C90_THREADING
                0154 #endif
                0155 
                0156 C--   Define the mapping for the _BARRIER macro
                0157 C     On some systems low-level hardware support can be accessed through
                0158 C     compiler directives here.
                0159 #define _BARRIER CALL BARRIER(myThid)
                0160 
9274434acc Jean*0161 C--   Define the mapping for the BEGIN_CRIT() and  END_CRIT() macros.
7f58e89433 Jean*0162 C     On some systems we simply execute this section only using the
                0163 C     master thread i.e. its not really a critical section. We can
                0164 C     do this because we do not use critical sections in any critical
                0165 C     sections of our code!
                0166 #define _BEGIN_CRIT(a) _BEGIN_MASTER(a)
                0167 #define _END_CRIT(a)   _END_MASTER(a)
                0168 
                0169 C--   Define the mapping for the BEGIN_MASTER_SECTION() and
                0170 C     END_MASTER_SECTION() macros. These are generally implemented by
                0171 C     simply choosing a particular thread to be "the master" and have
                0172 C     it alone execute the BEGIN_MASTER..., END_MASTER.. sections.
                0173 #define _BEGIN_MASTER(a)  IF ( a .EQ. 1 ) THEN
                0174 #define _END_MASTER(a)    ENDIF
                0175 
3d054304e0 Jean*0176 C- Note: global_sum/max macros were used to switch to  JAM routines (obsolete);
                0177 C  in addition, since only the R4 & R8 S/R are coded, GLOBAL RS & RL macros
                0178 C  enable to call the corresponding R4 or R8 S/R.
7f58e89433 Jean*0179 #ifdef REAL4_IS_SLOW
3d054304e0 Jean*0180 
7f58e89433 Jean*0181 #define _RS  Real*8
                0182 #define RS_IS_REAL8
3d054304e0 Jean*0183 #define _GLOBAL_SUM_RS(a,b)    CALL GLOBAL_SUM_R8( a, b )
                0184 #define _GLOBAL_MAX_RS(a,b)    CALL GLOBAL_MAX_R8( a, b )
                0185 #define _MPI_TYPE_RS MPI_DOUBLE_PRECISION
7f58e89433 Jean*0186 
3d054304e0 Jean*0187 #else /* REAL4_IS_SLOW */
7f58e89433 Jean*0188 
                0189 #define _RS  Real*4
                0190 #define RS_IS_REAL4
3d054304e0 Jean*0191 #define _GLOBAL_SUM_RS(a,b)    CALL GLOBAL_SUM_R4( a, b )
                0192 #define _GLOBAL_MAX_RS(a,b)    CALL GLOBAL_MAX_R4( a, b )
                0193 #define _MPI_TYPE_RS MPI_REAL
7f58e89433 Jean*0194 
3d054304e0 Jean*0195 #endif /* REAL4_IS_SLOW */
7f58e89433 Jean*0196 
3d054304e0 Jean*0197 #define _RL  Real*8
                0198 #define RL_IS_REAL8
                0199 #define _GLOBAL_SUM_RL(a,b)    CALL GLOBAL_SUM_R8( a, b )
                0200 #define _GLOBAL_MAX_RL(a,b)    CALL GLOBAL_MAX_R8( a, b )
                0201 #define _MPI_TYPE_RL MPI_DOUBLE_PRECISION
                0202 
                0203 C- Note: a) exch macros were used to switch to  JAM routines (obsolete)
                0204 C        b) exch R4 & R8 macros are not practically used ; if needed,
                0205 C           will directly call the corrresponding S/R.
                0206 #define _EXCH_XY_RS(a,b) CALL EXCH_XY_RS ( a, b )
                0207 #define _EXCH_XY_RL(a,b) CALL EXCH_XY_RL ( a, b )
                0208 #define _EXCH_XYZ_RS(a,b) CALL EXCH_XYZ_RS ( a, b )
                0209 #define _EXCH_XYZ_RL(a,b) CALL EXCH_XYZ_RL ( a, b )
7f58e89433 Jean*0210 
                0211 C--   Control use of "double" precision constants.
                0212 C     Use D0 where it means REAL*8 but not where it means REAL*16
                0213 #define D0 d0
                0214 #ifdef REAL_D0_IS_16BYTES
                0215 #define D0
                0216 #endif
                0217 
                0218 C--   Substitue for 1.D variables
                0219 C     Sun compilers do not use 8-byte precision for literals
                0220 C     unless .Dnn is specified. CRAY vector machines use 16-byte
                0221 C     precision when they see .Dnn which runs very slowly!
                0222 #ifdef REAL_D0_IS_16BYTES
                0223 #define _d
                0224 #define _F64( a ) a
                0225 #endif
                0226 #ifndef REAL_D0_IS_16BYTES
                0227 #define _d D
                0228 #define _F64( a ) DFLOAT( a )
                0229 #endif
                0230 
                0231 #endif /* _CPP_EEOPTIONS_H_ */
3d054304e0 Jean*0232