/[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.5 - (hide annotations) (download)
Mon Mar 29 03:33:51 2004 UTC (20 years, 1 month ago) by edhill
Branch: MAIN
CVS Tags: checkpoint54d_post, checkpoint54e_post, checkpoint55, checkpoint54, checkpoint53, checkpoint54f_post, checkpoint55c_post, checkpoint53d_post, checkpoint54b_post, checkpoint52m_post, checkpoint54a_pre, checkpoint53c_post, checkpoint54a_post, checkpoint55b_post, checkpoint53a_post, checkpoint53g_post, checkpoint53f_post, checkpoint52n_post, checkpoint53b_pre, checkpoint55a_post, checkpoint53b_post, checkpoint53d_pre, checkpoint54c_post
Changes since 1.4: +12 -12 lines
 o new "poster children" for the API reference:
   - generic_advdiff
   - mnc

1 edhill 1.5 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_fluxlimit_adv_y.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_Y
8    
9     C !INTERFACE: ==========================================================
10 adcroft 1.1 SUBROUTINE GAD_FLUXLIMIT_ADV_Y(
11     I bi,bj,k,deltaT,
12     I vTrans, vVel,
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 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     C vTrans :: meridional volume transport
39     C vVel :: meridional flow
40     C tracer :: tracer field
41     C myThid :: thread number
42 adcroft 1.1 INTEGER bi,bj,k
43     _RL deltaT
44     _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45     _RL vVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
46     _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47 adcroft 1.3 INTEGER myThid
48    
49     C !OUTPUT PARAMETERS: ==================================================
50 edhill 1.5 C vT :: meridional advective flux
51 adcroft 1.1 _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
52    
53 adcroft 1.3 C !LOCAL VARIABLES: ====================================================
54 edhill 1.5 C i,j :: loop indices
55     C Cr :: slope ratio
56     C Rjm,Rj,Rjp :: differences at j-1,j,j+1
57     C vFld :: velocity [m/s], meridional component
58 adcroft 1.1 INTEGER i,j
59     _RL Cr,Rjm,Rj,Rjp
60 jmc 1.4 _RL vFld
61 adcroft 1.3 C Statement function provides Limiter(Cr)
62 adcroft 1.1 #include "GAD_FLUX_LIMITER.h"
63 adcroft 1.3 CEOP
64 adcroft 1.1
65     DO i=1-Olx,sNx+Olx
66     vT(i,1-Oly)=0.
67 jmc 1.2 vT(i,2-Oly)=0.
68     vT(i,sNy+Oly)=0.
69 adcroft 1.1 ENDDO
70 jmc 1.2 DO j=1-Oly+2,sNy+Oly-1
71 adcroft 1.1 DO i=1-Olx,sNx+Olx
72 jmc 1.4
73     c vFld = vVel(i,j,k,bi,bj)
74     vFld = vTrans(i,j)*recip_dxG(i,j,bi,bj)
75     & *recip_drF(k)*recip_hFacS(i,j,k,bi,bj)
76 adcroft 1.1 Rjp=(tracer(i,j+1)-tracer(i,j))*maskS(i,j+1,k,bi,bj)
77     Rj=(tracer(i,j)-tracer(i,j-1))*maskS(i,j,k,bi,bj)
78     Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskS(i,j-1,k,bi,bj)
79 jmc 1.4
80 adcroft 1.1 IF (Rj.NE.0.) THEN
81     IF (vTrans(i,j).GT.0) THEN
82     Cr=Rjm/Rj
83     ELSE
84     Cr=Rjp/Rj
85     ENDIF
86     ELSE
87     IF (vTrans(i,j).GT.0) THEN
88     Cr=Rjm*1.E20
89     ELSE
90     Cr=Rjp*1.E20
91     ENDIF
92     ENDIF
93     Cr=Limiter(Cr)
94     vT(i,j) =
95     & vTrans(i,j)*(Tracer(i,j)+Tracer(i,j-1))*0.5 _d 0
96     & -0.5*(
97     & (1-Cr)*ABS(vTrans(i,j))
98 jmc 1.4 & +vTrans(i,j)*vFld*deltaT
99 adcroft 1.1 & *recip_dyC(i,j,bi,bj)*Cr
100     & )*Rj
101     ENDDO
102     ENDDO
103    
104     RETURN
105     END

  ViewVC Help
Powered by ViewVC 1.1.22