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

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

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


Revision 1.7 - (hide annotations) (download)
Fri Aug 19 22:19:35 2005 UTC (18 years, 9 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57s_post, checkpoint57r_post, checkpoint57t_post, checkpoint57v_post, checkpint57u_post, checkpoint57q_post
Changes since 1.6: +4 -4 lines
Make deltaT local deltaTloc to avoid interference with PARAMS.h

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

  ViewVC Help
Powered by ViewVC 1.1.22