7 |
C !ROUTINE: GAD_FLUXLIMIT_ADV_Y |
C !ROUTINE: GAD_FLUXLIMIT_ADV_Y |
8 |
|
|
9 |
C !INTERFACE: ========================================================== |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE GAD_FLUXLIMIT_ADV_Y( |
SUBROUTINE GAD_FLUXLIMIT_ADV_Y( |
11 |
I bi,bj,k,deltaT, |
I bi,bj,k, calcCFL, deltaTloc, |
12 |
I vTrans, vVel, |
I vTrans, vFld, |
13 |
I tracer, |
I maskLocS, tracer, |
14 |
O vT, |
O vT, |
15 |
I myThid ) |
I myThid ) |
16 |
|
|
33 |
#include "GRID.h" |
#include "GRID.h" |
34 |
|
|
35 |
C !INPUT PARAMETERS: =================================================== |
C !INPUT PARAMETERS: =================================================== |
36 |
C bi,bj :: tile indices |
C bi,bj :: tile indices |
37 |
C k :: vertical level |
C k :: vertical level |
38 |
C vTrans :: meridional volume transport |
C calcCFL :: =T: calculate CFL number ; =F: take vFld as CFL |
39 |
C vVel :: meridional flow |
C deltaTloc :: local time-step (s) |
40 |
C tracer :: tracer field |
C vTrans :: meridional volume transport |
41 |
C myThid :: thread number |
C vFld :: meridional flow / CFL number |
42 |
|
C tracer :: tracer field |
43 |
|
C myThid :: thread number |
44 |
INTEGER bi,bj,k |
INTEGER bi,bj,k |
45 |
_RL deltaT |
LOGICAL calcCFL |
46 |
|
_RL deltaTloc |
47 |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
48 |
_RL vVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
49 |
|
_RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
50 |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
51 |
INTEGER myThid |
INTEGER myThid |
52 |
|
|
53 |
C !OUTPUT PARAMETERS: ================================================== |
C !OUTPUT PARAMETERS: ================================================== |
54 |
C vT :: meridional advective flux |
C vT :: meridional advective flux |
55 |
_RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
56 |
|
|
57 |
C !LOCAL VARIABLES: ==================================================== |
C !LOCAL VARIABLES: ==================================================== |
58 |
C i,j :: loop indices |
C i,j :: loop indices |
59 |
C Cr :: slope ratio |
C Cr :: slope ratio |
60 |
C Rjm,Rj,Rjp :: differences at j-1,j,j+1 |
C Rjm,Rj,Rjp :: differences at j-1,j,j+1 |
|
C vFld :: velocity [m/s], meridional component |
|
61 |
INTEGER i,j |
INTEGER i,j |
62 |
_RL Cr,Rjm,Rj,Rjp |
_RL Cr,Rjm,Rj,Rjp |
63 |
_RL vFld |
_RL vCFL |
64 |
C Statement function provides Limiter(Cr) |
C Statement function provides Limiter(Cr) |
65 |
#include "GAD_FLUX_LIMITER.h" |
#include "GAD_FLUX_LIMITER.h" |
66 |
CEOP |
CEOP |
73 |
DO j=1-Oly+2,sNy+Oly-1 |
DO j=1-Oly+2,sNy+Oly-1 |
74 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
75 |
|
|
76 |
c vFld = vVel(i,j,k,bi,bj) |
vCFL = vFld(i,j) |
77 |
vFld = vTrans(i,j)*recip_dxG(i,j,bi,bj) |
IF ( calcCFL ) vCFL = ABS( vFld(i,j)*deltaTloc |
78 |
& *recip_drF(k)*recip_hFacS(i,j,k,bi,bj) |
& *recip_dyC(i,j,bi,bj)*recip_deepFacC(k) ) |
79 |
Rjp=(tracer(i,j+1)-tracer(i,j))*maskS(i,j+1,k,bi,bj) |
Rjp=(tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1) |
80 |
Rj=(tracer(i,j)-tracer(i,j-1))*maskS(i,j,k,bi,bj) |
Rj =(tracer(i, j )-tracer(i,j-1))*maskLocS(i, j ) |
81 |
Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskS(i,j-1,k,bi,bj) |
Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1) |
82 |
|
|
83 |
IF (Rj.NE.0.) THEN |
IF (Rj.NE.0.) THEN |
84 |
IF (vTrans(i,j).GT.0) THEN |
IF (vTrans(i,j).GT.0) THEN |
94 |
ENDIF |
ENDIF |
95 |
ENDIF |
ENDIF |
96 |
Cr=Limiter(Cr) |
Cr=Limiter(Cr) |
97 |
vT(i,j) = |
vT(i,j) = |
98 |
& vTrans(i,j)*(Tracer(i,j)+Tracer(i,j-1))*0.5 _d 0 |
& vTrans(i,j)*(Tracer(i,j)+Tracer(i,j-1))*0.5 _d 0 |
99 |
& -0.5*( |
& -ABS(vTrans(i,j))*((1.-Cr)+vCFL*Cr) |
100 |
& (1-Cr)*ABS(vTrans(i,j)) |
& *Rj*0.5 _d 0 |
|
& +vTrans(i,j)*vFld*deltaT |
|
|
& *recip_dyC(i,j,bi,bj)*Cr |
|
|
& )*Rj |
|
101 |
ENDDO |
ENDDO |
102 |
ENDDO |
ENDDO |
103 |
|
|