<p><b>dwj07@fsu.edu</b> 2011-08-30 10:03:43 -0600 (Tue, 30 Aug 2011)</p><p><br>
        Fixing comments.<br>
<br>
        Removing nCellsSolve from Vmix modules.<br>
        Changing some divisions to multiplications.<br>
<br>
        Modifying velocity forcing module to follow the older efficiency note.<br>
</p><hr noshade><pre><font color="gray">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-29 22:49:39 UTC (rev 960)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnCoriolis.F        2011-08-30 16:03:43 UTC (rev 961)
@@ -2,16 +2,13 @@
!
! OcnCoriolis
!
-!> \brief MPAS ocean horizontal tracer mixing driver
-!> \author Phil Jones
+!> \brief MPAS ocean coriolis tendency
+!> \author Doug Jacobsen
!> \date 26 July 2011
!> \version SVN:$Id:$
!> \details
-!> This module contains the main driver routine for computing
-!> horizontal mixing tendencies. It primarily decides which mixing
-!> parameterizations are being used and calls them individually.
-!> Detailed mixing parameterizations are contained in their own
-!> modules.
+!> This module contains the routine for computing
+!> tendencies from coriolis force.
!
!-----------------------------------------------------------------------
@@ -53,17 +50,12 @@
!
! routine OcnCoriolisTend
!
-!> \brief Computes tendency term for horizontal tracer mixing
-!> \author Phil Jones
+!> \brief Computes tendency term for coriolis force
+!> \author Doug Jacobsen
!> \date 26 July 2011
!> \version SVN:$Id$
!> \details
-!> This routine computes the horizontal mixing tendency for tracers
-!> 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.
+!> This routine computes the tendency from the coriolis force.
!
!-----------------------------------------------------------------------
@@ -120,6 +112,10 @@
weightsOnEdge => grid % weightsOnEdge % array
dcEdge => grid % dcEdge % array
+ !
+ ! velocity tendency: nonlinear Coriolis term and grad of kinetic energy
+ !
+
do iEdge=1,grid % nEdgesSolve
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
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-29 22:49:39 UTC (rev 960)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnHmixVelDel4.F        2011-08-30 16:03:43 UTC (rev 961)
@@ -113,6 +113,7 @@
real (kind=RKIND) :: &
invArea1, invArea2, &! reciprocal of cell areas
+ invLength1, invLength2, &! reciprocal of dv and dc edge
flux ! flux across edge
real (kind=RKIND), dimension(:), pointer :: &
@@ -179,13 +180,16 @@
vertex1 = verticesOnEdge(1,iEdge)
vertex2 = verticesOnEdge(2,iEdge)
+ invLength1 = 1.d0/dcEdge(iEdge)
+ invLength2 = 1.d0/dvEdge(iEdge)
+
do k=1,maxLevelEdgeTop(iEdge)
delsq_u(k,iEdge) = &
( divergence(k,cell2) - &
- divergence(k,cell1) ) / dcEdge(iEdge) &
+ divergence(k,cell1) ) * invLength1 &
-( vorticity(k,vertex2) - &
- vorticity(k,vertex1)) / dvEdge(iEdge)
+ vorticity(k,vertex1)) * invLength2
end do
do k=maxLevelEdgeTop(iEdge)+1,nVertLevels
@@ -250,13 +254,16 @@
vertex1 = verticesOnEdge(1,iEdge)
vertex2 = verticesOnEdge(2,iEdge)
+ invLength1 = 1.d0 / dcEdge(iEdge)
+ invLength2 = 1.d0 / dvEdge(iEdge)
+
do k=1,maxLevelEdgeTop(iEdge)
tend(k,iEdge) = tend(k,iEdge) - eddyVisc4 * ( &
( delsq_divergence(k,cell2 ) &
- - delsq_divergence(k,cell1 ) ) / dcEdge(iEdge) &
+ - delsq_divergence(k,cell1 ) ) * invLength1 &
-( delsq_vorticity (k,vertex2) &
- - delsq_vorticity (k,vertex1) ) / dvEdge(iEdge))
+ - delsq_vorticity (k,vertex1) ) * invLength2
end do
end do
Modified: branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVelocityForcing.F
===================================================================
--- branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVelocityForcing.F        2011-08-29 22:49:39 UTC (rev 960)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVelocityForcing.F        2011-08-30 16:03:43 UTC (rev 961)
@@ -116,29 +116,44 @@
do iEdge=1,grid % nEdgesSolve
- k = maxLevelEdgeTop(iEdge)
+!-------------------------------------------------------
+! Original Method, commented out for now.
+!-------------------------------------------------------
+! k = maxLevelEdgeTop(iEdge)
! efficiency note: it would be nice to avoid this
! if within a do. This could be done with
! k = max(maxLevelEdgeTop(iEdge),1)
! and then tend_u(1,iEdge) is just not used for land cells.
- if (k>0) then
+! if (k>0) then
! forcing in top layer only
- tend(1,iEdge) = tend(1,iEdge) &
- + u_src(1,iEdge)/rho_ref/hEdge(1,iEdge)
+! tend(1,iEdge) = tend(1,iEdge) &
+! + u_src(1,iEdge)/rho_ref/hEdge(1,iEdge)
! bottom drag is the same as POP:
! -c |u| u where c is unitless and 1.0e-3.
! see POP Reference guide, section 3.4.4.
- tend(k,iEdge) = tend(k,iEdge) &
- - 1.0e-3*u(k,iEdge) &
- *sqrt(2.0*keEdge(k,iEdge))/hEdge(k,iEdge)
+! tend(k,iEdge) = tend(k,iEdge) &
+! - 1.0e-3*u(k,iEdge) &
+! *sqrt(2.0*keEdge(k,iEdge))/hEdge(k,iEdge)
- endif
+! endif
+
+!-------------------------------------------------------
+! New method
+!-------------------------------------------------------
+ k = max(maxLevelEdgeTop(iEdge), 1)
+
+ tend(1,iEdge) = tend(1, iEdge) &
+ + u_src(1,iEdge)/rho_ref/hEdge(1,iEdge)
+
+ tend(k,iedge) = tend(k,iEdge) &
+ - 1.0e-3 * u(k,iEdge) &
+ * sqrt(2.0 * keEdge(k,iEdge))/hEdge(k,iEdge)
enddo
!--------------------------------------------------------------------
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-29 22:49:39 UTC (rev 960)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracer.F        2011-08-30 16:03:43 UTC (rev 961)
@@ -2,8 +2,8 @@
!
! OcnVmixTracer
!
-!> \brief MPAS ocean horizontal tracer mixing driver
-!> \author Phil Jones
+!> \brief MPAS ocean vertical tracer mixing driver
+!> \author Doug Jacobsen
!> \date 26 July 2011
!> \version SVN:$Id:$
!> \details
@@ -56,12 +56,12 @@
!
! routine OcnVmixTracerTend
!
-!> \brief Computes tendency term for horizontal tracer mixing
-!> \author Phil Jones
+!> \brief Computes tendency term for vertical tracer mixing
+!> \author Doug Jacobsen
!> \date 26 July 2011
!> \version SVN:$Id$
!> \details
-!> This routine computes the horizontal mixing tendency for tracers
+!> This routine computes the vertical mixing tendency for tracers
!> 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
@@ -70,7 +70,7 @@
!
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerTend(tend, tracers, hCell, nCellsSolve, grid, err)
+ subroutine OcnVmixTracerTend(tend, tracers, hCell, grid, err)
!-----------------------------------------------------------------
!
@@ -87,8 +87,6 @@
type (mesh_type), intent(in) :: &
grid !< Input: grid information
- integer, intent(in) :: nCellsSolve
-
!-----------------------------------------------------------------
!
! input/output variables
@@ -120,8 +118,8 @@
!
!-----------------------------------------------------------------
- call OcnVmixTracerConstTend(tend, tracers, hCell, nCellsSolve, grid, err)
- call OcnVmixTracerTanhTend(tend, tracers, hCell, nCellsSolve , grid, err)
+ call OcnVmixTracerConstTend(tend, tracers, hCell, grid, err)
+ call OcnVmixTracerTanhTend(tend, tracers, hCell, grid, err)
!--------------------------------------------------------------------
@@ -131,13 +129,13 @@
!
! routine OcnVmixTracerInit
!
-!> \brief Initializes ocean tracer horizontal mixing quantities
-!> \author Phil Jones
+!> \brief Initializes ocean tracer vertical mixing quantities
+!> \author Doug Jacobsen
!> \date 26 July 2011
!> \version SVN:$Id$
!> \details
!> This routine initializes a variety of quantities related to
-!> horizontal tracer mixing in the ocean. Since a variety of
+!> vertical tracer mixing in the ocean. Since a variety of
!> parameterizations are available, this routine primarily calls the
!> individual init routines for each parameterization.
!
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-29 22:49:39 UTC (rev 960)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracerConst.F        2011-08-30 16:03:43 UTC (rev 961)
@@ -2,13 +2,13 @@
!
! OcnVmixTracerConst
!
-!> \brief Ocean horizontal mixing - Laplacian parameterization
-!> \author Phil Jones
+!> \brief Ocean vertical mixing - constant parameterization
+!> \author Doug Jacobsen
!> \date 1 August 2011
!> \version SVN:$Id:$
!> \details
-!> This module contains routines for computing horizontal mixing
-!> tendencies using a Laplacian formulation.
+!> This module contains routines for computing vertical mixing
+!> tendencies using a constant formulation.
!
!-----------------------------------------------------------------------
@@ -56,20 +56,16 @@
!
! routine OcnVmixTracerConstTend
!
-!> \brief Computes tendency term for Laplacian horizontal tracer mixing
-!> \author Phil Jones
+!> \brief Computes tendency term for constant vertical tracer mixing
+!> \author Doug Jacobsen
!> \date 1 August 2011
!> \version SVN:$Id$
!> \details
-!> This routine computes the horizontal mixing tendency for tracers
-!> based on a Laplacian form for the mixing. This tendency takes the
-!> form </font>
<font color="black">abla \cdot (h \kappa_2 </font>
<font color="gray">abla \phi), where \phi is the
-!> tracer, h is the thickness and \kappa_2 is a base horizontal
-!> diffusivity.
-!
+!> This routine computes the vertical mixing tendency for tracers
+!> based on a constant form for the mixing.
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerConstTend(tend, tracers, h, nCellsSolve, grid, err)
+ subroutine OcnVmixTracerConstTend(tend, tracers, h, grid, err)
!-----------------------------------------------------------------
!
@@ -80,9 +76,6 @@
real (kind=RKIND), dimension(:,:,:), intent(in) :: &
tracers !< Input: array of tracers
- integer, intent(in) :: &
- nCellsSolve !< Input: number of cells to solve
-
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -114,7 +107,8 @@
integer :: &
k, iCell, iTracer, &! loop counters
- nVertLevels, nTracers ! array sizes
+ nVertLevels, nTracers, & ! array sizes
+ nCellsSolve
integer, dimension(:), pointer :: maxLevelCell
@@ -139,6 +133,8 @@
maxLevelCell => grid % maxLevelCell % array
+ nCellsSolve = grid % nCellsSolve
+
nTracers = size(tracers,dim=1)
nVertLevels = size(tracers, dim=2)
@@ -183,13 +179,13 @@
!
! routine OcnVmixTracerConstInit
!
-!> \brief Initializes ocean tracer Laplacian horizontal mixing
-!> \author Phil Jones
+!> \brief Initializes ocean tracer constant vertical mixing
+!> \author Doug Jacobsen
!> \date 26 July 2011
!> \version SVN:$Id$
!> \details
!> This routine initializes a variety of quantities related to
-!> Laplacian horizontal tracer mixing in the ocean.
+!> constant vertical tracer mixing in the ocean.
!
!-----------------------------------------------------------------------
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-29 22:49:39 UTC (rev 960)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_OcnVmixTracerTanh.F        2011-08-30 16:03:43 UTC (rev 961)
@@ -2,13 +2,13 @@
!
! OcnVmixTracerTanh
!
-!> \brief Ocean horizontal mixing - Laplacian parameterization
-!> \author Phil Jones
+!> \brief Ocean vertical mixing - hyperbolic tangent parameterization
+!> \author Doug Jacobsen
!> \date 1 August 2011
!> \version SVN:$Id:$
!> \details
-!> This module contains routines for computing horizontal mixing
-!> tendencies using a Laplacian formulation.
+!> This module contains routines for computing vertical mixing
+!> tendencies using a hyperbolic tangent formulation.
!
!-----------------------------------------------------------------------
@@ -56,20 +56,20 @@
!
! routine OcnVmixTracerTanhTend
!
-!> \brief Computes tendency term for Laplacian horizontal tracer mixing
-!> \author Phil Jones
+!> \brief Computes tendency term for hyperbolic tangent vertical tracer mixing
+!> \author Doug Jacobsen
!> \date 1 August 2011
!> \version SVN:$Id$
!> \details
-!> This routine computes the horizontal mixing tendency for tracers
-!> based on a Laplacian form for the mixing. This tendency takes the
+!> This routine computes the vertical mixing tendency for tracers
+!> based on a hyperbolic tangent form for the mixing. This tendency takes the
!> form </font>
<font color="black">abla \cdot (h \kappa_2 </font>
<font color="gray">abla \phi), where \phi is the
-!> tracer, h is the thickness and \kappa_2 is a base horizontal
+!> tracer, h is the thickness and \kappa_2 is a base vertical
!> diffusivity.
!
!-----------------------------------------------------------------------
- subroutine OcnVmixTracerTanhTend(tend, tracers, hCell, nCellsSolve, grid, err)
+ subroutine OcnVmixTracerTanhTend(tend, tracers, hCell, grid, err)
!-----------------------------------------------------------------
!
@@ -80,9 +80,6 @@
real (kind=RKIND), dimension(:,:,:), intent(in) :: &
tracers !< Input: array of tracers
- integer , intent(in) :: &
- nCellsSolve !< Input: number of cells
-
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -114,7 +111,8 @@
integer :: &
k, iCell, iTracer, &! loop counters
- nVertLevels, nTracers ! array sizes
+ nVertLevels, nTracers, & ! array sizes
+ nCellsSolve
integer, dimension(:), pointer :: maxLevelCell
@@ -143,6 +141,8 @@
maxLevelCell => grid % maxLevelCell % array
zTopZLevel => grid % zTopZLevel % array
+ nCellsSolve = grid % nCellsSolve
+
nTracers = size(tracers,dim=1)
nVertLevels = size(tracers, dim=2)
@@ -189,13 +189,13 @@
!
! routine OcnVmixTracerTanhInit
!
-!> \brief Initializes ocean tracer Laplacian horizontal mixing
-!> \author Phil Jones
+!> \brief Initializes ocean tracer hyperbolic tangent vertical mixing
+!> \author Doug Jacobsen
!> \date 26 July 2011
!> \version SVN:$Id$
!> \details
!> This routine initializes a variety of quantities related to
-!> Laplacian horizontal tracer mixing in the ocean.
+!> hyperbolic tangent vertical tracer mixing in the ocean.
!
!-----------------------------------------------------------------------
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-29 22:49:39 UTC (rev 960)
+++ branches/ocean_projects/performance/mpas/src/core_ocean/module_time_integration.F        2011-08-30 16:03:43 UTC (rev 961)
@@ -440,9 +440,6 @@
call OcnHmixVelTend(tend_u, divergence, vorticity, grid)
call timer_stop("vel dissipation")
- !
- ! velocity tendency: nonlinear Coriolis term and grad of kinetic energy
- !
call timer_start("coriolis")
call OcnCoriolisTend(tend_u, pv_edge, h_edge, u, ke, nEdgesSolve, grid)
@@ -930,7 +927,7 @@
! tracer tendency: vertical diffusion h d/dz( \kappa_v d\phi/dz)
!
call timer_start("scalar vdiff")
- call OcnVmixTracerTend(tend_tr, tracers, h, nCellsSolve, grid, err)
+ call OcnVmixTracerTend(tend_tr, tracers, h, grid, err)
if(err .ne. 0) then
call dmpar_abort(dminfo)
</font>
</pre>