File indexing completed on 2021-04-29 05:11:42 UTC
view on githubraw file Latest commit 2132daf4 on 2021-04-24 15:29:56 UTC
7b4413ef94 Jean*0001 #include "GAD_OPTIONS.h"
0002
0003
0004
0005
ec0db5c1b3 Jean*0006 SUBROUTINE GAD_FLUXLIMIT_IMPL_R(
0007 I bi,bj,k, iMin,iMax,jMin,jMax,
0008 I deltaTarg, rTrans, recip_hFac, tFld,
7b4413ef94 Jean*0009 O a3d, b3d, c3d,
0010 I myThid )
0011
1b5fb69d21 Ed H*0012
0013
381eb13d88 Jean*0014
0015
ec0db5c1b3 Jean*0016
381eb13d88 Jean*0017
7b4413ef94 Jean*0018
0019
0020 IMPLICIT NONE
0021
0022
0023 #include "SIZE.h"
0024 #include "GRID.h"
0025 #include "EEPARAMS.h"
0026 #include "PARAMS.h"
0027
0028
0029
2132daf4a7 Jean*0030
1b5fb69d21 Ed H*0031
2132daf4a7 Jean*0032
0033
1b5fb69d21 Ed H*0034
0035
ec0db5c1b3 Jean*0036
1b5fb69d21 Ed H*0037
ec0db5c1b3 Jean*0038
0039
0040
1b5fb69d21 Ed H*0041
7b4413ef94 Jean*0042 INTEGER bi,bj,k
0043 INTEGER iMin,iMax,jMin,jMax
ec0db5c1b3 Jean*0044 _RL deltaTarg(Nr)
0045 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0046 _RS recip_hFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0047 _RL tFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0048 _RL a3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0049 _RL b3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0050 _RL c3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
7b4413ef94 Jean*0051 INTEGER myThid
0052
0053
2132daf4a7 Jean*0054
1b5fb69d21 Ed H*0055
0056
0057
0058
2132daf4a7 Jean*0059
1b5fb69d21 Ed H*0060
0061
0062
0063
2132daf4a7 Jean*0064 INTEGER i, j, kp1, km1, km2
0065 _RL Cr, Rjm, Rj, Rjp, w_CFL
7b4413ef94 Jean*0066 _RL upwindFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0067 _RL rCenter, rUpwind
9de7a55d87 Jean*0068 _RL deltaTcfl
2132daf4a7 Jean*0069 _RL CrMax
0070 PARAMETER( CrMax = 1.D+6 )
7b4413ef94 Jean*0071
0072
0073 #include "GAD_FLUX_LIMITER.h"
0074
0075
2132daf4a7 Jean*0076 km2 = MAX(1,k-2)
0077 km1 = MAX(1,k-1)
0078 kp1 = MIN(Nr,k+1)
7b4413ef94 Jean*0079
9de7a55d87 Jean*0080
0081 IF ( k.GT.1 .AND. k.LE.Nr ) THEN
7b4413ef94 Jean*0082
0083
9de7a55d87 Jean*0084 deltaTcfl = deltaTarg(k)
7b4413ef94 Jean*0085 DO j=jMin,jMax
0086 DO i=iMin,iMax
9de7a55d87 Jean*0087 w_CFL = deltaTcfl*rTrans(i,j)*recip_rA(i,j,bi,bj)*recip_drC(k)
a7ec469280 Jean*0088 & *recip_deepFac2F(k)*recip_rhoFacF(k)
2132daf4a7 Jean*0089 Rjp = (tFld(i,j,kp1)-tFld(i,j,k) )*maskC(i,j,kp1,bi,bj)
0090 Rj = (tFld(i,j,k) -tFld(i,j,km1))
0091 Rjm = (tFld(i,j,km1)-tFld(i,j,km2))*maskC(i,j,km2,bi,bj)
7b4413ef94 Jean*0092
2132daf4a7 Jean*0093 IF ( rTrans(i,j).LT.zeroRL ) THEN
0094 Cr = Rjm
7b4413ef94 Jean*0095 ELSE
2132daf4a7 Jean*0096 Cr = Rjp
7b4413ef94 Jean*0097 ENDIF
2132daf4a7 Jean*0098 IF ( ABS(Rj)*CrMax .LE. ABS(Cr) ) THEN
0099 Cr = SIGN( CrMax, Cr )*SIGN( oneRL, Rj )
0100 ELSE
0101 Cr = Cr/Rj
0102 ENDIF
0103
0104
0105 upwindFac(i,j) = 1. _d 0
0106 & - Limiter(Cr) * ( 1. _d 0 + ABS(w_CFL) )
0107 upwindFac(i,j) = MAX( -1. _d 0, upwindFac(i,j) )
7b4413ef94 Jean*0108 ENDDO
0109 ENDDO
0110
0111
0112 DO j=jMin,jMax
0113 DO i=iMin,iMax
bb6c554092 Jean*0114 rCenter = 0.5 _d 0 *rTrans(i,j)*recip_rA(i,j,bi,bj)*rkSign
0115 rUpwind = ABS(rCenter)*upwindFac(i,j)
7b4413ef94 Jean*0116 a3d(i,j,k) = a3d(i,j,k)
bb6c554092 Jean*0117 & - (rCenter+rUpwind)*deltaTarg(k)
ec0db5c1b3 Jean*0118 & *recip_hFac(i,j,k)*recip_drF(k)
a7ec469280 Jean*0119 & *recip_deepFac2C(k)*recip_rhoFacC(k)
7b4413ef94 Jean*0120 b3d(i,j,k) = b3d(i,j,k)
bb6c554092 Jean*0121 & - (rCenter-rUpwind)*deltaTarg(k)
ec0db5c1b3 Jean*0122 & *recip_hFac(i,j,k)*recip_drF(k)
a7ec469280 Jean*0123 & *recip_deepFac2C(k)*recip_rhoFacC(k)
7b4413ef94 Jean*0124 b3d(i,j,k-1) = b3d(i,j,k-1)
bb6c554092 Jean*0125 & + (rCenter+rUpwind)*deltaTarg(k-1)
ec0db5c1b3 Jean*0126 & *recip_hFac(i,j,k-1)*recip_drF(k-1)
a7ec469280 Jean*0127 & *recip_deepFac2C(k-1)*recip_rhoFacC(k-1)
7b4413ef94 Jean*0128 c3d(i,j,k-1) = c3d(i,j,k-1)
bb6c554092 Jean*0129 & + (rCenter-rUpwind)*deltaTarg(k-1)
ec0db5c1b3 Jean*0130 & *recip_hFac(i,j,k-1)*recip_drF(k-1)
a7ec469280 Jean*0131 & *recip_deepFac2C(k-1)*recip_rhoFacC(k-1)
7b4413ef94 Jean*0132 ENDDO
0133 ENDDO
0134
9de7a55d87 Jean*0135
0136 ENDIF
0137
7b4413ef94 Jean*0138 RETURN
0139 END