Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sets the msec field using start_tod from the driver. #989

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 149 additions & 3 deletions cicecore/cicedyn/analysis/ice_history_pond.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ module ice_history_pond
f_apond = 'x', f_apond_ai = 'x', &
f_hpond = 'x', f_hpond_ai = 'x', &
f_ipond = 'x', f_ipond_ai = 'x', &
f_flpnd = 'x', f_expnd = 'x', &
f_frpnd = 'x', f_rfpnd = 'x', &
f_ilpnd = 'x', f_mipnd = 'x', &
f_rdpnd = 'x', &
f_flpndn = 'x', f_expndn = 'x', &
f_frpndn = 'x', f_rfpndn = 'x', &
f_ilpndn = 'x', &
f_apeff = 'x', f_apeff_ai = 'x'

!---------------------------------------------------------------
Expand All @@ -43,6 +50,13 @@ module ice_history_pond
f_apond, f_apond_ai , &
f_hpond, f_hpond_ai , &
f_ipond, f_ipond_ai , &
f_flpnd, f_expnd , &
f_frpnd, f_rfpnd , &
f_ilpnd, f_mipnd , &
f_rdpnd, &
f_flpndn, f_expndn , &
f_frpndn, f_rfpndn , &
f_ilpndn, &
f_apeff, f_apeff_ai

!---------------------------------------------------------------
Expand All @@ -55,6 +69,13 @@ module ice_history_pond
n_apond , n_apond_ai, &
n_hpond , n_hpond_ai, &
n_ipond , n_ipond_ai, &
n_flpnd , n_expnd , &
n_frpnd , n_rfpnd , &
n_ilpnd , n_mipnd , &
n_rdpnd, &
n_flpndn , n_expndn , &
n_frpndn , n_rfpndn , &
n_ilpndn , &
n_apeff , n_apeff_ai

!=======================================================================
Expand Down Expand Up @@ -133,6 +154,18 @@ subroutine init_hist_pond_2D
f_apond = 'x'
f_hpond = 'x'
f_ipond = 'x'
f_flpnd = 'x'
f_expnd = 'x'
f_frpnd = 'x'
f_rfpnd = 'x'
f_ilpnd = 'x'
f_mipnd = 'x'
f_rdpnd = 'x'
f_flpndn = 'x'
f_expndn = 'x'
f_frpndn = 'x'
f_rfpndn = 'x'
f_ilpndn = 'x'
f_apeff = 'x'
f_apond_ai = 'x'
f_hpond_ai = 'x'
Expand All @@ -151,6 +184,18 @@ subroutine init_hist_pond_2D
call broadcast_scalar (f_hpond_ai, master_task)
call broadcast_scalar (f_ipond_ai, master_task)
call broadcast_scalar (f_apeff_ai, master_task)
call broadcast_scalar (f_flpnd, master_task)
call broadcast_scalar (f_expnd, master_task)
call broadcast_scalar (f_frpnd, master_task)
call broadcast_scalar (f_rfpnd, master_task)
call broadcast_scalar (f_ilpnd, master_task)
call broadcast_scalar (f_mipnd, master_task)
call broadcast_scalar (f_rdpnd, master_task)
call broadcast_scalar (f_flpndn, master_task)
call broadcast_scalar (f_expndn, master_task)
call broadcast_scalar (f_frpndn, master_task)
call broadcast_scalar (f_rfpndn, master_task)
call broadcast_scalar (f_ilpndn, master_task)

if (tr_pond) then

Expand Down Expand Up @@ -206,6 +251,48 @@ subroutine init_hist_pond_2D
"weighted by ice area", c1, c0, &
ns, f_apeff_ai)

if (f_flpnd(1:1) /= 'x') &
call define_hist_field(n_flpnd,"flpnd","m/s",tstr2D, tcstr, &
"pond flushing rate due to ice permeability", &
"none", c1, c0, &
ns, f_flpnd)

if (f_expnd(1:1) /= 'x') &
call define_hist_field(n_expnd,"expnd","m/s",tstr2D, tcstr, &
"exponential pond drainage rate", &
"none", c1, c0, &
ns, f_expnd)

if (f_frpnd(1:1) /= 'x') &
call define_hist_field(n_frpnd,"frpnd","m/s",tstr2D, tcstr, &
"pond drainage rate due to freeboard constraint", &
"none", c1, c0, &
ns, f_frpnd)

