Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -734,11 +734,11 @@ subroutine column_conservation_check (fieldid, &
call icepack_warnings_add(warnstr)
write(warnstr,*) subname, 'Conservation error: ', trim(fieldid)
call icepack_warnings_add(warnstr)
write(warnstr,*) subname, 'Initial value =', x1
write(warnstr,*) subname, ' Initial value = ', x1
call icepack_warnings_add(warnstr)
write(warnstr,*) subname, 'Final value =', x2
write(warnstr,*) subname, ' Final value = ', x2
call icepack_warnings_add(warnstr)
write(warnstr,*) subname, 'Difference =', x2 - x1
write(warnstr,*) subname, ' Difference = ', x2 - x1
call icepack_warnings_add(warnstr)
endif

Expand Down
24 changes: 10 additions & 14 deletions columnphysics/icepack_mechred.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module icepack_mechred
use icepack_parameters, only: puny, Lfresh, rhoi, rhos

use icepack_parameters, only: kstrength, krdg_partic, krdg_redist, mu_rdg
use icepack_parameters, only: heat_capacity
use icepack_parameters, only: heat_capacity, conserv_check

use icepack_tracers, only: tr_pond_topo, tr_aero, tr_iso, tr_brine, ntrcr, nbtrcr
use icepack_tracers, only: nt_qice, nt_qsno, nt_fbri, nt_sice
Expand Down Expand Up @@ -79,10 +79,6 @@ module icepack_mechred
! (krdg_redist = 0)
! Flato & Hibler (1995) have Hstar = 100

logical (kind=log_kind), parameter :: &
l_conservation_check = .false. ! if true, check conservation
! (useful for debugging)

!=======================================================================

contains
Expand Down Expand Up @@ -322,7 +318,7 @@ subroutine ridge_ice (dt, ndtd, &
! Compute initial values of conserved quantities.
!-----------------------------------------------------------------

if (l_conservation_check) then
if (conserv_check) then

do n = 1, ncat
eicen(n) = c0
Expand Down Expand Up @@ -459,7 +455,7 @@ subroutine ridge_ice (dt, ndtd, &
! Check for conservation (allowing for snow thrown into ocean).
!-----------------------------------------------------------------

if (l_conservation_check) then
if (conserv_check) then

do n = 1, ncat
eicen(n) = c0
Expand Down Expand Up @@ -503,38 +499,38 @@ subroutine ridge_ice (dt, ndtd, &
vsno_final = vsno_final + msnow_mlt/rhos
esno_final = esno_final + esnow_mlt

fieldid = 'vice, ridging'
fieldid = subname//':vice'
call column_conservation_check (fieldid, &
vice_init, vice_final, &
puny)
if (icepack_warnings_aborted(subname)) return
fieldid = 'vsno, ridging'
fieldid = subname//':vsno'
call column_conservation_check (fieldid, &
vsno_init, vsno_final, &
puny)
if (icepack_warnings_aborted(subname)) return
fieldid = 'eice, ridging'
fieldid = subname//':eice'
call column_conservation_check (fieldid, &
eice_init, eice_final, &
puny*Lfresh*rhoi)
if (icepack_warnings_aborted(subname)) return
fieldid = 'esno, ridging'
fieldid = subname//':esno'
call column_conservation_check (fieldid, &
esno_init, esno_final, &
puny*Lfresh*rhos)
if (icepack_warnings_aborted(subname)) return
fieldid = 'sice, ridging'
fieldid = subname//':sice'
call column_conservation_check (fieldid, &
sice_init, sice_final, &
puny)
if (icepack_warnings_aborted(subname)) return
fieldid = 'vbrin, ridging'
fieldid = subname//':vbrin'
call column_conservation_check (fieldid, &
vbri_init, vbri_final, &
puny*c10)
if (icepack_warnings_aborted(subname)) return

endif ! l_conservation_check
endif ! conserv_check

!-----------------------------------------------------------------
! Compute ridging diagnostics.
Expand Down
16 changes: 11 additions & 5 deletions columnphysics/icepack_parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ module icepack_parameters
! atmos-ice fluxes are provided to CICE
update_ocn_f = .false. ,&! include fresh water and salt fluxes for frazil
solve_zsal = .false. ,&! if true, update salinity profile from solve_S_dt
modal_aero = .false. ! if true, use modal aerosal optical properties
modal_aero = .false. ,&! if true, use modal aerosal optical properties
! only for use with tr_aero or tr_zaero
conserv_check = .false. ! if true, do conservations checks and abort

character(len=char_len), public :: &
tfrz_option = 'mushy' ! form of ocean freezing temperature
Expand Down Expand Up @@ -398,7 +399,7 @@ subroutine icepack_init_parameters( &
fr_resp_in, algal_vel_in, R_dFe2dust_in, dustFe_sol_in, &
op_dep_min_in, fr_graze_s_in, fr_graze_e_in, fr_mort2min_in, &
fr_dFe_in, k_nitrif_in, t_iron_conv_in, max_loss_in, &
max_dfe_doc1_in, fr_resp_s_in, &
max_dfe_doc1_in, fr_resp_s_in, conserv_check_in, &
y_sk_DMS_in, t_sk_conv_in, t_sk_ox_in, frazil_scav_in)

!-----------------------------------------------------------------
Expand Down Expand Up @@ -620,7 +621,8 @@ subroutine icepack_init_parameters( &
scale_bgc_in, & ! if .true., initialize bgc tracers proportionally with salinity
solve_zbgc_in, & ! if .true., solve vertical biochemistry portion of code
dEdd_algae_in, & ! if .true., algal absorptionof Shortwave is computed in the
modal_aero_in ! if .true., use modal aerosol formulation in shortwave
modal_aero_in, & ! if .true., use modal aerosol formulation in shortwave
conserv_check_in ! if .true., run conservation checks and abort if checks fail

logical (kind=log_kind), intent(in), optional :: &
skl_bgc_in, & ! if true, solve skeletal biochemistry
Expand Down Expand Up @@ -804,6 +806,7 @@ subroutine icepack_init_parameters( &
if (present(solve_zbgc_in) ) solve_zbgc = solve_zbgc_in
if (present(dEdd_algae_in) ) dEdd_algae = dEdd_algae_in
if (present(modal_aero_in) ) modal_aero = modal_aero_in
if (present(conserv_check_in) ) conserv_check = conserv_check_in
if (present(skl_bgc_in) ) skl_bgc = skl_bgc_in
if (present(solve_zsal_in) ) solve_zsal = solve_zsal_in
if (present(grid_o_in) ) grid_o = grid_o_in
Expand Down Expand Up @@ -879,7 +882,7 @@ subroutine icepack_query_parameters( &
bgc_flux_type_out, z_tracers_out, scale_bgc_out, solve_zbgc_out, &
modal_aero_out, skl_bgc_out, solve_zsal_out, grid_o_out, l_sk_out, &
initbio_frac_out, grid_oS_out, l_skS_out, &
phi_snow_out, heat_capacity_out, &
phi_snow_out, heat_capacity_out, conserv_check_out, &
fr_resp_out, algal_vel_out, R_dFe2dust_out, dustFe_sol_out, &
T_max_out, fsal_out, op_dep_min_out, fr_graze_s_out, fr_graze_e_out, &
fr_mort2min_out, fr_resp_s_out, fr_dFe_out, &
Expand Down Expand Up @@ -1114,7 +1117,8 @@ subroutine icepack_query_parameters( &
scale_bgc_out, & ! if .true., initialize bgc tracers proportionally with salinity
solve_zbgc_out, & ! if .true., solve vertical biochemistry portion of code
dEdd_algae_out, & ! if .true., algal absorptionof Shortwave is computed in the
modal_aero_out ! if .true., use modal aerosol formulation in shortwave
modal_aero_out, & ! if .true., use modal aerosol formulation in shortwave
conserv_check_out ! if .true., run conservation checks and abort if checks fail

logical (kind=log_kind), intent(out), optional :: &
skl_bgc_out, & ! if true, solve skeletal biochemistry
Expand Down Expand Up @@ -1339,6 +1343,7 @@ subroutine icepack_query_parameters( &
if (present(solve_zbgc_out) ) solve_zbgc_out = solve_zbgc
if (present(dEdd_algae_out) ) dEdd_algae_out = dEdd_algae
if (present(modal_aero_out) ) modal_aero_out = modal_aero
if (present(conserv_check_out) ) conserv_check_out= conserv_check
if (present(skl_bgc_out) ) skl_bgc_out = skl_bgc
if (present(solve_zsal_out) ) solve_zsal_out = solve_zsal
if (present(grid_o_out) ) grid_o_out = grid_o
Expand Down Expand Up @@ -1513,6 +1518,7 @@ subroutine icepack_write_parameters(iounit)
write(iounit,*) " solve_zbgc = ", solve_zbgc
write(iounit,*) " dEdd_algae = ", dEdd_algae
write(iounit,*) " modal_aero = ", modal_aero
write(iounit,*) " conserv_check = ", conserv_check
write(iounit,*) " skl_bgc = ", skl_bgc
write(iounit,*) " solve_zsal = ", solve_zsal
write(iounit,*) " grid_o = ", grid_o
Expand Down
41 changes: 18 additions & 23 deletions columnphysics/icepack_therm_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module icepack_therm_itd
use icepack_parameters, only: p001, p1, p333, p5, p666, puny, bignum
use icepack_parameters, only: rhos, rhoi, Lfresh, ice_ref_salinity
use icepack_parameters, only: phi_init, dsin0_frazil, hs_ssl, salt_loss
use icepack_parameters, only: rhosi
use icepack_parameters, only: rhosi, conserv_check
use icepack_parameters, only: kitd, ktherm, heat_capacity
use icepack_parameters, only: z_tracers, solve_zsal

Expand Down Expand Up @@ -60,10 +60,6 @@ module icepack_therm_itd
lateral_melt, &
icepack_step_therm2

logical (kind=log_kind), parameter, public :: &
l_conservation_check = .false. ! if true, check conservation
! (useful for debugging)

!=======================================================================

contains
Expand Down Expand Up @@ -221,7 +217,7 @@ subroutine linear_itd (ncat, hin_max, &
! conserve.
!-----------------------------------------------------------------

if (l_conservation_check) then
if (conserv_check) then

do n = 1, ncat

Expand Down Expand Up @@ -264,7 +260,7 @@ subroutine linear_itd (ncat, hin_max, &
call column_sum (ncat, vbrin, vbri_init)
if (icepack_warnings_aborted(subname)) return

endif ! l_conservation_check
endif ! conserv_check

!-----------------------------------------------------------------
! Initialize remapping flag.
Expand Down Expand Up @@ -608,7 +604,7 @@ subroutine linear_itd (ncat, hin_max, &
! Check volume and energy conservation.
!-----------------------------------------------------------------

if (l_conservation_check) then
if (conserv_check) then

do n = 1, ncat

Expand Down Expand Up @@ -651,32 +647,32 @@ subroutine linear_itd (ncat, hin_max, &
call column_sum (ncat, vbrin, vbri_final)
if (icepack_warnings_aborted(subname)) return

fieldid = 'vice, ITD remap'
fieldid = subname//':vice'
call column_conservation_check (fieldid, &
vice_init, vice_final, &
puny)
if (icepack_warnings_aborted(subname)) return
fieldid = 'vsno, ITD remap'
fieldid = subname//':vsno'
call column_conservation_check (fieldid, &
vsno_init, vsno_final, &
puny)
if (icepack_warnings_aborted(subname)) return
fieldid = 'eice, ITD remap'
fieldid = subname//':eice'
call column_conservation_check (fieldid, &
eice_init, eice_final, &
puny*Lfresh*rhoi)
if (icepack_warnings_aborted(subname)) return
fieldid = 'esno, ITD remap'
fieldid = subname//':esno'
call column_conservation_check (fieldid, &
esno_init, esno_final, &
puny*Lfresh*rhos)
if (icepack_warnings_aborted(subname)) return
fieldid = 'sicen, ITD remap'
fieldid = subname//':sicen'
call column_conservation_check (fieldid, &
sice_init, sice_final, &
puny)
if (icepack_warnings_aborted(subname)) return
fieldid = 'vbrin, ITD remap'
fieldid = subname//':vbrin'
call column_conservation_check (fieldid, &
vbri_init, vbri_final, &
puny*c10)
Expand Down Expand Up @@ -1504,7 +1500,7 @@ subroutine add_new_ice (ncat, nilyr, &
endif
enddo

if (l_conservation_check) then
if (conserv_check) then

do n = 1, ncat
do k = 1, nilyr
Expand All @@ -1517,7 +1513,7 @@ subroutine add_new_ice (ncat, nilyr, &
call column_sum (ncat, eicen, eice_init)
if (icepack_warnings_aborted(subname)) return

endif ! l_conservation_check
endif ! conserv_check

!-----------------------------------------------------------------
! Compute average enthalpy of new ice.
Expand Down Expand Up @@ -1554,7 +1550,7 @@ subroutine add_new_ice (ncat, nilyr, &
vi0_init = vi0new ! for bgc

! increment ice volume and energy
if (l_conservation_check) then
if (conserv_check) then
vice_init = vice_init + vi0new
eice_init = eice_init + vi0new*qi0new
endif
Expand Down Expand Up @@ -1873,7 +1869,7 @@ subroutine add_new_ice (ncat, nilyr, &

enddo ! ncats

if (l_conservation_check) then
if (conserv_check) then

do n = 1, ncat
eicen(n) = c0
Expand All @@ -1887,18 +1883,18 @@ subroutine add_new_ice (ncat, nilyr, &
call column_sum (ncat, eicen, eice_final)
if (icepack_warnings_aborted(subname)) return

fieldid = 'vice, add_new_ice'
fieldid = subname//':vice'
call column_conservation_check (fieldid, &
vice_init, vice_final, &
puny)
if (icepack_warnings_aborted(subname)) return
fieldid = 'eice, add_new_ice'
fieldid = subname//':eice'
call column_conservation_check (fieldid, &
eice_init, eice_final, &
puny*Lfresh*rhoi)
if (icepack_warnings_aborted(subname)) return

endif ! l_conservation_check
endif ! conserv_check

!-----------------------------------------------------------------
! Biogeochemistry
Expand All @@ -1911,8 +1907,7 @@ subroutine add_new_ice (ncat, nilyr, &
aicen, vicen, vsnon1, &
vi0new, ntrcr, trcrn, &
nbtrcr, sss, ocean_bio,&
flux_bio, hsurp, &
l_conservation_check)
flux_bio, hsurp)
if (icepack_warnings_aborted(subname)) return

end subroutine add_new_ice
Expand Down
13 changes: 5 additions & 8 deletions columnphysics/icepack_zbgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module icepack_zbgc
use icepack_parameters, only: k_nitrif, t_iron_conv, max_loss, max_dfe_doc1
use icepack_parameters, only: fr_resp_s, y_sk_DMS, t_sk_conv, t_sk_ox
use icepack_parameters, only: scale_bgc, ktherm, skl_bgc, solve_zsal
use icepack_parameters, only: z_tracers, fsal
use icepack_parameters, only: z_tracers, fsal, conserv_check

use icepack_tracers, only: nt_sice, nt_bgc_S, bio_index
use icepack_tracers, only: tr_brine, nt_fbri, nt_qice, nt_Tsfc
Expand Down Expand Up @@ -74,7 +74,7 @@ subroutine add_new_ice_bgc (dt, nblyr, &
vi0new, &
ntrcr, trcrn, nbtrcr, &
sss, ocean_bio, flux_bio, &
hsurp, l_conservation_check)
hsurp)

integer (kind=int_kind), intent(in) :: &
nblyr , & ! number of bio layers
Expand Down Expand Up @@ -128,9 +128,6 @@ subroutine add_new_ice_bgc (dt, nblyr, &
intent(in) :: &
ocean_bio ! ocean concentration of biological tracer

logical (kind=log_kind), intent(in) :: &
l_conservation_check

! local

integer (kind=int_kind) :: &
Expand Down Expand Up @@ -264,17 +261,17 @@ subroutine add_new_ice_bgc (dt, nblyr, &
endif ! nltrcr > 0
endif ! vi0new > 0

if (tr_brine .and. l_conservation_check) then
if (tr_brine .and. conserv_check) then
call column_sum (ncat, vbrin, vbri_final)
if (icepack_warnings_aborted(subname)) return

fieldid = 'vbrin, add_new_ice_bgc'
fieldid = subname//':vbrin'
call column_conservation_check (fieldid, &
vbri_init, vbri_final, &
puny)
if (icepack_warnings_aborted(subname)) return

endif ! l_conservation_check
endif ! conserv_check

end subroutine add_new_ice_bgc

Expand Down
Loading