/[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.152 by jmc, Wed Nov 17 06:05:29 2010 UTC revision 1.160 by jmc, Thu Dec 1 14:22:27 2011 UTC
# Line 96  C     == Global variables === Line 96  C     == Global variables ===
96  #  include "PTRACERS_FIELDS.h"  #  include "PTRACERS_FIELDS.h"
97  # endif  # endif
98  # ifdef ALLOW_OBCS  # ifdef ALLOW_OBCS
99  #  include "OBCS.h"  #  include "OBCS_FIELDS.h"
100  #  ifdef ALLOW_PTRACERS  #  ifdef ALLOW_PTRACERS
101  #   include "OBCS_PTRACERS.h"  #   include "OBCS_PTRACERS.h"
102  #  endif  #  endif
# Line 247  C--- Line 247  C---
247  CEOP  CEOP
248    
249  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
250        IF ( debugLevel .GE. debLevB )        IF (debugMode) CALL DEBUG_ENTER( 'DYNAMICS', myThid )
      &   CALL DEBUG_ENTER( 'DYNAMICS', myThid )  
251  #endif  #endif
252    
253  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
# Line 265  C   if desired: Line 264  C   if desired:
264        CALL CALC_EP_FORCING(myThid)        CALL CALC_EP_FORCING(myThid)
265  #endif  #endif
266    
267    #ifdef ALLOW_AUTODIFF_MONITOR_DIAG
268          CALL DUMMY_IN_DYNAMICS( mytime, myiter, myThid )
269    #endif
270    
271  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
272  C--   HPF directive to help TAMC  C--   HPF directive to help TAMC
273  CHPF$ INDEPENDENT  CHPF$ INDEPENDENT
# Line 399  CADJ STORE KappaRV(:,:,:) Line 402  CADJ STORE KappaRV(:,:,:)
402  CADJ &     = comlev1_bibj, key=idynkey, byte=isbyte  CADJ &     = comlev1_bibj, key=idynkey, byte=isbyte
403  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
404    
405    #ifdef ALLOW_OBCS
406    C--   For Stevens boundary conditions velocities need to be extrapolated
407    C     (copied) to a narrow strip outside the domain
408             IF ( useOBCS ) THEN
409              CALL OBCS_COPY_UV_N(
410         U         uVel(1-Olx,1-Oly,1,bi,bj),
411         U         vVel(1-Olx,1-Oly,1,bi,bj),
412         I         Nr, bi, bj, myThid )
413             ENDIF
414    #endif /* ALLOW_OBCS */
415    
416  C--     Start of dynamics loop  C--     Start of dynamics loop
417          DO k=1,Nr          DO k=1,Nr
418    
# Line 557  C Line 571  C
571       I         guDissip, gvDissip,       I         guDissip, gvDissip,
572       I         myTime, myIter, myThid)       I         myTime, myIter, myThid)
573    
 #ifdef   ALLOW_OBCS  
 C--      Apply open boundary conditions  
 c          IF (useOBCS) THEN  
 c            CALL OBCS_APPLY_UV( bi, bj, k, gU, gV, myThid )  
 c          ENDIF  
 #endif   /* ALLOW_OBCS */  
   
574           ENDIF           ENDIF
575    
576  C--     end of dynamics k loop (1:Nr)  C--     end of dynamics k loop (1:Nr)
# Line 587  CADJ STORE gU(:,:,:,bi,bj) = comlev1_bib Line 594  CADJ STORE gU(:,:,:,bi,bj) = comlev1_bib
594  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
595            CALL IMPLDIFF(            CALL IMPLDIFF(
596       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
597       I         -1, KappaRU,recip_HFacW,       I         -1, KappaRU, recip_hFacW(1-OLx,1-OLy,1,bi,bj),
598       U         gU,       U         gU,
599       I         myThid )       I         myThid )
600  #ifdef    ALLOW_AUTODIFF_TAMC  #ifdef    ALLOW_AUTODIFF_TAMC
# Line 596  CADJ STORE gV(:,:,:,bi,bj) = comlev1_bib Line 603  CADJ STORE gV(:,:,:,bi,bj) = comlev1_bib
603  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
604            CALL IMPLDIFF(            CALL IMPLDIFF(
605       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
606       I         -2, KappaRV,recip_HFacS,       I         -2, KappaRV, recip_hFacS(1-OLx,1-OLy,1,bi,bj),
607       U         gV,       U         gV,
608       I         myThid )       I         myThid )
609          ENDIF          ENDIF
610    
611  #ifdef   ALLOW_OBCS  #ifdef ALLOW_OBCS
612  C--      Apply open boundary conditions  C--      Apply open boundary conditions
 c       IF ( useOBCS .AND.(implicitViscosity.OR.momImplVertAdv) ) THEN  
 c          DO K=1,Nr  
 c            CALL OBCS_APPLY_UV( bi, bj, k, gU, gV, myThid )  
 c          ENDDO  
