Skip to content

Commit

Permalink
finalize 0-layer thermo and cesm ponds deprecation in CICE (#787)
Browse files Browse the repository at this point in the history
* finalize 0-layer thermo and cesm ponds deprecation

* set default hs0=0 and document

* formatting table in doc

* revert hs0=0.03

* update Icepack
  • Loading branch information
eclare108213 committed Nov 16, 2022
1 parent 251ca48 commit 5a32f12
Show file tree
Hide file tree
Showing 27 changed files with 10 additions and 724 deletions.
30 changes: 1 addition & 29 deletions cicecore/cicedynB/analysis/ice_history_pond.F90
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,8 @@ subroutine accum_hist_pond (iblk)

integer (kind=int_kind) :: &
nt_apnd, nt_hpnd, nt_alvl, nt_ipnd
#ifdef UNDEPRECATE_CESMPONDS
logical (kind=log_kind) :: &
tr_pond_cesm, tr_pond_lvl, tr_pond_topo
#else
logical (kind=log_kind) :: &
tr_pond_lvl, tr_pond_topo
#endif

real (kind=dbl_kind) :: &
puny
Expand All @@ -289,41 +284,18 @@ subroutine accum_hist_pond (iblk)
!---------------------------------------------------------------

call icepack_query_parameters(puny_out=puny)
#ifdef UNDEPRECATE_CESMPONDS
call icepack_query_tracer_flags(tr_pond_cesm_out=tr_pond_cesm, &
tr_pond_lvl_out=tr_pond_lvl, tr_pond_topo_out=tr_pond_topo)
#else
call icepack_query_tracer_flags(tr_pond_lvl_out=tr_pond_lvl, &
tr_pond_topo_out=tr_pond_topo)
#endif
call icepack_query_tracer_indices(nt_apnd_out=nt_apnd, nt_hpnd_out=nt_hpnd, &
nt_alvl_out=nt_alvl, nt_ipnd_out=nt_ipnd)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)

if (allocated(a2D)) then
#ifdef UNDEPRECATE_CESMPONDS
if (tr_pond_cesm) then
if (f_apond(1:1)/= 'x') &
call accum_hist_field(n_apond, iblk, &
trcr(:,:,nt_apnd,iblk), a2D)
if (f_apond_ai(1:1)/= 'x') &
call accum_hist_field(n_apond_ai, iblk, &
aice(:,:,iblk) * trcr(:,:,nt_apnd,iblk), a2D)
if (f_hpond(1:1)/= 'x') &
call accum_hist_field(n_hpond, iblk, &
trcr(:,:,nt_apnd,iblk) &
* trcr(:,:,nt_hpnd,iblk), a2D)
if (f_hpond_ai(1:1)/= 'x') &
call accum_hist_field(n_hpond_ai, iblk, &
aice(:,:,iblk) * trcr(:,:,nt_apnd,iblk) &
* trcr(:,:,nt_hpnd,iblk), a2D)

elseif (tr_pond_lvl) then
#else
if (tr_pond_lvl) then
#endif

