From f5f03b92b206cbd59f9b284a0a98ef51c120b567 Mon Sep 17 00:00:00 2001 From: Tony Craig Date: Thu, 17 Oct 2024 09:48:12 -0700 Subject: [PATCH] Update Derecho Cray, rename subroutines, minor cleanup (#502) * Update Derecho Cray, rename subroutines, minor cleanup Update Derecho Cray, add -Rp to -O2 standard optimization to address SAME_TBS compiler bug that is triggered in limited cases. Reported issue to NCAR. -O2 -Rp changes answers relative to -O2. Rename two public Icepack subroutines, but maintain backward compatibility. Update the calls in Icepack driver, but also confirmed it works fine with the old names as well as in CICE with the old names. Closes #255 use icepack_therm_shared , only: icepack_init_thermo => icepack_init_salinity use icepack_therm_shared , only: icepack_init_trcr => icepack_init_enthalpy Add a check and abort for negative values in the sqrt in computation of Tin in function calculate_Tin_from_qin. Closes #482 Refactor calls to icepack_aggregate to make them consistent. This was part of the testing for the Derecho Cray bug, and decided to keep the implementation. Update comments associated with floeshape constant attribution. Change from Steele to Rothrock 1984. Closes #479 Clean up some of the variable declarations in subroutine set_state_var and module icedrv_state, merge multiple lines to one line and shift to assumed shape arrays where appropriate. Clean up implementation error in icedrv_restart.F90, subroutine restartfile. This subroutine was using a parameter, ntrcr, directly from icepack_tracers. Switched that to a call to icepack_query_tracer_sizes. Update documentation of kice noting it's use with BL99 and MU71. See #447. Generate updated interface documentation (./icepack.setup --docintfc) --- columnphysics/icepack_intfc.F90 | 7 +- columnphysics/icepack_parameters.F90 | 8 +- columnphysics/icepack_therm_shared.F90 | 42 +- configuration/driver/icedrv_InitMod.F90 | 39 +- configuration/driver/icedrv_init.F90 | 19 +- configuration/driver/icedrv_init_column.F90 | 4 +- configuration/driver/icedrv_restart.F90 | 36 +- configuration/driver/icedrv_state.F90 | 15 +- configuration/driver/icedrv_step.F90 | 28 +- .../scripts/machines/Macros.derecho_cray | 3 +- doc/source/icepack_index.rst | 2 +- doc/source/user_guide/interfaces.include | 743 ++++++++++-------- 12 files changed, 522 insertions(+), 424 deletions(-) diff --git a/columnphysics/icepack_intfc.F90 b/columnphysics/icepack_intfc.F90 index 2f8b648b3..2e96a7a9b 100644 --- a/columnphysics/icepack_intfc.F90 +++ b/columnphysics/icepack_intfc.F90 @@ -112,9 +112,12 @@ module icepack_intfc use icepack_therm_shared , only: icepack_snow_temperature use icepack_therm_shared , only: icepack_liquidus_temperature use icepack_therm_shared , only: icepack_sea_freezing_temperature - use icepack_therm_shared , only: icepack_init_thermo + use icepack_therm_shared , only: icepack_init_salinity use icepack_therm_shared , only: icepack_salinity_profile - use icepack_therm_shared , only: icepack_init_trcr + use icepack_therm_shared , only: icepack_init_enthalpy + ! for backwards compatibilty, remove in the future + use icepack_therm_shared , only: icepack_init_thermo => icepack_init_salinity + use icepack_therm_shared , only: icepack_init_trcr => icepack_init_enthalpy use icepack_mushy_physics , only: icepack_enthalpy_snow use icepack_mushy_physics , only: icepack_enthalpy_mush diff --git a/columnphysics/icepack_parameters.F90 b/columnphysics/icepack_parameters.F90 index ef82b0695..ed76b6b41 100644 --- a/columnphysics/icepack_parameters.F90 +++ b/columnphysics/icepack_parameters.F90 @@ -117,8 +117,8 @@ module icepack_parameters Timelt = 0.0_dbl_kind ,&! melting temperature, ice top surface (C) Tsmelt = 0.0_dbl_kind ,&! melting temperature, snow top surface (C) ice_ref_salinity =4._dbl_kind,&! (ppt) - ! kice is not used for mushy thermo kice = 2.03_dbl_kind ,&! thermal conductivity of fresh ice(W/m/deg) + ! kice is only used with ktherm=1 (BL99) and conduct='MU71' ksno = 0.30_dbl_kind ,&! thermal conductivity of snow (W/m/deg) hs_min = 1.e-4_dbl_kind ,&! min snow thickness for computing zTsn (m) snowpatch = 0.02_dbl_kind ,&! parameter for fractional snow area (m) @@ -316,7 +316,7 @@ module icepack_parameters nfreq = 25 ! number of frequencies real (kind=dbl_kind), public :: & - floeshape = 0.66_dbl_kind ! constant from Steele (unitless) + floeshape = 0.66_dbl_kind ! constant from Rothrock 1984 (unitless) real (kind=dbl_kind), public :: & floediam = 300.0_dbl_kind ! effective floe diameter for lateral melt (m) @@ -856,7 +856,7 @@ subroutine icepack_init_parameters( & nfreq_in ! number of frequencies real (kind=dbl_kind), intent(in), optional :: & - floeshape_in ! constant from Steele (unitless) + floeshape_in ! constant from Rothrock 1984 (unitless) logical (kind=log_kind), intent(in), optional :: & wave_spec_in ! if true, use wave forcing @@ -1876,7 +1876,7 @@ subroutine icepack_query_parameters( & nfreq_out ! number of frequencies real (kind=dbl_kind), intent(out), optional :: & - floeshape_out ! constant from Steele (unitless) + floeshape_out ! constant from Rothrock 1984 (unitless) logical (kind=log_kind), intent(out), optional :: & wave_spec_out ! if true, use wave forcing diff --git a/columnphysics/icepack_therm_shared.F90 b/columnphysics/icepack_therm_shared.F90 index 8f566bb9c..858e6c560 100644 --- a/columnphysics/icepack_therm_shared.F90 +++ b/columnphysics/icepack_therm_shared.F90 @@ -29,9 +29,9 @@ module icepack_therm_shared public :: calculate_Tin_from_qin, & surface_heat_flux, & dsurface_heat_flux_dTsf, & - icepack_init_thermo, & + icepack_init_salinity, & icepack_salinity_profile, & - icepack_init_trcr, & + icepack_init_enthalpy, & icepack_ice_temperature, & icepack_snow_temperature, & icepack_liquidus_temperature, & @@ -65,12 +65,12 @@ function calculate_Tin_from_qin (qin, Tmltk) & Tmltk ! melting temperature at one level real (kind=dbl_kind) :: & - Tin ! internal temperature + Tin ! internal temperature ! local variables real (kind=dbl_kind) :: & - aa1,bb1,cc1 ! quadratic solvers + aa1,bb1,cc1,csqrt ! quadratic solvers character(len=*),parameter :: subname='(calculate_Tin_from_qin)' @@ -78,8 +78,13 @@ function calculate_Tin_from_qin (qin, Tmltk) & aa1 = cp_ice bb1 = (cp_ocn-cp_ice)*Tmltk - qin/rhoi - Lfresh cc1 = Lfresh * Tmltk - Tin = min((-bb1 - sqrt(bb1*bb1 - c4*aa1*cc1)) / & - (c2*aa1),Tmltk) + csqrt = bb1*bb1 - c4*aa1*cc1 + if (csqrt < c0) then + call icepack_warnings_add(subname//' sqrt error: ') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + return + endif + Tin = min((-bb1 - sqrt(csqrt)) / (c2*aa1),Tmltk) else ! fresh ice Tin = (Lfresh + qin/rhoi) / cp_ice @@ -210,13 +215,14 @@ subroutine dsurface_heat_flux_dTsf(Tsf, rhoa, & end subroutine dsurface_heat_flux_dTsf !======================================================================= -!autodocument_start icepack_init_thermo -! Initialize the vertical profile of ice salinity and melting temperature. +!autodocument_start icepack_init_salinity +! Initialize the vertical profile of ice salinity. +! This subroutine was renamed from icepack_init_thermo in Oct 2024 ! ! authors: C. M. Bitz, UW ! William H. Lipscomb, LANL - subroutine icepack_init_thermo(sprofile) + subroutine icepack_init_salinity(sprofile) real (kind=dbl_kind), dimension(:), intent(out) :: & sprofile ! vertical salinity profile @@ -226,7 +232,7 @@ subroutine icepack_init_thermo(sprofile) integer (kind=int_kind) :: k ! ice layer index real (kind=dbl_kind) :: zn ! normalized ice thickness - character(len=*),parameter :: subname='(icepack_init_thermo)' + character(len=*),parameter :: subname='(icepack_init_salinity)' !----------------------------------------------------------------- ! Determine l_brine based on saltmax. @@ -239,7 +245,7 @@ subroutine icepack_init_thermo(sprofile) if (saltmax > min_salin) l_brine = .true. !----------------------------------------------------------------- - ! Prescibe vertical profile of salinity and melting temperature. + ! Prescibe vertical profile of salinity. ! Note this profile is only used for BL99 thermodynamics. !----------------------------------------------------------------- @@ -259,7 +265,7 @@ subroutine icepack_init_thermo(sprofile) enddo endif ! l_brine - end subroutine icepack_init_thermo + end subroutine icepack_init_salinity !======================================================================= !autodocument_start icepack_salinity_profile @@ -282,16 +288,17 @@ function icepack_salinity_profile(zn) result(salinity) nsal = 0.407_dbl_kind, & msal = 0.573_dbl_kind - character(len=*),parameter :: subname='(icepack_init_thermo)' + character(len=*),parameter :: subname='(icepack_salinity_profile)' salinity = (saltmax/c2)*(c1-cos(pi*zn**(nsal/(msal+zn)))) end function icepack_salinity_profile !======================================================================= -!autodocument_start icepack_init_trcr +!autodocument_start icepack_init_enthalpy +! This subroutine was renamed from icepack_init_trcr in Oct 2024 ! - subroutine icepack_init_trcr(Tair, Tf, & + subroutine icepack_init_enthalpy(Tair, Tf, & Sprofile, Tprofile, & Tsfc, & qin, qsn) @@ -320,7 +327,7 @@ subroutine icepack_init_trcr(Tair, Tf, & real (kind=dbl_kind) :: & slope, Ti - character(len=*),parameter :: subname='(icepack_init_trcr)' + character(len=*),parameter :: subname='(icepack_init_enthalpy)' ! surface temperature Tsfc = Tf ! default @@ -346,7 +353,7 @@ subroutine icepack_init_trcr(Tair, Tf, & qsn(k) = -rhos*(Lfresh - cp_ice*Ti) enddo ! nslyr - end subroutine icepack_init_trcr + end subroutine icepack_init_enthalpy !======================================================================= !autodocument_start icepack_liquidus_temperature @@ -406,6 +413,7 @@ function icepack_sea_freezing_temperature(sss) result(Tf) call icepack_warnings_add(subname//' tfrz_option unsupported: '//trim(tfrz_option)) call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + return endif diff --git a/configuration/driver/icedrv_InitMod.F90 b/configuration/driver/icedrv_InitMod.F90 index c077a9203..c45d28022 100644 --- a/configuration/driver/icedrv_InitMod.F90 +++ b/configuration/driver/icedrv_InitMod.F90 @@ -11,6 +11,7 @@ module icedrv_InitMod use icedrv_constants, only: nu_diag use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted use icepack_intfc, only: icepack_query_parameters, icepack_query_tracer_flags + use icepack_intfc, only: icepack_query_tracer_sizes use icepack_intfc, only: icepack_write_tracer_flags, icepack_write_tracer_indices use icepack_intfc, only: icepack_write_tracer_sizes, icepack_write_parameters use icedrv_system, only: icedrv_system_abort, icedrv_system_flush @@ -187,12 +188,13 @@ subroutine init_restart use icedrv_state ! almost everything integer(kind=int_kind) :: & - i ! horizontal indices + i, & ! horizontal indices + ntrcr ! tracer count logical (kind=log_kind) :: & - skl_bgc, & ! from icepack - z_tracers, & ! from icepack - tr_brine, & ! from icepack + skl_bgc, & ! from icepack + z_tracers, & ! from icepack + tr_brine, & ! from icepack tr_fsd ! from icepack character(len=*), parameter :: subname='(init_restart)' @@ -204,6 +206,7 @@ subroutine init_restart call icepack_query_parameters(skl_bgc_out=skl_bgc) call icepack_query_parameters(z_tracers_out=z_tracers) call icepack_query_tracer_flags(tr_brine_out=tr_brine, tr_fsd_out=tr_fsd) + call icepack_query_tracer_sizes(ntrcr_out=ntrcr) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & file=__FILE__,line= __LINE__) @@ -235,20 +238,20 @@ subroutine init_restart !----------------------------------------------------------------- do i = 1, nx if (tmask(i)) & - call icepack_aggregate(aicen=aicen(i,:), & - vicen=vicen(i,:), & - vsnon=vsnon(i,:), & - trcrn=trcrn(i,:,:), & - aice=aice (i), & - vice=vice (i), & - vsno=vsno (i), & - trcr=trcr (i,:), & - aice0=aice0(i), & - trcr_depend=trcr_depend, & - trcr_base=trcr_base, & - n_trcr_strata=n_trcr_strata, & - nt_strata=nt_strata, & - Tf=Tf(i)) + call icepack_aggregate(trcrn=trcrn(i,1:ntrcr,:), & + aicen=aicen(i,:), & + vicen=vicen(i,:), & + vsnon=vsnon(i,:), & + trcr=trcr (i,1:ntrcr), & + aice=aice (i), & + vice=vice (i), & + vsno=vsno (i), & + aice0=aice0(i), & + trcr_depend=trcr_depend(1:ntrcr), & + trcr_base=trcr_base (1:ntrcr,:), & + n_trcr_strata=n_trcr_strata(1:ntrcr), & + nt_strata=nt_strata (1:ntrcr,:), & + Tf = Tf(i)) enddo call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & diff --git a/configuration/driver/icedrv_init.F90 b/configuration/driver/icedrv_init.F90 index ac1873498..ddcd8b2f6 100644 --- a/configuration/driver/icedrv_init.F90 +++ b/configuration/driver/icedrv_init.F90 @@ -15,7 +15,7 @@ module icedrv_init use icepack_intfc, only: icepack_init_tracer_flags use icepack_intfc, only: icepack_init_tracer_sizes use icepack_intfc, only: icepack_init_tracer_indices - use icepack_intfc, only: icepack_init_trcr + use icepack_intfc, only: icepack_init_enthalpy use icepack_intfc, only: icepack_query_parameters use icepack_intfc, only: icepack_query_tracer_flags use icepack_intfc, only: icepack_query_tracer_sizes @@ -1301,27 +1301,24 @@ subroutine set_state_var (nx, & integer (kind=int_kind), intent(in) :: & nx ! number of grid cells - real (kind=dbl_kind), dimension (nx), intent(in) :: & + real (kind=dbl_kind), dimension (:), intent(in) :: & Tair ! air temperature (K) ! ocean values may be redefined here, unlike in CICE - real (kind=dbl_kind), dimension (nx), intent(inout) :: & + real (kind=dbl_kind), dimension (:), intent(inout) :: & Tf , & ! freezing temperature (C) sst ! sea surface temperature (C) - real (kind=dbl_kind), dimension (nx,nilyr), & - intent(in) :: & + real (kind=dbl_kind), dimension (:,:), intent(in) :: & salinz , & ! initial salinity profile Tmltz ! initial melting temperature profile - real (kind=dbl_kind), dimension (nx,ncat), & - intent(out) :: & + real (kind=dbl_kind), dimension (:,:), intent(out) :: & aicen , & ! concentration of ice vicen , & ! volume per unit area of ice (m) vsnon ! volume per unit area of snow (m) - real (kind=dbl_kind), dimension (nx,max_ntrcr,ncat), & - intent(out) :: & + real (kind=dbl_kind), dimension (:,:,:), intent(out) :: & trcrn ! ice tracers ! 1: surface temperature of ice/snow (C) @@ -1431,7 +1428,7 @@ subroutine set_state_var (nx, & vicen(i,n) = hinit(n) * ainit(n) ! m vsnon(i,n) = c0 ! tracers - call icepack_init_trcr(Tair = Tair(i), & + call icepack_init_enthalpy(Tair = Tair(i), & Tf = Tf(i), & Sprofile = salinz(i,:), & Tprofile = Tmltz(i,:), & @@ -1502,7 +1499,7 @@ subroutine set_state_var (nx, & vicen(i,n) = hinit(n) * ainit(n) ! m vsnon(i,n) = min(aicen(i,n)*hsno_init,p2*vicen(i,n)) ! tracers - call icepack_init_trcr(Tair = Tair(i), & + call icepack_init_enthalpy(Tair = Tair(i), & Tf = Tf(i), & Sprofile = salinz(i,:), & Tprofile = Tmltz(i,:), & diff --git a/configuration/driver/icedrv_init_column.F90 b/configuration/driver/icedrv_init_column.F90 index ef2754b81..ce1d1bbd0 100644 --- a/configuration/driver/icedrv_init_column.F90 +++ b/configuration/driver/icedrv_init_column.F90 @@ -24,7 +24,7 @@ module icedrv_init_column use icepack_intfc, only: icepack_query_tracer_indices use icepack_intfc, only: icepack_query_parameters use icepack_intfc, only: icepack_init_zbgc - use icepack_intfc, only: icepack_init_thermo, icepack_init_radiation + use icepack_intfc, only: icepack_init_salinity, icepack_init_radiation use icepack_intfc, only: icepack_step_radiation, icepack_init_orbit use icepack_intfc, only: icepack_init_bgc use icepack_intfc, only: icepack_init_ocean_bio, icepack_load_ocean_bio_array @@ -69,7 +69,7 @@ subroutine init_thermo_vertical !----------------------------------------------------------------- call icepack_query_parameters(depressT_out=depressT) - call icepack_init_thermo(sprofile=sprofile) + call icepack_init_salinity(sprofile=sprofile) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & file=__FILE__, line=__LINE__) diff --git a/configuration/driver/icedrv_restart.F90 b/configuration/driver/icedrv_restart.F90 index 4cedb5073..c9b076677 100644 --- a/configuration/driver/icedrv_restart.F90 +++ b/configuration/driver/icedrv_restart.F90 @@ -13,7 +13,7 @@ module icedrv_restart use icedrv_restart_shared, only: restart_format use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted use icepack_intfc, only: icepack_query_tracer_flags, icepack_query_tracer_indices - use icepack_intfc, only: icepack_query_parameters + use icepack_intfc, only: icepack_query_parameters, icepack_query_tracer_sizes use icedrv_system, only: icedrv_system_abort #ifdef USE_NETCDF use netcdf @@ -261,7 +261,6 @@ subroutine restartfile (ice_ic) use icedrv_restart_shared, only: restart_format use icedrv_arrays_column, only: dhsn, ffracn, hin_max use icedrv_arrays_column, only: first_ice, first_ice_real - use icepack_tracers, only: ntrcr, nbtrcr character (*), optional :: ice_ic @@ -270,6 +269,9 @@ subroutine restartfile (ice_ic) integer (kind=int_kind) :: & i, k ! counting indices + integer (kind=int_kind) :: & + ntrcr + integer (kind=int_kind) :: & nt_Tsfc, nt_sice, nt_qice, nt_qsno @@ -287,7 +289,7 @@ subroutine restartfile (ice_ic) ! Query tracers 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) - + 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_aero_out=tr_aero, tr_iso_out=tr_iso, & tr_brine_out=tr_brine, & @@ -415,20 +417,20 @@ subroutine restartfile (ice_ic) do i = 1, nx if (tmask(i)) & - call icepack_aggregate (aicen=aicen(i,:), & - trcrn=trcrn(i,:,:), & - vicen=vicen(i,:), & - vsnon=vsnon(i,:), & - aice=aice (i), & - trcr=trcr (i,:), & - vice=vice (i), & - vsno=vsno (i), & - aice0=aice0(i), & - trcr_depend=trcr_depend, & - trcr_base=trcr_base, & - n_trcr_strata=n_trcr_strata, & - nt_strata=nt_strata, & - Tf = Tf(i)) + call icepack_aggregate(trcrn=trcrn(i,1:ntrcr,:), & + aicen=aicen(i,:), & + vicen=vicen(i,:), & + vsnon=vsnon(i,:), & + trcr=trcr (i,1:ntrcr), & + aice=aice (i), & + vice=vice (i), & + vsno=vsno (i), & + aice0=aice0(i), & + trcr_depend=trcr_depend(1:ntrcr), & + trcr_base=trcr_base (1:ntrcr,:), & + n_trcr_strata=n_trcr_strata(1:ntrcr), & + nt_strata=nt_strata (1:ntrcr,:), & + Tf = Tf(i)) aice_init(i) = aice(i) enddo diff --git a/configuration/driver/icedrv_state.F90 b/configuration/driver/icedrv_state.F90 index 1a9ca66f5..74ae11f7e 100644 --- a/configuration/driver/icedrv_state.F90 +++ b/configuration/driver/icedrv_state.F90 @@ -42,14 +42,12 @@ module icedrv_state ! state of the ice aggregated over all categories !----------------------------------------------------------------- - real (kind=dbl_kind), dimension(nx), & - public :: & + real (kind=dbl_kind), dimension(nx), public :: & aice , & ! concentration of ice vice , & ! volume per unit area of ice (m) vsno ! volume per unit area of snow (m) - real (kind=dbl_kind), & - dimension(nx,max_ntrcr), public :: & + real (kind=dbl_kind), dimension(nx,max_ntrcr), public :: & trcr ! ice tracers ! 1: surface temperature of ice/snow (C) @@ -57,18 +55,15 @@ module icedrv_state ! state of the ice for each category !----------------------------------------------------------------- - real (kind=dbl_kind), dimension (nx), & - public:: & + real (kind=dbl_kind), dimension (nx), public:: & aice0 ! concentration of open water - real (kind=dbl_kind), & - dimension (nx,ncat), public :: & + real (kind=dbl_kind), dimension (nx,ncat), public :: & aicen , & ! concentration of ice vicen , & ! volume per unit area of ice (m) vsnon ! volume per unit area of snow (m) - real (kind=dbl_kind), public, & - dimension (nx,max_ntrcr,ncat) :: & + real (kind=dbl_kind), dimension (nx,max_ntrcr,ncat), public :: & trcrn ! tracers ! 1: surface temperature of ice/snow (C) diff --git a/configuration/driver/icedrv_step.F90 b/configuration/driver/icedrv_step.F90 index 0c4538c4d..f99d47e4c 100644 --- a/configuration/driver/icedrv_step.F90 +++ b/configuration/driver/icedrv_step.F90 @@ -600,19 +600,21 @@ subroutine update_state (dt, daidt, dvidt, dagedt, offset) ! Aggregate the updated state variables (includes ghost cells). !----------------------------------------------------------------- - if (tmask(i)) then - call icepack_aggregate ( & - aicen=aicen(i,:), trcrn=trcrn(i,1:ntrcr,:), & - vicen=vicen(i,:), vsnon=vsnon(i,:), & - aice =aice (i), trcr =trcr (i,1:ntrcr), & - vice =vice (i), vsno =vsno (i), & - aice0=aice0(i), & - trcr_depend=trcr_depend (1:ntrcr), & - trcr_base=trcr_base (1:ntrcr,:), & - n_trcr_strata=n_trcr_strata(1:ntrcr), & - nt_strata=nt_strata (1:ntrcr,:), & - Tf=Tf(i)) - endif + if (tmask(i)) & + call icepack_aggregate(trcrn=trcrn(i,1:ntrcr,:), & + aicen=aicen(i,:), & + vicen=vicen(i,:), & + vsnon=vsnon(i,:), & + trcr=trcr (i,1:ntrcr), & + aice=aice (i), & + vice=vice (i), & + vsno=vsno (i), & + aice0=aice0(i), & + trcr_depend=trcr_depend(1:ntrcr), & + trcr_base=trcr_base (1:ntrcr,:), & + n_trcr_strata=n_trcr_strata(1:ntrcr), & + nt_strata=nt_strata (1:ntrcr,:), & + Tf = Tf(i)) if (present(offset)) then diff --git a/configuration/scripts/machines/Macros.derecho_cray b/configuration/scripts/machines/Macros.derecho_cray index 1ead7f5c8..1e95da90c 100644 --- a/configuration/scripts/machines/Macros.derecho_cray +++ b/configuration/scripts/machines/Macros.derecho_cray @@ -14,7 +14,8 @@ FFLAGS_NOOPT:= -O0 ifeq ($(ICE_BLDDEBUG), true) FFLAGS += -O0 -hfp0 -g -Rbcdps -Ktrap=fp else - FFLAGS += -O2 -hfp0 # -eo + # -Rp is needed to work around SAME_TBS compiler bug in cce/16, cce/17 + FFLAGS += -O2 -hfp0 -Rp # -eo endif SCC := cc diff --git a/doc/source/icepack_index.rst b/doc/source/icepack_index.rst index bd5e89214..712d1d891 100755 --- a/doc/source/icepack_index.rst +++ b/doc/source/icepack_index.rst @@ -249,7 +249,7 @@ section :ref:`tabnamelist`. "kappav", "visible extinction coefficient in ice, wavelength\ :math:`<`\ 700nm", "1.4 m\ :math:`^{-1}`" "kcatbound", ":math:`\bullet` category boundary formula", "" "kg_to_g", "kg to g conversion factor", "1000." - "kice", "thermal conductivity of fresh ice (:cite:`Bitz99`)", "2.03 W/m/deg" + "kice", "thermal conductivity of fresh ice with BL99+MU71 (:cite:`Bitz99`)", "2.03 W/m/deg" "kitd", ":math:`\bullet` type of itd conversions (0 = delta function, 1 = linear remap)", "1" "krdg_partic", ":math:`\bullet` ridging participation function", "1" "krdg_redist", ":math:`\bullet` ridging redistribution function", "1" diff --git a/doc/source/user_guide/interfaces.include b/doc/source/user_guide/interfaces.include index 44aebada4..a18385378 100644 --- a/doc/source/user_guide/interfaces.include +++ b/doc/source/user_guide/interfaces.include @@ -81,26 +81,22 @@ icepack_init_hbrine ! Initialize brine height tracer - subroutine icepack_init_hbrine(bgrid, igrid, cgrid, & - icgrid, swgrid, nblyr, nilyr, phi_snow) + subroutine icepack_init_hbrine(bgrid_out, igrid_out, cgrid_out, & + icgrid_out, swgrid_out, phi_snow) - integer (kind=int_kind), intent(in) :: & - nilyr, & ! number of ice layers - nblyr ! number of bio layers - - real (kind=dbl_kind), intent(inout) :: & + real (kind=dbl_kind), optional, intent(inout) :: & phi_snow ! porosity at the ice-snow interface - real (kind=dbl_kind), dimension (nblyr+2), intent(out) :: & - bgrid ! biology nondimensional vertical grid points + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + bgrid_out ! biology nondimensional vertical grid points - real (kind=dbl_kind), dimension (nblyr+1), intent(out) :: & - igrid ! biology vertical interface points + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + igrid_out ! biology vertical interface points - real (kind=dbl_kind), dimension (nilyr+1), intent(out) :: & - cgrid , & ! CICE vertical coordinate - icgrid , & ! interface grid for CICE (shortwave variable) - swgrid ! grid for ice tracers used in dEdd scheme + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + cgrid_out , & ! CICE vertical coordinate + icgrid_out , & ! interface grid for CICE (shortwave variable) + swgrid_out ! grid for ice tracers used in dEdd scheme @@ -113,14 +109,8 @@ icepack_init_zsalinity ! **DEPRECATED**, all code removed ! Interface provided for backwards compatibility - subroutine icepack_init_zsalinity(nblyr,ntrcr_o, Rayleigh_criteria, & - Rayleigh_real, trcrn_bgc, nt_bgc_S, ncat, sss) - - integer (kind=int_kind), intent(in) :: & - nblyr , & ! number of biolayers - ntrcr_o, & ! number of non bio tracers - ncat , & ! number of categories - nt_bgc_S ! zsalinity index + subroutine icepack_init_zsalinity(Rayleigh_criteria, & + Rayleigh_real, trcrn_bgc, sss) logical (kind=log_kind), intent(inout) :: & Rayleigh_criteria @@ -151,16 +141,13 @@ icepack_init_fsd_bounds ! ! authors: Lettie Roach, NIWA/VUW and C. M. Bitz, UW - subroutine icepack_init_fsd_bounds(nfsd, & + subroutine icepack_init_fsd_bounds( & floe_rad_l, & ! fsd size lower bound in m (radius) floe_rad_c, & ! fsd size bin centre in m (radius) floe_binwidth, & ! fsd size bin width in m (radius) c_fsd_range, & ! string for history output write_diags ) ! flag for writing diagnostics - integer (kind=int_kind), intent(in) :: & - nfsd ! number of floe size categories - real(kind=dbl_kind), dimension(:), intent(inout) :: & floe_rad_l, & ! fsd size lower bound in m (radius) floe_rad_c, & ! fsd size bin centre in m (radius) @@ -185,14 +172,11 @@ icepack_init_fsd ! ! authors: Lettie Roach, NIWA/VUW - subroutine icepack_init_fsd(nfsd, ice_ic, & + subroutine icepack_init_fsd(ice_ic, & floe_rad_c, & ! fsd size bin centre in m (radius) floe_binwidth, & ! fsd size bin width in m (radius) afsd) ! floe size distribution tracer - integer(kind=int_kind), intent(in) :: & - nfsd - character(len=char_len_long), intent(in) :: & ice_ic ! method of ice cover initialization @@ -216,11 +200,7 @@ icepack_cleanup_fsd ! ! authors: Elizabeth Hunke, LANL ! - subroutine icepack_cleanup_fsd (ncat, nfsd, afsdn) - - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nfsd ! number of floe size categories + subroutine icepack_cleanup_fsd (afsdn) real (kind=dbl_kind), dimension(:,:), intent(inout) :: & afsdn ! floe size distribution tracer @@ -326,9 +306,12 @@ icepack_intfc.F90 use icepack_therm_shared , only: icepack_snow_temperature use icepack_therm_shared , only: icepack_liquidus_temperature use icepack_therm_shared , only: icepack_sea_freezing_temperature - use icepack_therm_shared , only: icepack_init_thermo + use icepack_therm_shared , only: icepack_init_salinity use icepack_therm_shared , only: icepack_salinity_profile - use icepack_therm_shared , only: icepack_init_trcr + use icepack_therm_shared , only: icepack_init_enthalpy + ! for backwards compatibilty, remove in the future + use icepack_therm_shared , only: icepack_init_thermo => icepack_init_salinity + use icepack_therm_shared , only: icepack_init_trcr => icepack_init_enthalpy use icepack_mushy_physics , only: icepack_enthalpy_snow use icepack_mushy_physics , only: icepack_enthalpy_mush @@ -358,10 +341,7 @@ icepack_init_itd ! authors: William H. Lipscomb and Elizabeth C. Hunke, LANL ! C. M. Bitz, UW - subroutine icepack_init_itd(ncat, hin_max) - - integer (kind=int_kind), intent(in) :: & - ncat ! number of thickness categories + subroutine icepack_init_itd(hin_max) real (kind=dbl_kind), intent(out) :: & hin_max(0:ncat) ! category limits (m) @@ -379,10 +359,7 @@ icepack_init_itd_hist ! authors: William H. Lipscomb and Elizabeth C. Hunke, LANL ! C. M. Bitz, UW - subroutine icepack_init_itd_hist (ncat, hin_max, c_hi_range) - - integer (kind=int_kind), intent(in) :: & - ncat ! number of thickness categories + subroutine icepack_init_itd_hist (hin_max, c_hi_range) real (kind=dbl_kind), intent(in) :: & hin_max(0:ncat) ! category limits (m) @@ -403,22 +380,16 @@ icepack_aggregate ! authors: C. M. Bitz, UW ! W. H. Lipscomb, LANL - subroutine icepack_aggregate (ncat, & - aicen, trcrn, & + subroutine icepack_aggregate(aicen, trcrn, & vicen, vsnon, & aice, trcr, & vice, vsno, & aice0, & - ntrcr, & trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, Tf) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - ntrcr ! number of tracers in use - real (kind=dbl_kind), dimension (:), intent(in) :: & aicen , & ! concentration of ice vicen , & ! volume per unit area of ice (m) @@ -475,15 +446,11 @@ icepack_ice_strength ! authors: William H. Lipscomb, LANL ! Elizabeth C. Hunke, LANL - subroutine icepack_ice_strength (ncat, & - aice, vice, & + subroutine icepack_ice_strength(aice, vice, & aice0, aicen, & vicen, & strength) - integer (kind=int_kind), intent(in) :: & - ncat ! number of thickness categories - real (kind=dbl_kind), intent(in) :: & aice , & ! concentration of ice vice , & ! volume per unit area of ice (m) @@ -509,10 +476,8 @@ icepack_step_ridge ! authors: William H. Lipscomb, LANL ! Elizabeth C. Hunke, LANL - subroutine icepack_step_ridge (dt, ndtd, & - nilyr, nslyr, & - nblyr, & - ncat, hin_max, & + subroutine icepack_step_ridge(dt, ndtd, & + hin_max, & rdg_conv, rdg_shear, & aicen, & trcrn, & @@ -524,7 +489,6 @@ icepack_step_ridge dvirdgdt, opening, & fpond, & fresh, fhocn, & - n_aero, & faero_ocn, fiso_ocn, & aparticn, krdgn, & aredistn, vredistn, & @@ -542,12 +506,7 @@ icepack_step_ridge Tf ! freezing temperature integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - ndtd , & ! number of dynamics supercycles - nblyr , & ! number of bio layers - nilyr , & ! number of ice layers - nslyr , & ! number of snow layers - n_aero ! number of aerosol tracers + ndtd ! number of dynamics supercycles real (kind=dbl_kind), dimension(0:ncat), intent(inout) :: & hin_max ! category limits (m) @@ -853,7 +812,7 @@ icepack_init_parameters zref_in, hs_min_in, snowpatch_in, rhosi_in, sk_l_in, & saltmax_in, phi_init_in, min_salin_in, salt_loss_in, & Tliquidus_max_in, & - min_bgc_in, dSin0_frazil_in, hi_ssl_in, hs_ssl_in, & + min_bgc_in, dSin0_frazil_in, hi_ssl_in, hs_ssl_in, hs_ssl_min_in, & awtvdr_in, awtidr_in, awtvdf_in, awtidf_in, & qqqice_in, TTTice_in, qqqocn_in, TTTocn_in, & ktherm_in, conduct_in, fbot_xfer_type_in, calc_Tsfc_in, dts_b_in, & @@ -864,17 +823,18 @@ icepack_init_parameters phi_i_mushy_in, shortwave_in, albedo_type_in, albsnowi_in, & albicev_in, albicei_in, albsnowv_in, & ahmax_in, R_ice_in, R_pnd_in, R_snw_in, dT_mlt_in, rsnw_mlt_in, & - kalg_in, kstrength_in, krdg_partic_in, krdg_redist_in, mu_rdg_in, & + kalg_in, R_gC2molC_in, kstrength_in, krdg_partic_in, krdg_redist_in, mu_rdg_in, & atmbndy_in, calc_strair_in, formdrag_in, highfreq_in, natmiter_in, & atmiter_conv_in, calc_dragio_in, & tfrz_option_in, kitd_in, kcatbound_in, hs0_in, frzpnd_in, & - saltflux_option_in, & + saltflux_option_in, congel_freeze_in, & floeshape_in, wave_spec_in, wave_spec_type_in, nfreq_in, & dpscale_in, rfracmin_in, rfracmax_in, pndaspect_in, hs1_in, hp1_in, & bgc_flux_type_in, z_tracers_in, scale_bgc_in, solve_zbgc_in, & - modal_aero_in, skl_bgc_in, solve_zsal_in, grid_o_in, l_sk_in, & + modal_aero_in, use_macromolecules_in, restartbgc_in, skl_bgc_in, & + solve_zsal_in, grid_o_in, l_sk_in, & initbio_frac_in, grid_oS_in, l_skS_in, dEdd_algae_in, & - phi_snow_in, T_max_in, fsal_in, & + phi_snow_in, T_max_in, fsal_in, use_atm_dust_iron_in, & 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, & @@ -886,7 +846,38 @@ icepack_init_parameters snwlvlfac_in, isnw_T_in, isnw_Tgrd_in, isnw_rhos_in, & snowage_rhos_in, snowage_Tgrd_in, snowage_T_in, & snowage_tau_in, snowage_kappa_in, snowage_drdt0_in, & - snw_aging_table_in, snw_ssp_table_in ) + snw_aging_table_in, snw_ssp_table_in, grid_o_t_in, tau_min_in, tau_max_in, & + f_don_protein_in, kn_bac_protein_in, f_don_Am_protein_in, & + ratio_Si2N_diatoms_in, & + ratio_Si2N_sp_in, ratio_Si2N_phaeo_in, ratio_S2N_diatoms_in, & + ratio_S2N_sp_in, ratio_S2N_phaeo_in, ratio_Fe2C_diatoms_in, & + ratio_Fe2C_sp_in, ratio_Fe2C_phaeo_in, ratio_Fe2N_diatoms_in, & + ratio_Fe2N_sp_in, ratio_Fe2N_phaeo_in, ratio_Fe2DON_in, & + ratio_Fe2DOC_s_in, ratio_Fe2DOC_l_in, & + chlabs_diatoms_in, chlabs_sp_in, chlabs_phaeo_in, alpha2max_low_diatoms_in, & + alpha2max_low_sp_in, alpha2max_low_phaeo_in, beta2max_diatoms_in, & + beta2max_sp_in, beta2max_phaeo_in, mu_max_diatoms_in, mu_max_sp_in, & + mu_max_phaeo_in, grow_Tdep_diatoms_in, grow_Tdep_sp_in, & + grow_Tdep_phaeo_in, fr_graze_diatoms_in, fr_graze_sp_in, & + fr_graze_phaeo_in, mort_pre_diatoms_in, mort_pre_sp_in, & + mort_pre_phaeo_in, mort_Tdep_diatoms_in, mort_Tdep_sp_in, & + mort_Tdep_phaeo_in, k_exude_diatoms_in, k_exude_sp_in, k_exude_phaeo_in, & + K_Nit_diatoms_in, K_Nit_sp_in, K_Nit_phaeo_in, & + K_Am_diatoms_in, K_Am_sp_in, K_Am_phaeo_in, & + K_Sil_diatoms_in, K_Sil_sp_in, K_Sil_phaeo_in, & + K_Fe_diatoms_in, K_Fe_sp_in, K_Fe_phaeo_in, & + f_doc_s_in, f_doc_l_in, f_exude_s_in, f_exude_l_in, & + k_bac_s_in, k_bac_l_in, algaltype_diatoms_in, & + algaltype_sp_in, algaltype_phaeo_in, nitratetype_in, & + ammoniumtype_in, silicatetype_in, dmspptype_in, & + dmspdtype_in, humtype_in, doctype_s_in, doctype_l_in, & + dictype_1_in, dontype_protein_in, fedtype_1_in, feptype_1_in, & + zaerotype_bc1_in, zaerotype_bc2_in, zaerotype_dust1_in, & + zaerotype_dust2_in, zaerotype_dust3_in, zaerotype_dust4_in, & + ratio_C2N_diatoms_in, ratio_C2N_sp_in, ratio_C2N_phaeo_in, & + ratio_chl2N_diatoms_in, ratio_chl2N_sp_in, ratio_chl2N_phaeo_in, & + F_abs_chl_diatoms_in, F_abs_chl_sp_in, F_abs_chl_phaeo_in, & + ratio_C2N_proteins_in ) !----------------------------------------------------------------- ! control settings @@ -978,15 +969,20 @@ icepack_init_parameters phi_i_mushy_in ! liquid fraction of congelation ice character(len=*), intent(in), optional :: & - tfrz_option_in ! form of ocean freezing temperature - ! 'minus1p8' = -1.8 C - ! 'linear_salt' = -depressT * sss - ! 'mushy' conforms with ktherm=2 + congel_freeze_in ! congelation computation + ! 'two-step' = original formulation + ! 'one-step' = Plante et al, The Cryosphere, 2024 character(len=*), intent(in), optional :: & - saltflux_option_in ! Salt flux computation - ! 'constant' reference value of ice_ref_salinity - ! 'prognostic' prognostic salt flux + tfrz_option_in ! form of ocean freezing temperature + ! 'minus1p8' = -1.8 C + ! 'linear_salt' = -depressT * sss + ! 'mushy' conforms with ktherm=2 + + character(len=*), intent(in), optional :: & + saltflux_option_in ! Salt flux computation + ! 'constant' reference value of ice_ref_salinity + ! 'prognostic' prognostic salt flux !----------------------------------------------------------------------- ! Parameters for radiation @@ -999,7 +995,8 @@ icepack_init_parameters stefan_boltzmann_in, & ! W/m^2/K^4 kappav_in, & ! vis extnctn coef in ice, wvlngth<700nm (1/m) hi_ssl_in, & ! ice surface scattering layer thickness (m) - hs_ssl_in, & ! visible, direct + hs_ssl_in, & ! snow surface scattering layer thickness (m) + hs_ssl_min_in, & ! minimum snow surface scattering layer thickness for aerosols (m) awtvdr_in, & ! visible, direct ! for history and awtidr_in, & ! near IR, direct ! diagnostics awtvdf_in, & ! visible, diffuse @@ -1026,7 +1023,8 @@ icepack_init_parameters dT_mlt_in , & ! change in temp for non-melt to melt snow grain ! radius change (C) rsnw_mlt_in , & ! maximum melting snow grain radius (10^-6 m) - kalg_in ! algae absorption coefficient for 0.5 m thick layer + kalg_in , & ! algae absorption coefficient for 0.5 m thick layer + R_gC2molC_in ! g carbon per mol logical (kind=log_kind), intent(in), optional :: & sw_redist_in ! redistribute shortwave @@ -1113,7 +1111,7 @@ icepack_init_parameters nfreq_in ! number of frequencies real (kind=dbl_kind), intent(in), optional :: & - floeshape_in ! constant from Steele (unitless) + floeshape_in ! constant from Rothrock 1984 (unitless) logical (kind=log_kind), intent(in), optional :: & wave_spec_in ! if true, use wave forcing @@ -1135,6 +1133,10 @@ icepack_init_parameters 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 + use_macromolecules_in, & ! if .true., ocean DOC is already split into + ! polysaccharid, lipid and protein fractions + use_atm_dust_iron_in, & ! if .true., compute iron contribution from dust + restartbgc_in, & conserv_check_in ! if .true., run conservation checks and abort if checks fail logical (kind=log_kind), intent(in), optional :: & @@ -1144,12 +1146,112 @@ icepack_init_parameters real (kind=dbl_kind), intent(in), optional :: & grid_o_in , & ! for bottom flux l_sk_in , & ! characteristic diffusive scale (zsalinity) (m) + grid_o_t_in , & ! top grid point length scale initbio_frac_in, & ! fraction of ocean tracer concentration used to initialize tracer phi_snow_in ! snow porosity at the ice/snow interface real (kind=dbl_kind), intent(in), optional :: & grid_oS_in , & ! for bottom flux (zsalinity) l_skS_in ! 0.02 characteristic skeletal layer thickness (m) (zsalinity) + + real (kind=dbl_kind), intent(in), optional :: & + ratio_Si2N_diatoms_in, & ! algal Si to N (mol/mol) + ratio_Si2N_sp_in , & + ratio_Si2N_phaeo_in , & + ratio_S2N_diatoms_in , & ! algal S to N (mol/mol) + ratio_S2N_sp_in , & + ratio_S2N_phaeo_in , & + ratio_Fe2C_diatoms_in, & ! algal Fe to C (umol/mol) + ratio_Fe2C_sp_in , & + ratio_Fe2C_phaeo_in , & + ratio_Fe2N_diatoms_in, & ! algal Fe to N (umol/mol) + ratio_Fe2N_sp_in , & + ratio_Fe2N_phaeo_in , & + ratio_Fe2DON_in , & ! Fe to N of DON (nmol/umol) + ratio_Fe2DOC_s_in , & ! Fe to C of DOC (nmol/umol) saccharids + ratio_Fe2DOC_l_in , & ! Fe to C of DOC (nmol/umol) lipids + tau_min_in , & ! rapid mobile to stationary exchanges (s) = 1.5 hours + tau_max_in , & ! long time mobile to stationary exchanges (s) = 2 days + chlabs_diatoms_in , & ! chl absorption (1/m/(mg/m^3)) + chlabs_sp_in , & ! + chlabs_phaeo_in , & ! + alpha2max_low_diatoms_in , & ! light limitation (1/(W/m^2)) + alpha2max_low_sp_in , & + alpha2max_low_phaeo_in , & + beta2max_diatoms_in , & ! light inhibition (1/(W/m^2)) + beta2max_sp_in , & + beta2max_phaeo_in , & + mu_max_diatoms_in , & ! maximum growth rate (1/day) + mu_max_sp_in , & + mu_max_phaeo_in , & + grow_Tdep_diatoms_in, & ! Temperature dependence of growth (1/C) + grow_Tdep_sp_in , & + grow_Tdep_phaeo_in , & + fr_graze_diatoms_in , & ! Fraction grazed + fr_graze_sp_in , & + fr_graze_phaeo_in , & + mort_pre_diatoms_in , & ! Mortality (1/day) + mort_pre_sp_in , & + mort_pre_phaeo_in , & + mort_Tdep_diatoms_in, & ! T dependence of mortality (1/C) + mort_Tdep_sp_in , & + mort_Tdep_phaeo_in , & + k_exude_diatoms_in , & ! algal exudation (1/d) + k_exude_sp_in , & + k_exude_phaeo_in , & + K_Nit_diatoms_in , & ! nitrate half saturation (mmol/m^3) + K_Nit_sp_in , & + K_Nit_phaeo_in , & + K_Am_diatoms_in , & ! ammonium half saturation (mmol/m^3) + K_Am_sp_in , & + K_Am_phaeo_in , & + K_Sil_diatoms_in , & ! silicate half saturation (mmol/m^3) + K_Sil_sp_in , & + K_Sil_phaeo_in , & + K_Fe_diatoms_in , & ! iron half saturation (nM) + K_Fe_sp_in , & + K_Fe_phaeo_in , & + f_don_protein_in , & ! fraction of spilled grazing to proteins + kn_bac_protein_in , & ! Bacterial degredation of DON (1/d) + f_don_Am_protein_in , & ! fraction of remineralized DON to ammonium + f_doc_s_in , & ! fraction of mortality to DOC + f_doc_l_in , & + f_exude_s_in , & ! fraction of exudation to DOC + f_exude_l_in , & + k_bac_s_in , & ! Bacterial degredation of DOC (1/d) + k_bac_l_in , & + algaltype_diatoms_in , & ! mobility type + algaltype_sp_in , & ! + algaltype_phaeo_in , & ! + nitratetype_in , & ! + ammoniumtype_in , & ! + silicatetype_in , & ! + dmspptype_in , & ! + dmspdtype_in , & ! + humtype_in , & ! + doctype_s_in , & ! + doctype_l_in , & ! + dictype_1_in , & ! + dontype_protein_in , & ! + fedtype_1_in , & ! + feptype_1_in , & ! + zaerotype_bc1_in , & ! + zaerotype_bc2_in , & ! + zaerotype_dust1_in , & ! + zaerotype_dust2_in , & ! + zaerotype_dust3_in , & ! + zaerotype_dust4_in , & ! + ratio_C2N_diatoms_in , & ! algal C to N ratio (mol/mol) + ratio_C2N_sp_in , & ! + ratio_C2N_phaeo_in , & ! + ratio_chl2N_diatoms_in, & ! algal chlorophyll to N ratio (mg/mmol) + ratio_chl2N_sp_in , & ! + ratio_chl2N_phaeo_in , & ! + F_abs_chl_diatoms_in , & ! scales absorbed radiation for dEdd + F_abs_chl_sp_in , & ! + F_abs_chl_phaeo_in , & ! + ratio_C2N_proteins_in ! ratio of C to N in proteins (mol/mol) + real (kind=dbl_kind), intent(in), optional :: & fr_resp_in , & ! fraction of algal growth lost due to respiration algal_vel_in , & ! 0.5 cm/d(m/s) Lavoie 2005 1.5 cm/day @@ -1269,7 +1371,7 @@ icepack_query_parameters zref_out, hs_min_out, snowpatch_out, rhosi_out, sk_l_out, & saltmax_out, phi_init_out, min_salin_out, salt_loss_out, & Tliquidus_max_out, & - min_bgc_out, dSin0_frazil_out, hi_ssl_out, hs_ssl_out, & + min_bgc_out, dSin0_frazil_out, hi_ssl_out, hs_ssl_out, hs_ssl_min_out, & awtvdr_out, awtidr_out, awtvdf_out, awtidf_out, cpl_frazil_out, & qqqice_out, TTTice_out, qqqocn_out, TTTocn_out, update_ocn_f_out, & Lfresh_out, cprho_out, Cp_out, ustar_min_out, hi_min_out, a_rapid_mode_out, & @@ -1279,15 +1381,16 @@ icepack_query_parameters albedo_type_out, albicev_out, albicei_out, albsnowv_out, & albsnowi_out, ahmax_out, R_ice_out, R_pnd_out, R_snw_out, dT_mlt_out, & rsnw_mlt_out, dEdd_algae_out, & - kalg_out, kstrength_out, krdg_partic_out, krdg_redist_out, mu_rdg_out, & + kalg_out, R_gC2molC_out, kstrength_out, krdg_partic_out, krdg_redist_out, mu_rdg_out, & atmbndy_out, calc_strair_out, formdrag_out, highfreq_out, natmiter_out, & atmiter_conv_out, calc_dragio_out, & tfrz_option_out, kitd_out, kcatbound_out, hs0_out, frzpnd_out, & - saltflux_option_out, & + saltflux_option_out, congel_freeze_out, & floeshape_out, wave_spec_out, wave_spec_type_out, nfreq_out, & dpscale_out, rfracmin_out, rfracmax_out, pndaspect_out, hs1_out, hp1_out, & 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, & + modal_aero_out, use_macromolecules_out, restartbgc_out, use_atm_dust_iron_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, conserv_check_out, & fr_resp_out, algal_vel_out, R_dFe2dust_out, dustFe_sol_out, & @@ -1301,7 +1404,37 @@ icepack_query_parameters snwlvlfac_out, isnw_T_out, isnw_Tgrd_out, isnw_rhos_out, & snowage_rhos_out, snowage_Tgrd_out, snowage_T_out, & snowage_tau_out, snowage_kappa_out, snowage_drdt0_out, & - snw_aging_table_out, snw_ssp_table_out ) + snw_aging_table_out, snw_ssp_table_out, ratio_Si2N_diatoms_out, & + ratio_Si2N_sp_out, ratio_Si2N_phaeo_out, ratio_S2N_diatoms_out, & + ratio_S2N_sp_out, ratio_S2N_phaeo_out, ratio_Fe2C_diatoms_out, & + ratio_Fe2C_sp_out, ratio_Fe2C_phaeo_out, ratio_Fe2N_diatoms_out, & + ratio_Fe2N_sp_out, ratio_Fe2N_phaeo_out, ratio_Fe2DON_out, & + ratio_Fe2DOC_s_out, ratio_Fe2DOC_l_out, grid_o_t_out, tau_min_out, tau_max_out, & + chlabs_diatoms_out, chlabs_sp_out, chlabs_phaeo_out, alpha2max_low_diatoms_out, & + alpha2max_low_sp_out, alpha2max_low_phaeo_out, beta2max_diatoms_out, & + beta2max_sp_out, beta2max_phaeo_out, mu_max_diatoms_out, mu_max_sp_out, & + mu_max_phaeo_out, grow_Tdep_diatoms_out, grow_Tdep_sp_out, & + grow_Tdep_phaeo_out, fr_graze_diatoms_out, fr_graze_sp_out, & + fr_graze_phaeo_out, mort_pre_diatoms_out, mort_pre_sp_out, & + mort_pre_phaeo_out, mort_Tdep_diatoms_out, mort_Tdep_sp_out, & + mort_Tdep_phaeo_out, k_exude_diatoms_out, k_exude_sp_out, k_exude_phaeo_out, & + K_Nit_diatoms_out, K_Nit_sp_out, K_Nit_phaeo_out, & + K_Am_diatoms_out, K_Am_sp_out, K_Am_phaeo_out, & + K_Sil_diatoms_out, K_Sil_sp_out, K_Sil_phaeo_out, & + K_Fe_diatoms_out, K_Fe_sp_out, K_Fe_phaeo_out, & + f_don_protein_out, kn_bac_protein_out, f_don_Am_protein_out, & + f_doc_s_out, f_doc_l_out, f_exude_s_out, f_exude_l_out, & + k_bac_s_out, k_bac_l_out, algaltype_diatoms_out, & + algaltype_sp_out, algaltype_phaeo_out, nitratetype_out, & + ammoniumtype_out, silicatetype_out, dmspptype_out, & + dmspdtype_out, humtype_out, doctype_s_out, doctype_l_out, & + dictype_1_out, dontype_protein_out, fedtype_1_out, feptype_1_out, & + zaerotype_bc1_out, zaerotype_bc2_out, zaerotype_dust1_out, & + zaerotype_dust2_out, zaerotype_dust3_out, zaerotype_dust4_out, & + ratio_C2N_diatoms_out, ratio_C2N_sp_out, ratio_C2N_phaeo_out, & + ratio_chl2N_diatoms_out, ratio_chl2N_sp_out, ratio_chl2N_phaeo_out, & + F_abs_chl_diatoms_out, F_abs_chl_sp_out, F_abs_chl_phaeo_out, & + ratio_C2N_proteins_out ) !----------------------------------------------------------------- ! control settings @@ -1402,16 +1535,21 @@ icepack_query_parameters phi_i_mushy_out ! liquid fraction of congelation ice character(len=*), intent(out), optional :: & - tfrz_option_out ! form of ocean freezing temperature - ! 'minus1p8' = -1.8 C - ! 'constant' = Tocnfrz - ! 'linear_salt' = -depressT * sss - ! 'mushy' conforms with ktherm=2 + congel_freeze_out ! congelation computation + ! 'two-step' = original formulation + ! 'one-step' = Plante et al, The Cryosphere, 2024 + + character(len=*), intent(out), optional :: & + tfrz_option_out ! form of ocean freezing temperature + ! 'minus1p8' = -1.8 C + ! 'constant' = Tocnfrz + ! 'linear_salt' = -depressT * sss + ! 'mushy' conforms with ktherm=2 character(len=*), intent(out), optional :: & - saltflux_option_out ! Salt flux computation - ! 'constant' reference value of ice_ref_salinity - ! 'prognostic' prognostic salt flux + saltflux_option_out ! Salt flux computation + ! 'constant' reference value of ice_ref_salinity + ! 'prognostic' prognostic salt flux !----------------------------------------------------------------------- @@ -1425,7 +1563,8 @@ icepack_query_parameters stefan_boltzmann_out, & ! W/m^2/K^4 kappav_out, & ! vis extnctn coef in ice, wvlngth<700nm (1/m) hi_ssl_out, & ! ice surface scattering layer thickness (m) - hs_ssl_out, & ! visible, direct + hs_ssl_out, & ! snow surface scattering layer thickness (m) + hs_ssl_min_out, & ! minimum snow surface scattering layer thickness for aerosols (m) awtvdr_out, & ! visible, direct ! for history and awtidr_out, & ! near IR, direct ! diagnostics awtvdf_out, & ! visible, diffuse @@ -1452,7 +1591,8 @@ icepack_query_parameters dT_mlt_out , & ! change in temp for non-melt to melt snow grain ! radius change (C) rsnw_mlt_out , & ! maximum melting snow grain radius (10^-6 m) - kalg_out ! algae absorption coefficient for 0.5 m thick layer + kalg_out , & ! algae absorption coefficient for 0.5 m thick layer + R_gC2molC_out ! grams carbon per mol logical (kind=log_kind), intent(out), optional :: & sw_redist_out ! redistribute shortwave @@ -1539,7 +1679,7 @@ icepack_query_parameters nfreq_out ! number of frequencies real (kind=dbl_kind), intent(out), optional :: & - floeshape_out ! constant from Steele (unitless) + floeshape_out ! constant from Rothrock 1984 (unitless) logical (kind=log_kind), intent(out), optional :: & wave_spec_out ! if true, use wave forcing @@ -1561,6 +1701,10 @@ icepack_query_parameters 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 + use_macromolecules_out, & ! if .true., ocean DOC is already split + ! into polysaccharid, lipid and protein fractions + use_atm_dust_iron_out, & ! if .true., compute iron contribution from dust + restartbgc_out, & conserv_check_out ! if .true., run conservation checks and abort if checks fail logical (kind=log_kind), intent(out), optional :: & @@ -1570,12 +1714,112 @@ icepack_query_parameters real (kind=dbl_kind), intent(out), optional :: & grid_o_out , & ! for bottom flux l_sk_out , & ! characteristic diffusive scale (zsalinity) (m) + grid_o_t_out , & ! top grid point length scale initbio_frac_out, & ! fraction of ocean tracer concentration used to initialize tracer phi_snow_out ! snow porosity at the ice/snow interface real (kind=dbl_kind), intent(out), optional :: & grid_oS_out , & ! for bottom flux (zsalinity) l_skS_out ! 0.02 characteristic skeletal layer thickness (m) (zsalinity) + + real (kind=dbl_kind), intent(out), optional :: & + ratio_Si2N_diatoms_out, & ! algal Si to N (mol/mol) + ratio_Si2N_sp_out , & + ratio_Si2N_phaeo_out , & + ratio_S2N_diatoms_out , & ! algal S to N (mol/mol) + ratio_S2N_sp_out , & + ratio_S2N_phaeo_out , & + ratio_Fe2C_diatoms_out, & ! algal Fe to C (umol/mol) + ratio_Fe2C_sp_out , & + ratio_Fe2C_phaeo_out , & + ratio_Fe2N_diatoms_out, & ! algal Fe to N (umol/mol) + ratio_Fe2N_sp_out , & + ratio_Fe2N_phaeo_out , & + ratio_Fe2DON_out , & ! Fe to N of DON (nmol/umol) + ratio_Fe2DOC_s_out , & ! Fe to C of DOC (nmol/umol) saccharids + ratio_Fe2DOC_l_out , & ! Fe to C of DOC (nmol/umol) lipids + tau_min_out , & ! rapid mobile to stationary exchanges (s) = 1.5 hours + tau_max_out , & ! long time mobile to stationary exchanges (s) = 2 days + chlabs_diatoms_out , & ! chl absorption (1/m/(mg/m^3)) + chlabs_sp_out , & ! + chlabs_phaeo_out , & ! + alpha2max_low_diatoms_out , & ! light limitation (1/(W/m^2)) + alpha2max_low_sp_out , & + alpha2max_low_phaeo_out , & + beta2max_diatoms_out , & ! light inhibition (1/(W/m^2)) + beta2max_sp_out , & + beta2max_phaeo_out , & + mu_max_diatoms_out , & ! maximum growth rate (1/day) + mu_max_sp_out , & + mu_max_phaeo_out , & + grow_Tdep_diatoms_out, & ! Temperature dependence of growth (1/C) + grow_Tdep_sp_out , & + grow_Tdep_phaeo_out , & + fr_graze_diatoms_out , & ! Fraction grazed + fr_graze_sp_out , & + fr_graze_phaeo_out , & + mort_pre_diatoms_out , & ! Mortality (1/day) + mort_pre_sp_out , & + mort_pre_phaeo_out , & + mort_Tdep_diatoms_out, & ! T dependence of mortality (1/C) + mort_Tdep_sp_out , & + mort_Tdep_phaeo_out , & + k_exude_diatoms_out , & ! algal exudation (1/d) + k_exude_sp_out , & + k_exude_phaeo_out , & + K_Nit_diatoms_out , & ! nitrate half saturation (mmol/m^3) + K_Nit_sp_out , & + K_Nit_phaeo_out , & + K_Am_diatoms_out , & ! ammonium half saturation (mmol/m^3) + K_Am_sp_out , & + K_Am_phaeo_out , & + K_Sil_diatoms_out , & ! silicate half saturation (mmol/m^3) + K_Sil_sp_out , & + K_Sil_phaeo_out , & + K_Fe_diatoms_out , & ! iron half saturation (nM) + K_Fe_sp_out , & + K_Fe_phaeo_out , & + f_don_protein_out , & ! fraction of spilled grazing to proteins + kn_bac_protein_out , & ! Bacterial degredation of DON (1/d) + f_don_Am_protein_out , & ! fraction of remineralized DON to ammonium + f_doc_s_out , & ! fraction of mortality to DOC + f_doc_l_out , & + f_exude_s_out , & ! fraction of exudation to DOC + f_exude_l_out , & + k_bac_s_out , & ! Bacterial degredation of DOC (1/d) + k_bac_l_out , & + algaltype_diatoms_out , & ! mobility type + algaltype_sp_out , & ! + algaltype_phaeo_out , & ! + nitratetype_out , & ! + ammoniumtype_out , & ! + silicatetype_out , & ! + dmspptype_out , & ! + dmspdtype_out , & ! + humtype_out , & ! + doctype_s_out , & ! + doctype_l_out , & ! + dictype_1_out , & ! + dontype_protein_out , & ! + fedtype_1_out , & ! + feptype_1_out , & ! + zaerotype_bc1_out , & ! + zaerotype_bc2_out , & ! + zaerotype_dust1_out , & ! + zaerotype_dust2_out , & ! + zaerotype_dust3_out , & ! + zaerotype_dust4_out , & ! + ratio_C2N_diatoms_out , & ! algal C to N ratio (mol/mol) + ratio_C2N_sp_out , & ! + ratio_C2N_phaeo_out , & ! + ratio_chl2N_diatoms_out, & ! algal chlorophyll to N ratio (mg/mmol) + ratio_chl2N_sp_out , & ! + ratio_chl2N_phaeo_out , & ! + F_abs_chl_diatoms_out , & ! scales absorbed radiation for dEdd + F_abs_chl_sp_out , & ! + F_abs_chl_phaeo_out , & ! + ratio_C2N_proteins_out ! ratio of C to N in proteins (mol/mol) + real (kind=dbl_kind), intent(out), optional :: & fr_resp_out , & ! fraction of algal growth lost due to respiration algal_vel_out , & ! 0.5 cm/d(m/s) Lavoie 2005 1.5 cm/day @@ -1785,7 +2029,6 @@ icepack_step_radiation ! Elizabeth C. Hunke, LANL subroutine icepack_step_radiation (dt, & - swgrid, igrid, & fbri, & aicen, vicen, & vsnon, Tsfcn, & @@ -1847,12 +2090,6 @@ icepack_step_radiation real (kind=dbl_kind), intent(inout) :: & coszen ! cosine solar zenith angle, < 0 for sun below horizon - real (kind=dbl_kind), dimension (:), intent(in) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (:), intent(in) :: & - swgrid ! grid for ice tracers used in dEdd scheme - real (kind=dbl_kind), dimension(:), intent(in) :: & aicen , & ! ice area fraction in each category vicen , & ! ice volume in each category (m) @@ -1940,8 +2177,7 @@ icepack_step_snow ! authors: Elizabeth C. Hunke, LANL ! Nicole Jeffery, LANL - subroutine icepack_step_snow(dt, nilyr, & - nslyr, ncat, & + subroutine icepack_step_snow(dt, & wind, aice, & aicen, vicen, & vsnon, Tsfc, & @@ -1953,11 +2189,6 @@ icepack_step_snow fresh, fhocn, & fsloss, fsnow) - integer (kind=int_kind), intent(in) :: & - nslyr, & ! number of snow layers - nilyr, & ! number of ice layers - ncat ! number of thickness categories - real (kind=dbl_kind), intent(in) :: & dt , & ! time step wind , & ! wind speed (m/s) @@ -2005,9 +2236,7 @@ icepack_step_therm2 ! authors: William H. Lipscomb, LANL ! Elizabeth C. Hunke, LANL - subroutine icepack_step_therm2 (dt, ncat, nltrcr, & - nilyr, nslyr, & - hin_max, nblyr, & + subroutine icepack_step_therm2(dt, hin_max, & aicen, & vicen, vsnon, & aicen_init, vicen_init, & @@ -2024,15 +2253,14 @@ icepack_step_therm2 frain, fpond, & fresh, fsalt, & fhocn, update_ocn_f, & - bgrid, cgrid, & - igrid, faero_ocn, & + faero_ocn, & first_ice, fzsal, & flux_bio, ocean_bio, & frazil_diag, & frz_onset, yday, & fiso_ocn, HDO_ocn, & H2_16O_ocn, H2_18O_ocn, & - nfsd, wave_sig_ht, & + wave_sig_ht, & wave_spectrum, & wavefreq, & dwavefreq, & @@ -2042,16 +2270,6 @@ icepack_step_therm2 use icepack_parameters, only: icepack_init_parameters - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nltrcr , & ! number of zbgc tracers - nblyr , & ! number of bio layers - nilyr , & ! number of ice layers - nslyr ! number of snow layers - - integer (kind=int_kind), intent(in), optional :: & - nfsd ! number of floe size categories - logical (kind=log_kind), intent(in), optional :: & update_ocn_f ! if true, update fresh water and salt fluxes @@ -2076,15 +2294,6 @@ icepack_step_therm2 integer (kind=int_kind), dimension (:,:), intent(in) :: & nt_strata ! indices of underlying tracer layers - real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - bgrid ! biology nondimensional vertical grid points - - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: & - cgrid ! CICE vertical coordinate - real (kind=dbl_kind), dimension(:), intent(in) :: & salinz , & ! initial salinity profile ocean_bio ! ocean concentration of biological tracer @@ -2164,21 +2373,19 @@ icepack_step_therm2 icepack_therm_shared.F90 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. _icepack_init_thermo: +.. _icepack_init_salinity: -icepack_init_thermo +icepack_init_salinity ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: fortran - ! Initialize the vertical profile of ice salinity and melting temperature. + ! Initialize the vertical profile of ice salinity. + ! This subroutine was renamed from icepack_init_thermo in Oct 2024 ! ! authors: C. M. Bitz, UW ! William H. Lipscomb, LANL - subroutine icepack_init_thermo(nilyr, sprofile) - - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers + subroutine icepack_init_salinity(sprofile) real (kind=dbl_kind), dimension(:), intent(out) :: & sprofile ! vertical salinity profile @@ -2206,23 +2413,19 @@ icepack_salinity_profile -.. _icepack_init_trcr: +.. _icepack_init_enthalpy: -icepack_init_trcr +icepack_init_enthalpy ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: fortran + ! This subroutine was renamed from icepack_init_trcr in Oct 2024 ! - subroutine icepack_init_trcr(Tair, Tf, & + subroutine icepack_init_enthalpy(Tair, Tf, & Sprofile, Tprofile, & Tsfc, & - nilyr, nslyr, & qin, qsn) - integer (kind=int_kind), intent(in) :: & - nilyr, & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & Tair, & ! air temperature (K) Tf ! freezing temperature (C) @@ -2315,7 +2518,7 @@ icepack_step_therm1 ! authors: William H. Lipscomb, LANL ! Elizabeth C. Hunke, LANL - subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & + subroutine icepack_step_therm1(dt, & aicen_init , & vicen_init , vsnon_init , & aice , aicen , & @@ -2404,11 +2607,6 @@ icepack_step_therm1 yday , prescribed_ice, & zlvs) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & dt , & ! time step uvel , & ! x-component of velocity (m/s) @@ -3027,15 +3225,12 @@ icepack_compute_tracers ! Compute tracer fields. ! Given atrcrn = aicen*trcrn (or vicen*trcrn, vsnon*trcrn), compute trcrn. - subroutine icepack_compute_tracers (ntrcr, trcr_depend, & + subroutine icepack_compute_tracers (trcr_depend, & atrcrn, aicen, & vicen, vsnon, & trcr_base, n_trcr_strata, & nt_strata, trcrn, Tf) - integer (kind=int_kind), intent(in) :: & - ntrcr ! number of tracers in use - integer (kind=int_kind), dimension (ntrcr), intent(in) :: & trcr_depend, & ! = 0 for aicen tracers, 1 for vicen, 2 for vsnon n_trcr_strata ! number of underlying tracer layers @@ -3177,8 +3372,7 @@ icepack_step_wavefracture ! authors: 2018 Lettie Roach, NIWA/VUW ! subroutine icepack_step_wavefracture(wave_spec_type, & - dt, ncat, nfsd, & - nfreq, & + dt, nfreq, & aice, vice, aicen, & floe_rad_l, floe_rad_c, & wave_spectrum, wavefreq, dwavefreq, & @@ -3186,12 +3380,10 @@ icepack_step_wavefracture character (len=char_len), intent(in) :: & - wave_spec_type ! type of wave spectrum forcing + wave_spec_type ! type of wave spectrum forcing integer (kind=int_kind), intent(in) :: & - nfreq, & ! number of wave frequency categories - ncat, & ! number of thickness categories - nfsd ! number of floe size categories + nfreq ! number of wave frequency categories real (kind=dbl_kind), intent(in) :: & dt, & ! time step @@ -3234,23 +3426,8 @@ icepack_init_bgc .. code-block:: fortran ! - subroutine icepack_init_bgc(ncat, nblyr, nilyr, ntrcr_o, & - cgrid, igrid, ntrcr, nbtrcr, & - sicen, trcrn, sss, ocean_bio_all) - - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nblyr , & ! number of bio layers - ntrcr_o,& ! number of tracers not including bgc - ntrcr , & ! number of tracers in use - nbtrcr ! number of bio tracers in use - - real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), intent(inout) :: & - cgrid ! CICE vertical coordinate + subroutine icepack_init_bgc( & + sicen, trcrn, sss, ocean_bio_all, DOCPoolFractions) real (kind=dbl_kind), dimension(nilyr, ncat), intent(in) :: & sicen ! salinity on the cice grid @@ -3261,9 +3438,12 @@ icepack_init_bgc real (kind=dbl_kind), intent(in) :: & sss ! sea surface salinity (ppt) - real (kind=dbl_kind), dimension (:), intent(inout) :: & + real (kind=dbl_kind), dimension (:), intent(in) :: & ocean_bio_all ! fixed order, all values even for tracers false + real (kind=dbl_kind), dimension (:), optional, intent(out) :: & + DOCPoolFractions ! Fraction of DOC in polysacharids, lipids, and proteins + .. _icepack_init_zbgc: @@ -3274,76 +3454,14 @@ icepack_init_zbgc ! - subroutine icepack_init_zbgc ( & - R_Si2N_in, R_S2N_in, R_Fe2C_in, R_Fe2N_in, R_C2N_in, R_C2N_DON_in, & - R_chl2N_in, F_abs_chl_in, R_Fe2DON_in, R_Fe2DOC_in, chlabs_in, & - alpha2max_low_in, beta2max_in, mu_max_in, fr_graze_in, mort_pre_in, & - mort_Tdep_in, k_exude_in, K_Nit_in, K_Am_in, K_sil_in, K_Fe_in, & - f_don_in, kn_bac_in, f_don_Am_in, f_doc_in, f_exude_in, k_bac_in, & - grow_Tdep_in, zbgc_frac_init_in, & - zbgc_init_frac_in, tau_ret_in, tau_rel_in, bgc_tracer_type_in, & - fr_resp_in, algal_vel_in, R_dFe2dust_in, dustFe_sol_in, T_max_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, y_sk_DMS_in, t_sk_conv_in, t_sk_ox_in, fsal_in) - - real (kind=dbl_kind), optional :: R_C2N_in(:) ! algal C to N (mole/mole) - real (kind=dbl_kind), optional :: R_chl2N_in(:) ! 3 algal chlorophyll to N (mg/mmol) - real (kind=dbl_kind), optional :: F_abs_chl_in(:) ! to scale absorption in Dedd - real (kind=dbl_kind), optional :: R_C2N_DON_in(:) ! increase compare to algal R_Fe2C - real (kind=dbl_kind), optional :: R_Si2N_in(:) ! algal Sil to N (mole/mole) - real (kind=dbl_kind), optional :: R_S2N_in(:) ! algal S to N (mole/mole) - real (kind=dbl_kind), optional :: R_Fe2C_in(:) ! algal Fe to carbon (umol/mmol) - real (kind=dbl_kind), optional :: R_Fe2N_in(:) ! algal Fe to N (umol/mmol) - real (kind=dbl_kind), optional :: R_Fe2DON_in(:) ! Fe to N of DON (nmol/umol) - real (kind=dbl_kind), optional :: R_Fe2DOC_in(:) ! Fe to C of DOC (nmol/umol) - - real (kind=dbl_kind), optional :: fr_resp_in ! frac of algal growth lost due to respiration - real (kind=dbl_kind), optional :: algal_vel_in ! 0.5 cm/d(m/s) Lavoie 2005 1.5 cm/day - real (kind=dbl_kind), optional :: R_dFe2dust_in ! g/g (3.5% content) Tagliabue 2009 - real (kind=dbl_kind), optional :: dustFe_sol_in ! solubility fraction - real (kind=dbl_kind), optional :: T_max_in ! maximum temperature (C) - real (kind=dbl_kind), optional :: op_dep_min_in ! Light attenuates for optical depths exceeding min - real (kind=dbl_kind), optional :: fr_graze_s_in ! fraction of grazing spilled or slopped - real (kind=dbl_kind), optional :: fr_graze_e_in ! fraction of assimilation excreted - real (kind=dbl_kind), optional :: fr_mort2min_in ! fractionation of mortality to Am - real (kind=dbl_kind), optional :: fr_dFe_in ! fraction of remineralized nitrogen - ! (in units of algal iron) - real (kind=dbl_kind), optional :: k_nitrif_in ! nitrification rate (1/day) - real (kind=dbl_kind), optional :: t_iron_conv_in ! desorption loss pFe to dFe (day) - real (kind=dbl_kind), optional :: max_loss_in ! restrict uptake to % of remaining value - real (kind=dbl_kind), optional :: max_dfe_doc1_in ! max ratio of dFe to saccharides in the ice (nM Fe/muM C) - real (kind=dbl_kind), optional :: fr_resp_s_in ! DMSPd fraction of respiration loss as DMSPd - real (kind=dbl_kind), optional :: y_sk_DMS_in ! fraction conversion given high yield - real (kind=dbl_kind), optional :: t_sk_conv_in ! Stefels conversion time (d) - real (kind=dbl_kind), optional :: t_sk_ox_in ! DMS oxidation time (d) - real (kind=dbl_kind), optional :: fsal_in ! salinity limitation factor (1) - - real (kind=dbl_kind), optional :: chlabs_in(:) ! chla absorption 1/m/(mg/m^3) - real (kind=dbl_kind), optional :: alpha2max_low_in(:) ! light limitation (1/(W/m^2)) - real (kind=dbl_kind), optional :: beta2max_in(:) ! light inhibition (1/(W/m^2)) - real (kind=dbl_kind), optional :: mu_max_in(:) ! maximum growth rate (1/d) - real (kind=dbl_kind), optional :: grow_Tdep_in(:) ! T dependence of growth (1/C) - real (kind=dbl_kind), optional :: fr_graze_in(:) ! fraction of algae grazed - real (kind=dbl_kind), optional :: mort_pre_in(:) ! mortality (1/day) - real (kind=dbl_kind), optional :: mort_Tdep_in(:) ! T dependence of mortality (1/C) - real (kind=dbl_kind), optional :: k_exude_in(:) ! algal carbon exudation rate (1/d) - real (kind=dbl_kind), optional :: K_Nit_in(:) ! nitrate half saturation (mmol/m^3) - real (kind=dbl_kind), optional :: K_Am_in(:) ! ammonium half saturation (mmol/m^3) - real (kind=dbl_kind), optional :: K_Sil_in(:) ! silicon half saturation (mmol/m^3) - real (kind=dbl_kind), optional :: K_Fe_in(:) ! iron half saturation or micromol/m^3 - real (kind=dbl_kind), optional :: f_don_in(:) ! fraction of spilled grazing to DON - real (kind=dbl_kind), optional :: kn_bac_in(:) ! Bacterial degredation of DON (1/d) - real (kind=dbl_kind), optional :: f_don_Am_in(:) ! fraction of remineralized DON to Am - real (kind=dbl_kind), optional :: f_doc_in(:) ! fraction of mort_N that goes to each doc pool - real (kind=dbl_kind), optional :: f_exude_in(:) ! fraction of exuded carbon to each DOC pool - real (kind=dbl_kind), optional :: k_bac_in(:) ! Bacterial degredation of DOC (1/d) - - real (kind=dbl_kind), optional :: zbgc_frac_init_in(:) ! initializes mobile fraction - real (kind=dbl_kind), optional :: bgc_tracer_type_in(:) ! described tracer in mobile or stationary phases - real (kind=dbl_kind), optional :: zbgc_init_frac_in(:) ! fraction of ocean tracer concentration in new ice - real (kind=dbl_kind), optional :: tau_ret_in(:) ! retention timescale (s), mobile to stationary phase - real (kind=dbl_kind), optional :: tau_rel_in(:) ! release timescale (s), stationary to mobile phase + subroutine icepack_init_zbgc (& + zbgc_frac_init_in, zbgc_init_frac_in, tau_ret_in, tau_rel_in, bgc_tracer_type_in) + + real (kind=dbl_kind), dimension (:), intent(in), optional :: zbgc_frac_init_in(:) ! initializes mobile fraction + real (kind=dbl_kind), dimension (:), intent(in), optional :: bgc_tracer_type_in(:) ! described tracer in mobile or stationary phases + real (kind=dbl_kind), dimension (:), intent(in), optional :: zbgc_init_frac_in(:) ! fraction of ocean tracer concentration in new ice + real (kind=dbl_kind), dimension (:), intent(in), optional :: tau_ret_in(:) ! retention timescale (s), mobile to stationary phase + real (kind=dbl_kind), dimension (:), intent(in), optional :: tau_rel_in(:) ! release timescale (s), stationary to mobile phase @@ -3354,54 +3472,40 @@ icepack_biogeochemistry .. code-block:: fortran ! - subroutine icepack_biogeochemistry(dt, & - ntrcr, nbtrcr, & upNO, upNH, iDi, iki, zfswin, & - zsal_tot, darcy_V, grow_net, & + darcy_V, grow_net, & PP_net, hbri,dhbr_bot, dhbr_top, Zoo,& - fbio_snoice, fbio_atmice, ocean_bio, & + fbio_snoice, fbio_atmice, ocean_bio_dh, ocean_bio, & first_ice, fswpenln, bphi, bTiz, ice_bio_net, & - snow_bio_net, fswthrun, Rayleigh_criteria, & - sice_rho, fzsal, fzsal_g, & - bgrid, igrid, icgrid, cgrid, & - nblyr, nilyr, nslyr, n_algae, n_zaero, ncat, & - n_doc, n_dic, n_don, n_fed, n_fep, & + snow_bio_net, totalChla, fswthrun, & meltbn, melttn, congeln, snoicen, & - sst, sss, fsnow, meltsn, & + sst, sss, Tf, fsnow, meltsn, & !hmix, & hin_old, flux_bio, flux_bio_atm, & aicen_init, vicen_init, aicen, vicen, vsnon, & - aice0, trcrn, vsnon_init, skl_bgc) + aice0, trcrn, vsnon_init, & + flux_bion, bioPorosityIceCell, & + bioSalinityIceCell, bioTemperatureIceCell) real (kind=dbl_kind), intent(in) :: & dt ! time step - integer (kind=int_kind), intent(in) :: & - ncat, & - nilyr, & - nslyr, & - nblyr, & - ntrcr, & - nbtrcr, & - n_algae, n_zaero, & - n_doc, n_dic, n_don, n_fed, n_fep - real (kind=dbl_kind), dimension (:), intent(inout) :: & - bgrid , & ! biology nondimensional vertical grid points - igrid , & ! biology vertical interface points - cgrid , & ! CICE vertical coordinate - icgrid , & ! interface grid for CICE (shortwave variable) - ocean_bio , & ! contains all the ocean bgc tracer concentrations fbio_snoice , & ! fluxes from snow to ice fbio_atmice , & ! fluxes from atm to ice dhbr_top , & ! brine top change dhbr_bot , & ! brine bottom change darcy_V , & ! darcy velocity positive up (m/s) hin_old , & ! old ice thickness - sice_rho , & ! avg sea ice density (kg/m^3) ice_bio_net , & ! depth integrated tracer (mmol/m^2) snow_bio_net , & ! depth integrated snow tracer (mmol/m^2) - flux_bio ! all bio fluxes to ocean + flux_bio ! all bio fluxes to ocean + + real (kind=dbl_kind), dimension (:), intent(in) :: & + ocean_bio ! contains the ocean bgc tracer concentrations in use (mmol/m^3) + + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + ocean_bio_dh ! The ocean bgc tracer concentrations in use * brine thickness * phi (mmol/m^2) logical (kind=log_kind), dimension (:), intent(inout) :: & first_ice ! distinguishes ice that disappears (e.g. melts) @@ -3409,6 +3513,14 @@ icepack_biogeochemistry ! during a single time step from ice that was ! there the entire time step (true until ice forms) + real (kind=dbl_kind), optional, dimension (:,:), intent(out) :: & + flux_bion ! per categeory ice to ocean biogeochemistry flux (mmol/m2/s) + + real (kind=dbl_kind), optional, dimension (:), intent(inout) :: & + bioPorosityIceCell, & ! category average porosity on the interface bio grid + bioSalinityIceCell, & ! (ppt) category average porosity on the interface bio grid + bioTemperatureIceCell ! (oC) category average porosity on the interface bio grid + real (kind=dbl_kind), dimension (:,:), intent(inout) :: & Zoo , & ! N losses accumulated in timestep (ie. zooplankton/bacteria) ! mmol/m^3 @@ -3426,15 +3538,8 @@ icepack_biogeochemistry upNO , & ! nitrate uptake rate (mmol/m^2/d) times aice upNH ! ammonium uptake rate (mmol/m^2/d) times aice - real (kind=dbl_kind), intent(inout), optional :: & - zsal_tot ! Total ice salinity in per grid cell (g/m^2) (deprecated) - - real (kind=dbl_kind), intent(inout), optional :: & - fzsal , & ! Total flux of salt to ocean at time step for conservation (deprecated) - fzsal_g ! Total gravity drainage flux (deprecated) - - logical (kind=log_kind), intent(inout), optional :: & - Rayleigh_criteria ! .true. means Ra_c was reached (deprecated) + real (kind=dbl_kind), optional, intent(inout) :: & + totalChla ! ice integrated chla and summed over all algal groups (mg/m^2) real (kind=dbl_kind), dimension (:,:), intent(in) :: & fswpenln ! visible SW entering ice layers (W m-2) @@ -3458,11 +3563,10 @@ icepack_biogeochemistry aice0 , & ! open water area fraction sss , & ! sea surface salinity (ppt) sst , & ! sea surface temperature (C) + !hmix , & ! mixed layer depth (m) + Tf , & ! basal freezing temperature (C) fsnow ! snowfall rate (kg/m^2 s) - logical (kind=log_kind), intent(in) :: & - skl_bgc ! if true, solve skeletal biochemistry - .. _icepack_load_ocean_bio_array: @@ -3473,20 +3577,10 @@ icepack_load_ocean_bio_array ! basic initialization for ocean_bio_all - subroutine icepack_load_ocean_bio_array(max_nbtrcr, & - max_algae, max_don, max_doc, max_dic, max_aero, max_fe, & + subroutine icepack_load_ocean_bio_array(& nit, amm, sil, dmsp, dms, algalN, & doc, don, dic, fed, fep, zaeros, ocean_bio_all, hum) - integer (kind=int_kind), intent(in) :: & - max_algae , & ! maximum number of algal types - max_dic , & ! maximum number of dissolved inorganic carbon types - max_doc , & ! maximum number of dissolved organic carbon types - max_don , & ! maximum number of dissolved organic nitrogen types - max_fe , & ! maximum number of iron types - max_aero , & ! maximum number of aerosols - max_nbtrcr ! maximum number of bio tracers - real (kind=dbl_kind), intent(in) :: & nit , & ! ocean nitrate (mmol/m^3) amm , & ! ammonia/um (mmol/m^3) @@ -3495,25 +3589,25 @@ icepack_load_ocean_bio_array dms , & ! dms (mmol/m^3) hum ! humic material (mmol/m^3) - real (kind=dbl_kind), dimension (max_algae), intent(in) :: & + real (kind=dbl_kind), dimension (:), intent(in) :: & algalN ! ocean algal nitrogen (mmol/m^3) (diatoms, phaeo, pico) - real (kind=dbl_kind), dimension (max_doc), intent(in) :: & + real (kind=dbl_kind), dimension (:), intent(in) :: & doc ! ocean doc (mmol/m^3) (proteins, EPS, lipid) - real (kind=dbl_kind), dimension (max_don), intent(in) :: & + real (kind=dbl_kind), dimension (:), intent(in) :: & don ! ocean don (mmol/m^3) - real (kind=dbl_kind), dimension (max_dic), intent(in) :: & + real (kind=dbl_kind), dimension (:), intent(in) :: & dic ! ocean dic (mmol/m^3) - real (kind=dbl_kind), dimension (max_fe), intent(in) :: & + real (kind=dbl_kind), dimension (:), intent(in) :: & fed, fep ! ocean disolved and particulate fe (nM) - real (kind=dbl_kind), dimension (max_aero), intent(in) :: & + real (kind=dbl_kind), dimension (:), intent(in) :: & zaeros ! ocean aerosols (mmol/m^3) - real (kind=dbl_kind), dimension (max_nbtrcr), intent(inout) :: & + real (kind=dbl_kind), dimension (:), intent(out) :: & ocean_bio_all ! fixed order, all values even for tracers false @@ -3527,16 +3621,9 @@ icepack_init_ocean_bio ! Initialize ocean concentration subroutine icepack_init_ocean_bio (amm, dmsp, dms, algalN, doc, dic, don, & - fed, fep, hum, nit, sil, zaeros, max_dic, max_don, max_fe, max_aero,& - CToN, CToN_DON) - - integer (kind=int_kind), intent(in) :: & - max_dic, & - max_don, & - max_fe, & - max_aero + fed, fep, hum, nit, sil, zaeros,CToN, CToN_DON) - real (kind=dbl_kind), intent(out):: & + real (kind=dbl_kind), intent(out), optional:: & amm , & ! ammonium dmsp , & ! DMSPp dms , & ! DMS @@ -3544,7 +3631,7 @@ icepack_init_ocean_bio nit , & ! nitrate sil ! silicate - real (kind=dbl_kind), dimension(:), intent(out):: & + real (kind=dbl_kind), dimension(:), intent(out), optional:: & algalN , & ! algae doc , & ! DOC dic , & ! DIC @@ -3553,7 +3640,7 @@ icepack_init_ocean_bio fep , & ! Particulate Iron zaeros ! BC and dust - real (kind=dbl_kind), dimension(:), intent(inout), optional :: & + real (kind=dbl_kind), dimension(:), intent(out), optional :: & CToN , & ! carbon to nitrogen ratio for algae CToN_DON ! nitrogen to carbon ratio for proteins