Skip to content

Commit

Permalink
Merge branch 'concepts/main' into concepts/more-namelist-icepack-params
Browse files Browse the repository at this point in the history
When trying to merge concepts/more-namelist-icepack-params to
concepts/main as of the previous commit, we get conflicts in
icepack_parameters because of the addition of 'umin' as a parameter in
0835686 (icepack_parameters: make 'umin' a parameter, 2022-12-19).

Let's do a back merge so that the merge request can be cleanly merged on
GitLab.
  • Loading branch information
phil-blain committed Feb 12, 2024
2 parents 5152159 + b232242 commit 8d9283f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 22 deletions.
16 changes: 9 additions & 7 deletions columnphysics/icepack_atmo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ subroutine atmo_boundary_layer (sfctype, &
uvel, vvel, &
Uref, zlvs )

use icepack_parameters, only: highfreq, natmiter, atmiter_conv, zTrf
use icepack_parameters, only: highfreq, natmiter, atmiter_conv, zTrf, &
umin

character (len=3), intent(in) :: &
sfctype ! ice or ocean
Expand Down Expand Up @@ -116,7 +117,7 @@ subroutine atmo_boundary_layer (sfctype, &
Uref ! reference height wind speed (m/s)

real (kind=dbl_kind), intent(in), optional :: &
zlvs ! atm level height (scalar quantities) (m)
zlvs ! atm level height (scalar quantities) (m)

! local variables

Expand All @@ -134,8 +135,7 @@ subroutine atmo_boundary_layer (sfctype, &
qqq , & ! for qsat, dqsfcdt
TTT , & ! for qsat, dqsfcdt
qsat , & ! the saturation humidity of air (kg/m^3)
Lheat , & ! Lvap or Lsub, depending on surface type
umin ! minimum wind speed (m/s)
Lheat ! Lvap or Lsub, depending on surface type

real (kind=dbl_kind) :: &
ustar , & ! ustar (m/s)
Expand Down Expand Up @@ -172,8 +172,6 @@ subroutine atmo_boundary_layer (sfctype, &

if (highfreq) then
umin = p5 ! minumum allowable wind-ice speed difference of 0.5 m/s
else
umin = c1 ! minumum allowable wind speed of 1m/s
endif

Tref = c0
Expand Down Expand Up @@ -358,7 +356,11 @@ subroutine atmo_boundary_layer (sfctype, &
! Compute diagnostics: T, Q (at zTrf), U (at zref)
!------------------------------------------------------------

hols = hols*zTrf/zlvl
if (present(zlvs)) then
hols = hols*zTrf/zlvs
else
hols = hols*zTrf/zlvl
endif
psix2 = -c5*hols*stable + (c1-stable)*psi_scalar_unstable(hols)
fac = (rh/vonkar) &
* (alzs + al2 - psixh + psix2)
Expand Down
17 changes: 16 additions & 1 deletion columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@ subroutine icepack_init_itd(ncat, hin_max)
real (kind=dbl_kind), dimension(5) :: wmo5 ! data for wmo itd
real (kind=dbl_kind), dimension(6) :: wmo6 ! data for wmo itd
real (kind=dbl_kind), dimension(7) :: wmo7 ! data for wmo itd
real (kind=dbl_kind), dimension(10) :: wmo10 ! data for wmo itd

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

Expand All @@ -1620,6 +1621,12 @@ subroutine icepack_init_itd(ncat, hin_max)
0.30_dbl_kind, 0.70_dbl_kind, &
1.20_dbl_kind, 2.00_dbl_kind, &
999._dbl_kind /
! 10 thickness categories
data wmo10 / 0.10_dbl_kind, 0.15_dbl_kind, &
0.30_dbl_kind, 0.50_dbl_kind, &
0.70_dbl_kind, 1.20_dbl_kind, &
2.00_dbl_kind, 4.00_dbl_kind, &
6.00_dbl_kind, 999._dbl_kind /

rncat = real(ncat, kind=dbl_kind)
d1 = 3.0_dbl_kind / rncat
Expand Down Expand Up @@ -1652,9 +1659,12 @@ subroutine icepack_init_itd(ncat, hin_max)
! Organization classification based on thickness. The full
! WMO thickness distribution is used if ncat = 7; if ncat=5
! or ncat = 6, some of the thinner categories are combined.
! If ncat = 10, the 4th WMO category is split in two, and additional
! categories are used for thicker ice.
! For ncat = 5, boundaries are 30, 70, 120, 200, >200 cm.
! For ncat = 6, boundaries are 15, 30, 70, 120, 200, >200 cm.
! For ncat = 7, boundaries are 10, 15, 30, 70, 120, 200, >200 cm.
! For ncat = 10, boundaries are 10, 15, 30, 50, 70, 120, 200, 400, 600, >600 cm.
!
! The fourth formula asymptotes to a particular category width as
! the number of categories increases, given by the parameter b1.
Expand Down Expand Up @@ -1725,8 +1735,13 @@ subroutine icepack_init_itd(ncat, hin_max)
do n = 1, ncat
hin_max(n) = wmo7(n)
enddo
elseif (ncat == 10) then
hin_max(0) = c0
do n = 1, ncat
hin_max(n) = wmo10(n)
enddo
else
call icepack_warnings_add(subname//' kcatbound=2 (WMO) must have ncat=5, 6 or 7')
call icepack_warnings_add(subname//' kcatbound=2 (WMO) must have ncat=5, 6, 7 or 10')
call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
return
endif
Expand Down
10 changes: 8 additions & 2 deletions columnphysics/icepack_parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ module icepack_parameters
zvir = 0.606_dbl_kind ,&! rh2o/rair - 1.0
zref = 10._dbl_kind ,&! reference height for stability (m)
zTrf = c2 ,&! reference height for {T,Q}ref (m)
umin = c1 ,&! min wind speed for turbulent fluxes (m/s)
iceruf = 0.0005_dbl_kind ,&! ice surface roughness (m)
qqqice = 11637800._dbl_kind ,&! for qsat over ice
TTTice = 5897.8_dbl_kind ,&! for qsat over ice
Expand Down Expand Up @@ -444,7 +445,7 @@ subroutine icepack_init_parameters( &
stefan_boltzmann_in, ice_ref_salinity_in, &
Tffresh_in, Lsub_in, Lvap_in, Timelt_in, Tsmelt_in, &
iceruf_in, Cf_in, Pstar_in, Cstar_in, kappav_in, &
kice_in, ksno_in, zTrf_in, &
kice_in, ksno_in, zTrf_in, umin_in, &
zref_in, hs_min_in, snowpatch_in, rhosi_in, sk_l_in, &
saltmax_in, phi_init_in, min_salin_in, salt_loss_in, &
min_bgc_in, dSin0_frazil_in, hi_ssl_in, hs_ssl_in, &
Expand Down Expand Up @@ -663,6 +664,7 @@ subroutine icepack_init_parameters( &
zvir_in, & ! rh2o/rair - 1.0
zref_in, & ! reference height for stability (m)
zTrf_in, & ! reference height for {T,Q}ref (m)
umin_in, & ! min wind speed for turbulent fluxes (m/s)
qqqice_in, & ! for qsat over ice
TTTice_in, & ! for qsat over ice
qqqocn_in, & ! for qsat over ocn
Expand Down Expand Up @@ -874,6 +876,7 @@ subroutine icepack_init_parameters( &
if (present(ksno_in) ) ksno = ksno_in
if (present(zref_in) ) zref = zref_in
if (present(zTrf_in) ) zTrf = zTrf_in
if (present(umin_in) ) umin = umin_in
if (present(hs_min_in) ) hs_min = hs_min_in
if (present(snowpatch_in) ) snowpatch = snowpatch_in
if (present(rhosi_in) ) rhosi = rhosi_in
Expand Down Expand Up @@ -1155,7 +1158,7 @@ subroutine icepack_query_parameters( &
stefan_boltzmann_out, ice_ref_salinity_out, &
Tffresh_out, Lsub_out, Lvap_out, Timelt_out, Tsmelt_out, &
iceruf_out, Cf_out, Pstar_out, Cstar_out, kappav_out, &
kice_out, ksno_out, zTrf_out, &
kice_out, ksno_out, zTrf_out, umin_out, &
zref_out, hs_min_out, snowpatch_out, rhosi_out, sk_l_out, &
saltmax_out, phi_init_out, min_salin_out, salt_loss_out, &
min_bgc_out, dSin0_frazil_out, hi_ssl_out, hs_ssl_out, &
Expand Down Expand Up @@ -1384,6 +1387,7 @@ subroutine icepack_query_parameters( &
zvir_out, & ! rh2o/rair - 1.0
zref_out, & ! reference height for stability (m)
zTrf_out, & ! reference height for {T,Q}ref (m)
umin_out, & ! min wind speed for turbulent fluxes (m/s)
qqqice_out, & ! for qsat over ice
TTTice_out, & ! for qsat over ice
qqqocn_out, & ! for qsat over ocn
Expand Down Expand Up @@ -1631,6 +1635,7 @@ subroutine icepack_query_parameters( &
if (present(ksno_out) ) ksno_out = ksno
if (present(zref_out) ) zref_out = zref
if (present(zTrf_out) ) zTrf_out = zTrf
if (present(umin_out) ) umin_out = umin
if (present(hs_min_out) ) hs_min_out = hs_min
if (present(snowpatch_out) ) snowpatch_out = snowpatch
if (present(rhosi_out) ) rhosi_out = rhosi
Expand Down Expand Up @@ -1826,6 +1831,7 @@ subroutine icepack_write_parameters(iounit)
write(iounit,*) " ksno = ",ksno
write(iounit,*) " zref = ",zref
write(iounit,*) " zTrf = ",zTrf
write(iounit,*) " umin = ",umin
write(iounit,*) " hs_min = ",hs_min
write(iounit,*) " snowpatch = ",snowpatch
write(iounit,*) " rhosi = ",rhosi
Expand Down
16 changes: 8 additions & 8 deletions columnphysics/icepack_therm_vertical.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
! Compute lateral and bottom heat fluxes.
!-----------------------------------------------------------------

call frzmlt_bottom_lateral (dt, ncat, &
if (ktherm >= 0) call frzmlt_bottom_lateral (dt, ncat, &
nilyr, nslyr, &
aice, frzmlt, &
vicen, vsnon, &
Expand Down Expand Up @@ -2650,7 +2650,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
! Vertical thermodynamics: Heat conduction, growth and melting.
!-----------------------------------------------------------------

if (.not.(calc_Tsfc)) then
if (.not.(calc_Tsfc) .and. ktherm >= 0) then

! If not calculating surface temperature and fluxes, set
! surface fluxes (flatn, fsurfn, and fcondtopn) to be used
Expand All @@ -2673,7 +2673,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
smliq(:) = smliqn(:,n)
endif

call thermo_vertical(nilyr=nilyr, nslyr=nslyr, &
if (ktherm >= 0) call thermo_vertical(nilyr=nilyr, nslyr=nslyr, &
dt=dt, aicen=aicen (n), &
vicen=vicen (n), vsnon=vsnon (n), &
Tsf=Tsfc (n), zSin=zSin (:,n), &
Expand Down Expand Up @@ -2726,7 +2726,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
! Aerosol update
!-----------------------------------------------------------------

if (tr_aero) then
if (tr_aero .and. ktherm >= 0) then
call update_aerosol (dt, &
nilyr, nslyr, n_aero, &
melttn (n), meltsn (n), &
Expand All @@ -2741,7 +2741,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
if (icepack_warnings_aborted(subname)) return
endif

if (tr_iso) then
if (tr_iso .and. ktherm >= 0) then
call update_isotope (dt = dt, &
nilyr = nilyr, nslyr = nslyr, &
meltt = melttn(n),melts = meltsn(n), &
Expand All @@ -2767,7 +2767,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &

endif ! aicen_init

if (snwgrain) then
if (snwgrain .and. ktherm >= 0) then
call drain_snow (nslyr = nslyr, &
vsnon = vsnon(n), &
aicen = aicen(n), &
Expand All @@ -2784,7 +2784,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
!-----------------------------------------------------------------

!call ice_timer_start(timer_ponds)
if (tr_pond) then
if (tr_pond .and. ktherm >= 0) then

if (tr_pond_lvl) then
rfrac = rfracmin + (rfracmax-rfracmin) * aicen(n)
Expand Down Expand Up @@ -2943,7 +2943,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
! Calculate ponds from the topographic scheme
!-----------------------------------------------------------------
!call ice_timer_start(timer_ponds)
if (tr_pond_topo) then
if (tr_pond_topo .and. ktherm >=0) then
call compute_ponds_topo(dt, ncat, nilyr, &
ktherm, &
aice, aicen, &
Expand Down
12 changes: 8 additions & 4 deletions configuration/driver/icedrv_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ subroutine ice_step
use icedrv_flux, only: init_history_therm, init_history_bgc, &
daidtt, daidtd, dvidtt, dvidtd, dagedtt, dagedtd, init_history_dyn
use icedrv_history, only: history_format, history_write
use icepack_parameters, only: ktherm
use icedrv_restart, only: dumpfile, final_restart
use icedrv_restart_bgc, only: write_restart_bgc
use icedrv_step, only: prep_radiation, step_therm1, step_therm2, &
Expand Down Expand Up @@ -147,7 +148,7 @@ subroutine ice_step
! Scale radiation fields
!-----------------------------------------------------------------

if (calc_Tsfc) call prep_radiation ()
if (calc_Tsfc .and. ktherm >= 0) call prep_radiation ()

! call icedrv_diagnostics_debug ('post prep_radiation')

Expand All @@ -156,8 +157,10 @@ subroutine ice_step
!-----------------------------------------------------------------

call step_therm1 (dt) ! vertical thermodynamics
call biogeochemistry (dt) ! biogeochemistry
call step_therm2 (dt) ! ice thickness distribution thermo
if (ktherm >= 0) then
call biogeochemistry (dt) ! biogeochemistry
call step_therm2 (dt) ! ice thickness distribution thermo
endif

! clean up, update tendency diagnostics
offset = dt
Expand Down Expand Up @@ -206,7 +209,8 @@ subroutine ice_step
! albedo, shortwave radiation
!-----------------------------------------------------------------

call step_radiation (dt)
if (ktherm >= 0) &
call step_radiation (dt)

!-----------------------------------------------------------------
! get ready for coupling and the next time step
Expand Down

0 comments on commit 8d9283f

Please sign in to comment.