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

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

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


Revision 1.3 - (hide annotations) (download)
Thu Jan 17 16:48:59 2002 UTC (22 years, 4 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint44e_post, checkpoint44f_post, chkpt44d_post, checkpoint44e_pre, chkpt44a_post, chkpt44c_pre, checkpoint44g_post, release1_final_v1, checkpoint44b_post, chkpt44a_pre, checkpoint44b_pre, checkpoint44, chkpt44c_post, checkpoint44f_pre
Branch point for: release1_final
Changes since 1.2: +6 -6 lines
Bug fix:

The mask arrays had the wrong tile indices
 o only affected multi-tile per thread calculations

1 adcroft 1.3 C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_dst3fl_adv_r.F,v 1.2 2001/11/08 23:39:34 heimbach Exp $
2     C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6     SUBROUTINE GAD_DST3FL_ADV_R(
7     I bi_arg,bj_arg,k,dTarg,
8     I rTrans, wVel,
9     I tracer,
10     O wT,
11     I myThid )
12     C /==========================================================\
13     C | SUBROUTINE GAD_DST3_ADV_R |
14     C | o Compute Vertical 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 "EEPARAMS.h"
23     #include "PARAMS.h"
24     #include "GAD.h"
25    
26     C == Routine arguments ==
27     INTEGER bi_arg,bj_arg,k
28     _RL dTarg
29     _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
30     _RL wVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
31     _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
32     _RL wT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
33     INTEGER myThid
34    
35     C == Local variables ==
36     INTEGER i,j,kp1,km1,km2,bi,bj
37     _RL Rjm,Rj,Rjp,cfl,d0,d1
38     _RL psiP,psiM,thetaP,thetaM
39    
40     IF (.NOT. multiDimAdvection) THEN
41     C If using the standard time-stepping/advection schemes (ie. AB-II)
42     C then the data-structures are all global arrays
43     bi=bi_arg
44     bj=bj_arg
45     ELSE
46     C otherwise if using the multi-dimensional advection schemes
47     C then the data-structures are all local arrays except
48     C for maskC(...) and wVel(...)
49     bi=1
50     bj=1
51     ENDIF
52    
53     km2=MAX(1,k-2)
54     km1=MAX(1,k-1)
55     kp1=MIN(Nr,k+1)
56    
57     DO j=1-Oly,sNy+Oly
58     DO i=1-Olx,sNx+Olx
59     Rjp=(tracer(i,j,k,bi,bj)-tracer(i,j,kp1,bi,bj))
60 adcroft 1.3 & *maskC(i,j,kp1,bi_arg,bj_arg)
61 adcroft 1.1 Rj =(tracer(i,j,km1,bi,bj)-tracer(i,j,k,bi,bj))
62 adcroft 1.3 & *maskC(i,j,k,bi_arg,bj_arg)*maskC(i,j,km1,bi_arg,bj_arg)
63 adcroft 1.1 Rjm=(tracer(i,j,km2,bi,bj)-tracer(i,j,km1,bi,bj))
64 adcroft 1.3 & *maskC(i,j,km1,bi_arg,bj_arg)
65 adcroft 1.1
66 adcroft 1.3 cfl=abs(wVel(i,j,k,bi_arg,bj_arg)*dTarg*recip_drc(k))
67 heimbach 1.2 d0=(2.D0-cfl)*(1.-cfl)*oneSixth
68     d1=(1.D0-cfl*cfl)*oneSixth
69     c thetaP=0.D0
70     c IF (Rj.NE.0.D0) thetaP=Rjm/Rj
71 adcroft 1.1 thetaP=Rjm/(1.D-20+Rj)
72     psiP=d0+d1*thetaP
73 heimbach 1.2 psiP=max(0.D0,min(min(1.D0,psiP),
74     & (1.D0-cfl)/(1.D-20+cfl)*thetaP))
75 adcroft 1.1 thetaM=Rjp/(1.D-20+Rj)
76 heimbach 1.2 c thetaM=0.D0
77     c IF (Rj.NE.0.D0) thetaM=Rjp/Rj
78 adcroft 1.1 psiM=d0+d1*thetaM
79 heimbach 1.2 psiM=max(0.D0,min(min(1.D0,psiM),
80     & (1.D0-cfl)/(1.D-20+cfl)*thetaM))
81 adcroft 1.1 wT(i,j)=
82     & 0.5*(rTrans(i,j)+abs(rTrans(i,j)))
83     & *( Tracer(i,j, k ,bi,bj) + psiM*Rj )
84     & +0.5*(rTrans(i,j)-abs(rTrans(i,j)))
85     & *( Tracer(i,j,km1,bi,bj) - psiP*Rj )
86    
87     ENDDO
88     ENDDO
89    
90     RETURN
91     END

  ViewVC Help
Powered by ViewVC 1.1.22