/[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.7 - (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.6: +8 -2 lines
re-compute velocity (uFld,vFld,wFld) from uTrans,vTrans,rTrans

1 jmc 1.7 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_fluxlimit_adv_r.F,v 1.6 2002/01/17 16:48:59 adcroft 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 adcroft 1.1 SUBROUTINE GAD_FLUXLIMIT_ADV_R(
11 adcroft 1.3 I bi_arg,bj_arg,k,dTarg,
12 adcroft 1.1 I rTrans, wVel,
13     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     C bi_arg,bj_arg :: tile indices
39     C k :: vertical level
40     C rTrans :: vertical volume transport
41     C wVel :: vertical flow
42     C tracer :: tracer field
43     C myThid :: thread number
44 adcroft 1.3 INTEGER bi_arg,bj_arg,k
45     _RL dTarg
46 adcroft 1.1 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47     _RL wVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
48     _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
49 adcroft 1.5 INTEGER myThid
50    
51     C !OUTPUT PARAMETERS: ==================================================
52     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     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.7 C wFld :: velocity, vertical component
64 adcroft 1.3 INTEGER i,j,kp1,km1,km2,bi,bj
65 adcroft 1.1 _RL Cr,Rjm,Rj,Rjp
66 jmc 1.7 _RL wFld
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 adcroft 1.3 IF (.NOT. multiDimAdvection) THEN
72     C If using the standard time-stepping/advection schemes (ie. AB-II)
73     C then the data-structures are all global arrays
74     bi=bi_arg
75     bj=bj_arg
76     ELSE
77     C otherwise if using the multi-dimensional advection schemes
78     C then the data-structures are all local arrays except
79     C for maskC(...) and wVel(...)
80     bi=1
81     bj=1
82     ENDIF
83    
84 adcroft 1.1 km2=MAX(1,k-2)
85     km1=MAX(1,k-1)
86     kp1=MIN(Nr,k+1)
87    
88     IF ( k.GT.Nr) THEN
89     DO j=1-Oly,sNy+Oly
90     DO i=1-Olx,sNx+Olx
91     wT(i,j) = 0.
92     ENDDO
93     ENDDO
94     ELSE
95     DO j=1-Oly,sNy+Oly
96     DO i=1-Olx,sNx+Olx
97 jmc 1.7
98     c wFld = wVel(i,j,k,bi_arg,bj_arg)
99     wFld = rTrans(i,j)*recip_rA(i,j,bi_arg,bj_arg)
100 adcroft 1.1 Rjp=(tracer(i,j,kp1,bi,bj)-tracer(i,j,k,bi,bj))
101 adcroft 1.6 & *maskC(i,j,kp1,bi_arg,bj_arg)
102 adcroft 1.1 Rj=(tracer(i,j,k,bi,bj)-tracer(i,j,kM1,bi,bj))
103     Rjm=(tracer(i,j,km1,bi,bj)-tracer(i,j,kM2,bi,bj))
104 adcroft 1.6 & *maskC(i,j,km2,bi_arg,bj_arg)
105 jmc 1.7
106 adcroft 1.1 IF (Rj.NE.0.) THEN
107 adcroft 1.4 IF (rTrans(i,j).LT.0.) THEN
108 adcroft 1.1 Cr=Rjm/Rj
109     ELSE
110     Cr=Rjp/Rj
111     ENDIF
112     ELSE
113 adcroft 1.4 IF (rTrans(i,j).LT.0.) THEN
114 adcroft 1.1 Cr=Rjm*1.E20
115     ELSE
116     Cr=Rjp*1.E20
117     ENDIF
118     ENDIF
119     Cr=Limiter(Cr)
120 adcroft 1.3 wT(i,j) = maskC(i,j,kM1,bi_arg,bj_arg)*(
121 jmc 1.2 & rTrans(i,j)*
122 adcroft 1.1 & (Tracer(i,j,k,bi,bj)+Tracer(i,j,kM1,bi,bj))*0.5 _d 0
123 jmc 1.2 & +(ABS(rTrans(i,j))*(1-Cr)
124 jmc 1.7 & +rTrans(i,j)*wFld*dTarg*recip_drC(k)
125 jmc 1.2 & *Cr
126     & )*Rj*0.5 _d 0 )
127 adcroft 1.1 ENDDO
128     ENDDO
129     ENDIF
130    
131     RETURN
132     END

  ViewVC Help
Powered by ViewVC 1.1.22