diff --git a/cicecore/cicedyn/analysis/ice_history.F90 b/cicecore/cicedyn/analysis/ice_history.F90 index 45a4bede0..32f744477 100644 --- a/cicecore/cicedyn/analysis/ice_history.F90 +++ b/cicecore/cicedyn/analysis/ice_history.F90 @@ -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' @@ -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 @@ -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) @@ -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) @@ -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, & @@ -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, & @@ -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 @@ -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 @@ -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 diff --git a/cicecore/cicedyn/analysis/ice_history_shared.F90 b/cicecore/cicedyn/analysis/ice_history_shared.F90 index 678888b09..62ee3c2ba 100644 --- a/cicecore/cicedyn/analysis/ice_history_shared.F90 +++ b/cicecore/cicedyn/analysis/ice_history_shared.F90 @@ -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', & @@ -485,6 +486,7 @@ module ice_history_shared f_sidmasslat, & f_sndmasssnf, & f_sndmassmelt, & + f_sndmassdyn, & f_siflswdtop, & f_siflswutop, & f_siflswdbot, & @@ -684,6 +686,7 @@ module ice_history_shared n_sidmasslat, & n_sndmasssnf, & n_sndmassmelt, & + n_sndmassdyn, & n_siflswdtop, & n_siflswutop, & n_siflswdbot, & diff --git a/cicecore/cicedyn/general/ice_flux.F90 b/cicecore/cicedyn/general/ice_flux.F90 index 2d61bf642..4d19bb8b2 100644 --- a/cicecore/cicedyn/general/ice_flux.F90 +++ b/cicecore/cicedyn/general/ice_flux.F90 @@ -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) @@ -319,6 +320,7 @@ module ice_flux dsnow, & ! change in snow thickness (m/step-->cm/day) daidtt, & ! ice area tendency thermo. (s^-1) dvidtt, & ! ice volume tendency thermo. (m/s) + dvsdtt, & ! snow volume tendency thermo. (m/s) dagedtt,& ! ice age tendency thermo. (s/s) mlt_onset, &! day of year that sfc melting begins frz_onset, &! day of year that freezing begins (congel or frazil) @@ -419,6 +421,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) 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) @@ -530,6 +533,7 @@ subroutine alloc_flux dsnow (nx_block,ny_block,max_blocks), & ! change in snow thickness (m/step-->cm/day) daidtt (nx_block,ny_block,max_blocks), & ! ice area tendency thermo. (s^-1) dvidtt (nx_block,ny_block,max_blocks), & ! ice volume tendency thermo. (m/s) + dvsdtt (nx_block,ny_block,max_blocks), & ! snow volume tendency thermo. (m/s) dagedtt (nx_block,ny_block,max_blocks), & ! ice age tendency thermo. (s/s) mlt_onset (nx_block,ny_block,max_blocks), & ! day of year that sfc melting begins frz_onset (nx_block,ny_block,max_blocks), & ! day of year that freezing begins (congel or frazil) @@ -918,7 +922,7 @@ end subroutine init_flux_ocn subroutine init_history_therm - use ice_state, only: aice, vice, trcr + use ice_state, only: aice, vice, vsno, trcr use ice_arrays_column, only: & hfreebd, hdraft, hridge, distrdg, hkeel, dkeel, lfloe, dfloe, & Cdn_atm_skin, Cdn_atm_floe, Cdn_atm_pond, Cdn_atm_rdg, & @@ -965,6 +969,7 @@ subroutine init_history_therm meltl (:,:,:) = c0 daidtt (:,:,:) = aice(:,:,:) ! temporary initial area dvidtt (:,:,:) = vice(:,:,:) ! temporary initial volume + dvsdtt (:,:,:) = vsno(:,:,:) ! temporary initial volume if (tr_iage) then dagedtt(:,:,:) = trcr(:,:,nt_iage,:) ! temporary initial age else @@ -1022,7 +1027,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) :: & @@ -1061,6 +1066,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 diff --git a/cicecore/cicedyn/general/ice_step_mod.F90 b/cicecore/cicedyn/general/ice_step_mod.F90 index b738e670b..2726a6101 100644 --- a/cicecore/cicedyn/general/ice_step_mod.F90 +++ b/cicecore/cicedyn/general/ice_step_mod.F90 @@ -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 @@ -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 :: & @@ -827,25 +828,26 @@ subroutine update_state (dt, daidt, dvidt, dagedt, offset) nt_strata = nt_strata(:,:), & Tf = Tf(i,j,iblk)) - if (present(offset)) then - - !----------------------------------------------------------------- - ! 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 (tr_iage) then - if (offset > c0) then ! thermo - if (trcr(i,j,nt_iage,iblk) > c0) & - dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & - - dagedt(i,j,iblk) - offset) / dt - else ! dynamics - dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & - - dagedt(i,j,iblk)) / dt - endif - endif ! tr_iage - endif ! present(offset) + if (present(offset)) then + + !----------------------------------------------------------------- + ! Compute thermodynamic area and volume tendencies. + !----------------------------------------------------------------- + + 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 (present(dagedt) .and. tr_iage) then + if (offset > c0) then ! thermo + if (trcr(i,j,nt_iage,iblk) > c0) & + dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & + - dagedt(i,j,iblk) - offset) / dt + else ! dynamics + dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & + - dagedt(i,j,iblk)) / dt + endif + endif ! tr_iage + endif ! present(offset) enddo ! i enddo ! j diff --git a/cicecore/drivers/direct/hadgem3/CICE_RunMod.F90 b/cicecore/drivers/direct/hadgem3/CICE_RunMod.F90 index b67e1a223..43a1a003f 100644 --- a/cicecore/drivers/direct/hadgem3/CICE_RunMod.F90 +++ b/cicecore/drivers/direct/hadgem3/CICE_RunMod.F90 @@ -140,7 +140,7 @@ subroutine ice_step use ice_dyn_eap, only: write_restart_eap use ice_dyn_shared, only: kdyn use ice_flux, only: scale_factor, init_history_therm, & - daidtt, daidtd, dvidtt, dvidtd, dagedtt, dagedtd + daidtt, daidtd, dvidtt, dvidtd, dvsdtt, dvsdtd, dagedtt, dagedtd use ice_history, only: accum_hist use ice_history_bgc, only: init_history_bgc use ice_restart, only: final_restart @@ -238,7 +238,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, dvsdt=dvsdtt, & + dagedt=dagedtt, offset=offset) call ice_timer_stop(timer_thermo) ! thermodynamics call ice_timer_stop(timer_column) ! column physics @@ -265,7 +266,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 diff --git a/cicecore/drivers/direct/nemo_concepts/CICE_RunMod.F90 b/cicecore/drivers/direct/nemo_concepts/CICE_RunMod.F90 index c9875d769..78c703c91 100644 --- a/cicecore/drivers/direct/nemo_concepts/CICE_RunMod.F90 +++ b/cicecore/drivers/direct/nemo_concepts/CICE_RunMod.F90 @@ -140,7 +140,7 @@ subroutine ice_step use ice_dyn_eap, only: write_restart_eap use ice_dyn_shared, only: kdyn use ice_flux, only: scale_factor, init_history_therm, & - daidtt, daidtd, dvidtt, dvidtd, dagedtt, dagedtd + daidtt, daidtd, dvidtt, dvidtd, dvsdtt, dvsdtd, dagedtt, dagedtd use ice_history, only: accum_hist use ice_history_bgc, only: init_history_bgc use ice_restart, only: final_restart @@ -238,7 +238,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, dvsdt=dvsdtt, & + dagedt=dagedtt, offset=offset) call ice_timer_stop(timer_thermo) ! thermodynamics call ice_timer_stop(timer_column) ! column physics @@ -265,7 +266,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 diff --git a/cicecore/drivers/mct/cesm1/CICE_RunMod.F90 b/cicecore/drivers/mct/cesm1/CICE_RunMod.F90 index 5836479b4..6ff6b1270 100644 --- a/cicecore/drivers/mct/cesm1/CICE_RunMod.F90 +++ b/cicecore/drivers/mct/cesm1/CICE_RunMod.F90 @@ -132,7 +132,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, dvsdtt, dvsdtd, dagedtt, dagedtd use ice_history, only: accum_hist use ice_history_bgc, only: init_history_bgc use ice_restart, only: final_restart @@ -261,7 +261,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, dvsdt=dvsdtt, & + dagedt=dagedtt, offset=offset) call ice_timer_stop(timer_thermo) ! thermodynamics call ice_timer_stop(timer_column) ! column physics @@ -302,7 +303,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 @@ -326,7 +328,7 @@ subroutine ice_step call step_snow (dt, iblk) enddo !$OMP END PARALLEL DO - call update_state (dt) ! clean up + call update_state (dt=dt) ! clean up endif !$OMP PARALLEL DO PRIVATE(iblk) SCHEDULE(runtime) diff --git a/cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90 b/cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90 index 483048051..c2cae81cb 100644 --- a/cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90 +++ b/cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90 @@ -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, dvsdtt, dvsdtd, dagedtt, dagedtd use ice_history, only: accum_hist use ice_history_bgc, only: init_history_bgc use ice_restart, only: final_restart @@ -250,7 +250,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, dvsdt=dvsdtt, & + dagedt=dagedtt, offset=offset) call ice_timer_stop(timer_thermo) ! thermodynamics call ice_timer_stop(timer_column) ! column physics @@ -291,7 +292,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 if (debug_model) then @@ -318,7 +320,7 @@ subroutine ice_step do iblk = 1, nblocks call step_snow (dt, iblk) enddo - call update_state (dt) ! clean up + call update_state (dt=dt) ! clean up endif !MHRI: CHECK THIS OMP diff --git a/cicecore/drivers/nuopc/dmi/CICE_RunMod.F90 b/cicecore/drivers/nuopc/dmi/CICE_RunMod.F90 index 897f62eea..5f8fb52bc 100644 --- a/cicecore/drivers/nuopc/dmi/CICE_RunMod.F90 +++ b/cicecore/drivers/nuopc/dmi/CICE_RunMod.F90 @@ -154,7 +154,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, dvsdtt, dvsdtd, dagedtt, dagedtd use ice_history, only: accum_hist use ice_history_bgc, only: init_history_bgc use ice_restart, only: final_restart @@ -273,7 +273,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, dvsdt=dvsdtt, & + dagedt=dagedtt, offset=offset) call ice_timer_stop(timer_thermo) ! thermodynamics call ice_timer_stop(timer_column) ! column physics @@ -314,7 +315,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 @@ -338,7 +340,7 @@ subroutine ice_step call step_snow (dt, iblk) enddo !$OMP END PARALLEL DO - call update_state (dt) ! clean up + call update_state (dt=dt) ! clean up endif !MHRI: CHECK THIS OMP diff --git a/cicecore/drivers/standalone/cice/CICE_RunMod.F90 b/cicecore/drivers/standalone/cice/CICE_RunMod.F90 index 42514e06c..59213f728 100644 --- a/cicecore/drivers/standalone/cice/CICE_RunMod.F90 +++ b/cicecore/drivers/standalone/cice/CICE_RunMod.F90 @@ -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, dvsdtt, dvsdtd, dagedtt, dagedtd use ice_history, only: accum_hist use ice_history_bgc, only: init_history_bgc use ice_restart, only: final_restart @@ -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, dvsdt=dvsdtt, & + dagedt=dagedtt, offset=offset) call ice_timer_stop(timer_thermo) ! thermodynamics call ice_timer_stop(timer_column) ! column physics @@ -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 @@ -330,7 +332,7 @@ subroutine ice_step call step_snow (dt, iblk) enddo !$OMP END PARALLEL DO - call update_state (dt) ! clean up + call update_state (dt=dt) ! clean up endif !$OMP PARALLEL DO PRIVATE(iblk) SCHEDULE(runtime) diff --git a/cicecore/drivers/unittest/opticep/CICE_InitMod.F90 b/cicecore/drivers/unittest/opticep/CICE_InitMod.F90 index cb1241a5e..194293118 100644 --- a/cicecore/drivers/unittest/opticep/CICE_InitMod.F90 +++ b/cicecore/drivers/unittest/opticep/CICE_InitMod.F90 @@ -66,7 +66,7 @@ subroutine cice_init floe_binwidth, c_fsd_range use ice_state, only: alloc_state use ice_flux_bgc, only: alloc_flux_bgc - use ice_calendar, only: dt, dt_dyn, write_ic, & + use ice_calendar, only: dt, write_ic, & init_calendar, advance_timestep, calc_timesteps use ice_communicate, only: init_communicate, my_task, master_task use ice_diagnostics, only: init_diags @@ -244,6 +244,7 @@ subroutine cice_init call init_flux_ocn ! initialize ocean fluxes sent to coupler call dealloc_grid ! deallocate temporary grid arrays + if (my_task == master_task) then call ice_memusage_print(nu_diag,subname//':end') endif diff --git a/cicecore/drivers/unittest/opticep/CICE_RunMod.F90 b/cicecore/drivers/unittest/opticep/CICE_RunMod.F90 index 42514e06c..59213f728 100644 --- a/cicecore/drivers/unittest/opticep/CICE_RunMod.F90 +++ b/cicecore/drivers/unittest/opticep/CICE_RunMod.F90 @@ -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, dvsdtt, dvsdtd, dagedtt, dagedtd use ice_history, only: accum_hist use ice_history_bgc, only: init_history_bgc use ice_restart, only: final_restart @@ -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, dvsdt=dvsdtt, & + dagedt=dagedtt, offset=offset) call ice_timer_stop(timer_thermo) ! thermodynamics call ice_timer_stop(timer_column) ! column physics @@ -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 @@ -330,7 +332,7 @@ subroutine ice_step call step_snow (dt, iblk) enddo !$OMP END PARALLEL DO - call update_state (dt) ! clean up + call update_state (dt=dt) ! clean up endif !$OMP PARALLEL DO PRIVATE(iblk) SCHEDULE(runtime) diff --git a/cicecore/drivers/unittest/opticep/ice_step_mod.F90 b/cicecore/drivers/unittest/opticep/ice_step_mod.F90 index 370fde6be..64320e601 100644 --- a/cicecore/drivers/unittest/opticep/ice_step_mod.F90 +++ b/cicecore/drivers/unittest/opticep/ice_step_mod.F90 @@ -752,7 +752,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 @@ -768,6 +768,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 :: & @@ -829,25 +830,26 @@ subroutine update_state (dt, daidt, dvidt, dagedt, offset) nt_strata = nt_strata(:,:), & Tf = Tf(i,j,iblk)) - if (present(offset)) then - - !----------------------------------------------------------------- - ! 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 (tr_iage) then - if (offset > c0) then ! thermo - if (trcr(i,j,nt_iage,iblk) > c0) & - dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & - - dagedt(i,j,iblk) - offset) / dt - else ! dynamics - dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & - - dagedt(i,j,iblk)) / dt - endif - endif ! tr_iage - endif ! present(offset) + if (present(offset)) then + + !----------------------------------------------------------------- + ! Compute thermodynamic area and volume tendencies. + !----------------------------------------------------------------- + + 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 .and. present(dagedt)) then + if (offset > c0) then ! thermo + if (trcr(i,j,nt_iage,iblk) > c0) & + dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & + - dagedt(i,j,iblk) - offset) / dt + else ! dynamics + dagedt(i,j,iblk) = (trcr(i,j,nt_iage,iblk) & + - dagedt(i,j,iblk)) / dt + endif + endif ! tr_iage + endif ! present(offset) enddo ! i enddo ! j