<p><b>dwj07@fsu.edu</b> 2012-12-13 11:00:18 -0700 (Thu, 13 Dec 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Changing vert_grid_type to vert_coord_movement.<br>
        Adding 1D array with vertical coordinate movement weights.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry        2012-12-12 22:25:52 UTC (rev 2347)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/Registry        2012-12-13 18:00:18 UTC (rev 2348)
@@ -28,8 +28,7 @@
namelist integer grid config_num_halos 3
namelist logical grid config_enforce_grid_on_restart .false.
-namelist character grid config_vert_grid_type 'isopycnal'
-namelist character grid config_vert_adv_layer_weights 'uniform'
+namelist character grid config_vert_coord_movement 'isopycnal'
namelist character grid config_alter_ICs_for_pbcs 'zlevel_pbcs_off'
namelist real grid config_min_pbc_fraction 0.10
namelist logical grid config_check_ssh_consistency .true.
@@ -240,7 +239,7 @@
% Arrays required for reconstruction of velocity field
var persistent real coeffs_reconstruct ( R3 maxEdges nCells ) 0 - coeffs_reconstruct mesh - -
-% Arrays for z-level version of mpas-ocean
+% Arrays for non-isopycnal version of mpas-ocean
var persistent integer maxLevelCell ( nCells ) 0 iro maxLevelCell mesh - -
var persistent integer maxLevelEdgeTop ( nEdges ) 0 - maxLevelEdgeTop mesh - -
var persistent integer maxLevelEdgeBot ( nEdges ) 0 - maxLevelEdgeBot mesh - -
@@ -249,7 +248,7 @@
var persistent real refBottomDepth ( nVertLevels ) 0 iro refBottomDepth mesh - -
var persistent real refBottomDepthTopOfCell ( nVertLevelsP1 ) 0 - refBottomDepthTopOfCell mesh - -
var persistent real hZLevel ( nVertLevels ) 0 iro hZLevel mesh - -
-var persistent real zstarWeight ( nVertLevels ) 0 - zstarWeight mesh - -
+var persistent real vertCoordMovementWeights ( nVertLevels ) 0 iro vertCoordMovementWeights mesh - -
% Boundary conditions and masks
var persistent integer boundaryEdge ( nVertLevels nEdges ) 0 - boundaryEdge mesh - -
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_equation_of_state.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_equation_of_state.F        2012-12-12 22:25:52 UTC (rev 2347)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_equation_of_state.F        2012-12-13 18:00:18 UTC (rev 2348)
@@ -158,7 +158,7 @@
linearEos = .false.
jmEos = .false.
- if(config_vert_grid_type.ne.'isopycnal') then
+ if(config_vert_coord_movement.ne.'isopycnal') then
eosON = .true.
if (config_eos_type.eq.'linear') then
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_gm.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_gm.F        2012-12-12 22:25:52 UTC (rev 2347)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_gm.F        2012-12-13 18:00:18 UTC (rev 2348)
@@ -30,7 +30,7 @@
contains
- subroutine ocn_gm_compute_uBolus(s, grid)
+ subroutine ocn_gm_compute_uBolus(s, grid)!{{{
implicit none
type(state_type), intent(inout) :: s
type(mesh_type), intent(in) :: grid
@@ -50,7 +50,7 @@
call ocn_gm_compute_hEddyFlux(s, grid)
- if (config_vert_grid_type .EQ. 'isopycnal') then
+ if (config_vert_coord_movement .EQ. 'isopycnal') then
do iEdge = 1, nEdges
do k = 1, maxLevelEdgeTop(iEdge)
@@ -65,10 +65,9 @@
end if
- end subroutine ocn_gm_compute_uBolus
+ end subroutine ocn_gm_compute_uBolus!}}}
-
- subroutine ocn_gm_compute_hEddyFlux(s, grid)
+ subroutine ocn_gm_compute_hEddyFlux(s, grid)!{{{
implicit none
type(state_type), intent(inout) :: s
type(mesh_type), intent(in) :: grid
@@ -90,7 +89,7 @@
hEddyFlux(:,:) = 0.0
- if (config_vert_grid_type .EQ. 'isopycnal') then
+ if (config_vert_coord_movement .EQ. 'isopycnal') then
do iEdge = 1,nEdges
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
@@ -104,12 +103,10 @@
end if
- end subroutine ocn_gm_compute_hEddyFlux
+ end subroutine ocn_gm_compute_hEddyFlux!}}}
+ subroutine ocn_get_h_kappa(s, grid)!{{{
-
- subroutine ocn_get_h_kappa(s, grid)
-
type (state_type), intent(inout) :: s
type (mesh_type), intent(in) :: grid
@@ -121,11 +118,10 @@
h_kappa(:,:) = config_h_kappa
- end subroutine ocn_get_h_kappa
+ end subroutine ocn_get_h_kappa!}}}
+ subroutine ocn_get_h_kappa_q(s, grid)!{{{
- subroutine ocn_get_h_kappa_q(s, grid)
-
type (state_type), intent(inout) :: s
type (mesh_type), intent(in) :: grid
@@ -137,6 +133,6 @@
h_kappa_q(:,:) = config_h_kappa_q
- end subroutine ocn_get_h_kappa_q
+ end subroutine ocn_get_h_kappa_q!}}}
end module ocn_gm
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_mpas_core.F        2012-12-12 22:25:52 UTC (rev 2347)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_mpas_core.F        2012-12-13 18:00:18 UTC (rev 2348)
@@ -117,24 +117,19 @@
if (.not. config_do_restart) call setup_sw_test_case(domain)
- if (config_vert_grid_type.ne.'isopycnal') call ocn_init_vert_coord(domain)
+ if (config_vert_coord_movement.ne.'isopycnal') call ocn_init_vert_coord(domain)
call ocn_compute_max_level(domain)
- if (config_enforce_grid_on_restart) then
- call ocn_init_h_zstar(domain)
- endif
-
if (.not.config_do_restart) call ocn_init_split_timestep(domain)
- write (0,'(a,a10)'), ' Vertical grid type is: ',config_vert_grid_type
+ write (0,'(a,a10)'), ' Vertical coordinate movement is: ',config_vert_coord_movement
- if (config_vert_grid_type.ne.'isopycnal'.and. &
- config_vert_grid_type.ne.'zlevel'.and. &
- config_vert_grid_type.ne.'zstar1'.and. &
- config_vert_grid_type.ne.'zstar'.and. &
- config_vert_grid_type.ne.'zstarWeights') then
- write (0,*) ' Incorrect choice of config_vert_grid_type.'
+ if (config_vert_coord_movement.ne.'isopycnal'.and. &
+ config_vert_coord_movement.ne.'fixed'.and. &
+ config_vert_coord_movement.ne.'uniform_stretching'.and. &
+ config_vert_coord_movement.ne.'user_specified') then
+ write (0,*) ' Incorrect choice of config_vert_coord_movement.'
call mpas_dmpar_abort(dminfo)
endif
@@ -145,10 +140,15 @@
call mpas_dmpar_abort(dminfo)
endif
+ if(config_vert_coord_movement .ne. 'isopycnal' .and. config_pressure_gradient_type .eq. 'MontgomeryPotential') then
+ write (0,*) ' Incorrect combination of config_vert_coord_movement and config_pressure_gradient_type'
+ call mpas_dmpar_abort(dminfo)
+ end if
+
if (config_filter_btr_mode.and. &
- config_vert_grid_type.ne.'zlevel')then
+ config_vert_coord_movement.ne.'fixed')then
write (0,*) 'filter_btr_mode has only been tested with'// &
- ' config_vert_grid_type=zlevel.'
+ ' config_vert_coord_movement=fixed.'
call mpas_dmpar_abort(dminfo)
endif
@@ -565,7 +565,7 @@
integer, dimension(:), pointer :: maxLevelCell
real (kind=RKIND), dimension(:), pointer :: refBottomDepth, &
- refBottomDepthTopOfCell, zstarWeight, hZLevel, bottomDepth
+ refBottomDepthTopOfCell, vertCoordMovementWeights, hZLevel, bottomDepth
real (kind=RKIND), dimension(:), allocatable :: minBottomDepth, minBottomDepthMid, zMidZLevel
real (kind=RKIND), dimension(:,:), pointer :: h
@@ -582,7 +582,7 @@
refBottomDepth => block % mesh % refBottomDepth % array
refBottomDepthTopOfCell => block % mesh % refBottomDepthTopOfCell % array
bottomDepth => block % mesh % bottomDepth % array
- zstarWeight => block % mesh % zstarWeight % array
+ vertCoordMovementWeights => block % mesh % vertCoordMovementWeights % array
hZLevel => block % mesh % hZLevel % array
maxLevelCell => block % mesh % maxLevelCell % array
@@ -606,28 +606,17 @@
refBottomDepthTopOfCell(k+1) = refBottomDepth(k)
end do
- ! Initialization of zstarWeights. This determines how SSH perturbations
+ ! Initialization of vertCoordMovementWeights. This determines how SSH perturbations
! are distributed throughout the column.
- if (config_vert_grid_type.eq.'zlevel') then
+ if (config_vert_coord_movement.eq.'fixed') then
- zstarWeight = 0.0
- zstarWeight(1) = 1.0
+ vertCoordMovementWeights = 0.0
+ vertCoordMovementWeights(1) = 1.0
- elseif (config_vert_grid_type.eq.'zstar') then
+ elseif (config_vert_coord_movement.eq.'uniform_stretching') then
- zstarWeight = 1.0
+ vertCoordMovementWeights = 1.0
- elseif (config_vert_grid_type.eq.'zstarWeights') then
-
- ! This is a test with other weights, just to make sure zstar functions
- ! using variable weights.
-
- zstarWeight = 0.0
- zstarWeight(1:5) = 1.0
- do k=1,10
- zstarWeight(5+k) = 1.0-k*0.1
- end do
-
endif
! Initial condition files (ocean.nc, produced by basin) include a realistic
@@ -855,64 +844,6 @@
end subroutine ocn_init_split_timestep!}}}
- subroutine ocn_init_h_zstar(domain)!{{{
- ! If changing from zlevel to zstar, compute h based on zstar weights,
- ! where SSH is distributed through the layers. We only change h.
- ! We do not remap the tracer variables, so this breaks total global
- ! conservation.
-
- use mpas_grid_types
- use mpas_configure
-
- implicit none
-
- type (domain_type), intent(inout) :: domain
-
- type (block_type), pointer :: block
-
- integer :: i, iCell, iEdge, iVertex, k, nVertLevels
- integer, dimension(:), pointer :: maxLevelCell
-
- real (kind=RKIND) :: hSum, sumZstarWeights
- real (kind=RKIND), dimension(:), pointer :: hZLevel, zstarWeight, &
- refBottomDepth
- real (kind=RKIND), dimension(:,:), pointer :: h
-
- ! Initialize z-level grid variables from h, read in from input file.
- block => domain % blocklist
- do while (associated(block))
-
- h => block % state % time_levs(1) % state % h % array
- nVertLevels = block % mesh % nVertLevels
- hZLevel => block % mesh % hZLevel % array
- maxLevelCell => block % mesh % maxLevelCell % array
- zstarWeight => block % mesh % zstarWeight % array
- refBottomDepth => block % mesh % refBottomDepth % array
-
- do iCell=1,block % mesh % nCells
- ! Compute the total column thickness, hSum, and the sum of zstar weights.
- hSum = 0.0
- sumZstarWeights = 0.0
- do k = 1,maxLevelCell(iCell)
- hSum = hSum + h(k,iCell)
- sumZstarWeights = sumZstarWeights + zstarWeight(k)
- enddo
-
- ! h_k = h_k^{zlevel} + zeta * W_k/sum(W_k)
- ! where zeta is SSH and W_k are weights
- do k = 1,maxLevelCell(iCell)
- h(k,iCell) = hZLevel(k) &
- + (hSum - refBottomDepth(maxLevelCell(iCell))) &
- * zstarWeight(k)/sumZstarWeights
- enddo
-
- enddo
-
- block => block % next
- end do
-
- end subroutine ocn_init_h_zstar!}}}
-
subroutine ocn_compute_max_level(domain)!{{{
! Initialize maxLevel and bouncary grid variables.
@@ -963,7 +894,7 @@
! for z-grids, maxLevelCell should be in input state
! Isopycnal grid uses all vertical cells
- if (config_vert_grid_type.eq.'isopycnal') then
+ if (config_vert_coord_movement.eq.'isopycnal') then
maxLevelCell(1:nCells) = nVertLevels
endif
maxLevelCell(nCells+1) = 0
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tendency.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tendency.F        2012-12-12 22:25:52 UTC (rev 2347)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tendency.F        2012-12-13 18:00:18 UTC (rev 2348)
@@ -684,7 +684,7 @@
!
! For an isopycnal model, density should remain constant.
! For zlevel, calculate in-situ density
- if (config_vert_grid_type.ne.'isopycnal') then
+ if (config_vert_coord_movement.ne.'isopycnal') then
call mpas_timer_start("equation of state", .false., diagEOSTimer)
call ocn_equation_of_state_rho(s, grid, 0, 'relative', err)
! mrp 110324 In order to visualize rhoDisplaced, include the following
@@ -836,7 +836,7 @@
real (kind=RKIND), dimension(:), pointer :: &
- dvEdge, areaCell, zstarWeight
+ dvEdge, areaCell, vertCoordMovementWeights
real (kind=RKIND), dimension(:), allocatable:: div_hu, h_tend_col
real (kind=RKIND) :: div_hu_btr
@@ -857,14 +857,14 @@
maxLevelCell => grid % maxLevelCell % array
maxLevelEdgeBot => grid % maxLevelEdgeBot % array
dvEdge => grid % dvEdge % array
- zstarWeight => grid % zstarWeight % array
+ vertCoordMovementWeights => grid % vertCoordMovementWeights % array
nCells = grid % nCells
nEdges = grid % nEdges
nVertLevels = grid % nVertLevels
- if (config_vert_grid_type.eq.'isopycnal') then
+ if (config_vert_coord_movement.eq.'isopycnal') then
! set vertical velocity to zero in isopycnal case
wTop=0.0_RKIND
return
@@ -895,8 +895,8 @@
end do
do k = 1, maxLevelCell(iCell)
- h_tend_col(k) = - zstarWeight(k) * h(k, iCell) * div_hu_btr
- hSum = hSum + zstarWeight(k) * h(k, iCell)
+ h_tend_col(k) = - vertCoordMovementWeights(k) * h(k, iCell) * div_hu_btr
+ hSum = hSum + vertCoordMovementWeights(k) * h(k, iCell)
end do
if(hSum > 0.0) then
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_vadv.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_vadv.F        2012-12-12 22:25:52 UTC (rev 2347)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_tracer_vadv.F        2012-12-13 18:00:18 UTC (rev 2348)
@@ -172,7 +172,7 @@
err = 0
vadvOn = .false.
- if (config_vert_grid_type.ne.'isopycnal') then
+ if (config_vert_coord_movement.ne.'isopycnal') then
vadvOn = .true.
call ocn_tracer_vadv_stencil_init(err1)
call ocn_tracer_vadv_spline_init(err2)
Modified: branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vel_vadv.F
===================================================================
--- branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vel_vadv.F        2012-12-12 22:25:52 UTC (rev 2347)
+++ branches/ocean_projects/namelist_cleanup/src/core_ocean/mpas_ocn_vel_vadv.F        2012-12-13 18:00:18 UTC (rev 2348)
@@ -183,7 +183,7 @@
err = 0
velVadvOn = .false.
- if (config_vert_grid_type.ne.'isopycnal') then
+ if (config_vert_coord_movement.ne.'isopycnal') then
velVadvOn = .true.
end if
</font>
</pre>