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 a new diagnostic variable dvsdtd. #940

Merged
merged 9 commits into from
Mar 20, 2024
32 changes: 28 additions & 4 deletions cicecore/cicedyn/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ subroutine init_hist (dt)
f_sidmasslat = 'mxxxx'
f_sndmasssnf = 'mxxxx'
f_sndmassmelt = 'mxxxx'
f_sndmassdyn = 'mxxxx'
f_siflswdtop = 'mxxxx'
f_siflswutop = 'mxxxx'
f_siflswdbot = 'mxxxx'
Expand Down Expand Up @@ -402,6 +403,11 @@ subroutine init_hist (dt)
f_siu = f_CMIP
f_siv = f_CMIP
f_sispeed = f_CMIP
f_sndmasssubl = f_CMIP
f_sndmasssnf = f_CMIP
f_sndmassmelt = f_CMIP
f_sndmassdyn = f_CMIP
f_sidmasssi = f_CMIP
endif

if (grid_ice == 'CD' .or. grid_ice == 'C') then
Expand Down Expand Up @@ -654,6 +660,7 @@ subroutine init_hist (dt)
call broadcast_scalar (f_sidmasslat, master_task)
call broadcast_scalar (f_sndmasssnf, master_task)
call broadcast_scalar (f_sndmassmelt, master_task)
call broadcast_scalar (f_sndmassdyn, master_task)
call broadcast_scalar (f_siflswdtop, master_task)
call broadcast_scalar (f_siflswutop, master_task)
call broadcast_scalar (f_siflswdbot, master_task)
Expand Down Expand Up @@ -1648,7 +1655,7 @@ subroutine init_hist (dt)
"none", c1, c0, &
ns1, f_sidmassevapsubl)

call define_hist_field(n_sndmasssubl,"sndmassubl","kg m-2 s-1",tstr2D, tcstr, &
call define_hist_field(n_sndmasssubl,"sndmasssubl","kg m-2 s-1",tstr2D, tcstr, &
"snow mass change from evaporation and sublimation", &
"none", c1, c0, &
ns1, f_sndmasssubl)
Expand Down Expand Up @@ -1678,6 +1685,11 @@ subroutine init_hist (dt)
"none", c1, c0, &
ns1, f_sndmassmelt)

call define_hist_field(n_sndmassdyn,"sndmassdyn","kg m-2 s-1",tstr2D, tcstr, &
"snow mass change from dynamics ridging", &
"none", c1, c0, &
ns1, f_sndmassdyn)

