/[MITgcm]/MITgcm/model/src/dynamics.F
ViewVC logotype

Diff of /MITgcm/model/src/dynamics.F

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

revision 1.11 by adcroft, Mon Jun 1 20:36:13 1998 UTC revision 1.16 by cnh, Tue Jun 9 16:34:03 1998 UTC
# Line 39  C     myThid - Thread number for this in Line 39  C     myThid - Thread number for this in
39  C     == Local variables  C     == Local variables
40  C     xA, yA                 - Per block temporaries holding face areas  C     xA, yA                 - Per block temporaries holding face areas
41  C     uTrans, vTrans, wTrans - Per block temporaries holding flow transport  C     uTrans, vTrans, wTrans - Per block temporaries holding flow transport
42  C                              o uTrans: Zonal transport  C     wVel                     o uTrans: Zonal transport
43  C                              o vTrans: Meridional transport  C                              o vTrans: Meridional transport
44  C                              o wTrans: Vertical transport  C                              o wTrans: Vertical transport
45    C                              o wVel:   Vertical velocity at upper and lower
46    C                                        cell faces.
47  C     maskC,maskUp             o maskC: land/water mask for tracer cells  C     maskC,maskUp             o maskC: land/water mask for tracer cells
48  C                              o maskUp: land/water mask for W points  C                              o maskUp: land/water mask for W points
49  C     aTerm, xTerm, cTerm    - Work arrays for holding separate terms in  C     aTerm, xTerm, cTerm    - Work arrays for holding separate terms in
# Line 68  C                          into fVerTerm Line 70  C                          into fVerTerm
70        _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
71        _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
72        _RL wTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL wTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
73          _RL wVel  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
74        _RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
75        _RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
76        _RL aTerm (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL aTerm (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
# Line 91  C                          into fVerTerm Line 94  C                          into fVerTerm
94        _RL K23   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz)        _RL K23   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz)
95        _RL K33   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz)        _RL K33   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nz)
96        _RL KapGM (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL KapGM (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
97          _RL KappaZT(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nz)
98    
99        INTEGER iMin, iMax        INTEGER iMin, iMax
100        INTEGER jMin, jMax        INTEGER jMin, jMax
101        INTEGER bi, bj        INTEGER bi, bj
# Line 106  C       pressure such that the resulting Line 111  C       pressure such that the resulting
111  C       with the free-surface evolution or the rigid-lid:  C       with the free-surface evolution or the rigid-lid:
112  C         U[n] = U* + dt x d/dx P  C         U[n] = U* + dt x d/dx P
113  C         V[n] = V* + dt x d/dy P  C         V[n] = V* + dt x d/dy P
 C       With implicit diffusion, the tracers must also be "finalized"  
 C         (1 + dt * K * d_zz) theta[n] = theta*  
 C         (1 + dt * K * d_zz) salt[n] = salt*  
114  C  C
115  C       "Calculation of Gs"  C       "Calculation of Gs"
116  C       ===================  C       ===================
# Line 122  C         Gv[n] = Gv( u[n], v[n], w, rho Line 124  C         Gv[n] = Gv( u[n], v[n], w, rho
124  C         Gt[n] = Gt( theta[n], u[n], v[n], w, K31, ... )  C         Gt[n] = Gt( theta[n], u[n], v[n], w, K31, ... )
125  C         Gs[n] = Gs( salt[n], u[n], v[n], w, K31, ... )  C         Gs[n] = Gs( salt[n], u[n], v[n], w, K31, ... )
126  C  C
127  C       "Time-stepping" or "Predicition"  C       "Time-stepping" or "Prediction"
128  C       ================================  C       ================================
129  C       The models variables are stepped forward with the appropriate  C       The models variables are stepped forward with the appropriate
130  C       time-stepping scheme (currently we use Adams-Bashforth II)  C       time-stepping scheme (currently we use Adams-Bashforth II)
# Line 137  C         U* = U[n] + dt x ( 3/2 Gu[n] - Line 139  C         U* = U[n] + dt x ( 3/2 Gu[n] -
139  C         V* = V[n] + dt x ( 3/2 Gv[n] - 1/2 Gv[n-1] )  C         V* = V[n] + dt x ( 3/2 Gv[n] - 1/2 Gv[n-1] )
140  C         theta[n+1] = theta[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] )  C         theta[n+1] = theta[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] )
141  C         salt[n+1] = salt[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] )  C         salt[n+1] = salt[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] )
142  C       or with implicit diffusion  C       With implicit diffusion:
143  C         theta* = theta[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] )  C         theta* = theta[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] )
 C  
