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

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

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


Revision 1.12 - (hide annotations) (download)
Wed Apr 4 01:39:06 2007 UTC (17 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62u, checkpoint62t, 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, checkpoint62c, checkpoint59, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint63g, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, 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, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint62b, 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, checkpoint61f, checkpoint61n, checkpoint59j, checkpoint61q, checkpoint61e, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
Changes since 1.11: +9 -7 lines
add a logical argument "calcCFL" to DST horizontal Advection S/R
(if false, assume that uFld,vFld are already CFL number in x,y dir)

1 jmc 1.12 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_fluxlimit_adv_y.F,v 1.11 2006/12/05 22:25:41 jmc Exp $
2 jmc 1.2 C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6 adcroft 1.3 CBOP
7     C !ROUTINE: GAD_FLUXLIMIT_ADV_Y
8    
9     C !INTERFACE: ==========================================================
10 jmc 1.9 SUBROUTINE GAD_FLUXLIMIT_ADV_Y(
11 jmc 1.12 I bi,bj,k, calcCFL, deltaTloc,
12 jmc 1.9 I vTrans, vFld,
13 jmc 1.6 I maskLocS, tracer,
14 adcroft 1.1 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 second-order interpolation with a flux limiter:
20     C \begin{equation*}
21     C F^y_{adv} = V \overline{ \theta }^j
22     C - \frac{1}{2} \left(
23     C [ 1 - \psi(C_r) ] |V|
24     C + V \frac{v \Delta t}{\Delta y_c} \psi(C_r)
25     C \right) \delta_j \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 adcroft 1.1 IMPLICIT NONE
32     #include "SIZE.h"
33     #include "GRID.h"
34    
35 adcroft 1.3 C !INPUT PARAMETERS: ===================================================
36 edhill 1.5 C bi,bj :: tile indices
37     C k :: vertical level
38 jmc 1.12 C calcCFL :: =T: calculate CFL number ; =F: take vFld as CFL
39     C deltaTloc :: local time-step (s)
40 edhill 1.5 C vTrans :: meridional volume transport
41 jmc 1.12 C vFld :: meridional flow / CFL number
42 edhill 1.5 C tracer :: tracer field
43     C myThid :: thread number
44 adcroft 1.1 INTEGER bi,bj,k
45 jmc 1.12 LOGICAL calcCFL
46 heimbach 1.7 _RL deltaTloc
47 adcroft 1.1 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48 jmc 1.9 _RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
49 jmc 1.6 _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
50 adcroft 1.1 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
51 adcroft 1.3 INTEGER myThid
52    
53     C !OUTPUT PARAMETERS: ==================================================
54 edhill 1.5 C vT :: meridional advective flux
55 adcroft 1.1 _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
56    
57 adcroft 1.3 C !LOCAL VARIABLES: ====================================================
58 edhill 1.5 C i,j :: loop indices
59     C Cr :: slope ratio
60     C Rjm,Rj,Rjp :: differences at j-1,j,j+1
61 adcroft 1.1 INTEGER i,j
62     _RL Cr,Rjm,Rj,Rjp
63 jmc 1.12 _RL vCFL
64 adcroft 1.3 C Statement function provides Limiter(Cr)
65 adcroft 1.1 #include "GAD_FLUX_LIMITER.h"
66 adcroft 1.3 CEOP
67 adcroft 1.1
68     DO i=1-Olx,sNx+Olx
69     vT(i,1-Oly)=0.
70 jmc 1.2 vT(i,2-Oly)=0.
71     vT(i,sNy+Oly)=0.
72 adcroft 1.1 ENDDO
73 jmc 1.2 DO j=1-Oly+2,sNy+Oly-1
74 adcroft 1.1 DO i=1-Olx,sNx+Olx
75 jmc 1.4
76 jmc 1.12 vCFL = vFld(i,j)
77     IF ( calcCFL ) vCFL = ABS( vFld(i,j)*deltaTloc
78 jmc 1.11 & *recip_dyC(i,j,bi,bj)*recip_deepFacC(k) )
79 jmc 1.6 Rjp=(tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1)
80     Rj =(tracer(i, j )-tracer(i,j-1))*maskLocS(i, j )
81     Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)
82 jmc 1.4
83 adcroft 1.1 IF (Rj.NE.0.) THEN
84     IF (vTrans(i,j).GT.0) THEN
85     Cr=Rjm/Rj
86     ELSE
87     Cr=Rjp/Rj
88     ENDIF
89     ELSE
90     IF (vTrans(i,j).GT.0) THEN
91     Cr=Rjm*1.E20
92     ELSE
93     Cr=Rjp*1.E20
94     ENDIF
95     ENDIF
96     Cr=Limiter(Cr)
97 jmc 1.9 vT(i,j) =
98 adcroft 1.1 & vTrans(i,j)*(Tracer(i,j)+Tracer(i,j-1))*0.5 _d 0
99 jmc 1.11 & -ABS(vTrans(i,j))*((1.-Cr)+vCFL*Cr)
100     & *Rj*0.5 _d 0
101 adcroft 1.1 ENDDO
102     ENDDO
103    
104     RETURN
105     END

  ViewVC Help
Powered by ViewVC 1.1.22