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

Updates to wave fracture, including a bug fix #299

Merged
merged 20 commits into from
Feb 20, 2020
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
36 changes: 26 additions & 10 deletions columnphysics/icepack_fsd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ module icepack_fsd
floe_area_binwidth ! floe area bin width (m^2)

integer(kind=int_kind), dimension(:,:), allocatable, public :: &
iweld ! floe size categories that can combine
! during welding (dimensionless)
iweld ! floe size categories that can combine
! during welding (dimensionless)

!=======================================================================

Expand Down Expand Up @@ -324,10 +324,14 @@ subroutine icepack_cleanup_fsd (ncat, nfsd, afsdn)
integer (kind=int_kind) :: &
n ! thickness category index

character(len=*), parameter :: subname='(icepack_cleanup_fsd)'


if (tr_fsd) then

do n = 1, ncat
call icepack_cleanup_fsdn(nfsd, afsdn(:,n))
if (icepack_warnings_aborted(subname)) return
enddo

endif ! tr_fsd
Expand Down Expand Up @@ -546,6 +550,7 @@ subroutine fsd_lateral_growth (ncat, nfsd, &
aicen, vicen, &
afsdn, lead_area, &
latsurf_area)
if (icepack_warnings_aborted(subname)) return

vi0new_lat = c0
if (latsurf_area > puny) then
Expand Down Expand Up @@ -719,6 +724,7 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, &
END DO

call icepack_cleanup_fsdn (nfsd, afsdn_latg(:,n))
if (icepack_warnings_aborted(subname)) return
trcrn(nt_fsd:nt_fsd+nfsd-1,n) = afsdn_latg(:,n)

end if ! lat growth
Expand All @@ -733,11 +739,13 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, &
if (SUM(afsdn_latg(:,n)) > puny) then ! fsd exists

if (wave_spec) then
if (wave_sig_ht > puny) &
if (wave_sig_ht > puny) then
call wave_dep_growth (nfsd, wave_spectrum, &
wavefreq, dwavefreq, &
new_size)

if (icepack_warnings_aborted(subname)) return
end if

! grow in new_size category
afsd_ni(new_size) = (afsdn_latg(new_size,n)*area2(n) + ai0new) &
/ (area2(n) + ai0new)
Expand All @@ -759,10 +767,13 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, &
else ! no fsd, so entirely new ice

if (wave_spec) then
if (wave_sig_ht > puny) &
if (wave_sig_ht > puny) then
call wave_dep_growth (nfsd, wave_spectrum, &
wavefreq, dwavefreq, &
new_size)
if (icepack_warnings_aborted(subname)) return
end if

afsd_ni(new_size) = c1
else
afsd_ni(1) = c1
Expand All @@ -772,7 +783,7 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, &

trcrn(nt_fsd:nt_fsd+nfsd-1,n) = afsd_ni(:)
call icepack_cleanup_fsdn (nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,n))

if (icepack_warnings_aborted(subname)) return
endif ! d_an_newi > puny
endif ! n = 1

Expand Down Expand Up @@ -808,9 +819,9 @@ subroutine wave_dep_growth (nfsd, local_wave_spec, &

real (kind=dbl_kind), dimension(:), intent(in) :: &
local_wave_spec ! ocean surface wave spectrum as a function of frequency
! power spectral density of surface elevation, E(f) (units m^2 s)
! dimension set in ice_forcing
! power spectral density of surface elevation, E(f) (units m^2 s)
! dimension set in ice_forcing

real(kind=dbl_kind), dimension(:), intent(in) :: &
wavefreq, & ! wave frequencies (s^-1)
dwavefreq ! wave frequency bin widths (s^-1)
Expand All @@ -821,7 +832,7 @@ subroutine wave_dep_growth (nfsd, local_wave_spec, &
! local variables
real (kind=dbl_kind), parameter :: &
tensile_param = 0.167_dbl_kind ! tensile mode parameter (kg m^-1 s^-2)
! value from Roach, Smith & Dean (2018)
! value from Roach, Smith & Dean (2018)

real (kind=dbl_kind) :: &
w_amp, & ! wave amplitude (m)
Expand Down Expand Up @@ -919,6 +930,9 @@ subroutine fsd_weld_thermo (ncat, nfsd, &
subdt , & ! subcycling time step for stability (s)
elapsed_t ! elapsed subcycling time

character(len=*), parameter :: subname='(fsd_weld_thermo)'


afsdn (:,:) = c0
afsd_init(:) = c0
stability = c0
Expand All @@ -930,6 +944,7 @@ subroutine fsd_weld_thermo (ncat, nfsd, &
d_afsdn_weld(:,n) = c0
afsdn(:,n) = trcrn(nt_fsd:nt_fsd+nfsd-1,n)
call icepack_cleanup_fsdn (nfsd, afsdn(:,n))
if (icepack_warnings_aborted(subname)) return

! If there is some ice in the lower (nfsd-1) categories
! and there is freezing potential
Expand Down Expand Up @@ -991,6 +1006,7 @@ subroutine fsd_weld_thermo (ncat, nfsd, &
END DO ! time

call icepack_cleanup_fsdn (nfsd, afsdn(:,n))
if (icepack_warnings_aborted(subname)) return

do k = 1, nfsd
afsdn(k,n) = afsd_tmp(k)
Expand Down
14 changes: 11 additions & 3 deletions columnphysics/icepack_therm_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,8 @@ subroutine lateral_melt (dt, ncat, &

if (tr_fsd) then
call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:))
if (icepack_warnings_aborted(subname)) return

afsdn = trcrn(nt_fsd:nt_fsd+nfsd-1,:)
aicen_init = aicen
afsdn_init = afsdn ! for diagnostics
Expand Down Expand Up @@ -1131,7 +1133,7 @@ subroutine lateral_melt (dt, ncat, &

afsdn(:,n) = afsd_tmp(:)


end if ! aicen
end if ! rside > 0, otherwise do nothing

Expand Down Expand Up @@ -1193,7 +1195,9 @@ subroutine lateral_melt (dt, ncat, &
endif ! flag

if (tr_fsd) then

call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:) )
if (icepack_warnings_aborted(subname)) return

! diagnostics
do k = 1, nfsd
Expand Down Expand Up @@ -1456,6 +1460,7 @@ subroutine add_new_ice (ncat, nilyr, &

if (tr_fsd) then
call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:))
if (icepack_warnings_aborted(subname)) return
endif

do n = 1, ncat
Expand All @@ -1468,7 +1473,6 @@ subroutine add_new_ice (ncat, nilyr, &
enddo
endif
enddo
! if (any(afsdn < c0)) print*,'add_new B afsdn < 0'

if (l_conservation_check) then

Expand Down Expand Up @@ -1578,6 +1582,8 @@ subroutine add_new_ice (ncat, nilyr, &
G_radial, d_an_latg, &
tot_latg)

if (icepack_warnings_aborted(subname)) return

ai0mod = aice0
! separate frazil ice growth from lateral ice growth
if (tr_fsd) ai0mod = aice0-tot_latg
Expand Down Expand Up @@ -1745,7 +1751,9 @@ subroutine add_new_ice (ncat, nilyr, &
d_afsd_newi, &
afsdn, aicen_init, &
aicen, trcrn)


if (icepack_warnings_aborted(subname)) return

if (vicen(n) > puny) then
if (tr_iage) &
trcrn(nt_iage,n) = (trcrn(nt_iage,n)*vice1 + dt*vin0new(n))/vicen(n)
Expand Down
Loading