Newer
Older

WAUTELET Philippe
committed
#else

WAUTELET Philippe
committed
JIJKOR = 1 + 1
JIJKEND = IIU*IJU*IKU
!
!$acc kernels present(PA,PDXM)
!CDIR NODEP
!OCL NOVREC
DO JIJK=JIJKOR , JIJKEND
PDXM(JIJK,1,1) = PA(JIJK,1,1) - PA(JIJK-1,1,1)
END DO
!
!CDIR NODEP
!OCL NOVREC
DO JJK=1,IJU*IKU
PDXM(1,JJK,1) = PDXM(IIU-2*JPHEXT+1,JJK,1)
END DO
!$acc end kernels

WAUTELET Philippe
committed
#endif

WAUTELET Philippe
committed
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
!
!-------------------------------------------------------------------------------
!
END SUBROUTINE DXM_DEVICE
!
! ###############################
SUBROUTINE DYF_DEVICE(PA,PDYF)
! ###############################
!
!!**** *DYF* - Shuman operator : finite difference operator in y direction
!! for a variable at a flux side
!!
!! PURPOSE
!! -------
! The purpose of this function is to compute a finite difference
! along the y direction (J index) for a field PA localized at a y-flux
! point (v point). The result is localized at a mass point.
!
!!** METHOD
!! ------
!! The result PDYF(:,j,:) is defined by (PA(:,j+1,:)-PA(:,j,:))
!! At j=size(PA,2), PDYF(:,j,:) are replaced by the values of PDYM,
!! which are the right values in the y-cyclic case
!!
!!
!! EXTERNAL
!! --------
!! NONE
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!! Module MODD_PARAMETERS: declaration of parameter variables
!! JPHEXT: define the number of marginal points out of the
!! physical domain along the horizontal directions.
!!
!! REFERENCE
!! ---------
!! Book2 of documentation of Meso-NH (SHUMAN operators)
!! Technical specifications Report of The Meso-NH (chapters 3)
!!
!!
!! AUTHOR
!! ------
!! V. Ducrocq * Meteo France *
!!
!! MODIFICATIONS
!! -------------
!! Original 05/07/94
!! Modification to include the periodic case 13/10/94 J.Stein
!! optimisation 20/08/00 J. Escobar
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_PARAMETERS
!
IMPLICIT NONE
!
!* 0.1 Declarations of argument and result
! ------------------------------------
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PA ! variable at flux side
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDYF ! result at mass localization
!$acc declare present(PA,PDYF)
!
!* 0.2 Declarations of local variables
! -------------------------------
!

WAUTELET Philippe
committed
INTEGER :: JI, JJ, JK ! Loop indices
INTEGER :: IIU, IJU, IKU ! upper bounds of PA

WAUTELET Philippe
committed
!

WAUTELET Philippe
committed
#ifdef _OPT_LINEARIZED_LOOPS

WAUTELET Philippe
committed
INTEGER :: JIJK,JIJKOR,JIJKEND

WAUTELET Philippe
committed
#endif

WAUTELET Philippe
committed
!
!-------------------------------------------------------------------------------
!
!* 1. DEFINITION OF DYF
! ------------------
!
IIU = SIZE(PA,1)
IJU = SIZE(PA,2)
IKU = SIZE(PA,3)
!

WAUTELET Philippe
committed
#ifndef _OPT_LINEARIZED_LOOPS
!$acc kernels present(PA,PDYF)
DO JK=1,IKU
DO JJ=1,IJU-1 !TODO: remplacer le 1 par JPHEXT ?
DO JI=1,IIU
PDYF(JI,JJ,JK) = PA(JI,JJ+1,JK) - PA(JI,JJ,JK)
END DO
END DO
END DO
!
PDYF(:,IJU,:) = PDYF(:,2*JPHEXT,:)
!$acc end kernels
#else

