<p><b>dwj07@fsu.edu</b> 2011-08-30 11:00:25 -0600 (Tue, 30 Aug 2011)</p><p><br>
        Separating out Vmix Velocity into modules and applying array masking.<br>
<br>
        Removing the error checker from the Vmix tracer modules, and putting that in mpas_core.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/performance/mpas/src/core_ocean/Makefile
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/Makefile        2011-08-30 16:03:43 UTC (rev 961)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/Makefile        2011-08-30 17:00:25 UTC (rev 962)
@@ -12,6 +12,9 @@
module_OcnVmixTracer.o \
module_OcnVmixTracerConst.o \
module_OcnVmixTracerTanh.o \
+ module_OcnVmixVel.o \
+ module_OcnVmixVelConst.o \
+ module_OcnVmixVelTanh.o \
module_OcnCoriolis.o \
         module_OcnThickness.o \
         module_OcnVelocityForcing.o \
@@ -39,6 +42,12 @@
module_OcnVmixTracer.o: module_OcnVmixTracerConst.o module_OcnVmixTracerTanh.o
+module_OcnVmixVelConst.o:
+
+module_OcnVmixVelTanh.o:
+
+module_OcnVmixVel.o: module_OcnVmixVelConst.o module_OcnVmixVelTanh.o
+
module_OcnHmixTracerDel2.o:
module_OcnHmixTracerDel4.o:
@@ -55,7 +64,7 @@
module_global_diagnostics.o:
-module_mpas_core.o: module_advection.o module_global_diagnostics.o module_test_cases.o module_OcnVelocityForcing.o module_OcnThickness.o module_OcnCoriolis.o module_OcnVmixTracer.o module_OcnVmixTracerConst.o module_OcnVmixTracerTanh.o module_OcnHmixTracer.o module_OcnHmixTracerDel2.o module_OcnHmixTracerDel4.o module_OcnHmixVel.o module_OcnHmixVelDel2.o module_OcnHmixVelDel4.o module_time_integration.o
+module_mpas_core.o: module_advection.o module_global_diagnostics.o module_test_cases.o module_OcnVelocityForcing.o module_OcnThickness.o module_OcnCoriolis.o module_OcnVmixVel.o module_OcnVmixVelConst.o module_OcnVmixVelTanh.o module_OcnVmixTracer.o module_OcnVmixTracerConst.o module_OcnVmixTracerTanh.o module_OcnHmixTracer.o module_OcnHmixTracerDel2.o module_OcnHmixTracerDel4.o module_OcnHmixVel.o module_OcnHmixVelDel2.o module_OcnHmixVelDel4.o module_time_integration.o
clean:
        $(RM) *.o *.mod *.f90 libdycore.a