if (f_rfpnd(1:1) /= 'x') &
call define_hist_field(n_rfpnd,"rfpnd","m/s",tstr2D, tcstr, &
"runoff rate due to rfrac", &
"none", c1, c0, &
ns, f_rfpnd)

if (f_ilpnd(1:1) /= 'x') &
call define_hist_field(n_ilpnd,"ilpnd","m/s",tstr2D, tcstr, &
"pond loss gain to ice lid freezing / melting", &
"none", c1, c0, &
ns, f_ilpnd)

if (f_mipnd(1:1) /= 'x') &
call define_hist_field(n_mipnd,"mipnd","m/s",tstr2D, tcstr, &
"pond drainage due to ice melting", &
"none", c1, c0, &
ns, f_mipnd)

if (f_rdpnd(1:1) /= 'x') &
call define_hist_field(n_rdpnd,"rdpnd","m",tstr2D, tcstr, &
"pond drainage due to ridging", &
"none", c1, c0, &
ns, f_rdpnd)

endif ! histfreq(ns) /= 'x'
enddo ! nstreams

Expand Down Expand Up @@ -251,6 +338,36 @@ subroutine init_hist_pond_3Dc
"none", c1, c0, &
ns, f_apeffn)

if (f_flpndn(1:1) /= 'x') &
call define_hist_field(n_flpndn,"flpndn","m/s",tstr3Dc, tcstr, &
"category pond flushing rate due to ice permeability", &
"none", c1, c0, &
ns, f_flpndn)

if (f_expndn(1:1) /= 'x') &
call define_hist_field(n_expndn,"expndn","m/s",tstr3Dc, tcstr, &
"category exponential pond drainage rate", &
"none", c1, c0, &
ns, f_expndn)

if (f_frpndn(1:1) /= 'x') &
call define_hist_field(n_frpndn,"frpndn","m/s",tstr3Dc, tcstr, &
"category pond drainage rate due to freeboard constraint", &
"none", c1, c0, &
ns, f_frpndn)

if (f_rfpndn(1:1) /= 'x') &
call define_hist_field(n_rfpndn,"rfpndn","m/s",tstr3Dc, tcstr, &
"category runoff rate due to rfrac", &
"none", c1, c0, &
ns, f_rfpndn)

if (f_ilpndn(1:1) /= 'x') &
call define_hist_field(n_ilpndn,"ilpndn","m/s",tstr3Dc, tcstr, &
"category pond loss gain to ice lid freezing / melting", &
"none", c1, c0, &
ns, f_ilpndn)

endif ! histfreq(ns) /= 'x'
enddo ! ns

Expand All @@ -268,6 +385,8 @@ subroutine accum_hist_pond (iblk)
use ice_blocks, only: block, get_block, nx_block, ny_block
use ice_domain, only: blocks_ice
use ice_flux, only: apeff_ai
use ice_flux, only: flpnd, expnd, frpnd, rfpnd, ilpnd, mipnd,rdpnd
use ice_flux, only: flpndn, expndn, frpndn, rfpndn, ilpndn
use ice_history_shared, only: n2D, a2D, a3Dc, ncat_hist, &
accum_hist_field
use ice_state, only: aice, trcr, trcrn
Expand All @@ -287,7 +406,7 @@ subroutine accum_hist_pond (iblk)
integer (kind=int_kind) :: &
nt_apnd, nt_hpnd, nt_alvl, nt_ipnd
logical (kind=log_kind) :: &
tr_pond_lvl, tr_pond_topo
tr_pond_lvl, tr_pond_sealvl, tr_pond_topo

real (kind=dbl_kind) :: &
puny
Expand All @@ -303,7 +422,7 @@ subroutine accum_hist_pond (iblk)

call icepack_query_parameters(puny_out=puny)
call icepack_query_tracer_flags(tr_pond_lvl_out=tr_pond_lvl, &
tr_pond_topo_out=tr_pond_topo)
tr_pond_topo_out=tr_pond_topo, tr_pond_sealvl_out=tr_pond_sealvl)
call icepack_query_tracer_indices(nt_apnd_out=nt_apnd, nt_hpnd_out=nt_hpnd, &
nt_alvl_out=nt_alvl, nt_ipnd_out=nt_ipnd)
call icepack_warnings_flush(nu_diag)
Expand Down Expand Up @@ -340,7 +459,7 @@ subroutine accum_hist_pond (iblk)
* trcr(:,:,nt_alvl,iblk) * trcr(:,:,nt_apnd,iblk) &
* trcr(:,:,nt_ipnd,iblk), a2D)

