/[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.83.4.5 by heimbach, Fri Mar 7 23:10:20 2003 UTC revision 1.83.4.6 by heimbach, Tue Jun 24 23:05:28 2003 UTC
# Line 204  C         (1 + dt * K * d_zz) salt[n] = Line 204  C         (1 + dt * K * d_zz) salt[n] =
204  C---  C---
205  CEOP  CEOP
206    
 C--   Set up work arrays with valid (i.e. not NaN) values  
 C     These inital values do not alter the numerical results. They  
 C     just ensure that all memory references are to valid floating  
 C     point numbers. This prevents spurious hardware signals due to  
 C     uninitialised but inert locations.  
       DO j=1-OLy,sNy+OLy  
        DO i=1-OLx,sNx+OLx  
         phiSurfX(i,j) = 0. _d 0  
         phiSurfY(i,j) = 0. _d 0  
        ENDDO  
       ENDDO  
   
207  C-- Call to routine for calculation of  C-- Call to routine for calculation of
208  C   Eliassen-Palm-flux-forced U-tendency,  C   Eliassen-Palm-flux-forced U-tendency,
209  C   if desired:  C   if desired:
# Line 253  CHPF$&                  ) Line 241  CHPF$&                  )
241       &                      + act4*max1*max2*max3       &                      + act4*max1*max2*max3
242  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
243    
244  C--     Set up work arrays that need valid initial values  C--   Set up work arrays with valid (i.e. not NaN) values
245    C     These inital values do not alter the numerical results. They
246    C     just ensure that all memory references are to valid floating
247    C     point numbers. This prevents spurious hardware signals due to
248    C     uninitialised but inert locations.
249    
250          DO k=1,Nr          DO k=1,Nr
251           DO j=1-OLy,sNy+OLy           DO j=1-OLy,sNy+OLy
252            DO i=1-OLx,sNx+OLx            DO i=1-OLx,sNx+OLx
253             KappaRU(i,j,k) = 0. _d 0             KappaRU(i,j,k) = 0. _d 0
254             KappaRV(i,j,k) = 0. _d 0             KappaRV(i,j,k) = 0. _d 0
255    #ifdef ALLOW_AUTODIFF_TAMC
256    cph(
257    c--   need some re-initialisation here to break dependencies
258    c--   totphihyd is assumed zero from ini_pressure, i.e.
259    c--   avoiding iterate pressure p = integral of (g*rho(p)*dz)
260    cph)
261               totPhiHyd(i,j,k,bi,bj) = 0. _d 0
262               gu(i,j,k,bi,bj) = 0. _d 0
263               gv(i,j,k,bi,bj) = 0. _d 0
264    #endif
265            ENDDO            ENDDO
266           ENDDO           ENDDO
267          ENDDO          ENDDO
# Line 272  C--     Set up work arrays that need val Line 275  C--     Set up work arrays that need val
275            phiHydC (i,j)  = 0. _d 0            phiHydC (i,j)  = 0. _d 0
276            dPhiHydX(i,j)  = 0. _d 0            dPhiHydX(i,j)  = 0. _d 0
277            dPhiHydY(i,j)  = 0. _d 0            dPhiHydY(i,j)  = 0. _d 0
278              phiSurfX(i,j)  = 0. _d 0
279              phiSurfY(i,j)  = 0. _d 0
280           ENDDO           ENDDO
281          ENDDO          ENDDO
282    
# Line 353  C        distinguishe between Stagger an Line 358  C        distinguishe between Stagger an
358           ENDIF           ENDIF
359    
360  C--      Calculate accelerations in the momentum equations (gU, gV, ...)  C--      Calculate accelerations in the momentum equations (gU, gV, ...)
361  C        and step forward storing the result in gUnm1, gVnm1, etc...  C        and step forward storing the result in gU, gV, etc...
362           IF ( momStepping ) THEN           IF ( momStepping ) THEN
363  #ifndef DISABLE_MOM_FLUXFORM  #ifndef DISABLE_MOM_FLUXFORM
364             IF (.NOT. vectorInvariantMomentum) CALL MOM_FLUXFORM(             IF (.NOT. vectorInvariantMomentum) CALL MOM_FLUXFORM(
# Line 372  C        and step forward storing the re Line 377  C        and step forward storing the re
377             CALL TIMESTEP(             CALL TIMESTEP(
378       I         bi,bj,iMin,iMax,jMin,jMax,k,       I         bi,bj,iMin,iMax,jMin,jMax,k,
379       I         dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,       I         dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,
380       I         myIter, myThid)       I         myTime, myIter, myThid)
381    
382  #ifdef   ALLOW_OBCS  #ifdef   ALLOW_OBCS
383  C--      Apply open boundary conditions  C--      Apply open boundary conditions
384           IF (useOBCS) THEN             IF (useOBCS) THEN
385             CALL OBCS_APPLY_UV( bi, bj, k, gUnm1, gVnm1, myThid )               CALL OBCS_APPLY_UV( bi, bj, k, gU, gV, myThid )
386           END IF             ENDIF
387  #endif   /* ALLOW_OBCS */  #endif   /* ALLOW_OBCS */
388    
 #ifdef   ALLOW_AUTODIFF_TAMC  
 #ifdef   INCLUDE_CD_CODE  
          ELSE  
            DO j=1-OLy,sNy+OLy  
              DO i=1-OLx,sNx+OLx  
                guCD(i,j,k,bi,bj) = 0.0  
                gvCD(i,j,k,bi,bj) = 0.0  
              END DO  
            END DO  
 #endif   /* INCLUDE_CD_CODE */  
 #endif   /* ALLOW_AUTODIFF_TAMC */  
389           ENDIF           ENDIF
390    
391    
# Line 401  C--     end of dynamics k loop (1:Nr) Line 395  C--     end of dynamics k loop (1:Nr)
395  C--     Implicit viscosity  C--     Implicit viscosity
396          IF (implicitViscosity.AND.momStepping) THEN          IF (implicitViscosity.AND.momStepping) THEN
397  #ifdef    ALLOW_AUTODIFF_TAMC  #ifdef    ALLOW_AUTODIFF_TAMC
398  CADJ STORE gUNm1(:,:,:,bi,bj) = comlev1_bibj , key=idynkey, byte=isbyte  CADJ STORE gU(:,:,:,bi,bj) = comlev1_bibj , key=idynkey, byte=isbyte
399  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
400            CALL IMPLDIFF(            CALL IMPLDIFF(
401       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
402       I         deltaTmom, KappaRU,recip_HFacW,       I         deltaTmom, KappaRU,recip_HFacW,
403       U         gUNm1,       U         gU,
404       I         myThid )       I         myThid )
405  #ifdef    ALLOW_AUTODIFF_TAMC  #ifdef    ALLOW_AUTODIFF_TAMC
406  CADJ STORE gVNm1(:,:,:,bi,bj) = comlev1_bibj , key=idynkey, byte=isbyte  CADJ STORE gV(:,:,:,bi,bj) = comlev1_bibj , key=idynkey, byte=isbyte
407  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
408            CALL IMPLDIFF(            CALL IMPLDIFF(
409       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
410       I         deltaTmom, KappaRV,recip_HFacS,       I         deltaTmom, KappaRV,recip_HFacS,
411       U         gVNm1,       U         gV,
412       I         myThid )       I         myThid )
413    
414  #ifdef   ALLOW_OBCS  #ifdef   ALLOW_OBCS
415  C--      Apply open boundary conditions  C--      Apply open boundary conditions
416           IF (useOBCS) THEN           IF (useOBCS) THEN
417             DO K=1,Nr             DO K=1,Nr
418               CALL OBCS_APPLY_UV( bi, bj, k, gUnm1, gVnm1, myThid )               CALL OBCS_APPLY_UV( bi, bj, k, gU, gV, myThid )
419             ENDDO             ENDDO
420           END IF           END IF
421  #endif   /* ALLOW_OBCS */  #endif   /* ALLOW_OBCS */

Legend:
Removed from v.1.83.4.5  
changed lines
  Added in v.1.83.4.6

  ViewVC Help
Powered by ViewVC 1.1.22