/[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.6 - (hide annotations) (download)
Tue Mar 29 15:50:30 2011 UTC (13 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63g, checkpoint64, checkpoint65, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint65o, checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, HEAD
Changes since 1.5: +19 -17 lines
pass maskW & maskS as argument

1 jmc 1.6 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_u3_adv_x.F,v 1.5 2008/02/29 01:31:00 mlosch 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.6 SUBROUTINE GAD_U3_ADV_X(
11 jmc 1.1 I bi,bj,k,
12 jmc 1.6 I uTrans, maskLocW,
13 jmc 1.1 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 jmc 1.4 C Near boundaries, mask all the gradients ==> still 3rd O.
25 adcroft 1.3
26     C !USES: ===============================================================
27 jmc 1.1 IMPLICIT NONE
28     #include "SIZE.h"
29 jmc 1.6 c#include "GRID.h"
30 jmc 1.1 #include "GAD.h"
31    
32 adcroft 1.3 C !INPUT PARAMETERS: ===================================================
33 jmc 1.6 C bi,bj :: tile indices
34     C k :: vertical level
35     C uTrans :: zonal volume transport
36     C maskLocW :: mask (either 0 or 1) at grid-cell western edge
37     C tracer :: tracer field
38     C myThid :: my thread Id number
39 jmc 1.1 INTEGER bi,bj,k
40 jmc 1.6 _RL uTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
41     _RS maskLocW(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
42     _RL tracer (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
43 adcroft 1.3 INTEGER myThid
44    
45     C !OUTPUT PARAMETERS: ==================================================
46 jmc 1.6 C uT :: zonal advective flux
47     _RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48 jmc 1.1
49 adcroft 1.3 C !LOCAL VARIABLES: ====================================================
50     C i,j :: loop indices
51     C Rjm,Rj,Rjp :: differences at i-1,i,i+1
52     C Rjjm,Rjjp :: second differences at i-1,i
53 jmc 1.1 INTEGER i,j
54     _RL Rjm,Rj,Rjp,Rjjm,Rjjp
55 adcroft 1.3 CEOP
56 jmc 1.1
57     DO j=1-Oly,sNy+Oly
58     uT(1-Olx,j)=0.
59     uT(2-Olx,j)=0.
60     uT(sNx+Olx,j)=0.
61 mlosch 1.5 ENDDO
62     DO j=1-Oly,sNy+Oly
63 jmc 1.1 DO i=1-Olx+2,sNx+Olx-1
64 jmc 1.6 Rjp = (tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j)
65     Rj = (tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j)
66     Rjm = (tracer(i-1,j)-tracer(i-2,j))*maskLocW(i-1,j)
67 jmc 1.4 Rjjp=Rjp-Rj
68     Rjjm=Rj-Rjm
69 jmc 1.6 uT(i,j) =
70 jmc 1.1 & uTrans(i,j)*(
71     & Tracer(i,j)+Tracer(i-1,j)-oneSixth*( Rjjp+Rjjm )
72     & )*0.5 _d 0
73     & +ABS( uTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
74     ENDDO
75     ENDDO
76    
77     RETURN
78     END

  ViewVC Help
Powered by ViewVC 1.1.22