/[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.3 - (hide annotations) (download)
Fri Sep 21 13:11:43 2001 UTC (22 years, 8 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint44e_post, release1_p13_pre, checkpoint44f_post, checkpoint43a-release1mods, release1_p13, chkpt44d_post, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint44e_pre, release1_b1, checkpoint43, release1_chkpt44d_post, release1_p11, icebear5, icebear4, icebear3, icebear2, release1-branch_tutorials, chkpt44a_post, chkpt44c_pre, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, release1_p10, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint44g_post, release1-branch-end, release1_final_v1, checkpoint44b_post, ecco_ice2, ecco_ice1, release1_p12_pre, ecco_c44_e22, ecco_c44_e25, chkpt44a_pre, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, release1_beta1, checkpoint44b_pre, checkpoint42, checkpoint41, checkpoint44, chkpt44c_post, checkpoint44f_pre, release1-branch_branchpoint
Branch point for: c24_e25_ice, release1_final, release1-branch, release1, ecco-branch, release1_50yr, icebear, release1_coupled
Changes since 1.2: +37 -11 lines
Added comments in form compatible with "protex".

1 adcroft 1.3 C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_fluxlimit_adv_x.F,v 1.2 2001/07/11 22:46:32 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     I tracer,
14     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     _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47 adcroft 1.3 INTEGER myThid
48    
49     C !OUTPUT PARAMETERS: ==================================================
50     C uT :: zonal advective flux
51 adcroft 1.1 _RL uT (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 i-1,i,i+1
57 adcroft 1.1 INTEGER i,j
58     _RL Cr,Rjm,Rj,Rjp
59 adcroft 1.3 C Statement function provides Limiter(Cr)
60 adcroft 1.1 #include "GAD_FLUX_LIMITER.h"
61 adcroft 1.3 CEOP
62 adcroft 1.1
63     DO j=1-Oly,sNy+Oly
64     uT(1-Olx,j)=0.
65 jmc 1.2 uT(2-Olx,j)=0.
66     uT(sNx+Olx,j)=0.
67     DO i=1-Olx+2,sNx+Olx-1
68 adcroft 1.1 Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj)
69     Rj=(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj)
70     Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj)
71     IF (Rj.NE.0.) THEN
72     IF (uTrans(i,j).GT.0) THEN
73     Cr=Rjm/Rj
74     ELSE
75     Cr=Rjp/Rj
76     ENDIF
77     ELSE
78     IF (uTrans(i,j).GT.0) THEN
79     Cr=Rjm*1.E20
80     ELSE
81     Cr=Rjp*1.E20
82     ENDIF
83     ENDIF
84     Cr=Limiter(Cr)
85     uT(i,j) =
86     & uTrans(i,j)*(Tracer(i,j)+Tracer(i-1,j))*0.5 _d 0
87     & -0.5*(
88     & (1-Cr)*ABS(uTrans(i,j))
89     & +uTrans(i,j)*uVel(i,j,k,bi,bj)*deltaT
90     & *recip_dxC(i,j,bi,bj)*Cr
91     & )*Rj
92     ENDDO
93     ENDDO
94    
95     RETURN
96     END

  ViewVC Help
Powered by ViewVC 1.1.22