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

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

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


Revision 1.2 - (hide annotations) (download)
Mon Sep 10 00:14:05 2001 UTC (22 years, 8 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint44e_post, release1_p13_pre, checkpoint44f_post, checkpoint43a-release1mods, release1_p13, checkpoint40pre9, 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, checkpoint40, 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.1: +18 -7 lines
Slight re-write to help debug flux limited form.

1 adcroft 1.2 C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_dst3_adv_x.F,v 1.1 2001/09/04 14:53:11 adcroft Exp $
2     C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6     SUBROUTINE GAD_DST3_ADV_X(
7     I bi,bj,k,deltaT,
8     I uTrans, uVel,
9     I tracer,
10     O uT,
11     I myThid )
12     C /==========================================================\
13     C | SUBROUTINE GAD_DST3_ADV_X |
14     C | o Compute Zonal advective Flux of Tracer using |
15     C | 3rd Order DST Sceheme |
16     C |==========================================================|
17     IMPLICIT NONE
18    
19     C == GLobal variables ==
20     #include "SIZE.h"
21     #include "GRID.h"
22     #include "GAD.h"
23    
24     C == Routine arguments ==
25     INTEGER bi,bj,k
26     _RL deltaT
27     _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
28     _RL uVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
29     _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
30     _RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
31     INTEGER myThid
32    
33     C == Local variables ==
34     INTEGER i,j
35     _RL Rjm,Rj,Rjp,cfl,d0,d1
36 adcroft 1.2 _RL psiP,psiM,thetaP,thetaM
37 adcroft 1.1
38     DO j=1-Oly,sNy+Oly
39     uT(1-Olx,j)=0.
40     uT(2-Olx,j)=0.
41     uT(sNx+Olx,j)=0.
42     DO i=1-Olx+2,sNx+Olx-1
43     Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj)
44     Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj)
45     Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj)
46    
47 adcroft 1.2 cfl=abs(uVel(i,j,k,bi,bj)*deltaT*recip_dxc(i,j,bi,bj))
48     d0=(2.-cfl)*(1.-cfl)*oneSixth
49     d1=(1.-cfl*cfl)*oneSixth
50     c thetaP=0.
51     c IF (Rj.NE.0.) thetaP=Rjm/Rj
52     thetaP=Rjm/(1.D-20+Rj)
53     psiP=d0+d1*thetaP
54     c psiP=max(0.,min(min(1.,psiP),(1.-cfl)/(1.D-20+cfl)*thetaP))
55     thetaM=Rjp/(1.D-20+Rj)
56     c thetaM=0.
57     c IF (Rj.NE.0.) thetaM=Rjp/Rj
58     psiM=d0+d1*thetaM
59     c psiM=max(0.,min(min(1.,psiM),(1.-cfl)/(1.D-20+cfl)*thetaM))
60 adcroft 1.1 uT(i,j)=
61     & 0.5*(uTrans(i,j)+abs(uTrans(i,j)))
62 adcroft 1.2 & *( Tracer(i-1,j) + psiP*Rj )
63 adcroft 1.1 & +0.5*(uTrans(i,j)-abs(uTrans(i,j)))
64 adcroft 1.2 & *( Tracer( i ,j) - psiM*Rj )
65 adcroft 1.1
66     ENDDO
67     ENDDO
68    
69     RETURN
70     END

  ViewVC Help
Powered by ViewVC 1.1.22