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

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

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

revision 1.11 by jmc, Mon Jun 19 14:40:43 2006 UTC revision 1.12 by jmc, Tue Dec 5 22:21:50 2006 UTC
# Line 34  C     == Routine arguments == Line 34  C     == Routine arguments ==
34  C     == Local variables ==  C     == Local variables ==
35  C     vLoc    :: velocity [m/s], meridional component  C     vLoc    :: velocity [m/s], meridional component
36        INTEGER i,j        INTEGER i,j
37        _RL Rjm,Rj,Rjp,cfl,d0,d1,psiP,psiM,thetaP,thetaM        _RL Rjm,Rj,Rjp,vCFL,d0,d1,psiP,psiM,thetaP,thetaM
38        _RL vLoc        _RL vLoc
39        _RL thetaMax        _RL thetaMax
40        PARAMETER( thetaMax = 1.D+20 )        PARAMETER( thetaMax = 1.D+20 )
# Line 51  C     vLoc    :: velocity [m/s], meridio Line 51  C     vLoc    :: velocity [m/s], meridio
51          Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)          Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)
52    
53          vLoc = vFld(i,j)          vLoc = vFld(i,j)
54  c       vLoc = vTrans(i,j)*recip_dxG(i,j,bi,bj)          vCFL = ABS( vLoc*deltaTloc
55  c    &       *recip_drF(k)*_recip_hFacS(i,j,k,bi,bj)       &                  *recip_dyC(i,j,bi,bj)*recip_deepFacC(k) )
56          cfl=abs(vLoc*deltaTloc*recip_dyC(i,j,bi,bj))          d0=(2. _d 0 -vCFL)*(1. _d 0 -vCFL)*oneSixth
57          d0=(2. _d 0 -cfl)*(1. _d 0 -cfl)*oneSixth          d1=(1. _d 0 -vCFL*vCFL)*oneSixth
         d1=(1. _d 0 -cfl*cfl)*oneSixth  
58    
59  C-      the old version: can produce overflow, division by zero,  C-      the old version: can produce overflow, division by zero,
60  c       and is wrong for tracer with low concentration:  c       and is wrong for tracer with low concentration:
# Line 79  C-      prevent |thetaP,M| to reach too Line 78  C-      prevent |thetaP,M| to reach too
78          ENDIF          ENDIF
79    
80          psiP=d0+d1*thetaP          psiP=d0+d1*thetaP
81          psiP=MAX(0. _d 0, MIN(MIN(1. _d 0,psiP),          psiP=MAX(0. _d 0,MIN(MIN(1. _d 0,psiP),
82       &                        thetaP*(1. _d 0 -cfl)/(cfl+1. _d -20) ))       &                       thetaP*(1. _d 0 -vCFL)/(vCFL+1. _d -20) ))
83          psiM=d0+d1*thetaM          psiM=d0+d1*thetaM
84          psiM=MAX(0. _d 0, MIN(MIN(1. _d 0,psiM),          psiM=MAX(0. _d 0,MIN(MIN(1. _d 0,psiM),
85       &                        thetaM*(1. _d 0 -cfl)/(cfl+1. _d -20) ))       &                       thetaM*(1. _d 0 -vCFL)/(vCFL+1. _d -20) ))
86    
87          vT(i,j)=          vT(i,j)=
88       &   0.5*(vTrans(i,j)+abs(vTrans(i,j)))       &   0.5*(vTrans(i,j)+ABS(vTrans(i,j)))
89       &      *( Tracer(i,j-1) + psiP*Rj )       &      *( Tracer(i,j-1) + psiP*Rj )
90       &  +0.5*(vTrans(i,j)-abs(vTrans(i,j)))       &  +0.5*(vTrans(i,j)-ABS(vTrans(i,j)))
91       &      *( Tracer(i, j ) - psiM*Rj )       &      *( Tracer(i, j ) - psiM*Rj )
92    
93         ENDDO         ENDDO

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22