forked from darwinproject/darwin3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gad_c2_adv_x.F
57 lines (48 loc) · 1.55 KB
/
gad_c2_adv_x.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "GAD_OPTIONS.h"
CBOP
C !ROUTINE: GAD_C2_ADV_X
C !INTERFACE: ==========================================================
SUBROUTINE GAD_C2_ADV_X(
I bi,bj,k,
I uTrans,
I tracer,
O uT,
I myThid )
C !DESCRIPTION:
C Calculates the area integrated zonal flux due to advection of a tracer using
C centered second-order interpolation:
C \begin{equation*}
C F^x_{adv} = U \overline{\theta}^i
C \end{equation*}
C !USES: ===============================================================
IMPLICIT NONE
#include "SIZE.h"
#include "GRID.h"
C !INPUT PARAMETERS: ===================================================
C bi,bj :: tile indices
C k :: vertical level
C uTrans :: zonal volume transport
C tracer :: tracer field
C myThid :: thread number
INTEGER bi,bj,k
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
INTEGER myThid
C !OUTPUT PARAMETERS: ==================================================
C uT :: zonal advective flux
_RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
C !LOCAL VARIABLES: ====================================================
C i,j :: loop indices
INTEGER i,j
CEOP
DO j=1-Oly,sNy+Oly
uT(1-Olx,j)=0.
ENDDO
DO j=1-Oly,sNy+Oly
DO i=1-Olx+1,sNx+Olx
uT(i,j) =
& uTrans(i,j)*(Tracer(i,j)+Tracer(i-1,j))*0.5 _d 0
ENDDO
ENDDO
RETURN
END