/[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.4 - (hide annotations) (download)
Wed Mar 6 01:29:36 2002 UTC (22 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint51k_post, checkpoint47e_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, checkpoint50c_post, checkpoint46f_post, checkpoint52d_pre, checkpoint48e_post, checkpoint50c_pre, checkpoint46b_post, checkpoint52j_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint48i_post, checkpoint46l_pre, checkpoint52l_post, checkpoint52k_post, checkpoint51, checkpoint50, checkpoint52, checkpoint50d_post, checkpoint52f_post, checkpoint50b_pre, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint47a_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint47d_post, checkpoint46d_pre, checkpoint48d_post, checkpoint48f_post, checkpoint45d_post, checkpoint52b_pre, checkpoint46j_pre, checkpoint51l_pre, checkpoint44h_pre, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint48a_post, checkpoint45a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52f_pre, checkpoint47j_post, branch-exfmods-tag, branchpoint-genmake2, checkpoint46e_pre, checkpoint51r_post, checkpoint48c_post, checkpoint45b_post, checkpoint46b_pre, checkpoint51i_post, checkpoint51b_post, checkpoint51c_post, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint46h_pre, checkpoint52d_post, checkpoint46m_post, checkpoint46a_pre, checkpoint50g_post, checkpoint45c_post, checkpoint44h_post, checkpoint46g_post, checkpoint52a_pre, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint52j_post, checkpoint47f_post, checkpoint50e_post, checkpoint46i_post, checkpoint46c_post, branch-netcdf, checkpoint50d_pre, checkpoint46e_post, checkpoint51e_post, checkpoint47, checkpoint45, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51o_post, checkpoint51f_pre, checkpoint48g_post, checkpoint47h_post, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint46d_post, checkpoint50b_post, checkpoint51m_post, checkpoint51a_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-exfmods-curt, branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.3: +9 -2 lines
re-compute velocity (uFld,vFld,wFld) from uTrans,vTrans,rTrans

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_fluxlimit_adv_y.F,v 1.3 2001/09/21 13:11:43 adcroft 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     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     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     C i,j :: loop indices
55     C Cr :: slope ratio
56     C Rjm,Rj,Rjp :: differences at j-1,j,j+1
57 jmc 1.4 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