WAUTELET Philippe
committed
JIJKOR = 1 + IIU
JIJKEND = IIU*IJU*IKU
!
!$acc kernels present(PA,PDYF)
!CDIR NODEP
!OCL NOVREC
DO JIJK=JIJKOR , JIJKEND
PDYF(JIJK-IIU,1,1) = PA(JIJK,1,1) - PA(JIJK-IIU,1,1)
END DO
!
PDYF(:,IJU,:) = PDYF(:,2*JPHEXT,:)
!$acc end kernels

WAUTELET Philippe
committed
#endif

WAUTELET Philippe
committed
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
!
!-------------------------------------------------------------------------------
!
END SUBROUTINE DYF_DEVICE
!
! ###############################
SUBROUTINE DYM_DEVICE(PA,PDYM)
! ###############################
!
!!**** *DYM* - Shuman operator : finite difference operator in y direction
!! for a variable at a mass localization
!!
!! PURPOSE
!! -------
! The purpose of this function is to compute a finite difference
! along the y direction (J index) for a field PA localized at a mass
! point. The result is localized at a y-flux point (v point).
!
!!** METHOD
!! ------
!! The result PDYM(:,j,:) is defined by (PA(:,j,:)-PA(:,j-1,:))
!! At j=1, PDYM(:,1,:) are replaced by the values of PDYM,
!! which are the right values in the y-cyclic case.
!!
!!
!! EXTERNAL
!! --------
!! NONE
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!! Module MODD_PARAMETERS: declaration of parameter variables
!! JPHEXT: define the number of marginal points out of the
!! physical domain along the horizontal directions.
!!
!! REFERENCE
!! ---------
!! Book2 of documentation of Meso-NH (SHUMAN operators)
!! Technical specifications Report of The Meso-NH (chapters 3)
!!
!!
!! AUTHOR
!! ------
!! V. Ducrocq * Meteo France *
!!
!! MODIFICATIONS
!! -------------
!! Original 05/07/94
!! Modification to include the periodic case 13/10/94 J.Stein
!! optimisation 20/08/00 J. Escobar
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_PARAMETERS
!
IMPLICIT NONE
!
!* 0.1 Declarations of argument and result
! ------------------------------------
!
REAL, DIMENSION(:,:,:), INTENT(IN) :: PA ! variable at mass localization
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDYM ! result at flux side
!$acc declare present(PA,PDYM)
!
!* 0.2 Declarations of local variables
! -------------------------------
!

WAUTELET Philippe
committed
INTEGER :: JI, JJ, JK ! Loop indices
INTEGER :: IIU, IJU, IKU ! upper bounds of PA

WAUTELET Philippe
committed
!

WAUTELET Philippe
committed
#ifdef _OPT_LINEARIZED_LOOPS

WAUTELET Philippe
committed
INTEGER :: JIJK,JIJKOR,JIJKEND

WAUTELET Philippe
committed
#endif

WAUTELET Philippe
committed
!
!-------------------------------------------------------------------------------
!
!* 1. DEFINITION OF DYM
! ------------------
!
IIU=SIZE(PA,1)
IJU=SIZE(PA,2)
IKU=SIZE(PA,3)
!

WAUTELET Philippe
committed
#ifndef _OPT_LINEARIZED_LOOPS
!$acc kernels present(PA,PDYM)
DO JK=1,IKU
DO JJ=2,IJU !TODO: remplacer le 2 par JPHEXT+1 ?
DO JI=1,IIU
PDYM(JI,JJ,JK) = PA(JI,JJ,JK) - PA(JI,JJ-1,JK)
END DO
END DO
END DO
!
PDYM(:,1,:) = PDYM(:,IJU-2*JPHEXT+1,:)
!$acc end kernels
#else

WAUTELET Philippe
committed
JIJKOR = 1 + IIU
JIJKEND = IIU*IJU*IKU
!
!$acc kernels present(PA,PDYM)
!CDIR NODEP
!OCL NOVREC
DO JIJK=JIJKOR , JIJKEND
PDYM(JIJK,1,1) = PA(JIJK,1,1) - PA(JIJK-IIU,1,1)
END DO
!
PDYM(:,1,:) = PDYM(:,IJU-2*JPHEXT+1,:)
!$acc end kernels

