/[MITgcm]/MITgcm/pkg/generic_advdiff/gad_u3_adv_x.F
ViewVC logotype

Annotation of /MITgcm/pkg/generic_advdiff/gad_u3_adv_x.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Wed Sep 26 19:05:21 2001 UTC (22 years, 8 months ago) by adcroft
Branch: MAIN
CVS Tags: release1_b1, checkpoint43, ecco-branch-mod1, release1_beta1, checkpoint42, checkpoint41
Branch point for: release1, ecco-branch, release1_coupled
Changes since 1.2: +30 -12 lines
Added comments in form compatible with "protex".

1 adcroft 1.3 C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_u3_adv_x.F,v 1.2 2001/08/20 20:44:01 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "GAD_OPTIONS.h"
5    
6 adcroft 1.3 CBOP
7     C !ROUTINE: GAD_U3_ADV_X
8    
9     C !INTERFACE: ==========================================================
10 jmc 1.1 SUBROUTINE GAD_U3_ADV_X(
11     I bi,bj,k,
12     I uTrans,
13     I tracer,
14     O uT,
15     I myThid )
16 adcroft 1.3
17     C !DESCRIPTION:
18     C Calculates the area integrated zonal flux due to advection of a tracer
19     C using upwind biased third-order interpolation (or the $\kappa=1/3$ scheme):
20     C \begin{equation*}
21     C F^x_{adv} = U \overline{ \theta - \frac{1}{6} \delta_{ii} \theta }^i
22     C + \frac{1}{12} |U| \delta_{iii} \theta
23     C \end{equation*}
24    
25     C !USES: ===============================================================
26 jmc 1.1 IMPLICIT NONE
27     #include "SIZE.h"
28     #include "GRID.h"
29     #include "GAD.h"
30    
31 adcroft 1.3 C !INPUT PARAMETERS: ===================================================
32     C bi,bj :: tile indices
33     C k :: vertical level
34     C uTrans :: zonal volume transport
35     C tracer :: tracer field
36     C myThid :: thread number
37 jmc 1.1 INTEGER bi,bj,k
38     _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
39     _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
40 adcroft 1.3 INTEGER myThid
41    
42     C !OUTPUT PARAMETERS: ==================================================
43     C uT :: zonal advective flux
44 jmc 1.1 _RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45    
46 adcroft 1.3 C !LOCAL VARIABLES: ====================================================
47     C i,j :: loop indices
48     C Rjm,Rj,Rjp :: differences at i-1,i,i+1
49     C Rjjm,Rjjp :: second differences at i-1,i
50 jmc 1.1 INTEGER i,j
51     _RL Rjm,Rj,Rjp,Rjjm,Rjjp
52 adcroft 1.3 CEOP
53 jmc 1.1
54     DO j=1-Oly,sNy+Oly
55     uT(1-Olx,j)=0.
56     uT(2-Olx,j)=0.
57     uT(sNx+Olx,j)=0.
58     DO i=1-Olx+2,sNx+Olx-1
59 jmc 1.2 Rjp=(tracer(i+1,j)-tracer(i,j))
60     c & *maskW(i+1,j,k,bi,bj)
61     Rj =(tracer(i,j)-tracer(i-1,j))
62     c & *maskW(i,j,k,bi,bj)
63     Rjm=(tracer(i-1,j)-tracer(i-2,j))
64     c & *maskW(i-1,j,k,bi,bj)
65     C- jmc: mask not needed here above if Rjjp & Rjjm & uTrans are masked
66     Rjjp=(Rjp-Rj)*maskW(i+1,j,k,bi,bj)
67     Rjjm=(Rj-Rjm)*maskW(i-1,j,k,bi,bj)
68 jmc 1.1 uT(i,j) =
69     & uTrans(i,j)*(
70     & Tracer(i,j)+Tracer(i-1,j)-oneSixth*( Rjjp+Rjjm )
71     & )*0.5 _d 0
72     & +ABS( uTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
73     ENDDO
74     ENDDO
75    
76     RETURN
77     END

  ViewVC Help
Powered by ViewVC 1.1.22