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

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

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


Revision 1.4 - (hide annotations) (download)
Thu Nov 8 23:39:34 2001 UTC (22 years, 6 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint44e_post, checkpoint44f_post, checkpoint43a-release1mods, chkpt44d_post, checkpoint44e_pre, release1-branch_tutorials, chkpt44a_post, chkpt44c_pre, checkpoint44g_post, release1-branch-end, release1_final_v1, checkpoint44b_post, chkpt44a_pre, checkpoint44b_pre, checkpoint44, chkpt44c_post, checkpoint44f_pre, release1-branch_branchpoint
Branch point for: release1_final, release1-branch
Changes since 1.3: +15 -13 lines
Replacing floating point numbers by ...D0 in MIN/MAX expressions
to avoid inconsistencies and problems on some platforms (e.g. IBM SP3).
(spotted by G. Gebbie)

1 heimbach 1.4 C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_dst3fl_adv_x.F,v 1.3 2001/09/10 00:24:14 adcroft Exp $
2     C $Name: checkpoint43 $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6     SUBROUTINE GAD_DST3FL_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_DST3FL_ADV_X |
14     C | o Compute Zonal advective Flux of Tracer using |
15     C | 3rd Order DST Sceheme with flux limiting |
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 adcroft 1.3 _RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,psiM,thetaP,thetaM
36 adcroft 1.1
37     DO j=1-Oly,sNy+Oly
38 heimbach 1.4 uT(1-Olx,j)=0.D0
39     uT(2-Olx,j)=0.D0
40     uT(sNx+Olx,j)=0.D0
41 adcroft 1.1 DO i=1-Olx+2,sNx+Olx-1
42     Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj)
43     Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj)
44     Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj)
45    
46 adcroft 1.3 cfl=abs(uVel(i,j,k,bi,bj)*deltaT*recip_dxc(i,j,bi,bj))
47 heimbach 1.4 d0=(2.D0-cfl)*(1.D0-cfl)*oneSixth
48     d1=(1.D0-cfl*cfl)*oneSixth
49     c thetaP=0.D0
50     c IF (Rj.NE.0.D0) thetaP=Rjm/Rj
51 adcroft 1.3 thetaP=Rjm/(1.D-20+Rj)
52 adcroft 1.1 psiP=d0+d1*thetaP
53 heimbach 1.4 psiP=max(0.D0, min(min(1.D0,psiP),
54     & (1.D0-cfl)/(1.D-20+cfl)*thetaP))
55 adcroft 1.3 thetaM=Rjp/(1.D-20+Rj)
56 heimbach 1.4 c thetaM=0.D0
57     c IF (Rj.NE.0.D0) thetaM=Rjp/Rj
58 adcroft 1.1 psiM=d0+d1*thetaM
59 heimbach 1.4 psiM=max(0.D0, min(min(1.D0,psiM),
60     & (1.D0-cfl)/(1.D-20+cfl)*thetaM))
61 adcroft 1.1 uT(i,j)=
62 heimbach 1.2 & 0.5*(uTrans(i,j)+abs(uTrans(i,j)))
63     & *( Tracer(i-1,j) + psiP*Rj )
64     & +0.5*(uTrans(i,j)-abs(uTrans(i,j)))
65     & *( Tracer( i ,j) - psiM*Rj )
66 adcroft 1.1
67     ENDDO
68     ENDDO
69    
70     RETURN
71     END

  ViewVC Help
Powered by ViewVC 1.1.22