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

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

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


Revision 1.4 - (hide annotations) (download)
Fri Sep 24 16:53:46 2004 UTC (19 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57b_post, checkpoint56b_post, checkpoint57d_post, checkpoint57, checkpoint56, checkpoint55i_post, checkpoint57a_post, checkpoint55g_post, checkpoint57c_post, checkpoint55d_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint55h_post, checkpoint57e_post, checkpoint55f_post, eckpoint57e_pre, checkpoint56a_post, checkpoint56c_post, checkpoint57a_pre, checkpoint55e_post
Changes since 1.3: +6 -5 lines
use a local copy of maskW & maskS (new arguments of advection S/R) for
 the purpose of doing multidimAdvection on CS-grid.

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst3_adv_y.F,v 1.3 2002/03/06 01:29:36 jmc Exp $
2 jmc 1.3 C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6     SUBROUTINE GAD_DST3_ADV_Y(
7     I bi,bj,k,deltaT,
8     I vTrans, vVel,
9 jmc 1.4 I maskLocS, tracer,
10 adcroft 1.1 O vT,
11     I myThid )
12     C /==========================================================\
13     C | SUBROUTINE GAD_DST3_ADV_Y |
14     C | o Compute Meridional 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 vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
28     _RL vVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
29 jmc 1.4 _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
30 adcroft 1.1 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
31     _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
32     INTEGER myThid
33    
34     C == Local variables ==
35 jmc 1.3 C vFld :: velocity [m/s], meridional component
36 adcroft 1.1 INTEGER i,j
37     _RL Rjm,Rj,Rjp,cfl,d0,d1
38 adcroft 1.2 _RL psiP,psiM,thetaP,thetaM
39 jmc 1.3 _RL vFld
40 adcroft 1.1
41     DO i=1-Olx,sNx+Olx
42     vT(i,1-Oly)=0.
43     vT(i,2-Oly)=0.
44     vT(i,sNy+Oly)=0.
45     ENDDO
46     DO j=1-Oly+2,sNy+Oly-1
47     DO i=1-Olx,sNx+Olx
48 jmc 1.4 Rjp=(tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1)
49     Rj =(tracer(i, j )-tracer(i,j-1))*maskLocS(i, j )
50     Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)
51 adcroft 1.1
52 jmc 1.3 c vFld = vVel(i,j,k,bi,bj)
53     vFld = vTrans(i,j)*recip_dxG(i,j,bi,bj)
54     & *recip_drF(k)*recip_hFacS(i,j,k,bi,bj)
55     cfl=abs(vFld*deltaT*recip_dyC(i,j,bi,bj))
56 adcroft 1.2 d0=(2.-cfl)*(1.-cfl)*oneSixth
57     d1=(1.-cfl*cfl)*oneSixth
58     c thetaP=0.
59     c IF (Rj.NE.0.) thetaP=Rjm/Rj
60     thetaP=Rjm/(1.D-20+Rj)
61     psiP=d0+d1*thetaP
62     c psiP=max(0.,min(min(1.,psiP),(1.-cfl)/(1.D-20+cfl)*thetaP))
63     thetaM=Rjp/(1.D-20+Rj)
64     c thetaM=0.
65     c IF (Rj.NE.0.) thetaM=Rjp/Rj
66     psiM=d0+d1*thetaM
67     c psiM=max(0.,min(min(1.,psiM),(1.-cfl)/(1.D-20+cfl)*thetaM))
68 adcroft 1.1 vT(i,j)=
69     & 0.5*(vTrans(i,j)+abs(vTrans(i,j)))
70 adcroft 1.2 & *( Tracer(i,j-1) + psiP*Rj )
71 adcroft 1.1 & +0.5*(vTrans(i,j)-abs(vTrans(i,j)))
72 adcroft 1.2 & *( Tracer(i, j ) - psiM*Rj )
73 adcroft 1.1
74     ENDDO
75     ENDDO
76    
77     RETURN
78     END

  ViewVC Help
Powered by ViewVC 1.1.22