if (f_apond(1:1)/= 'x') &
call accum_hist_field(n_apond, iblk, &
trcr(:,:,nt_alvl,iblk) * trcr(:,:,nt_apnd,iblk), a2D)
Expand Down
15 changes: 0 additions & 15 deletions cicecore/cicedynB/dynamics/ice_transport_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1534,27 +1534,17 @@ subroutine state_to_work (nx_block, ny_block, &
integer (kind=int_kind) :: &
nt_alvl, nt_apnd, nt_fbri

#ifdef UNDEPRECATE_CESMPONDS
logical (kind=log_kind) :: &
tr_pond_cesm, tr_pond_lvl, tr_pond_topo
#else
logical (kind=log_kind) :: &
tr_pond_lvl, tr_pond_topo
#endif

integer (kind=int_kind) :: &
i, j, n, it, & ! counting indices
narrays ! counter for number of state variable arrays

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

#ifdef UNDEPRECATE_CESMPONDS
call icepack_query_tracer_flags(tr_pond_cesm_out=tr_pond_cesm, &
tr_pond_lvl_out=tr_pond_lvl, tr_pond_topo_out=tr_pond_topo)
#else
call icepack_query_tracer_flags(tr_pond_lvl_out=tr_pond_lvl, &
tr_pond_topo_out=tr_pond_topo)
#endif
call icepack_query_tracer_indices(nt_alvl_out=nt_alvl, nt_apnd_out=nt_apnd, &
nt_fbri_out=nt_fbri)
call icepack_warnings_flush(nu_diag)
Expand Down Expand Up @@ -1613,13 +1603,8 @@ subroutine state_to_work (nx_block, ny_block, &
* trcrn(i,j,it ,n)
enddo
enddo
#ifdef UNDEPRECATE_CESMPONDS
elseif (trcr_depend(it) == 2+nt_apnd .and. &
tr_pond_cesm .or. tr_pond_topo) then
#else
elseif (trcr_depend(it) == 2+nt_apnd .and. &
tr_pond_topo) then
#endif
do j = 1, ny_block
do i = 1, nx_block
works(i,j,narrays+it) = aicen(i,j ,n) &
Expand Down
123 changes: 0 additions & 123 deletions cicecore/cicedynB/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,9 @@ subroutine input_data
npt, dt, ndtd, days_per_year, use_leap_years, &
write_ic, dump_last, npt_unit
use ice_arrays_column, only: oceanmixed_ice
#ifdef UNDEPRECATE_CESMPONDS
use ice_restart_column, only: restart_age, restart_FY, restart_lvl, &
restart_pond_cesm, restart_pond_lvl, restart_pond_topo, restart_aero, &
restart_fsd, restart_iso, restart_snow
#else
use ice_restart_column, only: restart_age, restart_FY, restart_lvl, &
restart_pond_lvl, restart_pond_topo, restart_aero, &
restart_fsd, restart_iso, restart_snow
#endif
use ice_restart_shared, only: &
restart, restart_ext, restart_coszen, restart_dir, restart_file, pointer_file, &
runid, runtype, use_restart_time, restart_format, lcdf64
Expand Down Expand Up @@ -165,23 +159,12 @@ subroutine input_data

logical (kind=log_kind) :: tr_iage, tr_FY, tr_lvl, tr_pond
logical (kind=log_kind) :: tr_iso, tr_aero, tr_fsd, tr_snow
#ifdef UNDEPRECATE_CESMPONDS
logical (kind=log_kind) :: tr_pond_cesm, tr_pond_lvl, tr_pond_topo
#else
logical (kind=log_kind) :: tr_pond_lvl, tr_pond_topo
#endif
integer (kind=int_kind) :: numin, numax ! unit number limits

#ifdef UNDEPRECATE_CESMPONDS
integer (kind=int_kind) :: rpcesm, rplvl, rptopo
#else
integer (kind=int_kind) :: rplvl, rptopo
#endif
real (kind=dbl_kind) :: Cf, ksno, puny
character (len=char_len) :: abort_list
#ifdef CESMCOUPLED
character (len=64) :: tmpstr
#endif
character (len=128) :: tmpstr2

character(len=*), parameter :: subname='(input_data)'
Expand Down Expand Up @@ -221,9 +204,6 @@ subroutine input_data
tr_iage, restart_age, &
tr_FY, restart_FY, &
tr_lvl, restart_lvl, &
#ifdef UNDEPRECATE_CESMPONDS
tr_pond_cesm, restart_pond_cesm, &
#endif
tr_pond_lvl, restart_pond_lvl, &
tr_pond_topo, restart_pond_topo, &
tr_snow, restart_snow, &
Expand Down Expand Up @@ -445,11 +425,7 @@ subroutine input_data
conserv_check = .false. ! tracer conservation check
shortwave = 'ccsm3' ! 'ccsm3' or 'dEdd' (delta-Eddington)
albedo_type = 'ccsm3' ! 'ccsm3' or 'constant'
#ifdef UNDEPRECATE_0LAYER
ktherm = 1 ! -1 = OFF, 0 = 0-layer, 1 = BL99, 2 = mushy thermo
#else
ktherm = 1 ! -1 = OFF, 1 = BL99, 2 = mushy thermo
#endif
conduct = 'bubbly' ! 'MU71' or 'bubbly' (Pringle et al 2007)
coriolis = 'latitude' ! latitude dependent, or 'constant'
ssh_stress = 'geostrophic' ! 'geostrophic' or 'coupled'
Expand Down Expand Up @@ -559,10 +535,6 @@ subroutine input_data
restart_FY = .false. ! ice age restart
tr_lvl = .false. ! level ice
restart_lvl = .false. ! level ice restart
#ifdef UNDEPRECATE_CESMPONDS
tr_pond_cesm = .false. ! CESM melt ponds
restart_pond_cesm = .false. ! melt ponds restart
#endif
tr_pond_lvl = .false. ! level-ice melt ponds
restart_pond_lvl = .false. ! melt ponds restart
tr_pond_topo = .false. ! explicit melt ponds (topographic)
Expand Down Expand Up @@ -1034,10 +1006,6 @@ subroutine input_data
call broadcast_scalar(restart_FY, master_task)
call broadcast_scalar(tr_lvl, master_task)
call broadcast_scalar(restart_lvl, master_task)
#ifdef UNDEPRECATE_CESMPONDS
call broadcast_scalar(tr_pond_cesm, master_task)
call broadcast_scalar(restart_pond_cesm, master_task)
#endif
call broadcast_scalar(tr_pond_lvl, master_task)
call broadcast_scalar(restart_pond_lvl, master_task)
call broadcast_scalar(tr_pond_topo, master_task)
Expand Down Expand Up @@ -1130,9 +1098,6 @@ subroutine input_data
restart_age = .false.
restart_fy = .false.
restart_lvl = .false.
#ifdef UNDEPRECATE_CESMPONDS
restart_pond_cesm = .false.
#endif
restart_pond_lvl = .false.
restart_pond_topo = .false.
restart_snow = .false.
Expand Down Expand Up @@ -1249,29 +1214,15 @@ subroutine input_data
endif
endif

#ifdef UNDEPRECATE_CESMPONDS
rpcesm = 0
#endif
rplvl = 0
rptopo = 0
#ifdef UNDEPRECATE_CESMPONDS
if (tr_pond_cesm) rpcesm = 1
#endif
if (tr_pond_lvl ) rplvl = 1
if (tr_pond_topo) rptopo = 1

tr_pond = .false. ! explicit melt ponds
#ifdef UNDEPRECATE_CESMPONDS
if (rpcesm + rplvl + rptopo > 0) tr_pond = .true.
#else
if (rplvl + rptopo > 0) tr_pond = .true.
#endif

#ifdef UNDEPRECATE_CESMPONDS
if (rpcesm + rplvl + rptopo > 1) then
#else
if (rplvl + rptopo > 1) then
#endif
if (my_task == master_task) then
write(nu_diag,*) subname//' ERROR: Must use only one melt pond scheme'
endif
Expand Down Expand Up @@ -1495,13 +1446,6 @@ subroutine input_data
abort_list = trim(abort_list)//":16"
endif

#ifdef UNDEPRECATE_CESMPONDS
if (tr_pond_cesm) then
if (my_task == master_task) write(nu_diag,*) subname//' ERROR: formdrag=T and frzpnd=cesm'
abort_list = trim(abort_list)//":17"
endif
#endif

if (.not. tr_lvl) then
if (my_task == master_task) write(nu_diag,*) subname//' ERROR: formdrag=T and tr_lvl=F'
abort_list = trim(abort_list)//":18"
Expand Down Expand Up @@ -1925,10 +1869,6 @@ subroutine input_data
tmpstr2 = ' : Bitz and Lipscomb 1999 thermo'
elseif (ktherm == 2) then
tmpstr2 = ' : mushy-layer thermo'
#ifdef UNDEPRECATE_0LAYER
elseif (ktherm == 0) then
tmpstr2 = ' : zero-layer thermo'
#endif
elseif (ktherm < 0) then
tmpstr2 = ' : Thermodynamics disabled'
else
Expand Down Expand Up @@ -2109,14 +2049,7 @@ subroutine input_data
write(nu_diag,*) ' '
write(nu_diag,*) ' Melt ponds'
write(nu_diag,*) '--------------------------------'
#ifdef UNDEPRECATE_CESMPONDS
if (tr_pond_cesm) then
write(nu_diag,1010) ' tr_pond_cesm = ', tr_pond_cesm,' : CESM pond formulation'
write(nu_diag,1002) ' pndaspect = ', pndaspect,' : ratio of pond depth to area fraction'
elseif (tr_pond_lvl) then
#else
if (tr_pond_lvl) then
#endif
write(nu_diag,1010) ' tr_pond_lvl = ', tr_pond_lvl,' : level-ice pond formulation'
write(nu_diag,1002) ' pndaspect = ', pndaspect,' : ratio of pond depth to area fraction'
write(nu_diag,1000) ' dpscale = ', dpscale,' : time scale for flushing in permeable ice'
Expand Down Expand Up @@ -2229,9 +2162,6 @@ subroutine input_data
if (tr_lvl) write(nu_diag,1010) ' tr_lvl = ', tr_lvl,' : ridging related tracers'
if (tr_pond_lvl) write(nu_diag,1010) ' tr_pond_lvl = ', tr_pond_lvl,' : level-ice pond formulation'
if (tr_pond_topo) write(nu_diag,1010) ' tr_pond_topo = ', tr_pond_topo,' : topo pond formulation'
#ifdef UNDEPRECATE_CESMPONDS
if (tr_pond_cesm) write(nu_diag,1010) ' tr_pond_cesm = ', tr_pond_cesm,' : CESM pond formulation'
#endif
if (tr_snow) write(nu_diag,1010) ' tr_snow = ', tr_snow,' : advanced snow physics'
if (tr_iage) write(nu_diag,1010) ' tr_iage = ', tr_iage,' : chronological ice age'
if (tr_FY) write(nu_diag,1010) ' tr_FY = ', tr_FY,' : first-year ice area'
Expand Down Expand Up @@ -2356,9 +2286,6 @@ subroutine input_data
write(nu_diag,1011) ' restart_age = ', restart_age
write(nu_diag,1011) ' restart_FY = ', restart_FY
write(nu_diag,1011) ' restart_lvl = ', restart_lvl
#ifdef UNDEPRECATE_CESMPONDS
write(nu_diag,1011) ' restart_pond_cesm= ', restart_pond_cesm
#endif
write(nu_diag,1011) ' restart_pond_lvl = ', restart_pond_lvl
write(nu_diag,1011) ' restart_pond_topo= ', restart_pond_topo
write(nu_diag,1011) ' restart_snow = ', restart_snow
Expand Down Expand Up @@ -2457,11 +2384,7 @@ subroutine input_data
call icepack_init_tracer_flags(tr_iage_in=tr_iage, tr_FY_in=tr_FY, &
tr_lvl_in=tr_lvl, tr_iso_in=tr_iso, tr_aero_in=tr_aero, &
tr_fsd_in=tr_fsd, tr_snow_in=tr_snow, tr_pond_in=tr_pond, &
#ifdef UNDEPRECATE_CESMPONDS
tr_pond_cesm_in=tr_pond_cesm, tr_pond_lvl_in=tr_pond_lvl, tr_pond_topo_in=tr_pond_topo)
#else
tr_pond_lvl_in=tr_pond_lvl, tr_pond_topo_in=tr_pond_topo)
#endif
call icepack_init_tracer_sizes(ncat_in=ncat, nilyr_in=nilyr, nslyr_in=nslyr, nblyr_in=nblyr, &
nfsd_in=nfsd, n_algae_in=n_algae, n_iso_in=n_iso, n_aero_in=n_aero, &
n_DOC_in=n_DOC, n_DON_in=n_DON, &
Expand Down Expand Up @@ -2518,18 +2441,10 @@ subroutine init_state
it , & ! tracer index
iblk ! block index

#ifdef UNDEPRECATE_0LAYER
logical (kind=log_kind) :: &
heat_capacity ! from icepack
#endif

integer (kind=int_kind) :: ntrcr
logical (kind=log_kind) :: tr_iage, tr_FY, tr_lvl, tr_iso, tr_aero
#ifdef UNDEPRECATE_CESMPONDS
logical (kind=log_kind) :: tr_pond_cesm, tr_pond_lvl, tr_pond_topo
#else
logical (kind=log_kind) :: tr_pond_lvl, tr_pond_topo
#endif
logical (kind=log_kind) :: tr_snow, tr_fsd
integer (kind=int_kind) :: nt_Tsfc, nt_sice, nt_qice, nt_qsno, nt_iage, nt_FY
integer (kind=int_kind) :: nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd
Expand All @@ -2543,17 +2458,10 @@ subroutine init_state

!-----------------------------------------------------------------

#ifdef UNDEPRECATE_0LAYER
call icepack_query_parameters(heat_capacity_out=heat_capacity)
#endif
call icepack_query_tracer_sizes(ntrcr_out=ntrcr)
call icepack_query_tracer_flags(tr_iage_out=tr_iage, tr_FY_out=tr_FY, &
tr_lvl_out=tr_lvl, tr_iso_out=tr_iso, tr_aero_out=tr_aero, &
#ifdef UNDEPRECATE_CESMPONDS
tr_pond_cesm_out=tr_pond_cesm, tr_pond_lvl_out=tr_pond_lvl, tr_pond_topo_out=tr_pond_topo, &
#else
tr_pond_lvl_out=tr_pond_lvl, tr_pond_topo_out=tr_pond_topo, &
#endif
tr_snow_out=tr_snow, tr_fsd_out=tr_fsd)
call icepack_query_tracer_indices(nt_Tsfc_out=nt_Tsfc, nt_sice_out=nt_sice, &
nt_qice_out=nt_qice, nt_qsno_out=nt_qsno, nt_iage_out=nt_iage, nt_fy_out=nt_fy, &
Expand Down Expand Up @@ -2587,25 +2495,6 @@ subroutine init_state
file=__FILE__, line=__LINE__)
endif

#ifdef UNDEPRECATE_0LAYER
if (.not.heat_capacity) then

if (nilyr > 1) then
write(nu_diag,*) subname//' ERROR: Must have nilyr = 1 if heat_capacity=F'
write(nu_diag,*) subname//' ERROR: nilyr =', nilyr
call abort_ice(error_message=subname//' Too many ice layers', &
file=__FILE__, line=__LINE__)
endif

if (nslyr > 1) then
write(nu_diag,*) subname//' ERROR: Must have nslyr = 1 if heat_capacity=F'
write(nu_diag,*) subname//' ERROR: nslyr =', nslyr
call abort_ice(error_message=subname//' Too many snow layers', &
file=__FILE__, line=__LINE__)
endif

endif ! heat_capacity = F
#endif
endif ! my_task

!-----------------------------------------------------------------
Expand All @@ -2624,12 +2513,6 @@ subroutine init_state
if (tr_FY) trcr_depend(nt_FY) = 0 ! area-weighted first-year ice area
if (tr_lvl) trcr_depend(nt_alvl) = 0 ! level ice area
if (tr_lvl) trcr_depend(nt_vlvl) = 1 ! level ice volume
#ifdef UNDEPRECATE_CESMPONDS
if (tr_pond_cesm) then
trcr_depend(nt_apnd) = 0 ! melt pond area
trcr_depend(nt_hpnd) = 2+nt_apnd ! melt pond depth
endif
#endif
if (tr_pond_lvl) then
trcr_depend(nt_apnd) = 2+nt_alvl ! melt pond area
trcr_depend(nt_hpnd) = 2+nt_apnd ! melt pond depth
Expand Down Expand Up @@ -2691,12 +2574,6 @@ subroutine init_state
nt_strata (it,2) = 0
enddo

#ifdef UNDEPRECATE_CESMPONDS
if (tr_pond_cesm) then
n_trcr_strata(nt_hpnd) = 1 ! melt pond depth
nt_strata (nt_hpnd,1) = nt_apnd ! on melt pond area
endif
#endif
if (tr_pond_lvl) then
n_trcr_strata(nt_apnd) = 1 ! melt pond area
nt_strata (nt_apnd,1) = nt_alvl ! on level ice area
Expand Down
Loading

0 comments on commit 5a32f12

Please sign in to comment.