/[MITgcm]/MITgcm/pkg/mom_fluxform/mom_fluxform.F
ViewVC logotype

Diff of /MITgcm/pkg/mom_fluxform/mom_fluxform.F

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

revision 1.45 by heimbach, Mon Oct 1 15:46:33 2012 UTC revision 1.48 by jmc, Mon Feb 3 22:55:44 2014 UTC
# Line 26  C stresses as well as internal viscous s Line 26  C stresses as well as internal viscous s
26  CEOI  CEOI
27    
28  #include "MOM_FLUXFORM_OPTIONS.h"  #include "MOM_FLUXFORM_OPTIONS.h"
29    #ifdef ALLOW_MOM_COMMON
30    # include "MOM_COMMON_OPTIONS.h"
31    #endif
32    
33  CBOP  CBOP
34  C !ROUTINE: MOM_FLUXFORM  C !ROUTINE: MOM_FLUXFORM
# Line 47  C !USES: =============================== Line 50  C !USES: ===============================
50  C     == Global variables ==  C     == Global variables ==
51        IMPLICIT NONE        IMPLICIT NONE
52  #include "SIZE.h"  #include "SIZE.h"
 #include "DYNVARS.h"  
 #include "FFIELDS.h"  
53  #include "EEPARAMS.h"  #include "EEPARAMS.h"
54  #include "PARAMS.h"  #include "PARAMS.h"
55  #include "GRID.h"  #include "GRID.h"
56    #include "DYNVARS.h"
57    #include "FFIELDS.h"
58  #include "SURFACE.h"  #include "SURFACE.h"
59    #ifdef ALLOW_MOM_COMMON
60    # include "MOM_VISC.h"
61    #endif
62  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
63  # include "tamc.h"  # include "tamc.h"
64  # include "tamc_keys.h"  # include "tamc_keys.h"
# Line 159  C     uDudxFac, AhDudxFac, etc ... indiv Line 165  C     uDudxFac, AhDudxFac, etc ... indiv
165        _RL  mtFacV        _RL  mtFacV
166        _RL  mtNHFacV        _RL  mtNHFacV
167        _RL  sideMaskFac        _RL  sideMaskFac
168        LOGICAL bottomDragTerms,harmonic,biharmonic,useVariableViscosity        LOGICAL bottomDragTerms
169  CEOP  CEOP
170  #ifdef MOM_BOUNDARY_CONSERVE  #ifdef MOM_BOUNDARY_CONSERVE
171        COMMON / MOM_FLUXFORM_LOCAL / uBnd, vBnd        COMMON / MOM_FLUXFORM_LOCAL / uBnd, vBnd
# Line 344  C-    Free surface correction term (flux Line 350  C-    Free surface correction term (flux
350  C---  endif momAdvection & k=1  C---  endif momAdvection & k=1
351        ENDIF        ENDIF
352    
   