Modified: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnCoriolis.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnCoriolis.F        2011-08-30 16:03:43 UTC (rev 961)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnCoriolis.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -59,7 +59,7 @@
!
!-----------------------------------------------------------------------
- subroutine OcnCoriolisTend(tend, pvEdge, hEdge, u, ke, nEdgesSolve, grid)
+ subroutine OcnCoriolisTend(tend, pvEdge, hEdge, u, ke, grid)
!-----------------------------------------------------------------
!
@@ -73,8 +73,6 @@
type (mesh_type), intent(in) :: &
grid !< Input: grid information
- integer, intent(in) :: nEdgesSolve
-
!-----------------------------------------------------------------
!
! input/output variables
@@ -96,7 +94,7 @@
!
!-----------------------------------------------------------------
- integer :: iEdge, j, k, cell1, cell2, eoe
+ integer :: iEdge, j, k, cell1, cell2, eoe, nEdgesSolve
real (kind=RKIND) :: q, workpv
integer, dimension(:,:), pointer :: cellsOnEdge, edgesOnEdge
integer, dimension(:), pointer :: maxLeveLEdgeTop, nEdgesOnEdge
@@ -112,6 +110,8 @@
weightsOnEdge => grid % weightsOnEdge % array
dcEdge => grid % dcEdge % array
+ nEdgesSolve = grid % nEdgesSolve
+
!
! velocity tendency: nonlinear Coriolis term and grad of kinetic energy
!
Modified: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnHmixVelDel4.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnHmixVelDel4.F        2011-08-30 16:03:43 UTC (rev 961)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnHmixVelDel4.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -263,7 +263,7 @@
( delsq_divergence(k,cell2 ) &
- delsq_divergence(k,cell1 ) ) * invLength1 &
-( delsq_vorticity (k,vertex2) &
- - delsq_vorticity (k,vertex1) ) * invLength2
+ - delsq_vorticity (k,vertex1) ) * invLength2 )
end do
end do
Modified: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracer.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracer.F        2011-08-30 16:03:43 UTC (rev 961)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracer.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -70,7 +70,7 @@
!
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerTend(tend, tracers, hCell, grid, err)
+ subroutine OcnVmixTracerTend(tend, tracers, hCell, grid)
!-----------------------------------------------------------------
!
@@ -102,8 +102,6 @@
!
!-----------------------------------------------------------------
- integer, intent(inout) :: err
-
!-----------------------------------------------------------------
!
! local variables
@@ -118,8 +116,8 @@
!
!-----------------------------------------------------------------
- call OcnVmixTracerConstTend(tend, tracers, hCell, grid, err)
- call OcnVmixTracerTanhTend(tend, tracers, hCell, grid, err)
+ call OcnVmixTracerConstTend(tend, tracers, hCell, grid)
+ call OcnVmixTracerTanhTend(tend, tracers, hCell, grid)
!--------------------------------------------------------------------
@@ -142,7 +140,7 @@
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerInit(err)
+ subroutine OcnVmixTracerInit
!--------------------------------------------------------------------
@@ -151,8 +149,6 @@
! Output Variables
!
!-----------------------------------------------------------------
-
- integer, intent(out) :: err
!-----------------------------------------------------------------
!
@@ -160,8 +156,8 @@
!
!-----------------------------------------------------------------
- call OcnVmixTracerConstInit(err)
- call OcnVmixTracerTanhInit(err)
+ call OcnVmixTracerConstInit
+ call OcnVmixTracerTanhInit
!--------------------------------------------------------------------
Modified: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracerConst.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracerConst.F        2011-08-30 16:03:43 UTC (rev 961)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracerConst.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -65,7 +65,7 @@
!> based on a constant form for the mixing.
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerConstTend(tend, tracers, h, grid, err)
+ subroutine OcnVmixTracerConstTend(tend, tracers, h, grid)
!-----------------------------------------------------------------
!
@@ -97,8 +97,6 @@
!
!-----------------------------------------------------------------
- integer, intent(out) :: err
-
!-----------------------------------------------------------------
!
! local variables
@@ -123,7 +121,6 @@
!-----------------------------------------------------------------
if (.not. VmixConstOn) return
- err = 0
!-----------------------------------------------------------------
!
@@ -189,7 +186,7 @@
!
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerConstInit(err)
+ subroutine OcnVmixTracerConstInit
!--------------------------------------------------------------------
@@ -198,8 +195,6 @@
!
!--------------------------------------------------------------------
- integer, intent(out) :: err
-
!--------------------------------------------------------------------
!
! set some local module variables based on input config choices
@@ -207,7 +202,6 @@
!--------------------------------------------------------------------
VmixConstOn = .false.
- err = 0
if ( config_vert_diff_type .EQ. 'const' ) then
VmixConstOn = .true.
Modified: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracerTanh.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracerTanh.F        2011-08-30 16:03:43 UTC (rev 961)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracerTanh.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -69,7 +69,7 @@
!
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerTanhTend(tend, tracers, hCell, grid, err)
+ subroutine OcnVmixTracerTanhTend(tend, tracers, hCell, grid)
!-----------------------------------------------------------------
!
@@ -101,8 +101,6 @@
!
!-----------------------------------------------------------------
- integer, intent(out) :: err
-
!-----------------------------------------------------------------
!
! local variables
@@ -130,7 +128,6 @@
!-----------------------------------------------------------------
if (.not. VmixTanhOn) return
- err = 0
!-----------------------------------------------------------------
!
@@ -199,7 +196,7 @@
!
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerTanhInit(err)
+ subroutine OcnVmixTracerTanhInit
!--------------------------------------------------------------------
!
@@ -207,8 +204,6 @@
!
!--------------------------------------------------------------------
- integer, intent(out) :: err
-
!--------------------------------------------------------------------
!
! set some local module variables based on input config choices
@@ -216,15 +211,8 @@
!--------------------------------------------------------------------
VmixTanhOn = .false.
- err = 0
if ( config_vert_diff_type .EQ. 'tanh' ) then
- if (config_vert_grid_type.ne.'zlevel') then
- write(0,*) 'Abort: config_vert_diff_type.eq.tanh may only', &
- ' use config_vert_grid_type of zlevel at this time'
- err = 1
- endif
-
VmixTanhOn = .true.
diff = config_vert_diffusion
Added: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVel.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVel.F         (rev 0)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVel.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -0,0 +1,168 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+! OcnVmixVel
+!
+!> \brief MPAS ocean vertical momentum mixing driver
+!> \author Doug Jacobsen
+!> \date 30 August 2011
+!> \version SVN:$Id:$
+!> \details
+!> This module contains the main driver routine for computing
+!> vertical mixing tendencies. It primarily decides which mixing
+!> parameterizations are being used and calls them individually.
+!> Detailed mixing parameterizations are contained in their own
+!> modules.
+!
+!-----------------------------------------------------------------------
+
+module OcnVmixVel
+
+ use grid_types
+ use configure
+ use OcnVmixVelConst
+ use OcnVmixVelTanh
+
+ implicit none
+ private
+ save
+
+ !--------------------------------------------------------------------
+ !
+ ! Public parameters
+ !
+ !--------------------------------------------------------------------
+
+ !--------------------------------------------------------------------
+ !
+ ! Public member functions
+ !
+ !--------------------------------------------------------------------
+
+ public :: OcnVmixVelTend, &
+ OcnVmixVelInit
+
+ !--------------------------------------------------------------------
+ !
+ ! Private module variables
+ !
+ !--------------------------------------------------------------------
+
+
+!***********************************************************************
+
+contains
+
+!***********************************************************************
+!
+! routine OcnVmixVelTend
+!
+!> \brief Computes tendency term for vertical momentum mixing
+!> \author Doug Jacobsen
+!> \date 30 August 2011
+!> \version SVN:$Id$
+!> \details
+!> This routine computes the vertical mixing tendency for momentum
+!> based on current state and user choices of mixing parameterization.
+!> Multiple parameterizations may be chosen and added together. These
+!> tendencies are generally computed by calling the specific routine
+!> for the chosen parameterization, so this routine is primarily a
+!> driver for managing these choices.
+!
+!-----------------------------------------------------------------------
+
+ subroutine OcnVmixVelTend(tend, u, hEdge, grid)
+
+ !-----------------------------------------------------------------
+ !
+ ! input variables
+ !
+ !-----------------------------------------------------------------
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ u !< Input: current velocity
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ hEdge !< Input: edge thickness
+
+ type (mesh_type), intent(in) :: &
+ grid !< Input: grid information
+
+ !-----------------------------------------------------------------
+ !
+ ! input/output variables
+ !
+ !-----------------------------------------------------------------
+
+ real (kind=RKIND), dimension(:,:), intent(inout) :: &
+ tend !< Input/Output: velocity tendency
+
+ !-----------------------------------------------------------------
+ !
+ ! output variables
+ !
+ !-----------------------------------------------------------------
+
+ !-----------------------------------------------------------------
+ !
+ ! local variables
+ !
+ !-----------------------------------------------------------------
+
+ !-----------------------------------------------------------------
+ !
+ ! call relevant routines for computing tendencies
+ ! note that the user can choose multiple options and the
+ ! tendencies will be added together
+ !
+ !-----------------------------------------------------------------
+
+ !
+ ! velocity tendency: vertical mixing d/dz( nu_v du/dz))
+ !
+
+ call OcnVmixVelConstTend(tend, u, hEdge, grid)
+ call OcnVmixVelTanhTend(tend, u, hEdge, grid)
+
+ !--------------------------------------------------------------------
+
+ end subroutine OcnVmixVelTend
+
+!***********************************************************************
+!
+! routine OcnVmixVelInit
+!
+!> \brief Initializes ocean momentum vertical mixing quantities
+!> \author Doug Jacobsen
+!> \date 30 August 2011
+!> \version SVN:$Id$
+!> \details
+!> This routine initializes a variety of quantities related to
+!> vertical velocity mixing in the ocean. Since a variety of
+!> parameterizations are available, this routine primarily calls the
+!> individual init routines for each parameterization.
+!
+!-----------------------------------------------------------------------
+
+
+ subroutine OcnVmixVelInit
+
+ !--------------------------------------------------------------------
+
+ !-----------------------------------------------------------------
+ !
+ ! call individual init routines for each parameterization
+ !
+ !-----------------------------------------------------------------
+
+ call OcnVmixVelConstInit
+ call OcnVmixVelTanhInit
+
+ !--------------------------------------------------------------------
+
+ end subroutine OcnVmixVelInit
+
+!***********************************************************************
+
+end module OcnVmixVel
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVelConst.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVelConst.F         (rev 0)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVelConst.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -0,0 +1,189 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+! OcnVMixVelConst
+!
+!> \brief Ocean vertical mixing - constant parameterization
+!> \author Doug Jacobsen
+!> \date 22 August 2011
+!> \version SVN:$Id:$
+!> \details
+!> This module contains routines for computing vertical mixing
+!> tendencies using a constant formulation.
+!
+!-----------------------------------------------------------------------
+
+module OcnVMixVelConst
+
+ use grid_types
+ use configure
+
+ implicit none
+ private
+ save
+
+ !--------------------------------------------------------------------
+ !
+ ! Public parameters
+ !
+ !--------------------------------------------------------------------
+
+ !--------------------------------------------------------------------
+ !
+ ! Public member functions
+ !
+ !--------------------------------------------------------------------
+
+ public :: OcnVMixVelConstTend, &
+ OcnVMixVelConstInit
+
+ !-------------------------------------------------------------------
+ !
+ ! Private module variables
+ !
+ !--------------------------------------------------------------------
+
+ logical :: &
+ vmixConstOn !< local flag to determine whether Const chosen
+
+ real (kind=RKIND) :: &
+ vertViscTop !< viscosity for vertical mixing
+
+!***********************************************************************
+
+contains
+
+!***********************************************************************
+!
+! routine OcnVMixVelConstTend
+!
+!> \brief Computes tendency term for constant vertical momentum mixing
+!> \author Doug Jacobsen
+!> \date 22 August 2011
+!> \version SVN:$Id$
+!> \details
+!> This routine computes the vertical mixing tendency for momentum
+!> with a constant mixing parameterization
+!
+!-----------------------------------------------------------------------
+
+ subroutine OcnVMixVelConstTend(tend, u, hEdge, grid)
+
+ !-----------------------------------------------------------------
+ !
+ ! input variables
+ !
+ !-----------------------------------------------------------------
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ u !< Input: current velocity
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ hEdge !< Input: thickness at edges
+
+ type (mesh_type), intent(in) :: &
+ grid !< Input: grid information
+
+ !-----------------------------------------------------------------
+ !
+ ! input/output variables
+ !
+ !-----------------------------------------------------------------
+
+ real (kind=RKIND), dimension(:,:), intent(inout) :: &
+ tend !< Input/Output: velocity tendency
+
+ !-----------------------------------------------------------------
+ !
+ ! local variables
+ !
+ !-----------------------------------------------------------------
+
+ integer :: &
+ iEdge, k ! loop counters
+
+ integer, dimension(:), pointer :: maxLevelEdgeTop
+
+ real (kind=RKIND), dimension(:), allocatable :: fluxVertTop
+
+ !-----------------------------------------------------------------
+ !
+ ! exit if this mixing is not selected
+ !
+ !-----------------------------------------------------------------
+
+ if (.not. vmixConstOn) return
+
+ !-----------------------------------------------------------------
+ !
+ ! initialize some arrays and sizes
+ !
+ !-----------------------------------------------------------------
+
+ maxLevelEdgeTop => grid % maxLevelEdgeTop % array
+
+ allocate(fluxVertTop(grid % nVertLevels+1))
+
+ fluxVertTop(1) = 0.0
+
+ do iEdge=1,grid % nEdgesSolve
+
+ do k=2,maxLevelEdgeTop(iEdge)
+ fluxVertTop(k) = vertViscTop &
+ * ( u(k-1,iEdge) - u(k,iEdge) ) &
+ * 2 / (hEdge(k-1,iEdge) + hEdge(k,iEdge))
+ enddo
+
+ fluxVertTop(maxLevelEdgeTop(iEdge)+1) = 0.0
+
+ do k=1,maxLevelEdgeTop(iEdge)
+ tend(k,iEdge) = tend(k,iEdge) &
+ + (fluxVertTop(k) - fluxVertTop(k+1)) &
+ / hEdge(k,iEdge)
+ enddo
+
+ enddo
+
+ deallocate(fluxVertTop)
+ !--------------------------------------------------------------------
+
+ end subroutine OcnVMixVelConstTend
+
+!***********************************************************************
+!
+! routine OcnVMixVelConstInit
+!
+!> \brief Initializes ocean momentum constant vertical mixing
+!> \author Doug Jacobsen
+!> \date 30 August 2011
+!> \version SVN:$Id$
+!> \details
+!> This routine initializes a variety of quantities related to
+!> constant vertical momentum mixing in the ocean.
+!
+!-----------------------------------------------------------------------
+
+ subroutine OcnVMixVelConstInit
+
+ !--------------------------------------------------------------------
+ !
+ ! set some local module variables based on input config choices
+ !
+ !--------------------------------------------------------------------
+
+ vmixConstOn = .false.
+
+ if (config_vert_visc_type.eq.'const') then
+ vertViscTop = config_vert_viscosity
+
+ vmixConstOn = .true.
+ endif
+
+ !--------------------------------------------------------------------
+
+ end subroutine OcnVMixVelConstInit
+
+!***********************************************************************
+
+end module OcnVMixVelConst
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVelTanh.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVelTanh.F         (rev 0)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixVelTanh.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -0,0 +1,198 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+! OcnVMixVelTanh
+!
+!> \brief Ocean vertical mixing - Tanhant parameterization
+!> \author Doug Jacobsen
+!> \date 22 August 2011
+!> \version SVN:$Id:$
+!> \details
+!> This module contains routines for computing vertical mixing
+!> tendencies using a Tanhant formulation.
+!
+!-----------------------------------------------------------------------
+
+module OcnVMixVelTanh
+
+ use grid_types
+ use configure
+
+ implicit none
+ private
+ save
+
+ !--------------------------------------------------------------------
+ !
+ ! Public parameters
+ !
+ !--------------------------------------------------------------------
+
+ !--------------------------------------------------------------------
+ !
+ ! Public member functions
+ !
+ !--------------------------------------------------------------------
+
+ public :: OcnVMixVelTanhTend, &
+ OcnVMixVelTanhInit
+
+ !-------------------------------------------------------------------
+ !
+ ! Private module variables
+ !
+ !--------------------------------------------------------------------
+
+ logical :: &
+ vmixTanhOn !< local flag to determine whether Tanh chosen
+
+ real (kind=RKIND) :: &
+ vertViscTop !< viscosity for vertical mixing
+
+!***********************************************************************
+
+contains
+
+!***********************************************************************
+!
+! routine OcnVMixVelTanhTend
+!
+!> \brief Computes tendency term for Tanhant vertical momentum mixing
+!> \author Doug Jacobsen
+!> \date 22 August 2011
+!> \version SVN:$Id$
+!> \details
+!> This routine computes the vertical mixing tendency for momentum
+!> with a Tanhant mixing parameterization
+!
+!-----------------------------------------------------------------------
+
+ subroutine OcnVMixVelTanhTend(tend, u, hEdge, grid)
+
+ !-----------------------------------------------------------------
+ !
+ ! input variables
+ !
+ !-----------------------------------------------------------------
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ u !< Input: current velocity
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ hEdge !< Input: thickness at edges
+
+ type (mesh_type), intent(in) :: &
+ grid !< Input: grid information
+
+ !-----------------------------------------------------------------
+ !
+ ! input/output variables
+ !
+ !-----------------------------------------------------------------
+
+ real (kind=RKIND), dimension(:,:), intent(inout) :: &
+ tend !< Input/Output: velocity tendency
+
+ !-----------------------------------------------------------------
+ !
+ ! local variables
+ !
+ !-----------------------------------------------------------------
+
+ integer :: &
+ iEdge, k ! loop counters
+
+ integer, dimension(:), pointer :: maxLevelEdgeTop
+ real (kind=RKIND), dimension(:), pointer :: zTopZLevel
+
+ real (kind=RKIND), dimension(:), allocatable :: fluxVertTop, viscTop
+
+ !-----------------------------------------------------------------
+ !
+ ! exit if this mixing is not selected
+ !
+ !-----------------------------------------------------------------
+
+ if (.not. vmixTanhOn) return
+
+ !-----------------------------------------------------------------
+ !
+ ! initialize some arrays and sizes
+ !
+ !-----------------------------------------------------------------
+
+ maxLevelEdgeTop => grid % maxLevelEdgeTop % array
+ zTopZLevel => grid % zTopZLevel % array
+
+
+ allocate(fluxVertTop(grid % nVertLevels+1))
+ allocate(viscTop(grid % nVertLevels+1))
+
+ fluxVertTop(1) = 0.0
+
+ do k=1,grid % nVertLevels+1
+ viscTop(k) = -(config_vmixTanhViscMax-config_vmixTanhViscMin)/2.0 &
+ *tanh(-(zTopZLevel(k)-config_vmixTanhZMid) &
+ /config_vmixTanhZWidth) &
+ + (config_vmixTanhViscMax+config_vmixTanhViscMin)/2
+ enddo
+
+
+ do iEdge=1,grid % nEdgesSolve
+ do k=2,maxLevelEdgeTop(iEdge)
+ fluxVertTop(k) = viscTop(k) &
+ * ( u(k-1,iEdge) - u(k,iEdge) ) &
+ * 2 / (hEdge(k-1,iEdge) + hEdge(k,iEdge))
+ enddo
+
+ fluxVertTop(maxLevelEdgeTop(iEdge)+1) = 0.0
+
+ do k=1,maxLevelEdgeTop(iEdge)
+ tend(k,iEdge) = tend(k,iEdge) &
+ + (fluxVertTop(k) - fluxVertTop(k+1)) &
+ / hEdge(k,iEdge)
+ enddo
+
+ enddo
+
+ deallocate(fluxVertTop, viscTop)
+ !--------------------------------------------------------------------
+
+ end subroutine OcnVMixVelTanhTend
+
+!***********************************************************************
+!
+! routine OcnVMixVelTanhInit
+!
+!> \brief Initializes ocean momentum Tanhant vertical mixing
+!> \author Doug Jacobsen
+!> \date 30 August 2011
+!> \version SVN:$Id$
+!> \details
+!> This routine initializes a variety of quantities related to
+!> Tanhant vertical momentum mixing in the ocean.
+!
+!-----------------------------------------------------------------------
+
+ subroutine OcnVMixVelTanhInit
+
+ !--------------------------------------------------------------------
+ !
+ ! set some local module variables based on input config choices
+ !
+ !--------------------------------------------------------------------
+
+ vmixTanhOn = .false.
+
+ if (config_vert_visc_type.eq.'tanh') then
+ vmixTanhOn = .true.
+ endif
+
+ !--------------------------------------------------------------------
+
+ end subroutine OcnVMixVelTanhInit
+
+!***********************************************************************
+
+end module OcnVMixVelTanh
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Modified: branches/ocean_projects/performance/mpas/src/core_ocean/module_mpas_core.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_mpas_core.F        2011-08-30 16:03:43 UTC (rev 961)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_mpas_core.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -5,6 +5,7 @@
use test_cases
use OcnHmixVel
use OcnHmixTracer
+ use OcnVmixVel
use OcnVmixTracer
type (io_output_object) :: restart_obj
@@ -26,7 +27,6 @@
real (kind=RKIND) :: dt
type (block_type), pointer :: block
type (dm_info) :: dminfo
- integer :: err
if (.not. config_do_restart) call setup_sw_test_case(domain)
@@ -59,12 +59,33 @@
call OcnHmixTracerInit
call OcnHmixVelInit
- call OcnVmixTracerInit(err)
- if(err .ne. 0) then
+ if (config_vert_diff_type .eq.'tanh') then
+ if(config_vert_grid_type .ne. 'zlevel') then
+ write(0,*) 'Abort: config_vert_visc_type.eq.tanh may only', &
+ ' use config_vert_grid_type of zlevel at this time'
call dmpar_abort(dminfo)
+ endif
+ else if (config_vert_diff_type .ne. 'const') then
+ write(0,*) 'Abort: unrecognized config_vert_visc_type'
+ call dmpar_abort(dminfo)
endif
+ call OcnVmixTracerInit
+
+ if (config_vert_visc_type.eq.'tanh') then
+ if (config_vert_grid_type.ne.'zlevel') then
+ write(0,*) 'Abort: config_vert_visc_type.eq.tanh may only', &
+ ' use config_vert_grid_type of zlevel at this time'
+ call dmpar_abort(dminfo)
+ endif
+ else if (config_vert_visc_type.ne.'const') then
+ write(0,*) 'Abort: unrecognized config_vert_visc_type'
+ call dmpar_abort(dminfo)
+ endif
+
+ call OcnVmixVelInit
+
! mrp 100316 In order for this to work, we need to pass domain % dminfo as an
! input arguement into mpas_init. Ask about that later. For now, there will be
! no initial statistics write.
Modified: branches/ocean_projects/performance/mpas/src/core_ocean/module_time_integration.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_time_integration.F        2011-08-30 16:03:43 UTC (rev 961)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_time_integration.F        2011-08-30 17:00:25 UTC (rev 962)
@@ -12,6 +12,7 @@
use OcnHmixTracer
use OcnHmixVel
use OcnVmixTracer
+ use OcnVmixVel
use OcnCoriolis
use OcnThickness
use OcnVelocityForcing
@@ -442,7 +443,7 @@
call timer_stop("vel dissipation")
call timer_start("coriolis")
- call OcnCoriolisTend(tend_u, pv_edge, h_edge, u, ke, nEdgesSolve, grid)
+ call OcnCoriolisTend(tend_u, pv_edge, h_edge, u, ke, grid)
call timer_stop("coriolis")
call timer_start("vel forcing")
@@ -451,52 +452,10 @@
call timer_stop("vel forcing")
call timer_start("vel vmix")
- !
- ! velocity tendency: vertical mixing d/dz( nu_v du/dz))
- !
- allocate(vertViscTop(nVertLevels+1))
- if (config_vert_visc_type.eq.'const') then
- vertViscTop = config_vert_viscosity
- elseif (config_vert_visc_type.eq.'tanh') then
- if (config_vert_grid_type.ne.'zlevel') then
- write(0,*) 'Abort: config_vert_visc_type.eq.tanh may only', &
- ' use config_vert_grid_type of zlevel at this time'
- call dmpar_abort(dminfo)
- endif
-
- do k=1,nVertLevels+1
- vertViscTop(k) = -(config_vmixTanhViscMax-config_vmixTanhViscMin)/2.0 &
- *tanh(-(zTopZLevel(k)-config_vmixTanhZMid) &
- /config_vmixTanhZWidth) &
- + (config_vmixTanhViscMax+config_vmixTanhViscMin)/2
- enddo
- else
- write(0,*) 'Abort: unrecognized config_vert_visc_type'
- call dmpar_abort(dminfo)
- endif
+ call OcnVmixVelTend(tend_u, h_edge, u, grid)
- allocate(fluxVertTop(nVertLevels+1))
- fluxVertTop(1) = 0.0
- do iEdge=1,grid % nEdgesSolve
-
- do k=2,maxLevelEdgeTop(iEdge)
- fluxVertTop(k) = vertViscTop(k) &
- * ( u(k-1,iEdge) - u(k,iEdge) ) &
- * 2 / (h_edge(k-1,iEdge) + h_edge(k,iEdge))
- enddo
- fluxVertTop(maxLevelEdgeTop(iEdge)+1) = 0.0
-
- do k=1,maxLevelEdgeTop(iEdge)
- tend_u(k,iEdge) = tend_u(k,iEdge) &
- + (fluxVertTop(k) - fluxVertTop(k+1)) &
- / h_edge(k,iEdge)
- enddo
-
- end do
call timer_stop("vel vmix")
call timer_stop("velocity")
- deallocate(fluxVertTop, vertViscTop)
-
end subroutine compute_tend
@@ -553,8 +512,6 @@
real (kind=RKIND), dimension(:,:,:),allocatable :: &
tracersA, tend_trA
- integer :: err
-
u => s % u % array
h => s % h % array
boundaryCell=> grid % boundaryCell % array
@@ -927,11 +884,7 @@
! tracer tendency: vertical diffusion h d/dz( \kappa_v d\phi/dz)
!
call timer_start("scalar vdiff")
- call OcnVmixTracerTend(tend_tr, tracers, h, grid, err)
-
- if(err .ne. 0) then
- call dmpar_abort(dminfo)
- endif
+ call OcnVmixTracerTend(tend_tr, tracers, h, grid)
call timer_stop("scalar vdiff")
call timer_stop("scalar")
</font>
</pre>