<p><b>qchen3@fsu.edu</b> 2013-04-03 10:37:04 -0600 (Wed, 03 Apr 2013)</p><p>BRANCH COMMIT<br>
<br>
The vertical component of Redi diffusion is now added into the vmix_implicit subroutine. Code compiles, but not tested.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/gm_implement/src/core_ocean/Makefile
===================================================================
--- branches/ocean_projects/gm_implement/src/core_ocean/Makefile        2013-04-03 16:25:11 UTC (rev 2714)
+++ branches/ocean_projects/gm_implement/src/core_ocean/Makefile        2013-04-03 16:37:04 UTC (rev 2715)
@@ -34,6 +34,7 @@
mpas_ocn_vmix_coefs_const.o \
mpas_ocn_vmix_coefs_rich.o \
mpas_ocn_vmix_coefs_tanh.o \
+ mpas_ocn_vmix_coefs_redi.o \
mpas_ocn_restoring.o \
mpas_ocn_tendency.o \
mpas_ocn_diagnostics.o \
@@ -154,7 +155,7 @@
mpas_ocn_restoring.o:
-mpas_ocn_vmix.o: mpas_ocn_vmix_coefs_const.o mpas_ocn_vmix_coefs_rich.o mpas_ocn_vmix_coefs_tanh.o
+mpas_ocn_vmix.o: mpas_ocn_vmix_coefs_const.o mpas_ocn_vmix_coefs_rich.o mpas_ocn_vmix_coefs_tanh.o mpas_ocn_vmix_coefs_redi.o
mpas_ocn_vmix_coefs_const.o:
@@ -162,6 +163,8 @@
mpas_ocn_vmix_coefs_tanh.o:
+mpas_ocn_vmix_coefs_redi.o:
+
mpas_ocn_equation_of_state.o: mpas_ocn_equation_of_state_jm.o mpas_ocn_equation_of_state_linear.o
mpas_ocn_equation_of_state_jm.o:
@@ -202,6 +205,7 @@
mpas_ocn_vmix_coefs_const.o \
mpas_ocn_vmix_coefs_rich.o \
mpas_ocn_vmix_coefs_tanh.o \
+ mpas_ocn_vmix_coefs_redi.o \
mpas_ocn_restoring.o \
mpas_ocn_tracer_advection.o \
mpas_ocn_tracer_advection_std.o \
Modified: branches/ocean_projects/gm_implement/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/gm_implement/src/core_ocean/Registry        2013-04-03 16:25:11 UTC (rev 2714)
+++ branches/ocean_projects/gm_implement/src/core_ocean/Registry        2013-04-03 16:37:04 UTC (rev 2715)
@@ -54,6 +54,8 @@
namelist real hmix_Leith config_Leith_dx 15000.0
namelist real hmix_Leith config_Leith_visc2_max 2.5e3
+namelist logical standard_GM config_use_GM .false.
+namelist logical standard_GM config_use_Redi_diff .false.
namelist real standard_GM config_h_kappa 0.0
namelist real standard_GM config_h_kappa_q 0.0
namelist real standard_GM config_diapycnal_diff 0.0000001
Modified: branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_time_integration_rk4.F
===================================================================
--- branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_time_integration_rk4.F        2013-04-03 16:25:11 UTC (rev 2714)
+++ branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_time_integration_rk4.F        2013-04-03 16:37:04 UTC (rev 2715)
@@ -214,9 +214,11 @@
block % provis % uBolusGM % array(:,:) = 0.0
end if
- block % provis % uTransport % array(:,:) &
+ if (config_use_GM) then
+ block % provis % uTransport % array(:,:) &
= block % provis % u % array(:,:) &
+ block % provis % uBolusGM % array(:,:)
+ end if
block => block % next
end do
@@ -281,6 +283,19 @@
! implicit vmix routine that follows.
call ocn_diagnostic_solve(dt, block % state % time_levs(2) % state, block % mesh)
+ ! Compute uBolusGM and the tracer transport velocity
+ if (config_h_kappa .GE. epsilon(0D0)) then
+ call ocn_gm_compute_uBolus(block % state % time_levs(2) % state, block % mesh, block % scratch)
+ else
+ block % state % time_levs(2) % state % uBolusGM % array(:,:) = 0.0
+ end if
+
+ if (config_use_GM) then
+ block % state % time_levs(2) % state % uTransport % array(:,:) &
+ = block % state % time_levs(2) % state % u % array(:,:) &
+ + block % state % time_levs(2) % state % uBolusGM % array(:,:)
+ end if
+
call ocn_vmix_implicit(dt, block % mesh, block % diagnostics, block % state % time_levs(2) % state, err)
block => block % next
end do
@@ -315,9 +330,11 @@
block % state % time_levs(2) % state % uBolusGM % array(:,:) = 0.0
end if
+ if (config_use_GM) then
block % state % time_levs(2) % state % uTransport % array(:,:) &
- = block % state % time_levs(2) % state % u % array(:,:) &
- + block % state % time_levs(2) % state % uBolusGM % array(:,:)
+ = block % state % time_levs(2) % state % u % array(:,:) &
+ + block % state % time_levs(2) % state % uBolusGM % array(:,:)
+ end if
call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % u % array, &
block % state % time_levs(2) % state % uReconstructX % array, &
Modified: branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_time_integration_split.F
===================================================================
--- branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_time_integration_split.F        2013-04-03 16:25:11 UTC (rev 2714)
+++ branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_time_integration_split.F        2013-04-03 16:37:04 UTC (rev 2715)
@@ -945,6 +945,20 @@
! implicit vmix routine that follows.
call ocn_diagnostic_solve(dt, block % state % time_levs(2) % state, block % mesh)
+ ! Compute uBolusGM
+ if (config_h_kappa .GE. epsilon(0D0)) then
+ call ocn_gm_compute_uBolus(block % state % time_levs(2) % state, block % mesh, block % scratch)
+ else
+ block % state % time_levs(2) % state % uBolusGM % array(:,:) = 0.0
+ end if
+
+ if(config_use_GM) then
+ ! Compute velocity transport, used in advection terms of h and tracer tendency
+ block % state % time_levs(2) % state % uTransport % array(:,:) &
+ = block % state % time_levs(2) % state % u % array(:,:) &
+ + block % state % time_levs(2) % state % uBolusGM % array(:,:)
+ end if
+
call ocn_vmix_implicit(dt, block % mesh, block % diagnostics, block % state % time_levs(2) % state, err)
block => block % next
@@ -981,10 +995,12 @@
block % state % time_levs(2) % state % uBolusGM % array(:,:) = 0.0
end if
- ! Compute velocity transport, used in advection terms of h and tracer tendency
- block % state % time_levs(2) % state % uTransport % array(:,:) &
- = block % state % time_levs(2) % state % u % array(:,:) &
- + block % state % time_levs(2) % state % uBolusGM % array(:,:)
+ if(config_use_GM) then
+ ! Compute velocity transport, used in advection terms of h and tracer tendency
+ block % state % time_levs(2) % state % uTransport % array(:,:) &
+ = block % state % time_levs(2) % state % u % array(:,:) &
+ + block % state % time_levs(2) % state % uBolusGM % array(:,:)
+ end if
call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % u % array, &
block % state % time_levs(2) % state % uReconstructX % array, &
Modified: branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_vmix.F
===================================================================
--- branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_vmix.F        2013-04-03 16:25:11 UTC (rev 2714)
+++ branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_vmix.F        2013-04-03 16:37:04 UTC (rev 2715)
@@ -23,6 +23,7 @@
use ocn_vmix_coefs_const
use ocn_vmix_coefs_tanh
use ocn_vmix_coefs_rich
+ use ocn_vmix_coefs_redi
implicit none
private
@@ -112,7 +113,7 @@
!
!-----------------------------------------------------------------
- integer :: err1, err2, err3
+ integer :: err1, err2, err3, err4
!-----------------------------------------------------------------
!
@@ -128,8 +129,9 @@
call ocn_vmix_coefs_const_build(grid, s, d, err1)
call ocn_vmix_coefs_tanh_build(grid, s, d, err2)
call ocn_vmix_coefs_rich_build(grid, s, d, err3)
+ call ocn_vmix_coefs_redi_build(grid, s, d, err4)
- err = ior(err1, ior(err2, err3))
+ err = ior(ior(err1, ior(err2, err3)), err4)
!--------------------------------------------------------------------
Copied: branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_vmix_coefs_redi.F (from rev 2711, branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_vmix_coefs_const.F)
===================================================================
--- branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_vmix_coefs_redi.F         (rev 0)
+++ branches/ocean_projects/gm_implement/src/core_ocean/mpas_ocn_vmix_coefs_redi.F        2013-04-03 16:37:04 UTC (rev 2715)
@@ -0,0 +1,236 @@
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+!
+! ocn_vmix_coefs_const
+!
+!> \brief MPAS ocean vertical mixing coefficients
+!> \author Doug Jacobsen
+!> \date 19 September 2011
+!> \version SVN:$Id:$
+!> \details
+!> This module contains the routines for compounding
+!> the Redi vertical mixing coefficients.
+!>
+!
+!-----------------------------------------------------------------------
+
+module ocn_vmix_coefs_redi
+
+ use mpas_grid_types
+ use mpas_configure
+ use mpas_timer
+
+ implicit none
+ private
+ save
+
+ !--------------------------------------------------------------------
+ !
+ ! Public parameters
+ !
+ !--------------------------------------------------------------------
+
+ !--------------------------------------------------------------------
+ !
+ ! Public member functions
+ !
+ !--------------------------------------------------------------------
+
+ private :: ocn_tracer_vmix_coefs_redi
+
+ public :: ocn_vmix_coefs_redi_build, &
+ ocn_vmix_coefs_redi_init
+
+ !--------------------------------------------------------------------
+ !
+ ! Private module variables
+ !
+ !--------------------------------------------------------------------
+
+ logical :: rediDiffOn
+
+
+
+!***********************************************************************
+
+contains
+
+!***********************************************************************
+!
+! routine ocn_vmix_coefs_redi_build
+!
+!> \brief Computes coefficients for vertical mixing
+!> \author Doug Jacobsen
+!> \date 19 September 2011
+!> \version SVN:$Id$
+!> \details
+!> This routine computes the vertical mixing coefficients for momentum
+!> and tracers based user choices of mixing parameterization.
+!
+!-----------------------------------------------------------------------
+
+ subroutine ocn_vmix_coefs_redi_build(grid, s, d, err)!{{{
+
+ !-----------------------------------------------------------------
+ !
+ ! input variables
+ !
+ !-----------------------------------------------------------------
+
+ type (mesh_type), intent(in) :: &
+ grid !< Input: grid information
+
+ !-----------------------------------------------------------------
+ !
+ ! input/output variables
+ !
+ !-----------------------------------------------------------------
+
+ type (state_type), intent(inout) :: &
+ s !< Input/Output: state information
+
+ type (diagnostics_type), intent(inout) :: &
+ d !< Input/Output: diagnostic information
+
+ !-----------------------------------------------------------------
+ !
+ ! output variables
+ !
+ !-----------------------------------------------------------------
+
+ integer, intent(out) :: err !< Output: error flag
+
+ !-----------------------------------------------------------------
+ !
+ ! local variables
+ !
+ !-----------------------------------------------------------------
+
+ real (kind=RKIND), dimension(:,:), pointer :: &
+ vertDiffTopOfCell, vertRediDiff
+
+ !-----------------------------------------------------------------
+ !
+ ! call relevant routines for computing tendencies
+ ! note that the user can choose multiple options and the
+ ! tendencies will be added together
+ !
+ !-----------------------------------------------------------------
+
+ err = 0
+
+ vertDiffTopOfCell => d % vertDiffTopOfCell % array
+ vertRediDiff => s % k33 % array
+
+ call ocn_tracer_vmix_coefs_redi(grid, vertDiffTopOfCell, vertRediDiff, err)
+
+ !--------------------------------------------------------------------
+
+ end subroutine ocn_vmix_coefs_redi_build!}}}
+
+!***********************************************************************
+!
+! routine ocn_tracer_vmix_coefs_redi
+!
+!> \brief Computes coefficients for vertical tracer mixing
+!> \author Doug Jacobsen
+!> \date 19 September 2011
+!> \version SVN:$Id$
+!> \details
+!> This routine computes the rediant vertical mixing coefficients for tracers
+!
+!-----------------------------------------------------------------------
+
+ subroutine ocn_tracer_vmix_coefs_redi(grid, vertDiffTopOfCell, vertRediDiff, err)!{{{
+
+ !-----------------------------------------------------------------
+ !
+ ! input variables
+ !
+ !-----------------------------------------------------------------
+
+ type (mesh_type), intent(in) :: &
+ grid !< Input: grid information
+
+ !-----------------------------------------------------------------
+ !
+ ! input/output variables
+ !
+ !-----------------------------------------------------------------
+
+ !-----------------------------------------------------------------
+ !
+ ! output variables
+ !
+ !-----------------------------------------------------------------
+
+ real (kind=RKIND), dimension(:,:), intent(inout) :: vertDiffTopOfCell !< Output: Vertical diffusion
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: vertRediDiff !< Output: Vertical diffusion
+
+ integer, intent(out) :: err !< Output: error flag
+
+ !-----------------------------------------------------------------
+ !
+ ! local variables
+ !
+ !-----------------------------------------------------------------
+
+ err = 0
+
+ if(.not.rediDiffOn) return
+
+ vertDiffTopOfCell = vertDiffTopOfCell + vertRediDiff
+
+ !--------------------------------------------------------------------
+
+ end subroutine ocn_tracer_vmix_coefs_redi!}}}
+
+
+!***********************************************************************
+!
+! routine ocn_vmix_coefs_redi_init
+!
+!> \brief Initializes ocean momentum vertical mixing quantities
+!> \author Doug Jacobsen
+!> \date 19 September 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 ocn_vmix_coefs_redi_init(err)!{{{
+
+ !--------------------------------------------------------------------
+
+ !-----------------------------------------------------------------
+ !
+ ! call individual init routines for each parameterization
+ !
+ !-----------------------------------------------------------------
+
+ integer, intent(out) :: err !< Output: error flag
+
+ err = 0
+
+ if (config_Redi_kappa > 0.) then
+ rediDiffOn = .True.
+ else
+ rediDiffOn = .False.
+ end if
+
+ !--------------------------------------------------------------------
+
+ end subroutine ocn_vmix_coefs_redi_init!}}}
+
+!***********************************************************************
+
+end module ocn_vmix_coefs_redi
+
+!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+! vim: foldmethod=marker
</font>
</pre>