WAUTELET Philippe
committed
#endif

WAUTELET Philippe
committed
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
!
!
!-------------------------------------------------------------------------------
!
END SUBROUTINE DYM_DEVICE
!
! ###############################
SUBROUTINE DZF_DEVICE(KKA,KKU,KL,PA,PDZF)
! ###############################
!
!!**** *DZF* - Shuman operator : finite difference operator in z direction
!! for a variable at a flux side
!!
!! PURPOSE
!! -------
! The purpose of this function is to compute a finite difference
! along the z direction (K index) for a field PA localized at a z-flux
! point (w point). The result is localized at a mass point.
!
!!** METHOD
!! ------
!! The result PDZF(:,:,k) is defined by (PA(:,:,k+1)-PA(:,:,k))
!! At k=size(PA,3), PDZF(:,:,k) is defined by -999.
!!
!!
!! EXTERNAL
!! --------
!! NONE
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!! NONE
!!
!! REFERENCE
!! ---------
!! Book2 of documentation of Meso-NH (SHUMAN operators)
!! Technical specifications Report of The Meso-NH (chapters 3)
!!
!!
!! AUTHOR
!! ------
!! V. Ducrocq * Meteo France *
!!
!! MODIFICATIONS
!! -------------
!! Original 05/07/94
!! optimisation 20/08/00 J. Escobar
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
IMPLICIT NONE
!
!* 0.1 Declarations of argument and result
! ------------------------------------
!
INTEGER, INTENT(IN) :: KKA, KKU ! near ground and uppest atmosphere array indexes
INTEGER, INTENT(IN) :: KL ! +1 if grid goes from ground to atmosphere top, -1 otherwise
REAL, DIMENSION(:,:,:), INTENT(IN) :: PA ! variable at flux side
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDZF ! result at mass localization
!$acc declare present(PA,PDZF)
!
!* 0.2 Declarations of local variables
! -------------------------------
!

WAUTELET Philippe
committed
INTEGER :: JI, JJ, JK ! Loop indices
INTEGER :: IIU, IJU, IKU ! upper bounds of PA

WAUTELET Philippe
committed
!

WAUTELET Philippe
committed
#ifdef _OPT_LINEARIZED_LOOPS

WAUTELET Philippe
committed
INTEGER :: JIJ
INTEGER :: JIJK,JIJKOR,JIJKEND

WAUTELET Philippe
committed
#endif

WAUTELET Philippe
committed
!
!-------------------------------------------------------------------------------
!
!* 1. DEFINITION OF DZF
! ------------------
!
IIU = SIZE(PA,1)
IJU = SIZE(PA,2)
IKU = SIZE(PA,3)
!

WAUTELET Philippe
committed
#ifndef _OPT_LINEARIZED_LOOPS
!$acc kernels present(PA,PDZF)
DO JK=1,IKU-1 !TODO: remplacer le 1 par JPHEXT ?
DO JJ=1,IJU
DO JI=1,IIU
PDZF(JI,JJ,JK) = PA(JI,JJ,JK+1)-PA(JI,JJ,JK)
END DO
END DO
END DO
!
PDZF(:,:,IKU) = -999.
!$acc end kernels
#else

WAUTELET Philippe
committed
JIJKOR = 1 + IIU*IJU
JIJKEND = IIU*IJU*IKU
!
!$acc kernels present(PA,PDZF)
!CDIR NODEP
!OCL NOVREC
DO JIJK=JIJKOR , JIJKEND
PDZF(JIJK-IIU*IJU,1,1) = PA(JIJK,1,1)-PA(JIJK-IIU*IJU,1,1)
END DO
!
!CDIR NODEP
!OCL NOVREC
DO JIJ=1,IIU*IJU
PDZF(JIJ,1,IKU) = -999.
END DO
!$acc end kernels

