Warning, /eesupp/src/exch1_rx_cube_ad.template is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
ba0dad37f4 Jean*0001 #include "CPP_EEOPTIONS.h"
0002
0003 C-- File exch1_RX_cube_ad.F: adjoint routines to exch1 cube routines
0004 C-- Contents
0005 C-- o EXCH1_RX_CUBE_AD
0006 C-- o EXCH1_Z_RX_CUBE_AD
0007 C-- o EXCH1_UV_RX_CUBE_AD
0008 C-- o EXCH1_BG_RX_CUBE_AD
0009
0010 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
0011 CBOP
0012 C !ROUTINE: EXCH1_RX_CUBE_AD
0013
0014 C !INTERFACE:
0015 #ifdef AUTODIFF_TAMC_COMPATIBILITY
0016 SUBROUTINE EXCH1_RX_CUBE_AD(
0017 I withSigns,
0018 I myOLw, myOLe, myOLs, myOLn, myNz,
0019 I exchWidthX, exchWidthY,
0020 I cornerMode, myThid,
0021 U array )
0022 #else
0023 SUBROUTINE EXCH1_RX_CUBE_AD(
0024 U array,
0025 I withSigns,
0026 I myOLw, myOLe, myOLs, myOLn, myNz,
0027 I exchWidthX, exchWidthY,
0028 I cornerMode, myThid )
0029 #endif
0030
0031 C !DESCRIPTION:
0032 C *==========================================================*
0033 C | SUBROUTINE EXCH1_RX_CUBE_AD
0034 C | o Reverse-mode edge exchanges for RX array on CS config.
0035 C *==========================================================*
0036 C | - not yet coded -
0037 C *==========================================================*
0038
0039 C !USES:
0040 IMPLICIT NONE
0041
0042 C == Global data ==
0043 #include "SIZE.h"
0044 #include "EEPARAMS.h"
0045
0046 C !INPUT/OUTPUT PARAMETERS:
0047 C == Routine arguments ==
0048 C array :: Array with edges to exchange.
0049 C withSigns :: Flag controlling whether field sign depends on orientation
0050 C :: (signOption not yet implemented but needed for SM exch)
0051 C myOLw,myOLe :: West and East overlap region sizes.
0052 C myOLs,myOLn :: South and North overlap region sizes.
0053 C exchWidthX :: Width of data region exchanged in X.
0054 C exchWidthY :: Width of data region exchanged in Y.
0055 C Note --
0056 C 1. In theory one could have a send width and
0057 C a receive width for each face of each tile. The only
0058 C restriction would be that the send width of one
0059 C face should equal the receive width of the sent to
0060 C tile face. Dont know if this would be useful. I
0061 C have left it out for now as it requires additional
0062 C bookeeping.
0063 C cornerMode :: Flag indicating whether corner updates are needed.
0064 C myThid :: my Thread Id number
0065
0066 INTEGER myOLw, myOLe, myOLs, myOLn, myNz
0067 _RX array( 1-myOLw:sNx+myOLe,
0068 & 1-myOLs:sNy+myOLn,
0069 & myNz, nSx, nSy )
0070 LOGICAL withSigns
0071 INTEGER exchWidthX
0072 INTEGER exchWidthY
0073 INTEGER cornerMode
0074 INTEGER myThid
0075
0076 C !LOCAL VARIABLES:
0077 C == Local variables ==
0078 C theSimulationMode :: Holds working copy of simulation mode
0079 C theCornerMode :: Holds working copy of corner mode
0080 c INTEGER theSimulationMode
0081 c INTEGER theCornerMode
0082 CHARACTER*(MAX_LEN_MBUF) msgBuf
0083 CEOP
0084
0085 c theSimulationMode = REVERSE_SIMULATION
0086 c theCornerMode = cornerMode
0087
0088 c IF ( simulationMode.EQ.REVERSE_SIMULATION ) THEN
0089 WRITE(msgBuf,'(A)') 'ADEXCH1_RX_CUBE: AD mode not implemented'
0090 CALL PRINT_ERROR( msgBuf, myThid )
0091 STOP 'ABNORMAL END: EXCH1_RX_CUBE_AD: no AD code'
0092 c ENDIF
0093
0094 RETURN
0095 END
0096
0097 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
0098 CBOP
0099
0100 C !ROUTINE: EXCH1_Z_RX_CUBE_AD
0101
0102 C !INTERFACE:
0103 #ifdef AUTODIFF_TAMC_COMPATIBILITY
0104 SUBROUTINE EXCH1_Z_RX_CUBE_AD(
0105 I withSigns,
0106 I myOLw, myOLe, myOLs, myOLn, myNz,
0107 I exchWidthX, exchWidthY,
0108 I cornerMode, myThid,
0109 U array )
0110 #else
0111 SUBROUTINE EXCH1_Z_RX_CUBE_AD(
0112 U array,
0113 I withSigns,
0114 I myOLw, myOLe, myOLs, myOLn, myNz,
0115 I exchWidthX, exchWidthY,
0116 I cornerMode, myThid )
0117 #endif
0118
0119 C !DESCRIPTION:
0120 C *==========================================================*
0121 C | SUBROUTINE EXCH1_Z_RX_CUBE_AD
0122 C | o Reverse-mode edge exchanges for RX array on CS config:
0123 C | Fill overlap region through tile exchanges,
0124 C | according to CS topology,
0125 C | for a Zeta-located, scalar field RX arrays.
0126 C *==========================================================*
0127 C | - not yet coded -
0128 C *==========================================================*
0129
0130 C !USES:
0131 IMPLICIT NONE
0132
0133 C == Global data ==
0134 #include "SIZE.h"
0135 #include "EEPARAMS.h"
0136
0137 C !INPUT/OUTPUT PARAMETERS:
0138 C == Routine arguments ==
0139 C array :: Array with edges to exchange.
0140 C withSigns :: Flag controlling whether field sign depends on orientation
0141 C :: (signOption not yet implemented but needed for SM exch)
0142 C myOLw,myOLe :: West and East overlap region sizes.
0143 C myOLs,myOLn :: South and North overlap region sizes.
0144 C exchWidthX :: Width of data region exchanged in X.
0145 C exchWidthY :: Width of data region exchanged in Y.
0146 C Note --
0147 C 1. In theory one could have a send width and
0148 C a receive width for each face of each tile. The only
0149 C restriction would be that the send width of one
0150 C face should equal the receive width of the sent to
0151 C tile face. Dont know if this would be useful. I
0152 C have left it out for now as it requires additional
0153 C bookeeping.
0154 C cornerMode :: Flag indicating whether corner updates are needed.
0155 C myThid :: my Thread Id number
0156
0157 INTEGER myOLw, myOLe, myOLs, myOLn, myNz
0158 _RX array( 1-myOLw:sNx+myOLe,
0159 & 1-myOLs:sNy+myOLn,
0160 & myNz, nSx, nSy )
0161 LOGICAL withSigns
0162 INTEGER exchWidthX
0163 INTEGER exchWidthY
0164 INTEGER cornerMode
0165 INTEGER myThid
0166
0167 C !LOCAL VARIABLES:
0168 C == Local variables ==
0169 C theSimulationMode :: Holds working copy of simulation mode
0170 C theCornerMode :: Holds working copy of corner mode
0171 c INTEGER theSimulationMode
0172 c INTEGER theCornerMode
0173 CHARACTER*(MAX_LEN_MBUF) msgBuf
0174 CEOP
0175
0176 c theSimulationMode = REVERSE_SIMULATION
0177 c theCornerMode = cornerMode
0178
0179 c IF ( simulationMode.EQ.REVERSE_SIMULATION ) THEN
0180 WRITE(msgBuf,'(A)') 'ADEXCH1_Z_RX_CUBE: AD mode not implemented'
0181 CALL PRINT_ERROR( msgBuf, myThid )
0182 STOP 'ABNORMAL END: EXCH1_Z_RX_CUBE_AD: no AD code'
0183 c ENDIF
0184
0185 RETURN
0186 END
0187
0188 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
0189 CBOP
0190 C !ROUTINE: EXCH1_UV_RX_CUBE_AD
0191
0192 C !INTERFACE:
0193 #ifdef AUTODIFF_TAMC_COMPATIBILITY
0194 SUBROUTINE EXCH1_UV_RX_CUBE_AD(
0195 I withSigns,
0196 I myOLw, myOLe, myOLs, myOLn, myNz,
0197 I exchWidthX, exchWidthY,
0198 I cornerMode, myThid,
0199 U Uarray, Varray )
0200 #else
0201 SUBROUTINE EXCH1_UV_RX_CUBE_AD(
0202 U Uarray, Varray,
0203 I withSigns,
0204 I myOLw, myOLe, myOLs, myOLn, myNz,
0205 I exchWidthX, exchWidthY,
0206 I cornerMode, myThid )
0207 #endif
0208
0209 C !DESCRIPTION:
0210 C *==========================================================*
0211 C | SUBROUTINE EXCH1_UV_RX_CUBE_AD
0212 C | o Reverse-mode edge exchanges for RX vector on CS config.
0213 C *==========================================================*
0214 C | - not yet coded -
0215 C *==========================================================*
0216
0217 C !USES:
0218 IMPLICIT NONE
0219
0220 C == Global data ==
0221 #include "SIZE.h"
0222 #include "EEPARAMS.h"
0223
0224 C !INPUT/OUTPUT PARAMETERS:
0225 C == Routine arguments ==
0226 C Uarray :: (u-type) Array with edges to exchange.
0227 C Varray :: (v-type) Array with edges to exchange.
0228 C withSigns :: sign of Uarray,Varray depends on orientation
0229 C myOLw,myOLe :: West and East overlap region sizes.
0230 C myOLs,myOLn :: South and North overlap region sizes.
0231 C exchWidthX :: Width of data region exchanged in X.
0232 C exchWidthY :: Width of data region exchanged in Y.
0233 C Note --
0234 C 1. In theory one could have a send width and
0235 C a receive width for each face of each tile. The only
0236 C restriction would be that the send width of one
0237 C face should equal the receive width of the sent to
0238 C tile face. Dont know if this would be useful. I
0239 C have left it out for now as it requires additional
0240 C bookeeping.
0241 C cornerMode :: Flag indicating whether corner updates are needed.
0242 C myThid :: my Thread Id number
0243
0244 INTEGER myOLw, myOLe, myOLs, myOLn, myNz
0245 _RX Uarray( 1-myOLw:sNx+myOLe,
0246 & 1-myOLs:sNy+myOLn,
0247 & myNZ, nSx, nSy )
0248 _RX Varray( 1-myOLw:sNx+myOLe,
0249 & 1-myOLs:sNy+myOLn,
0250 & myNZ, nSx, nSy )
0251 LOGICAL withSigns
0252 INTEGER exchWidthX
0253 INTEGER exchWidthY
0254 INTEGER cornerMode
0255 INTEGER myThid
0256
0257 C !LOCAL VARIABLES:
0258 C == Local variables ==
0259 C theSimulationMode :: Holds working copy of simulation mode
0260 C theCornerMode :: Holds working copy of corner mode
0261 c INTEGER theSimulationMode
0262 c INTEGER theCornerMode
0263 CHARACTER*(MAX_LEN_MBUF) msgBuf
0264 CEOP
0265
0266 c theSimulationMode = REVERSE_SIMULATION
0267 c theCornerMode = cornerMode
0268
0269 c IF ( simulationMode.EQ.REVERSE_SIMULATION ) THEN
0270 WRITE(msgBuf,'(A)') 'ADEXCH1_UV_RX_CUBE: AD mode not implemented'
0271 CALL PRINT_ERROR( msgBuf, myThid )
0272 STOP 'ABNORMAL END: EXCH1_UV_RX_CUBE_AD: no AD code'
0273 c ENDIF
0274
0275 RETURN
0276 END
0277
0278 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
0279 CBOP
0280
0281 C !ROUTINE: EXCH1_BG_RX_CUBE_AD
0282
0283 C !INTERFACE:
0284 #ifdef AUTODIFF_TAMC_COMPATIBILITY
0285 SUBROUTINE EXCH1_BG_RX_CUBE_AD(
0286 I withSigns,
0287 I myOLw, myOLe, myOLs, myOLn, myNz,
0288 I exchWidthX, exchWidthY,
0289 I cornerMode, myThid,
0290 U uField, vField )
0291 #else
0292 SUBROUTINE EXCH1_BG_RX_CUBE_AD(
0293 U uField, vField,
0294 I withSigns,
0295 I myOLw, myOLe, myOLs, myOLn, myNz,
0296 I exchWidthX, exchWidthY,
0297 I cornerMode, myThid )
0298 #endif
0299
0300 C !DESCRIPTION:
0301 C *==========================================================*
0302 C | SUBROUTINE EXCH1_BG_RX_CUBE_AD
0303 C | o Forward-mode edge exchanges for RX vector on CS config:
0304 C | Fill overlap region through tile exchanges,
0305 C | according to CS topology,
0306 C | for a 2-Components B-Grid vector field RX arrays.
0307 C *==========================================================*
0308 C | - not yet coded -
0309 C *==========================================================*
0310
0311 C !USES:
0312 IMPLICIT NONE
0313
0314 C == Global data ==
0315 #include "SIZE.h"
0316 #include "EEPARAMS.h"
0317
0318 C !INPUT/OUTPUT PARAMETERS:
0319 C == Routine arguments ==
0320 C uField :: 1rst component array with overlap to exchange.
0321 C vField :: 2nd component array with overlap to exchange.
0322 C withSigns :: sign of uField,vField depends on orientation.
0323 C myOLw,myOLe :: West and East overlap region sizes.
0324 C myOLs,myOLn :: South and North overlap region sizes.
0325 C exchWidthX :: Width of data region exchanged in X.
0326 C exchWidthY :: Width of data region exchanged in Y.
0327 C Note --
0328 C 1. In theory one could have a send width and
0329 C a receive width for each face of each tile. The only
0330 C restriction would be that the send width of one
0331 C face should equal the receive width of the sent to
0332 C tile face. Dont know if this would be useful. I
0333 C have left it out for now as it requires additional
0334 C bookeeping.
0335 C cornerMode :: Flag indicating whether corner updates are needed.
0336 C myThid :: my Thread Id number
0337
0338 INTEGER myOLw, myOLe, myOLs, myOLn, myNz
0339 _RX uField( 1-myOLw:sNx+myOLe, 1-myOLs:sNy+myOLn,
0340 & myNz, nSx, nSy )
0341 _RX vField( 1-myOLw:sNx+myOLe, 1-myOLs:sNy+myOLn,
0342 & myNz, nSx, nSy )
0343 LOGICAL withSigns
0344 INTEGER exchWidthX
0345 INTEGER exchWidthY
0346 INTEGER cornerMode
0347 INTEGER myThid
0348
0349 C !LOCAL VARIABLES:
0350 C == Local variables ==
0351 C theSimulationMode :: Holds working copy of simulation mode
0352 C theCornerMode :: Holds working copy of corner mode
0353 c INTEGER theSimulationMode
0354 c INTEGER theCornerMode
0355 CHARACTER*(MAX_LEN_MBUF) msgBuf
0356 CEOP
0357
0358 c theSimulationMode = REVERSE_SIMULATION
0359 c theCornerMode = cornerMode
0360
0361 c IF ( simulationMode.EQ.REVERSE_SIMULATION ) THEN
0362 WRITE(msgBuf,'(A)') 'ADEXCH1_BG_RX_CUBE: AD mode not implemented'
0363 CALL PRINT_ERROR( msgBuf, myThid )
0364 STOP 'ABNORMAL END: EXCH1_BG_RX_CUBE_AD: no AD code'
0365 c ENDIF
0366
0367 RETURN
0368 END