353  C---  Calculate vertical transports (at k+1) below U & V points :  C---  Calculate vertical transports (at k+1) below U & V points :
354        IF (momAdvection) THEN        IF (momAdvection) THEN
355          CALL MOM_CALC_RTRANS( k+1, bi, bj,          CALL MOM_CALC_RTRANS( k+1, bi, bj,
# Line 363  C---  Calculate vertical transports (at Line 368  C---  Calculate vertical transports (at
368  #endif /* MOM_BOUNDARY_CONSERVE */  #endif /* MOM_BOUNDARY_CONSERVE */
369    
370        IF (momViscosity) THEN        IF (momViscosity) THEN
371         CALL MOM_CALC_VISC(         DO j=1-OLy,sNy+OLy
372       I        bi,bj,k,          DO i=1-OLx,sNx+OLx
373       O        viscAh_Z,viscAh_D,viscA4_Z,viscA4_D,           viscAh_D(i,j) = viscAhD
374       O        harmonic,biharmonic,useVariableViscosity,           viscAh_Z(i,j) = viscAhZ
375       I        hDiv,vort3,tension,strain,KE,hFacZ,           viscA4_D(i,j) = viscA4D
376       I        myThid)           viscA4_Z(i,j) = viscA4Z
377            ENDDO
378           ENDDO
379           IF ( useVariableVisc ) THEN
380            CALL MOM_CALC_VISC( bi, bj, k,
381         O           viscAh_Z, viscAh_D, viscA4_Z, viscA4_D,
382         I           hDiv, vort3, tension, strain, KE, hFacZ,
383         I           myThid )
384           ENDIF
385        ENDIF        ENDIF
386    
387  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
# Line 480  C-    endif momAdvection. Line 493  C-    endif momAdvection.
493  C---  Calculate eddy fluxes (dissipation) between cells for zonal flow.  C---  Calculate eddy fluxes (dissipation) between cells for zonal flow.
494    
495  C     Bi-harmonic term del^2 U -> v4F  C     Bi-harmonic term del^2 U -> v4F
496          IF (biharmonic)          IF ( useBiharmonicVisc )
497       &  CALL MOM_U_DEL2U(bi,bj,k,uFld,hFacZ,v4f,myThid)       &  CALL MOM_U_DEL2U(bi,bj,k,uFld,hFacZ,v4f,myThid)
498    
499  C     Laplacian and bi-harmonic terms, Zonal  Fluxes -> fZon  C     Laplacian and bi-harmonic terms, Zonal  Fluxes -> fZon
# Line 529  C     anelastic: hor.visc.fluxes are not Line 542  C     anelastic: hor.visc.fluxes are not
542  C-- No-slip and drag BCs appear as body forces in cell abutting topography  C-- No-slip and drag BCs appear as body forces in cell abutting topography
543          IF (no_slip_sides) THEN          IF (no_slip_sides) THEN
544  C-     No-slip BCs impose a drag at walls...  C-     No-slip BCs impose a drag at walls...
545           CALL MOM_U_SIDEDRAG(           CALL MOM_U_SIDEDRAG( bi, bj, k,
      I        bi,bj,k,  
546       I        uFld, v4f, hFacZ,       I        uFld, v4f, hFacZ,
547       I        viscAh_Z,viscA4_Z,       I        viscAh_Z, viscA4_Z,
548       I        harmonic,biharmonic,useVariableViscosity,       I        useHarmonicVisc, useBiharmonicVisc, useVariableVisc,
549       O        vF,       O        vF,
550       I        myThid)       I        myThid )
551           DO j=jMin,jMax           DO j=jMin,jMax
552            DO i=iMin,iMax            DO i=iMin,iMax
553             gUdiss(i,j) = gUdiss(i,j) + vF(i,j)             gUdiss(i,j) = gUdiss(i,j) + vF(i,j)
# Line 706  C-    endif momAdvection. Line 718  C-    endif momAdvection.
718        IF (momViscosity) THEN        IF (momViscosity) THEN
719  C---  Calculate eddy fluxes (dissipation) between cells for meridional flow.  C---  Calculate eddy fluxes (dissipation) between cells for meridional flow.
720  C     Bi-harmonic term del^2 V -> v4F  C     Bi-harmonic term del^2 V -> v4F
721          IF (biharmonic)          IF ( useBiharmonicVisc )
722       &  CALL MOM_V_DEL2V(bi,bj,k,vFld,hFacZ,v4f,myThid)       &  CALL MOM_V_DEL2V(bi,bj,k,vFld,hFacZ,v4f,myThid)
723    
724  C     Laplacian and bi-harmonic terms, Zonal  Fluxes -> fZon  C     Laplacian and bi-harmonic terms, Zonal  Fluxes -> fZon
# Line 755  C     anelastic: hor.visc.fluxes are not Line 767  C     anelastic: hor.visc.fluxes are not
767  C-- No-slip and drag BCs appear as body forces in cell abutting topography  C-- No-slip and drag BCs appear as body forces in cell abutting topography
768          IF (no_slip_sides) THEN          IF (no_slip_sides) THEN
769  C-     No-slip BCs impose a drag at walls...  C-     No-slip BCs impose a drag at walls...
770           CALL MOM_V_SIDEDRAG(           CALL MOM_V_SIDEDRAG( bi, bj, k,
      I        bi,bj,k,  
771       I        vFld, v4f, hFacZ,       I        vFld, v4f, hFacZ,
772       I        viscAh_Z,viscA4_Z,       I        viscAh_Z,viscA4_Z,
773       I        harmonic,biharmonic,useVariableViscosity,       I        useHarmonicVisc, useBiharmonicVisc, useVariableVisc,
774       O        vF,       O        vF,
775       I        myThid)       I        myThid )
776           DO j=jMin,jMax           DO j=jMin,jMax
777            DO i=iMin,iMax            DO i=iMin,iMax
778             gvDiss(i,j) = gvDiss(i,j) + vF(i,j)             gvDiss(i,j) = gvDiss(i,j) + vF(i,j)
# Line 829  C      o Cylindrical grid metric terms Line 840  C      o Cylindrical grid metric terms
840    
841  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
842    
843  C--   Coriolis term  C--   Coriolis term (call to CD_CODE_SCHEME has been moved to timestep.F)
 C     Note. As coded here, coriolis will not work with "thin walls"  
 c     IF (useCDscheme) THEN  
 c       CALL MOM_CDSCHEME(bi,bj,k,dPhiHydX,dPhiHydY,myThid)  
 c     ELSE  
844        IF (.NOT.useCDscheme) THEN        IF (.NOT.useCDscheme) THEN
845          CALL MOM_U_CORIOLIS(bi,bj,k,vFld,cf,myThid)          CALL MOM_U_CORIOLIS(bi,bj,k,vFld,cf,myThid)
846          DO j=jMin,jMax          DO j=jMin,jMax

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.48

  ViewVC Help
Powered by ViewVC 1.1.22