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

Annotation of /MITgcm/pkg/generic_advdiff/gad_u3_adv_y.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 -13 lines
Added comments in form compatible with "protex".

1 adcroft 1.3 C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_u3_adv_y.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_Y
8    
9     C !INTERFACE: ==========================================================
10 jmc 1.1 SUBROUTINE GAD_U3_ADV_Y(
11     I bi,bj,k,
12     I vTrans,
13     I tracer,
14     O vT,
15     I myThid )
16 adcroft 1.3
17     C !DESCRIPTION:
18     C Calculates the area integrated meridional 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^y_{adv} = V \overline{ \theta - \frac{1}{6} \delta_{jj} \theta }^j
22     C + \frac{1}{12} |V| \delta_{jjj} \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 vTrans :: meridional volume transport
35     C tracer :: tracer field
36     C myThid :: thread number
37 jmc 1.1 INTEGER bi,bj,k
38     _RL vTrans(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 vT :: meridional advective flux
44 jmc 1.1 _RL vT (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 j-1,j,j+1
49     C Rjjm,Rjjp :: second differences at j-1,j
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 i=1-Olx,sNx+Olx
55     vT(i,1-Oly)=0.
56     vT(i,2-Oly)=0.
57     vT(i,sNy+Oly)=0.
58     ENDDO
59     DO j=1-Oly+2,sNy+Oly-1
60     DO i=1-Olx,sNx+Olx
61 jmc 1.2 Rjp=(tracer(i,j+1)-tracer(i,j))
62     c & *maskS(i,j+1,k,bi,bj)
63     Rj =(tracer(i,j)-tracer(i,j-1))
64     c & *maskS(i,j,k,bi,bj)
65     Rjm=(tracer(i,j-1)-tracer(i,j-2))
66     c & *maskS(i,j-1,k,bi,bj)
67     C- jmc: mask not needed here above if Rjjp & Rjjm & vTrans are masked
68     Rjjp=(Rjp-Rj)*maskS(i,j+1,k,bi,bj)
69     Rjjm=(Rj-Rjm)*maskS(i,j-1,k,bi,bj)
70 jmc 1.1 vT(i,j) =
71     & vTrans(i,j)*(
72     & Tracer(i,j)+Tracer(i,j-1)-oneSixth*( Rjjp+Rjjm )
73     & )*0.5 _d 0
74     & +ABS( vTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
75     ENDDO
76     ENDDO
77    
78     RETURN
79     END

  ViewVC Help
Powered by ViewVC 1.1.22