From 73e43383f60b38ed2a09d311cb15c2326a7197a6 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Thu, 14 Mar 2024 09:51:34 -0600 Subject: [PATCH] This PR has been updated to include dvsdtt (thermodynamic tendency for snow). Also, the calls to update_state have been updated in all of the drivers. Note that I can only test the NUOPC/CMEPS and standalone drivers, so it would be good if others could test. --- cicecore/cicedyn/general/ice_flux.F90 | 5 ++- .../drivers/direct/hadgem3/CICE_RunMod.F90 | 8 ++-- .../direct/nemo_concepts/CICE_RunMod.F90 | 8 ++-- cicecore/drivers/mct/cesm1/CICE_RunMod.F90 | 10 +++-- cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90 | 10 +++-- cicecore/drivers/nuopc/dmi/CICE_RunMod.F90 | 10 +++-- .../drivers/standalone/cice/CICE_RunMod.F90 | 8 ++-- .../drivers/unittest/opticep/CICE_RunMod.F90 | 10 +++-- .../drivers/unittest/opticep/ice_step_mod.F90 | 42 ++++++++++--------- 9 files changed, 64 insertions(+), 47 deletions(-) diff --git a/cicecore/cicedyn/general/ice_flux.F90 b/cicecore/cicedyn/general/ice_flux.F90 index 51cc6e2b3..4d19bb8b2 100644 --- a/cicecore/cicedyn/general/ice_flux.F90 +++ b/cicecore/cicedyn/general/ice_flux.F90 @@ -320,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) @@ -532,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) @@ -920,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, & @@ -967,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 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 16e4fa8fb..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, dvsdtd, 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=dt, daidt=daidtt, dvidt=dvidtt, dagedt=dagedtt, offset=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=dt_dyn, daidt=daidtd, dvidt=dvidtd, dvsdt=dvsdtd, dagedt=dagedtd, offset=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 f4de62132..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, dvsdtd, 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,8 +265,8 @@ subroutine ice_step ! clean up, update tendency diagnostics offset = dt - call update_state (dt=dt, daidt=daidtt, dvidt=dvidtt, dagedt=dagedtt, & - offset=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 @@ -332,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_RunMod.F90 b/cicecore/drivers/unittest/opticep/CICE_RunMod.F90 index 42514e06c..cde982e4a 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, daidtd=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