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

Add time-varying wave forcing, add warning for FSD without waves, make FSD tendencies per second #775

Merged
Merged
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
2 changes: 1 addition & 1 deletion cicecore/cicedynB/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3546,7 +3546,7 @@ subroutine accum_hist (dt)
call accum_hist_drag (iblk)

! floe size distribution
call accum_hist_fsd (iblk)
call accum_hist_fsd (dt, iblk)

! advanced snow physics
call accum_hist_snow (iblk)
Expand Down
53 changes: 28 additions & 25 deletions cicecore/cicedynB/analysis/ice_history_fsd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ subroutine init_hist_fsd_2D
do ns = 1, nstreams

if (f_wave_sig_ht(1:1) /= 'x') &
call define_hist_field(n_wave_sig_ht,"wave_sig_ht","1",tstr2D, tcstr, &
call define_hist_field(n_wave_sig_ht,"wave_sig_ht","m",tstr2D, tcstr, &
"significant height of wind and swell waves", &
"from attenuated spectrum in ice", c1, c0, &
ns, f_wave_sig_ht)
Expand All @@ -147,7 +147,7 @@ subroutine init_hist_fsd_2D
"for waves", c1, c0, &
ns, f_aice_ww)
if (f_diam_ww(1:1) /= 'x') &
call define_hist_field(n_diam_ww,"diam_ww","1",tstr2D, tcstr, &
call define_hist_field(n_diam_ww,"diam_ww","m",tstr2D, tcstr, &
"Average (number) diameter of floes > Dmin", &
"for waves", c1, c0, &
ns, f_diam_ww)
Expand Down Expand Up @@ -216,27 +216,27 @@ subroutine init_hist_fsd_3Df
if (histfreq(ns) /= 'x') then

if (f_afsd(1:1) /= 'x') &
call define_hist_field(n_afsd,"afsd", "1", tstr3Df, tcstr, &
call define_hist_field(n_afsd,"afsd", "1/m", tstr3Df, tcstr, &
"areal floe size distribution", &
"per unit bin width ", c1, c0, ns, f_afsd)
if (f_dafsd_newi(1:1) /= 'x') &
call define_hist_field(n_dafsd_newi,"dafsd_newi","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_newi,"dafsd_newi","1/s",tstr3Df, tcstr, &
"Change in fsd: new ice", &
"Avg over freq period", c1, c0, ns, f_dafsd_newi)
if (f_dafsd_latg(1:1) /= 'x') &
call define_hist_field(n_dafsd_latg,"dafsd_latg","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_latg,"dafsd_latg","1/s",tstr3Df, tcstr, &
"Change in fsd: lateral growth", &
"Avg over freq period", c1, c0, ns, f_dafsd_latg)
if (f_dafsd_latm(1:1) /= 'x') &
call define_hist_field(n_dafsd_latm,"dafsd_latm","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_latm,"dafsd_latm","1/s",tstr3Df, tcstr, &
"Change in fsd: lateral melt", &
"Avg over freq period", c1, c0, ns, f_dafsd_latm)
if (f_dafsd_wave(1:1) /= 'x') &
call define_hist_field(n_dafsd_wave,"dafsd_wave","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_wave,"dafsd_wave","1/s",tstr3Df, tcstr, &
"Change in fsd: waves", &
"Avg over freq period", c1, c0, ns, f_dafsd_wave)
if (f_dafsd_weld(1:1) /= 'x') &
call define_hist_field(n_dafsd_weld,"dafsd_weld","1",tstr3Df, tcstr, &
call define_hist_field(n_dafsd_weld,"dafsd_weld","1/s",tstr3Df, tcstr, &
"Change in fsd: welding", &
"Avg over freq period", c1, c0, ns, f_dafsd_weld)
endif ! if (histfreq(ns) /= 'x')
Expand Down Expand Up @@ -272,7 +272,7 @@ subroutine init_hist_fsd_4Df
if (histfreq(ns) /= 'x') then

if (f_afsdn(1:1) /= 'x') &
call define_hist_field(n_afsdn,"afsdn","1",tstr4Df, tcstr, &
call define_hist_field(n_afsdn,"afsdn","1/m",tstr4Df, tcstr, &
"areal floe size and thickness distribution", &
"per unit bin width", c1, c0, ns, f_afsdn)

Expand All @@ -288,16 +288,19 @@ end subroutine init_hist_fsd_4Df
! accumulate average ice quantities or snapshots
! author: Elizabeth C. Hunke, LANL

subroutine accum_hist_fsd (iblk)
subroutine accum_hist_fsd (dt, iblk)

use ice_blocks, only: nx_block, ny_block
use ice_constants, only: c0, c1, c2, c4
use ice_history_shared, only: a2D, a3Df, a4Df, nfsd_hist, &
ncat_hist, accum_hist_field, n3Dacum, n4Dscum
use ice_state, only: trcrn, aicen_init, vicen, aice_init
use ice_state, only: trcrn, aicen, vicen, aice
use ice_arrays_column, only: wave_sig_ht, floe_rad_c, floe_binwidth, &
d_afsd_newi, d_afsd_latg, d_afsd_latm, d_afsd_wave, d_afsd_weld

real (kind=dbl_kind), intent(in) :: &
dt ! time step

integer (kind=int_kind), intent(in) :: &
iblk ! block index

Expand Down Expand Up @@ -342,7 +345,7 @@ subroutine accum_hist_fsd (iblk)
worka(i,j) = c0
do n = 1, ncat_hist
do k = 1, nfsd_hist
worka(i,j) = worka(i,j) + aicen_init(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
worka(i,j) = worka(i,j) + aicen(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
end do
end do
end do
Expand All @@ -357,7 +360,7 @@ subroutine accum_hist_fsd (iblk)
workb = c0
do n = 1, ncat_hist
do k = 1, nfsd_hist
workc = aicen_init(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk) &
workc = aicen(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk) &
/ (c4*floeshape*floe_rad_c(k)**2)
! number-mean radius
worka(i,j) = worka(i,j) + workc * floe_rad_c(k)
Expand All @@ -380,7 +383,7 @@ subroutine accum_hist_fsd (iblk)
workb = c0
do n = 1, ncat_hist
do k = 1, nfsd_hist
workb = workb + aicen_init(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
workb = workb + aicen(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
worka(i,j) = worka(i,j) + vicen(i,j,n,iblk)*trcrn(i,j,nt_fsd+k-1,n,iblk)
end do
end do
Expand All @@ -398,12 +401,12 @@ subroutine accum_hist_fsd (iblk)
do j = 1, ny_block
do i = 1, nx_block
worka(i,j) = c0
if (aice_init(i,j,iblk) > puny) then
if (aice(i,j,iblk) > puny) then
do k = 1, nfsd_hist
do n = 1, ncat_hist
worka(i,j) = worka(i,j) &
+ (trcrn(i,j,nt_fsd+k-1,n,iblk) * floe_rad_c(k) &
* aicen_init(i,j,n,iblk)/aice_init(i,j,iblk))
* aicen(i,j,n,iblk)/aice(i,j,iblk))
end do
end do
endif
Expand All @@ -416,12 +419,12 @@ subroutine accum_hist_fsd (iblk)
do j = 1, ny_block
do i = 1, nx_block
worka(i,j) = c0
if (aice_init(i,j,iblk) > puny) then
if (aice(i,j,iblk) > puny) then
do k = 1, nfsd_hist
do n = 1, ncat_hist
worka(i,j) = worka(i,j) &
+ (c8*floeshape*trcrn(i,j,nt_fsd+k-1,n,iblk)*floe_rad_c(k) &
*aicen_init(i,j,n,iblk)/(c4*floeshape*floe_rad_c(k)**2 *aice_init(i,j,iblk)))
*aicen(i,j,n,iblk)/(c4*floeshape*floe_rad_c(k)**2 *aice(i,j,iblk)))
end do
end do
endif
Expand All @@ -442,7 +445,7 @@ subroutine accum_hist_fsd (iblk)
worke(i,j,k)=c0
do n = 1, ncat_hist
worke(i,j,k) = worke(i,j,k) + (trcrn(i,j,nt_fsd+k-1,n,iblk) &
* aicen_init(i,j,n,iblk)/floe_binwidth(k))
* aicen(i,j,n,iblk)/floe_binwidth(k))
end do
end do
end do
Expand All @@ -452,19 +455,19 @@ subroutine accum_hist_fsd (iblk)

if (f_dafsd_newi(1:1)/= 'x') &
call accum_hist_field(n_dafsd_newi-n3Dacum, iblk, nfsd_hist, &
d_afsd_newi(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_newi(:,:,1:nfsd_hist,iblk)/dt, a3Df)
if (f_dafsd_latg(1:1)/= 'x') &
call accum_hist_field(n_dafsd_latg-n3Dacum, iblk, nfsd_hist, &
d_afsd_latg(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_latg(:,:,1:nfsd_hist,iblk)/dt, a3Df)
if (f_dafsd_latm(1:1)/= 'x') &
call accum_hist_field(n_dafsd_latm-n3Dacum, iblk, nfsd_hist, &
d_afsd_latm(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_latm(:,:,1:nfsd_hist,iblk)/dt, a3Df)
if (f_dafsd_wave(1:1)/= 'x') &
call accum_hist_field(n_dafsd_wave-n3Dacum, iblk, nfsd_hist, &
d_afsd_wave(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_wave(:,:,1:nfsd_hist,iblk)/dt, a3Df)
if (f_dafsd_weld(1:1)/= 'x') &
call accum_hist_field(n_dafsd_weld-n3Dacum, iblk, nfsd_hist, &
d_afsd_weld(:,:,1:nfsd_hist,iblk), a3Df)
d_afsd_weld(:,:,1:nfsd_hist,iblk)/dt, a3Df)
endif ! a3Df allocated

! 4D floe size, thickness category fields
Expand All @@ -476,7 +479,7 @@ subroutine accum_hist_fsd (iblk)
do j = 1, ny_block
do i = 1, nx_block
workd(i,j,k,n) = trcrn(i,j,nt_fsd+k-1,n,iblk) &
* aicen_init(i,j,n,iblk)/floe_binwidth(k)
* aicen(i,j,n,iblk)/floe_binwidth(k)
end do
end do
end do
Expand Down
Loading