File indexing completed on 2018-03-02 18:40:55 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
31566b6684 Alis*0001 #include "GAD_OPTIONS.h"
0002
527a84022c Alis*0003
0004
0005
0006
e9de1d7682 Jean*0007 SUBROUTINE GAD_C4_ADV_R(
0008 I bi, bj, k,
31566b6684 Alis*0009 I rTrans,
0010 I tracer,
0011 O wT,
0012 I myThid )
0013
527a84022c Alis*0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 IMPLICIT NONE
31566b6684 Alis*0026 #include "SIZE.h"
0027 #include "GRID.h"
0028 #include "GAD.h"
0029
527a84022c Alis*0030
0031
0032
0033
0034
0035
31566b6684 Alis*0036 INTEGER bi,bj,k
0037 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
e9de1d7682 Jean*0038 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
31566b6684 Alis*0039 INTEGER myThid
0040
527a84022c Alis*0041
0042
0043 _RL wT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0044
0045
0046
0047
0048
0049
0050
0051
0052
31566b6684 Alis*0053 INTEGER i,j,kp1,km1,km2
8a37624a25 Jean*0054 _RL Rjm,Rj,Rjp,Rjjm,Rjjp
5d63e10665 Jean*0055 _RL maskPM, maskBound
527a84022c Alis*0056
31566b6684 Alis*0057
0058 km2=MAX(1,k-2)
0059 km1=MAX(1,k-1)
0060 kp1=MIN(Nr,k+1)
5d63e10665 Jean*0061 maskPM = 1.
0062 IF (k.LE.2 .OR. k.GE.Nr) maskPM = 0.
31566b6684 Alis*0063
ab2f187c7d Jean*0064 IF ( k.EQ.1 .OR. k.GT.Nr) THEN
e9de1d7682 Jean*0065 DO j=1-OLy,sNy+OLy
0066 DO i=1-OLx,sNx+OLx
31566b6684 Alis*0067 wT(i,j) = 0.
0068 ENDDO
0069 ENDDO
0070 ELSE
e9de1d7682 Jean*0071 DO j=1-OLy,sNy+OLy
0072 DO i=1-OLx,sNx+OLx
5d63e10665 Jean*0073 maskBound = maskPM*maskC(i,j,km2,bi,bj)*maskC(i,j,kp1,bi,bj)
e9de1d7682 Jean*0074 Rjp = (tracer(i,j,kp1)-tracer(i,j, k ))*maskC(i,j,kp1,bi,bj)
0075 Rj = (tracer(i,j, k )-tracer(i,j,km1))
0076 Rjm = (tracer(i,j,km1)-tracer(i,j,km2))*maskC(i,j,km1,bi,bj)
0077 &
5d63e10665 Jean*0078 Rjjp=(Rjp-Rj)
0079 Rjjm=(Rj-Rjm)
8a37624a25 Jean*0080 wT(i,j) = maskC(i,j,km1,bi,bj)*(
e9de1d7682 Jean*0081 & rTrans(i,j)*( (tracer(i,j,k)+tracer(i,j,km1))*0.5 _d 0
0082 & -oneSixth*(Rjjm+Rjjp)*0.5 _d 0 )
8a37624a25 Jean*0083 & +ABS(rTrans(i,j))*
e9de1d7682 Jean*0084 & oneSixth*(Rjjm-Rjjp)*0.5 _d 0
0085 & *(1. _d 0 - maskBound)
0086 & )
31566b6684 Alis*0087 ENDDO
0088 ENDDO
0089 ENDIF
0090
0091 RETURN
0092 END