613          IF ( useOBCS ) THEN          IF ( useOBCS ) THEN
614    C--      but first save intermediate velocities to be used in the
615    C        next time step for the Stevens boundary conditions
616              CALL OBCS_SAVE_UV_N(
617         I        bi, bj, iMin, iMax, jMin, jMax, 0,
618         I        gU, gV, myThid )
619            CALL OBCS_APPLY_UV( bi, bj, 0, gU, gV, myThid )            CALL OBCS_APPLY_UV( bi, bj, 0, gU, gV, myThid )
620          ENDIF          ENDIF
621  #endif   /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
622    
623  #ifdef    ALLOW_CD_CODE  #ifdef    ALLOW_CD_CODE
624          IF (implicitViscosity.AND.useCDscheme) THEN          IF (implicitViscosity.AND.useCDscheme) THEN
# Line 619  CADJ STORE vVelD(:,:,:,bi,bj) = comlev1_ Line 627  CADJ STORE vVelD(:,:,:,bi,bj) = comlev1_
627  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
628            CALL IMPLDIFF(            CALL IMPLDIFF(
629       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
630       I         0, KappaRU,recip_HFacW,       I         0, KappaRU, recip_hFacW(1-OLx,1-OLy,1,bi,bj),
631       U         vVelD,       U         vVelD,
632       I         myThid )       I         myThid )
633  #ifdef    ALLOW_AUTODIFF_TAMC  #ifdef    ALLOW_AUTODIFF_TAMC
# Line 627  CADJ STORE uVelD(:,:,:,bi,bj) = comlev1_ Line 635  CADJ STORE uVelD(:,:,:,bi,bj) = comlev1_
635  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
636            CALL IMPLDIFF(            CALL IMPLDIFF(
637       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
638       I         0, KappaRV,recip_HFacS,       I         0, KappaRV, recip_hFacS(1-OLx,1-OLy,1,bi,bj),
639       U         uVelD,       U         uVelD,
640       I         myThid )       I         myThid )
641          ENDIF          ENDIF
# Line 640  C---+----1----+----2----+----3----+----4 Line 648  C---+----1----+----2----+----3----+----4
648  C--   Step forward W field in N-H algorithm  C--   Step forward W field in N-H algorithm
649          IF ( nonHydrostatic ) THEN          IF ( nonHydrostatic ) THEN
650  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
651           IF ( debugLevel .GE. debLevB )           IF (debugMode) CALL DEBUG_CALL('CALC_GW', myThid )
      &     CALL DEBUG_CALL('CALC_GW', myThid )  
652  #endif  #endif
653           CALL TIMER_START('CALC_GW          [DYNAMICS]',myThid)           CALL TIMER_START('CALC_GW          [DYNAMICS]',myThid)
654           CALL CALC_GW(           CALL CALC_GW(
# Line 662  C-    end of bi,bj loops Line 669  C-    end of bi,bj loops
669    
670  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
671        IF (useOBCS) THEN        IF (useOBCS) THEN
672         CALL OBCS_PRESCRIBE_EXCHANGES(myThid)          CALL OBCS_EXCHANGES( myThid )
673        ENDIF        ENDIF
674  #endif  #endif
675    
# Line 691  Cml) Line 698  Cml)
698  #endif /* ALLOW_DIAGNOSTICS */  #endif /* ALLOW_DIAGNOSTICS */
699    
700  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
701        If ( debugLevel .GE. debLevB ) THEN        IF ( debugLevel .GE. debLevD ) THEN
702         CALL DEBUG_STATS_RL(1,EtaN,'EtaN (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(1,EtaN,'EtaN (DYNAMICS)',myThid)
703         CALL DEBUG_STATS_RL(Nr,uVel,'Uvel (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,uVel,'Uvel (DYNAMICS)',myThid)
704         CALL DEBUG_STATS_RL(Nr,vVel,'Vvel (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,vVel,'Vvel (DYNAMICS)',myThid)
# Line 715  Cml) Line 722  Cml)
722  C- jmc: For safety checking only: This Exchange here should not change  C- jmc: For safety checking only: This Exchange here should not change
723  C       the solution. If solution changes, it means something is wrong,  C       the solution. If solution changes, it means something is wrong,
724  C       but it does not mean that it is less wrong with this exchange.  C       but it does not mean that it is less wrong with this exchange.
725        IF ( debugLevel .GT. debLevB ) THEN        IF ( debugLevel .GE. debLevE ) THEN
726         CALL EXCH_UV_XYZ_RL(gU,gV,.TRUE.,myThid)         CALL EXCH_UV_XYZ_RL(gU,gV,.TRUE.,myThid)
727        ENDIF        ENDIF
728  #endif  #endif
729    
730  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
731        IF ( debugLevel .GE. debLevB )        IF (debugMode) CALL DEBUG_LEAVE( 'DYNAMICS', myThid )
      &   CALL DEBUG_LEAVE( 'DYNAMICS', myThid )  
732  #endif  #endif
733    
734        RETURN        RETURN

Legend:
Removed from v.1.152  
changed lines
  Added in v.1.160

  ViewVC Help
Powered by ViewVC 1.1.22