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

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

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


Revision 1.5 - (hide annotations) (download)
Fri Sep 24 16:53:45 2004 UTC (19 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57g_pre, checkpoint57b_post, checkpoint57g_post, checkpoint56b_post, checkpoint57d_post, checkpoint57i_post, checkpoint57, checkpoint56, checkpoint57n_post, checkpoint55i_post, checkpoint57l_post, checkpoint57f_post, checkpoint57a_post, checkpoint57h_pre, checkpoint57h_post, checkpoint55g_post, checkpoint57c_post, checkpoint55d_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint55h_post, checkpoint57e_post, checkpoint55f_post, checkpoint57p_post, eckpoint57e_pre, checkpoint56a_post, checkpoint57h_done, checkpoint57j_post, checkpoint57f_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint57o_post, checkpoint57k_post, checkpoint55e_post
Changes since 1.4: +6 -5 lines
use a local copy of maskW & maskS (new arguments of advection S/R) for
 the purpose of doing multidimAdvection on CS-grid.

1 jmc 1.5 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_fluxlimit_adv_x.F,v 1.4 2002/03/06 01:29:36 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_X
8    
9     C !INTERFACE: ==========================================================
10 adcroft 1.1 SUBROUTINE GAD_FLUXLIMIT_ADV_X(
11     I bi,bj,k,deltaT,
12     I uTrans, uVel,
13 jmc 1.5 I maskLocW, tracer,
14 adcroft 1.1 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 second-order interpolation with a flux limiter:
20     C \begin{equation*}
21     C F^x_{adv} = U \overline{ \theta }^i
22     C - \frac{1}{2} \left(
23     C [ 1 - \psi(C_r) ] |U|
24     C + U \frac{u \Delta t}{\Delta x_c} \psi(C_r)
25     C \right) \delta_i \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     C bi,bj :: tile indices
37     C k :: vertical level
38     C uTrans :: zonal volume transport
39     C uVel :: zonal flow
40     C tracer :: tracer field
41     C myThid :: thread number
42 adcroft 1.1 INTEGER bi,bj,k
43     _RL deltaT
44     _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45     _RL uVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
46 jmc 1.5 _RS maskLocW(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47 adcroft 1.1 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48 adcroft 1.3 INTEGER myThid
49    
50     C !OUTPUT PARAMETERS: ==================================================
51     C uT :: zonal advective flux
52 adcroft 1.1 _RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
53    
54 adcroft 1.3 C !LOCAL VARIABLES: ====================================================
55     C i,j :: loop indices
56     C Cr :: slope ratio
57     C Rjm,Rj,Rjp :: differences at i-1,i,i+1
58 jmc 1.4 C uFld :: velocity [m/s], zonal component
59 adcroft 1.1 INTEGER i,j
60     _RL Cr,Rjm,Rj,Rjp
61 jmc 1.4 _RL uFld
62 adcroft 1.3 C Statement function provides Limiter(Cr)
63 adcroft 1.1 #include "GAD_FLUX_LIMITER.h"
64 adcroft 1.3 CEOP
65 adcroft 1.1
66     DO j=1-Oly,sNy+Oly
67     uT(1-Olx,j)=0.
68 jmc 1.2 uT(2-Olx,j)=0.
69     uT(sNx+Olx,j)=0.
70     DO i=1-Olx+2,sNx+Olx-1
71 jmc 1.4
72     c uFld = uVel(i,j,k,bi,bj)
73     uFld = uTrans(i,j)*recip_dyG(i,j,bi,bj)
74     & *recip_drF(k)*recip_hFacW(i,j,k,bi,bj)
75 jmc 1.5 Rjp=(tracer(i+1,j)-tracer( i ,j))*maskLocW(i+1,j)
76     Rj =(tracer( i ,j)-tracer(i-1,j))*maskLocW( i ,j)
77     Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskLocW(i-1,j)
78 jmc 1.4
79 adcroft 1.1 IF (Rj.NE.0.) THEN
80     IF (uTrans(i,j).GT.0) THEN
81     Cr=Rjm/Rj
82     ELSE
83     Cr=Rjp/Rj
84     ENDIF
85     ELSE
86     IF (uTrans(i,j).GT.0) THEN
87     Cr=Rjm*1.E20
88     ELSE
89     Cr=Rjp*1.E20
90     ENDIF
91     ENDIF
92     Cr=Limiter(Cr)
93     uT(i,j) =
94     & uTrans(i,j)*(Tracer(i,j)+Tracer(i-1,j))*0.5 _d 0
95     & -0.5*(
96     & (1-Cr)*ABS(uTrans(i,j))
97 jmc 1.4 & +uTrans(i,j)*uFld*deltaT
98 adcroft 1.1 & *recip_dxC(i,j,bi,bj)*Cr
99     & )*Rj
100     ENDDO
101     ENDDO
102    
103     RETURN
104     END

  ViewVC Help
Powered by ViewVC 1.1.22