3 |
|
|
4 |
#include "GAD_OPTIONS.h" |
#include "GAD_OPTIONS.h" |
5 |
|
|
6 |
SUBROUTINE GAD_FLUXLIMIT_ADV_X( |
CBOP |
7 |
I bi,bj,k,deltaT, |
C !ROUTINE: GAD_FLUXLIMIT_ADV_X |
8 |
I uTrans, uVel, |
|
9 |
I tracer, |
C !INTERFACE: ========================================================== |
10 |
|
SUBROUTINE GAD_FLUXLIMIT_ADV_X( |
11 |
|
I bi,bj,k,deltaTloc, |
12 |
|
I uTrans, uFld, |
13 |
|
I maskLocW, tracer, |
14 |
O uT, |
O uT, |
15 |
I myThid ) |
I myThid ) |
|
C /==========================================================\ |
|
|
C | SUBROUTINE GAD_FLUXLIMIT_ADV_X | |
|
|
C | o Compute Zonal advective Flux of Tracer using | |
|
|
C | Flux Limiter Scheme | |
|
|
C |==========================================================| |
|
|
IMPLICIT NONE |
|
16 |
|
|
17 |
C == GLobal variables == |
C !DESCRIPTION: |
18 |
|
C Calculates the area integrated zonal flux due to advection of a tracer |
19 |
|
C using second-order interpolation with a flux limiter: |
20 |
|
C \begin{equation*} |
21 |
|
C F^x_{adv} = U \overline{ \theta }^i |
22 |
|
C - \frac{1}{2} \left( |
23 |
|
C [ 1 - \psi(C_r) ] |U| |
24 |
|
C + U \frac{u \Delta t}{\Delta x_c} \psi(C_r) |
25 |
|
C \right) \delta_i \theta |
26 |
|
C \end{equation*} |
27 |
|
C where the $\psi(C_r)$ is the limiter function and $C_r$ is |
28 |
|
C the slope ratio. |
29 |
|
|
30 |
|
C !USES: =============================================================== |
31 |
|
IMPLICIT NONE |
32 |
#include "SIZE.h" |
#include "SIZE.h" |
33 |
#include "GRID.h" |
#include "GRID.h" |
34 |
|
|
35 |
C == Routine arguments == |
C !INPUT PARAMETERS: =================================================== |
36 |
|
C bi,bj :: tile indices |
37 |
|
C k :: vertical level |
38 |
|
C uTrans :: zonal volume transport |
39 |
|
C uFld :: zonal flow |
40 |
|
C tracer :: tracer field |
41 |
|
C myThid :: thread number |
42 |
INTEGER bi,bj,k |
INTEGER bi,bj,k |
43 |
_RL deltaT |
_RL deltaTloc |
44 |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
45 |
_RL uVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL uFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
46 |
|
_RS maskLocW(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
47 |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
48 |
INTEGER myThid |
INTEGER myThid |
49 |
|
|
50 |
C == Local variables == |
C !OUTPUT PARAMETERS: ================================================== |
51 |
|
C uT :: zonal advective flux |
52 |
|
_RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
53 |
|
|
54 |
|
C !LOCAL VARIABLES: ==================================================== |
55 |
|
C i,j :: loop indices |
56 |
|
C Cr :: slope ratio |
57 |
|
C Rjm,Rj,Rjp :: differences at i-1,i,i+1 |
58 |
|
C uLoc :: velocity [m/s], zonal component |
59 |
INTEGER i,j |
INTEGER i,j |
60 |
_RL Cr,Rjm,Rj,Rjp |
_RL Cr,Rjm,Rj,Rjp |
61 |
|
_RL uLoc, uCFL |
62 |
|
C Statement function provides Limiter(Cr) |
63 |
#include "GAD_FLUX_LIMITER.h" |
#include "GAD_FLUX_LIMITER.h" |
64 |
|
CEOP |
65 |
|
|
66 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
67 |
uT(1-Olx,j)=0. |
uT(1-Olx,j)=0. |
68 |
uT(2-Olx,j)=0. |
uT(2-Olx,j)=0. |
69 |
uT(sNx+Olx,j)=0. |
uT(sNx+Olx,j)=0. |
70 |
DO i=1-Olx+2,sNx+Olx-1 |
DO i=1-Olx+2,sNx+Olx-1 |
71 |
Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj) |
|
72 |
Rj=(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj) |
uLoc = uFld(i,j) |
73 |
Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj) |
uCFL = ABS( uLoc*deltaTloc |
74 |
|
& *recip_dxC(i,j,bi,bj)*recip_deepFacC(k) ) |
75 |
|
Rjp=(tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j) |
76 |
|
Rj =(tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j) |
77 |
|
Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskLocW(i-1,j) |
78 |
|
|
79 |
IF (Rj.NE.0.) THEN |
IF (Rj.NE.0.) THEN |
80 |
IF (uTrans(i,j).GT.0) THEN |
IF (uTrans(i,j).GT.0) THEN |
81 |
Cr=Rjm/Rj |
Cr=Rjm/Rj |
90 |
ENDIF |
ENDIF |
91 |
ENDIF |
ENDIF |
92 |
Cr=Limiter(Cr) |
Cr=Limiter(Cr) |
93 |
uT(i,j) = |
uT(i,j) = |
94 |
& uTrans(i,j)*(Tracer(i,j)+Tracer(i-1,j))*0.5 _d 0 |
& uTrans(i,j)*(Tracer(i,j)+Tracer(i-1,j))*0.5 _d 0 |
95 |
& -0.5*( |
& -ABS(uTrans(i,j))*((1.-Cr)+uCFL*Cr) |
96 |
& (1-Cr)*ABS(uTrans(i,j)) |
& *Rj*0.5 _d 0 |
|
& +uTrans(i,j)*uVel(i,j,k,bi,bj)*deltaT |
|
|
& *recip_dxC(i,j,bi,bj)*Cr |
|
|
& )*Rj |
|
97 |
ENDDO |
ENDDO |
98 |
ENDDO |
ENDDO |
99 |
|
|