144  C         salt* = salt[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] )  C         salt* = salt[n] + dt x ( 3/2 Gt[n] - 1/2 atG[n-1] )
145    C         (1 + dt * K * d_zz) theta[n] = theta*
146    C         (1 + dt * K * d_zz) salt[n] = salt*
147  C---  C---
148    
   
149  C--   Set up work arrays with valid (i.e. not NaN) values  C--   Set up work arrays with valid (i.e. not NaN) values
150  C     These inital values do not alter the numerical results. They  C     These inital values do not alter the numerical results. They
151  C     just ensure that all memory references are to valid floating  C     just ensure that all memory references are to valid floating
# Line 167  C     uninitialised but inert locations. Line 169  C     uninitialised but inert locations.
169           K13(i,j,k) = 0. _d 0           K13(i,j,k) = 0. _d 0
170           K23(i,j,k) = 0. _d 0           K23(i,j,k) = 0. _d 0
171           K33(i,j,k) = 0. _d 0           K33(i,j,k) = 0. _d 0
172             KappaZT(i,j,k) = 0. _d 0
173          ENDDO          ENDDO
174          rhokm1(i,j)  = 0. _d 0          rhokm1(i,j)  = 0. _d 0
175          rhokp1(i,j)  = 0. _d 0          rhokp1(i,j)  = 0. _d 0
176          rhotmp(i,j)  = 0. _d 0          rhotmp(i,j)  = 0. _d 0
177            maskC (i,j)  = 0. _d 0
178         ENDDO         ENDDO
179        ENDDO        ENDDO
180    
# Line 181  C--     Set up work arrays that need val Line 185  C--     Set up work arrays that need val
185          DO j=1-OLy,sNy+OLy          DO j=1-OLy,sNy+OLy
186           DO i=1-OLx,sNx+OLx           DO i=1-OLx,sNx+OLx
187            wTrans(i,j)  = 0. _d 0            wTrans(i,j)  = 0. _d 0
188              wVel  (i,j,1) = 0. _d 0
189              wVel  (i,j,2) = 0. _d 0
190            fVerT(i,j,1) = 0. _d 0            fVerT(i,j,1) = 0. _d 0
191            fVerT(i,j,2) = 0. _d 0            fVerT(i,j,2) = 0. _d 0
192            fVerS(i,j,1) = 0. _d 0            fVerS(i,j,1) = 0. _d 0
# Line 222  C--     Integrate hydrostatic balance fo Line 228  C--     Integrate hydrostatic balance fo
228       I      bi,bj,iMin,iMax,jMin,jMax,1,rhoKm1,rhoKm1,       I      bi,bj,iMin,iMax,jMin,jMax,1,rhoKm1,rhoKm1,
229       U      pH,       U      pH,
230       I      myThid )       I      myThid )
231          DO J=1-Oly,sNy+Oly          DO J=jMin,jMax
232           DO I=1-Olx,sNx+Olx           DO I=iMin,iMax
233            rhoKp1(I,J)=rhoKm1(I,J)            rhoKp1(I,J)=rhoKm1(I,J)
234           ENDDO           ENDDO
235          ENDDO          ENDDO
# Line 238  copt I     bi, bj, iMin, iMax, jMin, jMa Line 244  copt I     bi, bj, iMin, iMax, jMin, jMa
244  copt O     rhoKm1,  copt O     rhoKm1,
245  copt I     myThid )  copt I     myThid )
246  C       rhoKm1=rhoKp1  C       rhoKm1=rhoKp1
247          DO J=1-Oly,sNy+Oly          DO J=jMin,jMax
248           DO I=1-Olx,sNx+Olx           DO I=iMin,iMax
249            rhoKm1(I,J)=rhoKp1(I,J)            rhoKm1(I,J)=rhoKp1(I,J)
250           ENDDO           ENDDO
251          ENDDO          ENDDO
# Line 261  C--     Calculate iso-neutral slopes for Line 267  C--     Calculate iso-neutral slopes for
267       I            myThid )       I            myThid )
268  C--     Calculate static stability and mix where convectively unstable  C--     Calculate static stability and mix where convectively unstable
269          CALL CONVECT(          CALL CONVECT(
270       I      bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1,rhoKp1,       I      bi,bj,iMin,iMax,jMin,jMax,K,rhotmp,rhoKp1,
271       I      myTime,myIter,myThid)       I      myTime,myIter,myThid)
272  C--     Density of K-1 level (above W(K)) reference to K-1 level  C--     Density of K-1 level (above W(K)) reference to K-1 level
273          CALL FIND_RHO(          CALL FIND_RHO(
# Line 300  C--     Initial boundary condition on ba Line 306  C--     Initial boundary condition on ba
306  C--      Get temporary terms used by tendency routines  C--      Get temporary terms used by tendency routines
307           CALL CALC_COMMON_FACTORS (           CALL CALC_COMMON_FACTORS (
308       I        bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,       I        bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
309       O        xA,yA,uTrans,vTrans,wTrans,maskC,maskUp,       O        xA,yA,uTrans,vTrans,wTrans,wVel,maskC,maskUp,
310         I        myThid)
311    
312    C--      Calculate the total vertical diffusivity
313             CALL CALC_DIFFUSIVITY(
314         I        bi,bj,iMin,iMax,jMin,jMax,K,
315         I        maskC,maskUp,KapGM,K33,
316         O        KappaZT,
317       I        myThid)       I        myThid)
318    
319  C--      Calculate accelerations in the momentum equations  C--      Calculate accelerations in the momentum equations
320           IF ( momStepping ) THEN           IF ( momStepping ) THEN
321            CALL CALC_MOM_RHS(            CALL CALC_MOM_RHS(
322       I         bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,       I         bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
323       I         xA,yA,uTrans,vTrans,wTrans,maskC,       I         xA,yA,uTrans,vTrans,wTrans,wVel,maskC,
324       I         pH,       I         pH,
325       U         aTerm,xTerm,cTerm,mTerm,pTerm,       U         aTerm,xTerm,cTerm,mTerm,pTerm,
326       U         fZon, fMer, fVerU, fVerV,       U         fZon, fMer, fVerU, fVerV,
# Line 319  C--      Calculate active tracer tendenc Line 332  C--      Calculate active tracer tendenc
332            CALL CALC_GT(            CALL CALC_GT(
333       I         bi,bj,iMin,iMax,jMin,jMax, k,kM1,kUp,kDown,       I         bi,bj,iMin,iMax,jMin,jMax, k,kM1,kUp,kDown,
334       I         xA,yA,uTrans,vTrans,wTrans,maskUp,       I         xA,yA,uTrans,vTrans,wTrans,maskUp,
335       I         K13,K23,K33,KapGM,       I         K13,K23,KappaZT,KapGM,
336       U         aTerm,xTerm,fZon,fMer,fVerT,       U         aTerm,xTerm,fZon,fMer,fVerT,
337       I         myThid)       I         myThid)
338           ENDIF           ENDIF
# Line 342  C--      Diagnose barotropic divergence Line 355  C--      Diagnose barotropic divergence
355       I       myThid)       I       myThid)
356    
357          ENDDO ! K          ENDDO ! K
358    
359    C--     Implicit diffusion
360            IF (implicitDiffusion) THEN
361             CALL IMPLDIFF( bi, bj, iMin, iMax, jMin, jMax,
362         I                  KappaZT,
363         I                  myThid )
364            ENDIF
365    
366         ENDDO         ENDDO
367        ENDDO        ENDDO
368    
369  !dbg  write(0,*) 'dynamics: pS',minval(cg2d_x),maxval(cg2d_x)        write(0,*) 'dynamics: pS ',minval(cg2d_x(1:sNx,1:sNy,:,:)),
370  !dbg  write(0,*) 'dynamics: U',minval(uVel(1:sNx,1:sNy,:,:,:)),       &                           maxval(cg2d_x(1:sNx,1:sNy,:,:))
371  !dbg &                         maxval(uVel(1:sNx,1:sNy,:,:,:))        write(0,*) 'dynamics: U  ',minval(uVel(1:sNx,1:sNy,:,:,:)),
372  !dbg  write(0,*) 'dynamics: V',minval(vVel(1:sNx,1:sNy,:,:,:)),       &                           maxval(uVel(1:sNx,1:sNy,:,:,:))
373  !dbg &                         maxval(vVel(1:sNx,1:sNy,:,:,:))        write(0,*) 'dynamics: V  ',minval(vVel(1:sNx,1:sNy,:,:,:)),
374  !dbg  write(0,*) 'dynamics: K13',minval(K13(1:sNx,1:sNy,:)),       &                           maxval(vVel(1:sNx,1:sNy,:,:,:))
375  !dbg &                         maxval(K13(1:sNx,1:sNy,:))  cblk  write(0,*) 'dynamics: K13',minval(K13(1:sNx,1:sNy,:)),
376  !dbg  write(0,*) 'dynamics: K23',minval(K23(1:sNx,1:sNy,:)),  cblk &                           maxval(K13(1:sNx,1:sNy,:))
377  !dbg &                         maxval(K23(1:sNx,1:sNy,:))  cblk  write(0,*) 'dynamics: K23',minval(K23(1:sNx,1:sNy,:)),
378  !dbg  write(0,*) 'dynamics: K33',minval(K33(1:sNx,1:sNy,:)),  cblk &                           maxval(K23(1:sNx,1:sNy,:))
379  !dbg &                         maxval(K33(1:sNx,1:sNy,:))  cblk  write(0,*) 'dynamics: K33',minval(K33(1:sNx,1:sNy,:)),
380  !dbg  write(0,*) 'dynamics: gT',minval(gT(1:sNx,1:sNy,:,:,:)),  cblk &                           maxval(K33(1:sNx,1:sNy,:))
381  !dbg &                         maxval(gT(1:sNx,1:sNy,:,:,:))        write(0,*) 'dynamics: gT ',minval(gT(1:sNx,1:sNy,:,:,:)),
382  !dbg  write(0,*) 'dynamics: T',minval(Theta(1:sNx,1:sNy,:,:,:)),       &                           maxval(gT(1:sNx,1:sNy,:,:,:))
383  !dbg &                         maxval(Theta(1:sNx,1:sNy,:,:,:))        write(0,*) 'dynamics: T  ',minval(Theta(1:sNx,1:sNy,:,:,:)),
384  !dbg  write(0,*) 'dynamics: pH',minval(pH/(Gravity*Rhonil)),       &                           maxval(Theta(1:sNx,1:sNy,:,:,:))
385  !dbg &                          maxval(pH/(Gravity*Rhonil))  cblk  write(0,*) 'dynamics: pH ',minval(pH/(Gravity*Rhonil)),
386    cblk &                           maxval(pH/(Gravity*Rhonil))
387    
388        RETURN        RETURN
389        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22