call define_hist_field(n_siflswdtop,"siflswdtop","W/m2",tstr2D, tcstr, &
"down shortwave flux over sea ice", &
"positive downward", c1, c0, &
Expand Down Expand Up @@ -2160,7 +2172,7 @@ subroutine accum_hist (dt)
taubxN, taubyN, strocnxN, strocnyN, &
strairxE, strairyE, strtltxE, strtltyE, strintxE, strintyE, &
taubxE, taubyE, strocnxE, strocnyE, &
fmU, fmN, fmE, daidtt, dvidtt, daidtd, dvidtd, fsurf, &
fmU, fmN, fmE, daidtt, dvidtt, daidtd, dvidtd, dvsdtd, fsurf, &
fcondtop, fcondbot, fsurfn, fcondtopn, flatn, fsensn, albcnt, snwcnt, &
stressp_1, stressm_1, stress12_1, &
stresspT, stressmT, stress12T, &
Expand Down Expand Up @@ -3068,7 +3080,7 @@ subroutine accum_hist (dt)
do j = jlo, jhi
do i = ilo, ihi
if (aice(i,j,iblk) > puny) then
worka(i,j) = evaps(i,j,iblk)*rhos
worka(i,j) = evaps(i,j,iblk)
endif
enddo
enddo
Expand All @@ -3080,7 +3092,7 @@ subroutine accum_hist (dt)
do j = jlo, jhi
do i = ilo, ihi
if (aice(i,j,iblk) > puny) then
worka(i,j) = aice(i,j,iblk)*fsnow(i,j,iblk)*rhos
worka(i,j) = aice(i,j,iblk)*fsnow(i,j,iblk)
endif
enddo
enddo
Expand All @@ -3099,6 +3111,18 @@ subroutine accum_hist (dt)
call accum_hist_field(n_sndmassmelt, iblk, worka(:,:), a2D)
endif

if (f_sndmassdyn(1:1) /= 'x') then
worka(:,:) = c0
do j = jlo, jhi
do i = ilo, ihi
if (aice(i,j,iblk) > puny) then
worka(i,j) = dvsdtd(i,j,iblk)*rhos
endif
enddo
enddo
call accum_hist_field(n_sndmassdyn, iblk, worka(:,:), a2D)
endif

if (f_siflswdtop(1:1) /= 'x') then
worka(:,:) = c0
do j = jlo, jhi
Expand Down
3 changes: 3 additions & 0 deletions cicecore/cicedyn/analysis/ice_history_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ module ice_history_shared
f_sidmasslat = 'x', &
f_sndmasssnf = 'x', &
f_sndmassmelt = 'x', &
f_sndmassdyn = 'x', &
f_siflswdtop = 'x', &
f_siflswutop = 'x', &
f_siflswdbot = 'x', &
Expand Down Expand Up @@ -485,6 +486,7 @@ module ice_history_shared
f_sidmasslat, &
f_sndmasssnf, &
f_sndmassmelt, &
f_sndmassdyn, &
f_siflswdtop, &
f_siflswutop, &
f_siflswdbot, &
Expand Down Expand Up @@ -684,6 +686,7 @@ module ice_history_shared
n_sidmasslat, &
n_sndmasssnf, &
n_sndmassmelt, &
n_sndmassdyn, &
n_siflswdtop, &
n_siflswutop, &
n_siflswdbot, &
Expand Down
5 changes: 4 additions & 1 deletion cicecore/cicedyn/general/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ module ice_flux
strintyE, & ! divergence of internal ice stress, y at E points (N/m^2)
daidtd , & ! ice area tendency due to transport (1/s)
dvidtd , & ! ice volume tendency due to transport (m/s)
dvsdtd , & ! snow volume tendency due to transport (m/s)
dagedtd , & ! ice age tendency due to transport (s/s)
dardg1dt, & ! rate of area loss by ridging ice (1/s)
dardg2dt, & ! rate of area gain by new ridges (1/s)
Expand Down Expand Up @@ -419,6 +420,7 @@ subroutine alloc_flux
strintyU (nx_block,ny_block,max_blocks), & ! divergence of internal ice stress, y (N/m^2)
daidtd (nx_block,ny_block,max_blocks), & ! ice area tendency due to transport (1/s)
dvidtd (nx_block,ny_block,max_blocks), & ! ice volume tendency due to transport (m/s)
dvsdtd (nx_block,ny_block,max_blocks), & ! snow volume tendency due to transport (m/s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I first looked at the PR, I thought this was salt, not snow. Do we need to distinguish the names of those now, in case we want to add a salt tendency term?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it would not be hard to add a dvsdtt term. I was doing it specifically since there is the need for an SIMIP variable sndmassdyn. There is not a similar term for the thermodynamics. The snow melt and snow ice formation are called out in separate terms. I was using dvsdtd to be consistent with dvidtd.

dagedtd (nx_block,ny_block,max_blocks), & ! ice age tendency due to transport (s/s)
dardg1dt (nx_block,ny_block,max_blocks), & ! rate of area loss by ridging ice (1/s)
dardg2dt (nx_block,ny_block,max_blocks), & ! rate of area gain by new ridges (1/s)
Expand Down Expand Up @@ -1022,7 +1024,7 @@ end subroutine init_history_therm

subroutine init_history_dyn

use ice_state, only: aice, vice, trcr, strength, divu, shear, vort
use ice_state, only: aice, vice, vsno, trcr, strength, divu, shear, vort
use ice_grid, only: grid_ice

logical (kind=log_kind) :: &
Expand Down Expand Up @@ -1061,6 +1063,7 @@ subroutine init_history_dyn
opening (:,:,:) = c0
daidtd (:,:,:) = aice(:,:,:) ! temporary initial area
dvidtd (:,:,:) = vice(:,:,:) ! temporary initial volume
dvsdtd (:,:,:) = vsno(:,:,:) ! temporary initial volume
if (tr_iage) &
dagedtd (:,:,:) = trcr(:,:,nt_iage,:) ! temporary initial age
fmU (:,:,:) = c0
Expand Down
8 changes: 5 additions & 3 deletions cicecore/cicedyn/general/ice_step_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ end subroutine step_therm2
!
! authors: Elizabeth Hunke, LANL

subroutine update_state (dt, daidt, dvidt, dagedt, offset)
subroutine update_state (dt, daidt, dvidt, dvsdt, dagedt, offset)

use ice_domain_size, only: ncat
! use ice_grid, only: tmask
Expand All @@ -766,6 +766,7 @@ subroutine update_state (dt, daidt, dvidt, dagedt, offset)
real (kind=dbl_kind), dimension(:,:,:), intent(inout), optional :: &
daidt, & ! change in ice area per time step
dvidt, & ! change in ice volume per time step
dvsdt, & ! change in snow volume per time step
dagedt ! change in ice age per time step

real (kind=dbl_kind), intent(in), optional :: &
Expand Down Expand Up @@ -833,8 +834,9 @@ subroutine update_state (dt, daidt, dvidt, dagedt, offset)
! Compute thermodynamic area and volume tendencies.
!-----------------------------------------------------------------

daidt(i,j,iblk) = (aice(i,j,iblk) - daidt(i,j,iblk)) / dt
dvidt(i,j,iblk) = (vice(i,j,iblk) - dvidt(i,j,iblk)) / dt
if (present(daidt)) daidt(i,j,iblk) = (aice(i,j,iblk) - daidt(i,j,iblk)) / dt
if (present(dvidt)) dvidt(i,j,iblk) = (vice(i,j,iblk) - dvidt(i,j,iblk)) / dt
if (present(dvsdt)) dvsdt(i,j,iblk) = (vsno(i,j,iblk) - dvsdt(i,j,iblk)) / dt
if (tr_iage) then
if (offset > c0) then ! thermo
if (trcr(i,j,nt_iage,iblk) > c0) &
Expand Down
6 changes: 3 additions & 3 deletions cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ subroutine ice_step
use ice_dyn_eap, only: write_restart_eap
use ice_dyn_shared, only: kdyn, kridge
use ice_flux, only: scale_factor, init_history_therm, &
daidtt, daidtd, dvidtt, dvidtd, dagedtt, dagedtd
daidtt, daidtd, dvidtt, dvidtd, dvsdtd, dagedtt, dagedtd
use ice_history, only: accum_hist
use ice_history_bgc, only: init_history_bgc
use ice_restart, only: final_restart
Expand Down Expand Up @@ -250,7 +250,7 @@ subroutine ice_step

! clean up, update tendency diagnostics
offset = dt
call update_state (dt, daidtt, dvidtt, dagedtt, offset)
call update_state (dt=dt, daidt=daidtt, dvidt=dvidtt, dagedt=dagedtt, offset=offset)

call ice_timer_stop(timer_thermo) ! thermodynamics
call ice_timer_stop(timer_column) ! column physics
Expand Down Expand Up @@ -291,7 +291,7 @@ subroutine ice_step

! clean up, update tendency diagnostics
offset = c0
call update_state (dt_dyn, daidtd, dvidtd, dagedtd, offset)
call update_state (dt=dt_dyn, daidt=daidtd, dvidt=dvidtd, dvsdt=dvsdtd, dagedt=dagedtd, offset=offset)

enddo
if (debug_model) then
Expand Down
8 changes: 5 additions & 3 deletions cicecore/drivers/standalone/cice/CICE_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ subroutine ice_step
use ice_dyn_eap, only: write_restart_eap
use ice_dyn_shared, only: kdyn, kridge
use ice_flux, only: scale_factor, init_history_therm, &
daidtt, daidtd, dvidtt, dvidtd, dagedtt, dagedtd
daidtt, daidtd, dvidtt, dvidtd, dvsdtd, dagedtt, dagedtd
use ice_history, only: accum_hist
use ice_history_bgc, only: init_history_bgc
use ice_restart, only: final_restart
Expand Down Expand Up @@ -265,7 +265,8 @@ subroutine ice_step

! clean up, update tendency diagnostics
offset = dt
call update_state (dt, daidtt, dvidtt, dagedtt, offset)
call update_state (dt=dt, daidt=daidtt, dvidt=dvidtt, dagedt=dagedtt, &
offset=offset)

call ice_timer_stop(timer_thermo) ! thermodynamics
call ice_timer_stop(timer_column) ! column physics
Expand Down Expand Up @@ -306,7 +307,8 @@ subroutine ice_step

! clean up, update tendency diagnostics
offset = c0
call update_state (dt_dyn, daidtd, dvidtd, dagedtd, offset)
call update_state (dt=dt_dyn, daidt=daidtd, dvidt=dvidtd, dvsdt=dvsdtd, &
dagedt=dagedtd, offset=offset)

enddo

Expand Down
Loading