elseif (tr_pond_topo) then
elseif (tr_pond_topo .or. tr_pond_sealvl) then

if (f_apond(1:1)/= 'x') &
call accum_hist_field(n_apond, iblk, &
Expand Down Expand Up @@ -385,6 +504,21 @@ subroutine accum_hist_pond (iblk)
if (f_apeff_ai(1:1) /= 'x') &
call accum_hist_field(n_apeff_ai, iblk, apeff_ai(:,:,iblk), a2D)

if (f_flpnd (1:1) /= 'x') &
call accum_hist_field(n_flpnd, iblk, flpnd(:,:,iblk), a2D)
if (f_expnd (1:1) /= 'x') &
call accum_hist_field(n_expnd, iblk, expnd(:,:,iblk), a2D)
if (f_frpnd (1:1) /= 'x') &
call accum_hist_field(n_frpnd, iblk, frpnd(:,:,iblk), a2D)
if (f_rfpnd (1:1) /= 'x') &
call accum_hist_field(n_rfpnd, iblk, rfpnd(:,:,iblk), a2D)
if (f_ilpnd (1:1) /= 'x') &
call accum_hist_field(n_ilpnd, iblk, ilpnd(:,:,iblk), a2D)
if (f_mipnd (1:1) /= 'x') &
call accum_hist_field(n_mipnd, iblk, mipnd(:,:,iblk), a2D)
if (f_rdpnd (1:1) /= 'x') &
call accum_hist_field(n_rdpnd, iblk, rdpnd(:,:,iblk), a2D)

endif ! allocated(a2D)

! 3D category fields
Expand All @@ -399,6 +533,18 @@ subroutine accum_hist_pond (iblk)
call accum_hist_field(n_hpondn-n2D, iblk, ncat_hist, &
trcrn(:,:,nt_apnd,1:ncat_hist,iblk) &
* trcrn(:,:,nt_hpnd,1:ncat_hist,iblk), a3Dc)

if (f_flpndn (1:1) /= 'x') &
call accum_hist_field(n_flpndn-n2D, iblk, ncat_hist, flpndn(:,:,:,iblk), a3Dc)
if (f_expndn (1:1) /= 'x') &
call accum_hist_field(n_expndn-n2D, iblk, ncat_hist, expndn(:,:,:,iblk), a3Dc)
if (f_frpndn (1:1) /= 'x') &
call accum_hist_field(n_frpndn-n2D, iblk, ncat_hist, frpndn(:,:,:,iblk), a3Dc)
if (f_rfpndn (1:1) /= 'x') &
call accum_hist_field(n_rfpndn-n2D, iblk, ncat_hist, rfpndn(:,:,:,iblk), a3Dc)
if (f_ilpndn (1:1) /= 'x') &
call accum_hist_field(n_ilpndn-n2D, iblk, ncat_hist, ilpndn(:,:,:,iblk), a3Dc)

endif ! allocated(a3Dc)

end subroutine accum_hist_pond
Expand Down
6 changes: 3 additions & 3 deletions cicecore/cicedyn/dynamics/ice_transport_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,7 @@ subroutine state_to_work (nx_block, ny_block, &
nt_alvl, nt_apnd, nt_fbri

logical (kind=log_kind) :: &
tr_pond_lvl, tr_pond_topo
tr_pond_lvl, tr_pond_topo, tr_pond_sealvl

integer (kind=int_kind) :: &
i, j, n, it, & ! counting indices
Expand All @@ -1537,7 +1537,7 @@ subroutine state_to_work (nx_block, ny_block, &
character(len=*), parameter :: subname = '(state_to_work)'

call icepack_query_tracer_flags(tr_pond_lvl_out=tr_pond_lvl, &
tr_pond_topo_out=tr_pond_topo)
tr_pond_topo_out=tr_pond_topo, tr_pond_sealvl_out=tr_pond_sealvl)
call icepack_query_tracer_indices(nt_alvl_out=nt_alvl, nt_apnd_out=nt_apnd, &
nt_fbri_out=nt_fbri)
call icepack_warnings_flush(nu_diag)
Expand Down Expand Up @@ -1597,7 +1597,7 @@ subroutine state_to_work (nx_block, ny_block, &
enddo
enddo
elseif (trcr_depend(it) == 2+nt_apnd .and. &
tr_pond_topo) then
(tr_pond_topo .or. tr_pond_sealvl)) then
do j = 1, ny_block
do i = 1, nx_block
works(i,j,narrays+it) = aicen(i,j ,n) &
Expand Down
Loading
Loading