WAUTELET Philippe
committed
#endif

WAUTELET Philippe
committed
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
!
!-------------------------------------------------------------------------------
!
END SUBROUTINE DZF_DEVICE
!
! ###############################
SUBROUTINE DZM_DEVICE(KKA,KKU,KL,PA,PDZM)
! ###############################
!
!!**** *DZM* - Shuman operator : finite difference operator in z direction
!! for a variable at a mass localization
!!
!! PURPOSE
!! -------
! The purpose of this function is to compute a finite difference
! along the z direction (K index) for a field PA localized at a mass
! point. The result is localized at a z-flux point (w point).
!
!!** METHOD
!! ------
!! The result PDZM(:,j,:) is defined by (PA(:,:,k)-PA(:,:,k-1))
!! At k=1, PDZM(:,:,k) is defined by -999.
!!
!!
!! EXTERNAL
!! --------
!! NONE
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!! NONE
!!
!! REFERENCE
!! ---------
!! Book2 of documentation of Meso-NH (SHUMAN operators)
!! Technical specifications Report of The Meso-NH (chapters 3)
!!
!!
!! AUTHOR
!! ------
!! V. Ducrocq * Meteo France *
!!
!! MODIFICATIONS
!! -------------
!! Original 05/07/94
!! optimisation 20/08/00 J. Escobar
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
IMPLICIT NONE
!
!* 0.1 Declarations of argument and result
! ------------------------------------
!
INTEGER, INTENT(IN) :: KKA, KKU ! near ground and uppest atmosphere array indexes
INTEGER, INTENT(IN) :: KL ! +1 if grid goes from ground to atmosphere top, -1 otherwise
REAL, DIMENSION(:,:,:), INTENT(IN) :: PA ! variable at mass localization
REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDZM ! result at flux side
!$acc declare present(PA,PDZM)
!
!* 0.2 Declarations of local variables
! -------------------------------
!

WAUTELET Philippe
committed
INTEGER :: JI, JJ, JK ! Loop indices
INTEGER :: IIU, IJU, IKU ! upper bounds of PA

WAUTELET Philippe
committed
!

WAUTELET Philippe
committed
#ifdef _OPT_LINEARIZED_LOOPS

WAUTELET Philippe
committed
INTEGER :: JIJ
INTEGER :: JIJK,JIJKOR,JIJKEND

WAUTELET Philippe
committed
#endif

WAUTELET Philippe
committed
!
!-------------------------------------------------------------------------------
!
!* 1. DEFINITION OF DZM
! ------------------
!
IIU = SIZE(PA,1)
IJU = SIZE(PA,2)
IKU = SIZE(PA,3)
!

WAUTELET Philippe
committed
#ifndef _OPT_LINEARIZED_LOOPS
!$acc kernels present(PA,PDZM)
DO JK=2,IKU !TODO: remplacer le 1+1 par 1+JPHEXT ?
DO JJ=1,IJU
DO JI=1,IIU
PDZM(JI,JJ,JK) = PA(JI,JJ,JK) - PA(JI,JJ,JK-1)
END DO
END DO
END DO
!
PDZM(:,:,1) = -999.
!$acc end kernels
#else

WAUTELET Philippe
committed
JIJKOR = 1 + IIU*IJU
JIJKEND = IIU*IJU*IKU
!
!$acc kernels present(PA,PDZM)
!CDIR NODEP
!OCL NOVREC

WAUTELET Philippe
committed
DO JIJK=JIJKOR , JIJKEND
PDZM(JIJK,1,1) = PA(JIJK,1,1)-PA(JIJK-IIU*IJU,1,1)
END DO

WAUTELET Philippe
committed
!
!CDIR NODEP
!OCL NOVREC

WAUTELET Philippe
committed
DO JIJ=1,IIU*IJU
PDZM(JIJ,1,1) = -999.
END DO
#endif

WAUTELET Philippe
committed
!
!-------------------------------------------------------------------------------
!
END SUBROUTINE DZM_DEVICE