<p><b>qchen3@fsu.edu</b> 2012-05-15 10:09:17 -0600 (Tue, 15 May 2012)</p><p>BRANCH COMMIT<br>
<br>
GM closure for pv is implemented. <br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/accgm/namelist.input.ocean
===================================================================
--- branches/ocean_projects/accgm/namelist.input.ocean        2012-05-15 00:07:23 UTC (rev 1911)
+++ branches/ocean_projects/accgm/namelist.input.ocean        2012-05-15 16:09:17 UTC (rev 1912)
@@ -42,7 +42,9 @@
config_h_mom_eddy_visc2 = 0.0
config_h_mom_eddy_visc4 = 0.0
config_h_kappa = 800.0
- config_h_kappa_q = 0.0
+ config_h_kappa_q = 200.0
+ config_uTPV = .true.
+ config_diffPV = .true.
config_visc_vorticity_term = .true.
config_h_tracer_eddy_diff2 = 1.0e5
config_h_tracer_eddy_diff4 = 0.0
Modified: branches/ocean_projects/accgm/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/Registry        2012-05-15 00:07:23 UTC (rev 1911)
+++ branches/ocean_projects/accgm/src/core_ocean/Registry        2012-05-15 16:09:17 UTC (rev 1912)
@@ -47,6 +47,8 @@
namelist logical hmix config_include_KE_vertex false
namelist real hmix config_h_tracer_eddy_diff2 0.0
namelist real hmix config_h_tracer_eddy_diff4 0.0
+namelist logical hmix config_uTPV false
+namelist logical hmix config_diffPV false
namelist real hmix config_h_kappa 0.0
namelist real hmix config_h_kappa_q 0.0
namelist logical hmix config_rayleigh_friction false
Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tendency.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tendency.F        2012-05-15 00:07:23 UTC (rev 1911)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_tendency.F        2012-05-15 16:09:17 UTC (rev 1912)
@@ -169,9 +169,9 @@
type (mesh_type), intent(in) :: grid !< Input: Grid information
real (kind=RKIND), dimension(:,:), pointer :: &
- h_edge, h, u, rho, zMid, pressure, &
+ h_edge, h, u, uTransport, rho, zMid, pressure, &
tend_u, circulation, vorticity, ke, ke_edge, Vor_edge, &
- MontPot, wTop, divergence, vertViscTopOfEdge
+ MontPot, wTop, divergence, vertViscTopOfEdge, Vor_vertex
real (kind=RKIND), dimension(:,:), pointer :: u_src
@@ -179,18 +179,20 @@
call mpas_timer_start("ocn_tend_u")
- u => s % u % array
- rho => s % rho % array
- wTop => s % wTop % array
- zMid => s % zMid % array
- h_edge => s % h_edge % array
- vorticity => s % vorticity % array
- divergence => s % divergence % array
- ke => s % ke % array
- ke_edge => s % ke_edge % array
- Vor_edge => s % Vor_edge % array
- MontPot => s % MontPot % array
- pressure => s % pressure % array
+ u => s % u % array
+ uTransport => s % uTransport % array
+ rho => s % rho % array
+ wTop => s % wTop % array
+ zMid => s % zMid % array
+ h_edge => s % h_edge % array
+ vorticity => s % vorticity % array
+ Vor_vertex => s % Vor_vertex % array
+ divergence => s % divergence % array
+ ke => s % ke % array
+ ke_edge => s % ke_edge % array
+ Vor_edge => s % Vor_edge % array
+ MontPot => s % MontPot % array
+ pressure => s % pressure % array
vertViscTopOfEdge => d % vertViscTopOfEdge % array
tend_u => tend % u % array
@@ -208,7 +210,11 @@
!
call mpas_timer_start("coriolis", .false., velCorTimer)
- call ocn_vel_coriolis_tend(grid, Vor_edge, h_edge, u, ke, tend_u, err)
+ if (config_uTPV) then
+ call ocn_vel_coriolis_tend(grid, Vor_edge, h_edge, uTransport, ke, tend_u, err)
+ else
+ call ocn_vel_coriolis_tend(grid, Vor_edge, h_edge, u, ke, tend_u, err)
+ end if
call mpas_timer_stop("coriolis", velCorTimer)
!
@@ -235,7 +241,7 @@
! strictly only valid for config_h_mom_eddy_visc2 == constant
!
call mpas_timer_start("hmix", .false., velHmixTimer)
- call ocn_vel_hmix_tend(grid, divergence, vorticity, tend_u, err)
+ call ocn_vel_hmix_tend(grid, divergence, vorticity, Vor_vertex, h_edge, tend_u, err)
call mpas_timer_stop("hmix", velHmixTimer)
!
@@ -404,7 +410,7 @@
integer, dimension(:,:), pointer :: cellsOnEdge, cellsOnVertex, &
verticesOnEdge, edgesOnEdge, edgesOnVertex,boundaryCell, vertexMask
- real (kind=RKIND) :: d2fdx2_cell1, d2fdx2_cell2, coef_3rd_order, r_tmp, invAreaCell1, invAreaCell2, invAreaTri1, invAreaTri2, invLength, h_vertex
+ real (kind=RKIND) :: d2fdx2_cell1, d2fdx2_cell2, coef_3rd_order, r_tmp, invAreaCell1, invAreaCell2, invAreaTri1, invAreaTri2, invLength, h_vertex, areaEdge
real (kind=RKIND), dimension(:), allocatable:: pTop
@@ -610,6 +616,7 @@
r_tmp = r_tmp * dcEdge(iEdge) * u(k,iEdge)
ke(k,cell1) = ke(k,cell1) + 0.25 * r_tmp * invAreaCell1
ke(k,cell2) = ke(k,cell2) + 0.25 * r_tmp * invAreaCell2
+
end do
! Compute v (tangential) velocities
@@ -870,6 +877,21 @@
uBolusGM = 0.0
end if
+ !
+ ! Adjust the definition of kinetic energy when GM is applied to PV
+ !
+ if (config_uTPV) then
+ do iEdge = 1, nEdges
+ cell1 = cellsOnEdge(1,iEdge)
+ cell2 = cellsOnEdge(2,iEdge)
+ areaEdge = dvEdge(iEdge) * dcEdge(iEdge)
+ do k = 1,nVertLevels
+ ke(k,iCell) = ke(k,iCell) + 0.5 * areaEdge * u(k,iEdge) * uBolusGM(k,iEdge)
+ end do
+ end do
+ end if
+
+
end subroutine ocn_diagnostic_solve!}}}
!***********************************************************************
Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_rk4.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_rk4.F        2012-05-15 00:07:23 UTC (rev 1911)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_time_integration_rk4.F        2012-05-15 16:09:17 UTC (rev 1912)
@@ -320,16 +320,15 @@
!
call ocn_vel_vmix_tend_implicit(block % mesh, dt, ke_edge, vertvisctopofedge, h, h_edge, u, err)
- ! mrp 110718 filter btr mode out of u
- if (config_rk_filter_btr_mode) then
- call filter_btr_mode_u(block % state % time_levs(2) % state, block % mesh)
- !block % tend % h % array(:,:) = 0.0 ! I should not need this
- endif
+ ! mrp 110718 filter btr mode out of u
+ if (config_rk_filter_btr_mode) then
+ call filter_btr_mode_u(block % state % time_levs(2) % state, block % mesh)
+ !block % tend % h % array(:,:) = 0.0 ! I should not need this
+ endif
!
! Implicit vertical solve for tracers
!
-
call ocn_tracer_vmix_tend_implicit(block % mesh, dt, vertdifftopofcell, h, tracers, err)
call mpas_timer_stop("RK4-implicit vert mix")
end if
Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix.F        2012-05-15 00:07:23 UTC (rev 1911)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix.F        2012-05-15 16:09:17 UTC (rev 1912)
@@ -72,7 +72,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_hmix_tend(grid, divergence, vorticity, tend, err)!{{{
+ subroutine ocn_vel_hmix_tend(grid, divergence, vorticity, Vor_vertex, h_edge, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -86,6 +86,12 @@
real (kind=RKIND), dimension(:,:), intent(in) :: &
vorticity !< Input: vorticity
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ Vor_vertex !< Input: pv on vertices
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ h_edge !< Input: thickness on edge
+
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -123,7 +129,7 @@
!-----------------------------------------------------------------
call mpas_timer_start("del2", .false., del2Timer)
- call ocn_vel_hmix_del2_tend(grid, divergence, vorticity, tend, err1)
+ call ocn_vel_hmix_del2_tend(grid, divergence, vorticity, Vor_vertex, h_edge, tend, err1)
call mpas_timer_stop("del2", del2Timer)
call mpas_timer_start("del4", .false., del4Timer)
call ocn_vel_hmix_del4_tend(grid, divergence, vorticity, tend, err2)
Modified: branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix_del2.F
===================================================================
--- branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix_del2.F        2012-05-15 00:07:23 UTC (rev 1911)
+++ branches/ocean_projects/accgm/src/core_ocean/mpas_ocn_vel_hmix_del2.F        2012-05-15 16:09:17 UTC (rev 1912)
@@ -70,7 +70,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_hmix_del2_tend(grid, divergence, vorticity, tend, err)!{{{
+ subroutine ocn_vel_hmix_del2_tend(grid, divergence, vorticity, Vor_vertex, h_edge, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -84,6 +84,12 @@
real (kind=RKIND), dimension(:,:), intent(in) :: &
vorticity !< Input: vorticity
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ Vor_vertex !< Input: pv on vertices
+
+ real (kind=RKIND), dimension(:,:), intent(in) :: &
+ h_edge !< Input: thickness on edge
+
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -149,17 +155,21 @@
invLength2 = 1.0 / dvEdge(iEdge)
do k=1,maxLevelEdgeTop(iEdge)
+ if (config_diffPV) then
+ u_diffusion = -( Vor_vertex(k,vertex2) - Vor_vertex(k,vertex1) ) / dvEdge(iEdge)
+ u_diffusion = config_h_kappa_q * h_edge(k,iEdge) * u_diffusion
+ else
+ ! Here -( vorticity(k,vertex2) - vorticity(k,vertex1) ) / dvEdge(iEdge)
+ ! is - </font>
<font color="blue">abla vorticity pointing from vertex 2 to vertex 1, or equivalently
+ ! + k \times </font>
<font color="red">abla vorticity pointing from cell1 to cell2.
+ u_diffusion = ( divergence(k,cell2) - divergence(k,cell1) ) * invLength1 &
+ -viscVortCoef &
+ *( vorticity(k,vertex2) - vorticity(k,vertex1) ) * invLength2
- ! Here -( vorticity(k,vertex2) - vorticity(k,vertex1) ) / dvEdge(iEdge)
- ! is - </font>
<font color="red">abla vorticity pointing from vertex 2 to vertex 1, or equivalently
- ! + k \times </font>
<font color="gray">abla vorticity pointing from cell1 to cell2.
+ u_diffusion = meshScalingDel2(iEdge) * eddyVisc2 * u_diffusion
- u_diffusion = ( divergence(k,cell2) - divergence(k,cell1) ) * invLength1 &
- -viscVortCoef &
- *( vorticity(k,vertex2) - vorticity(k,vertex1) ) * invLength2
+ end if
- u_diffusion = meshScalingDel2(iEdge) * eddyVisc2 * u_diffusion
-
tend(k,iEdge) = tend(k,iEdge) + edgeMask(k, iEdge) * u_diffusion
end do
@@ -198,7 +208,7 @@
hmixDel2On = .false.
- if ( config_h_mom_eddy_visc2 > 0.0 ) then
+ if ( config_h_mom_eddy_visc2 > 0.0 .or. config_diffPV ) then
hmixDel2On = .true.
eddyVisc2 = config_h_mom_eddy_visc2
</font>
</pre>