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

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

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


Revision 1.12 - (hide annotations) (download)
Tue Dec 5 22:25:41 2006 UTC (17 years, 5 months 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, checkpoint58t_post, checkpoint63g, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint58w_post, mitgcm_mapl_00, 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, checkpoint58v_post, 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, checkpoint58x_post, checkpoint61n, checkpoint59j, checkpoint61q, checkpoint61e, checkpoint58u_post, checkpoint58s_post, 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: +5 -7 lines
similar to the other DST advection scheme : fct of CFL number, > 0.

1 jmc 1.12 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_fluxlimit_adv_r.F,v 1.11 2006/06/19 14:40:43 jmc Exp $
2 jmc 1.2 C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6 adcroft 1.5 CBOP
7     C !ROUTINE: GAD_FLUXLIMIT_ADV_R
8    
9     C !INTERFACE: ==========================================================
10 jmc 1.10 SUBROUTINE GAD_FLUXLIMIT_ADV_R(
11 jmc 1.9 I bi,bj,k,dTarg,
12 jmc 1.10 I rTrans, wFld,
13 adcroft 1.1 I tracer,
14     O wT,
15     I myThid )
16 adcroft 1.5
17     C !DESCRIPTION:
18     C Calculates the area integrated vertical flux due to advection of a tracer
19     C using second-order interpolation with a flux limiter:
20     C \begin{equation*}
21     C F^x_{adv} = W \overline{ \theta }^k
22     C - \frac{1}{2} \left(
23     C [ 1 - \psi(C_r) ] |W|
24     C + W \frac{w \Delta t}{\Delta r_c} \psi(C_r)
25     C \right) \delta_k \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 adcroft 1.3 #include "EEPARAMS.h"
35     #include "PARAMS.h"
36 adcroft 1.1
37 adcroft 1.5 C !INPUT PARAMETERS: ===================================================
38 jmc 1.9 C bi,bj :: tile indices
39 edhill 1.8 C k :: vertical level
40     C rTrans :: vertical volume transport
41 jmc 1.10 C wFld :: vertical flow
42 edhill 1.8 C tracer :: tracer field
43     C myThid :: thread number
44 jmc 1.9 INTEGER bi,bj,k
45 adcroft 1.3 _RL dTarg
46 adcroft 1.1 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47 jmc 1.10 _RL wFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48 jmc 1.9 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
49 adcroft 1.5 INTEGER myThid
50    
51     C !OUTPUT PARAMETERS: ==================================================
52 edhill 1.8 C wT :: vertical advective flux
53 adcroft 1.1 _RL wT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
54    
55 adcroft 1.5 C !LOCAL VARIABLES: ====================================================
56 edhill 1.8 C i,j :: loop indices
57     C kp1 :: =min( k+1 , Nr )
58     C km1 :: =max( k-1 , 1 )
59     C km2 :: =max( k-2 , 1 )
60     C bi,bj :: tile indices or (1,1) depending on use
61     C Cr :: slope ratio
62     C Rjm,Rj,Rjp :: differences at i-1,i,i+1
63 jmc 1.10 C wLoc :: velocity, vertical component
64 jmc 1.9 INTEGER i,j,kp1,km1,km2
65 adcroft 1.1 _RL Cr,Rjm,Rj,Rjp
66 jmc 1.12 _RL wLoc, wCFL
67 adcroft 1.5 C Statement function provides Limiter(Cr)
68 adcroft 1.1 #include "GAD_FLUX_LIMITER.h"
69 adcroft 1.5 CEOP
70 adcroft 1.1
71     km2=MAX(1,k-2)
72     km1=MAX(1,k-1)
73     kp1=MIN(Nr,k+1)
74    
75     IF ( k.GT.Nr) THEN
76     DO j=1-Oly,sNy+Oly
77     DO i=1-Olx,sNx+Olx
78     wT(i,j) = 0.
79     ENDDO
80     ENDDO
81     ELSE
82     DO j=1-Oly,sNy+Oly
83     DO i=1-Olx,sNx+Olx
84 jmc 1.7
85 jmc 1.11 wLoc = wFld(i,j)
86 jmc 1.12 wCFL = ABS( wLoc*dTarg*recip_drC(k) )
87 jmc 1.9 Rjp=(tracer(i,j,kp1)-tracer(i,j,k))
88     & *maskC(i,j,kp1,bi,bj)
89     Rj= (tracer(i,j,k) -tracer(i,j,kM1))
90     Rjm=(tracer(i,j,km1)-tracer(i,j,kM2))
91     & *maskC(i,j,km2,bi,bj)
92 jmc 1.7
93 adcroft 1.1 IF (Rj.NE.0.) THEN
94 adcroft 1.4 IF (rTrans(i,j).LT.0.) THEN
95 adcroft 1.1 Cr=Rjm/Rj
96     ELSE
97     Cr=Rjp/Rj
98     ENDIF
99     ELSE
100 adcroft 1.4 IF (rTrans(i,j).LT.0.) THEN
101 adcroft 1.1 Cr=Rjm*1.E20
102     ELSE
103     Cr=Rjp*1.E20
104     ENDIF
105     ENDIF
106     Cr=Limiter(Cr)
107 jmc 1.9 wT(i,j) = maskC(i,j,kM1,bi,bj)*(
108 jmc 1.2 & rTrans(i,j)*
109 jmc 1.9 & (tracer(i,j,k)+tracer(i,j,kM1))*0.5 _d 0
110 jmc 1.12 & +ABS(rTrans(i,j))*((1.-Cr)+wCFL*Cr)
111     & *Rj*0.5 _d 0 )
112 adcroft 1.1 ENDDO
113     ENDDO
114     ENDIF
115    
116     RETURN
117     END

  ViewVC Help
Powered by ViewVC 1.1.22