diff --git a/columnphysics/icepack_aerosol.F90 b/columnphysics/icepack_aerosol.F90 index 8e6a4933..dd80a81b 100644 --- a/columnphysics/icepack_aerosol.F90 +++ b/columnphysics/icepack_aerosol.F90 @@ -8,9 +8,9 @@ module icepack_aerosol use icepack_kinds - use icepack_parameters, only: c0, c1, c2, puny, rhoi, rhos, hs_min - use icepack_parameters, only: hi_ssl, hs_ssl - use icepack_tracers, only: max_aero + use icepack_parameters, only: c0, c1, c2, p5, puny, rhoi, rhos, hs_min + use icepack_parameters, only: hi_ssl, hs_ssl, hs_ssl_min + use icepack_tracers, only: max_aero, nilyr, nslyr, nblyr, ntrcr, nbtrcr, n_aero use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -27,12 +27,10 @@ module icepack_aerosol !======================================================================= -! Increase aerosol in ice or snow surface due to deposition -! and vertical cycling +! Deposition and vertical cycling of aerosol in ice or snow +! Called from icepack_step_therm1 when tr_aero=T (not used for zbgc tracers) subroutine update_aerosol(dt, & - nilyr, nslyr, & - n_aero, & meltt, melts, & meltb, congel, & snoice, & @@ -43,9 +41,6 @@ subroutine update_aerosol(dt, & vicen, vsnon, aicen, & faero_atm, faero_ocn) - integer (kind=int_kind), intent(in) :: & - nilyr, nslyr, n_aero - real (kind=dbl_kind), intent(in) :: & dt, & ! time step meltt, & ! thermodynamic melt/growth rates @@ -128,6 +123,7 @@ subroutine update_aerosol(dt, & hs = vsnon*ar hi = vicen*ar + ! fluxes were divided by aice for thermo, not yet multiplied by aice dhs_melts = -melts dhi_snoice = snoice dhs_snoice = dhi_snoice*rhoi/rhos @@ -424,30 +420,24 @@ end subroutine update_aerosol !======================================================================= -! Increase aerosol in snow surface due to deposition -! and vertical cycling : after update_aerosol +! Aerosol in snow for vertical biogeochemistry with mushy thermodynamics +! Called from icepack_algae.F90 when z_tracers=T (replaces update_aerosol) - subroutine update_snow_bgc (dt, nblyr, & - nslyr, & + subroutine update_snow_bgc(dt, & meltt, melts, & meltb, congel, & - snoice, nbtrcr, & - fsnow, ntrcr, & + snoice, fsnow, & trcrn, bio_index, & aice_old, zbgc_snow, & vice_old, vsno_old, & vicen, vsnon, & aicen, flux_bio_atm,& - zbgc_atm, flux_bio) - - integer (kind=int_kind), intent(in) :: & - nbtrcr, & ! number of distinct snow tracers - nblyr, & ! number of bio layers - nslyr, & ! number of snow layers - ntrcr ! number of tracers + zbgc_atm, flux_bio, & + bio_index_o) integer (kind=int_kind), dimension (nbtrcr), intent(in) :: & - bio_index + bio_index, & + bio_index_o ! provides index of scavenging (kscavz) data array real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -466,9 +456,11 @@ subroutine update_snow_bgc (dt, nblyr, & vice_old, & vsno_old - real (kind=dbl_kind),dimension(nbtrcr), intent(inout) :: & + real (kind=dbl_kind), dimension(nbtrcr), intent(out) :: & zbgc_snow, & ! aerosol contribution from snow to ice - zbgc_atm, & ! and atm to ice concentration * volume (kg or mmol/m^3*m) + zbgc_atm ! and atm to ice concentration * volume (kg or mmol/m^3*m) + + real (kind=dbl_kind),dimension(nbtrcr), intent(inout) :: & flux_bio ! total ocean tracer flux (mmol/m^2/s) real (kind=dbl_kind), dimension(nbtrcr), intent(in) :: & @@ -484,6 +476,9 @@ subroutine update_snow_bgc (dt, nblyr, & real (kind=dbl_kind) :: & dzssl, dzssl_new, & ! snow ssl thickness dzint, dzint_new, & ! snow interior thickness + dz, & ! + hi, & ! ice thickness (m) + hilyr, & ! ice layer thickness (m) hs, & ! snow thickness (m) dhs_evap, & ! snow thickness change due to evap dhs_melts, & ! ... due to surface melt @@ -516,38 +511,53 @@ subroutine update_snow_bgc (dt, nblyr, & zbgc_atm(:) = c0 hs_old = vsno_old/aice_old + if (aice_old .gt. puny) then + hs_old = vsno_old/aice_old + else + hs_old = c0 + end if hslyr_old = hs_old/real(nslyr,kind=dbl_kind) - dzssl = min(hslyr_old/c2, hs_ssl) + dzssl = hslyr_old/c2 dzint = hs_old - dzssl if (aicen > c0) then ar = c1/aicen hs = vsnon*ar - dhs_melts = -melts - dhs_snoice = snoice*rhoi/rhos + hi = vicen*ar else ! ice disappeared during time step ar = c1 - hs = vsnon/aice_old - dhs_melts = -melts - dhs_snoice = snoice*rhoi/rhos + hs = c0 + hi = c0 + if (aice_old > c0) hs = vsnon/aice_old endif - + hilyr = hi/real(nblyr,kind=dbl_kind) + hslyr = hs/real(nslyr,kind=dbl_kind) + dzssl_new = hslyr/c2 + dhs_melts = -melts + dhs_snoice = snoice*rhoi/rhos dhs_evap = hs - (hs_old + dhs_melts - dhs_snoice & + fsnow/rhos*dt) ! trcrn() has units kg/m^3 - if ((vsno_old .le. puny) .or. (vsnon .le. puny)) then - + if (dzssl_new .lt. hs_ssl_min) then ! Put atm BC/dust flux directly into the sea ice do k=1,nbtrcr - flux_bio(k) = flux_bio(k) + & + flux_bio_o(k) = flux_bio(k) + if (hilyr .lt. hs_ssl_min) then + flux_bio(k) = flux_bio(k) + & (trcrn(bio_index(k)+ nblyr+1)*dzssl+ & trcrn(bio_index(k)+ nblyr+2)*dzint)/dt + flux_bio(k) = flux_bio(k) + flux_bio_atm(k) + else + zbgc_snow(k) = zbgc_snow(k) + & + (trcrn(bio_index(k)+ nblyr+1)*dzssl+ & + trcrn(bio_index(k)+ nblyr+2)*dzint) + zbgc_atm(k) = zbgc_atm(k) & + + flux_bio_atm(k)*dt + end if trcrn(bio_index(k) + nblyr+1) = c0 trcrn(bio_index(k) + nblyr+2) = c0 - zbgc_atm(k) = zbgc_atm(k) & - + flux_bio_atm(k)*dt enddo else @@ -565,6 +575,48 @@ subroutine update_snow_bgc (dt, nblyr, & !------------------------------------------------------------------- dzint = dzint + min(dzssl + dhs_evap, c0) dzssl = max(dzssl + dhs_evap, c0) + if (dzssl <= puny) then + do k = 1,nbtrcr + aerosno(k,2) = aerosno(k,2) + aerosno(k,1) + aerosno(k,1) = c0 + end do + end if + if (dzint <= puny) then + do k = 1,nbtrcr + zbgc_snow(k) = zbgc_snow(k) + (aerosno(k,2) + aerosno(k,1)) + aerosno(k,2) = c0 + aerosno(k,1) = c0 + end do + end if + + !------------------------------------------------------------------ + ! snowfall + !------------------------------------------------------------------- + if (fsnow > c0) then + sloss1 = c0 + dz = min(fsnow/rhos*dt,dzssl) + do k = 1, nbtrcr + if (dzssl > puny) & + sloss1 = aerosno(k,1)*dz/dzssl + aerosno(k,1) = max(c0,aerosno(k,1) - sloss1) + aerosno(k,2) = aerosno(k,2) + sloss1 + end do + dzssl = dzssl - dz + fsnow/rhos*dt + dzint = dzint + dz + end if + if (dzssl <= puny) then + do k = 1,nbtrcr + aerosno(k,2) = aerosno(k,2) + aerosno(k,1) + aerosno(k,1) = c0 + end do + end if + if (dzint <= puny) then + do k = 1,nbtrcr + zbgc_snow(k) = zbgc_snow(k) + (aerosno(k,2) + aerosno(k,1)) + aerosno(k,2) = c0 + aerosno(k,1) = c0 + end do + end if !------------------------------------------------------------------- ! surface snow melt @@ -573,38 +625,37 @@ subroutine update_snow_bgc (dt, nblyr, & do k = 1, nbtrcr sloss1 = c0 sloss2 = c0 - if (dzssl > puny) & - sloss1 = kscavz(k)*aerosno(k,1) & - *min(-dhs_melts,dzssl)/dzssl - aerosno(k,1) = aerosno(k,1) - sloss1 - if (dzint > puny) & - sloss2 = kscavz(k)*aerosno(k,2) & - *max(-dhs_melts-dzssl,c0)/dzint - aerosno(k,2) = aerosno(k,2) - sloss2 - zbgc_snow(k) = zbgc_snow(k) + (sloss1+sloss2) - enddo ! + if (dzssl > puny) & + sloss1 = kscavz(bio_index_o(k))*aerosno(k,1) & + *min(-dhs_melts,dzssl)/dzssl + aerosno(k,1) = max(c0,aerosno(k,1) - sloss1) + if (dzint > puny) & + sloss2 = kscavz(bio_index_o(k))*aerosno(k,2) & + *max(-dhs_melts-dzssl,c0)/dzint + aerosno(k,2) = max(c0,aerosno(k,2) - sloss2) + zbgc_snow(k) = zbgc_snow(k) + (sloss1+sloss2) ! all not scavenged ends in ice + enddo ! update snow thickness dzint=dzint+min(dzssl+dhs_melts, c0) dzssl=max(dzssl+dhs_melts, c0) - if ( dzssl <= puny ) then ! ssl melts away - aerosno(:,2) = aerosno(:,1) + aerosno(:,2) - aerosno(:,1) = c0 + if ( dzssl .le. puny ) then ! ssl melts away + do k = 1,nbtrcr + aerosno(k,2) = aerosno(k,1) + aerosno(k,2) + aerosno(k,1) = c0 + end do dzssl = max(dzssl, c0) endif - if (dzint <= puny ) then ! all snow melts away - zbgc_snow(:) = zbgc_snow(:) & - + max(c0,aerosno(:,1) + aerosno(:,2)) - aerosno(:,:) = c0 + if (dzint .le. puny ) then ! all snow melts away + do k = 1,nbtrcr + zbgc_snow(k) = zbgc_snow(k) & + + aerosno(k,1) + aerosno(k,2) + aerosno(k,:) = c0 + enddo dzint = max(dzint, c0) endif - endif - - !------------------------------------------------------------------- - ! snowfall - !------------------------------------------------------------------- - if (fsnow > c0) dzssl = dzssl + fsnow/rhos*dt + endif ! -dhs_melts > puny !------------------------------------------------------------------- ! snow-ice formation @@ -613,39 +664,41 @@ subroutine update_snow_bgc (dt, nblyr, & do k = 1, nbtrcr sloss1 = c0 sloss2 = c0 - if (dzint > puny) & - sloss2 = min(dhs_snoice, dzint) & - *aerosno(k,2)/dzint - aerosno(k,2) = aerosno(k,2) - sloss2 - if (dzssl > puny) & + if (dzint > puny .and. aerosno(k,2) > c0) & + sloss2 = min(dhs_snoice, dzint) & + *aerosno(k,2)/dzint + aerosno(k,2) = max(c0,aerosno(k,2) - sloss2) + if (dzssl > puny .and. aerosno(k,1) > c0) & sloss1 = max(dhs_snoice-dzint, c0) & *aerosno(k,1)/dzssl - aerosno(k,1) = aerosno(k,1) - sloss1 + + aerosno(k,1) = max(c0,aerosno(k,1) - sloss1) + flux_bio(k) = flux_bio(k) & + + kscavz(bio_index_o(k)) * (sloss2+sloss1)/dt zbgc_snow(k) = zbgc_snow(k) & - + (sloss2+sloss1) + + (c1-kscavz(bio_index_o(k)))*(sloss2+sloss1) enddo - dzssl = dzssl - max(dhs_snoice-dzint, c0) + dzssl = max(c0,dzssl - max(dhs_snoice-dzint, c0)) dzint = max(dzint-dhs_snoice, c0) - endif + endif ! dhs_snowice > puny !------------------------------------------------------------------- ! aerosol deposition !------------------------------------------------------------------- - if (aicen > c0) then - hs = vsnon * ar - else - hs = c0 - endif - if (hs >= hs_min) then !should this really be hs_min or 0? - ! should use same hs_min value as in radiation + ! Spread out the atm dust flux in the snow interior for small snow surface layers + if (dzssl .ge. hs_ssl*p5) then + do k=1,nbtrcr aerosno(k,1) = aerosno(k,1) & + flux_bio_atm(k)*dt enddo else + dz = (hs_ssl*p5 - dzssl)/(hs_ssl*p5) do k=1,nbtrcr - zbgc_atm(k) = zbgc_atm(k) & - + flux_bio_atm(k)*dt + aerosno(k,1) = aerosno(k,1) & + + flux_bio_atm(k)*dt*(c1-dz) + aerosno(k,2) = aerosno(k,2) & + + flux_bio_atm(k)*dt*dz enddo endif @@ -665,30 +718,31 @@ subroutine update_snow_bgc (dt, nblyr, & endif if (dzint <= puny) then ! nothing in Snow Int do k = 1, nbtrcr - zbgc_snow(k) = zbgc_snow(k) + max(c0,aerosno(k,2)) + zbgc_snow(k) = zbgc_snow(k) + max(c0,aerosno(k,2)+aerosno(k,1)) + aerosno(k,1) = c0 aerosno(k,2) = c0 enddo endif hslyr = hs/real(nslyr,kind=dbl_kind) - dzssl_new = min(hslyr/c2, hs_ssl) - dzint_new = hs - dzssl_new + dzssl_new = hslyr/c2 + dzint_new = max(c0,hs - dzssl_new) - if (hs > hs_min) then !should this really be hs_min or 0? + if (hs > hs_min) then do k = 1, nbtrcr dznew = min(dzssl_new-dzssl, c0) sloss1 = c0 - if (dzssl > puny) & + if (dzssl > puny .and. aerosno(k,1) > c0) & sloss1 = dznew*aerosno(k,1)/dzssl ! not neccesarily a loss - dznew = max(dzssl_new-dzssl, c0) - if (dzint > puny) & - sloss1 = sloss1 + aerosno(k,2)*dznew/dzint - aerosno(k,1) = aerosno(k,1) + sloss1 - aerosno(k,2) = aerosno(k,2) - sloss1 + dznew = max(dzssl_new-dzssl, c0) + if (dzint > puny .and. aerosno(k,2) > c0) & + sloss1 = aerosno(k,2)*dznew/dzint + aerosno(k,1) = max(c0,aerosno(k,1) + sloss1) + aerosno(k,2) = max(c0,aerosno(k,2) - sloss1) enddo else zbgc_snow(:) = zbgc_snow(:) & - + max(c0,aerosno(:,1) + aerosno(:,2)) + + aerosno(:,1) + aerosno(:,2) aerosno(:,:) = c0 endif @@ -701,6 +755,11 @@ subroutine update_snow_bgc (dt, nblyr, & aero_cons(k) = aerotot(k)-aerotot0(k) & - ( flux_bio_atm(k) & - (flux_bio(k)-flux_bio_o(k))) * dt + if (aerotot0(k) > aerotot(k) .and. aerotot0(k) > c0) then + aero_cons(k) = aero_cons(k)/aerotot0(k) + else if (aerotot(k) > c0) then + aero_cons(k) = aero_cons(k)/aerotot(k) + end if if (aero_cons(k) > puny .or. zbgc_snow(k) + zbgc_atm(k) < c0) then write(warnstr,*) subname, 'Conservation failure: aerosols in snow' call icepack_warnings_add(warnstr) @@ -729,18 +788,18 @@ subroutine update_snow_bgc (dt, nblyr, & !------------------------------------------------------------------- ! reload tracers !------------------------------------------------------------------- - if (vsnon > puny) then + if (dzssl_new > puny .and. dzint_new > puny .and. vsnon > puny) then do k = 1,nbtrcr trcrn(bio_index(k)+nblyr+1)=aerosno(k,1)/dzssl_new trcrn(bio_index(k)+nblyr+2)=aerosno(k,2)/dzint_new enddo else do k = 1,nbtrcr - zbgc_snow(k) = (zbgc_snow(k) + aerosno(k,1) + aerosno(k,2)) trcrn(bio_index(k)+nblyr+1)= c0 trcrn(bio_index(k)+nblyr+2)= c0 enddo endif + !------------------------------------------------------------------- ! check for negative values !------------------------------------------------------------------- diff --git a/columnphysics/icepack_algae.F90 b/columnphysics/icepack_algae.F90 index 0ffd880a..7a958ee8 100644 --- a/columnphysics/icepack_algae.F90 +++ b/columnphysics/icepack_algae.F90 @@ -10,11 +10,11 @@ module icepack_algae use icepack_kinds - use icepack_parameters, only: p05, p5, c0, c1, c2, c6, c10 + use icepack_parameters, only: p05, p5, c0, c1, c2, c6, c10, p1 use icepack_parameters, only: pi, secday, puny use icepack_parameters, only: hs_ssl, sk_l - use icepack_parameters, only: dEdd_algae, solve_zbgc + use icepack_parameters, only: dEdd_algae, solve_zbgc, use_atm_dust_iron use icepack_parameters, only: R_dFe2dust, dustFe_sol, algal_vel use icepack_parameters, only: bgc_flux_type use icepack_parameters, only: grid_o @@ -27,11 +27,14 @@ module icepack_algae use icepack_parameters, only: y_sk_DMS , t_sk_conv use icepack_parameters, only: t_sk_ox - use icepack_tracers, only: ntrcr, bio_index + use icepack_tracers, only: nblyr, nilyr, nslyr, ntrcr, nbtrcr + use icepack_tracers, only: n_algae, n_doc, n_dic, n_don, n_fed, n_fep, n_zaero + use icepack_tracers, only: bio_index, bio_index_o use icepack_tracers, only: nt_bgc_N, nt_fbri, nt_zbgc_frac use icepack_tracers, only: tr_brine + use icepack_tracers, only: nt_bgc_DON, nt_bgc_hum, nt_bgc_DOC use icepack_tracers, only: tr_bgc_Nit, tr_bgc_Am, tr_bgc_Sil - use icepack_tracers, only: tr_bgc_DMS, tr_bgc_PON + use icepack_tracers, only: tr_bgc_DMS, tr_bgc_PON, tr_bgc_hum use icepack_tracers, only: tr_bgc_N, tr_bgc_C, tr_bgc_chl use icepack_tracers, only: tr_bgc_DON, tr_bgc_Fe, tr_zaero use icepack_tracers, only: nlt_bgc_Nit, nlt_bgc_Am, nlt_bgc_Sil @@ -39,21 +42,23 @@ module icepack_algae use icepack_tracers, only: nlt_bgc_N, nlt_bgc_C, nlt_bgc_chl use icepack_tracers, only: nlt_bgc_DOC, nlt_bgc_DON, nlt_bgc_DIC use icepack_tracers, only: nlt_zaero , nlt_bgc_DMSPp,nlt_bgc_DMSPd - use icepack_tracers, only: nlt_bgc_Fed, nlt_bgc_Fep + use icepack_tracers, only: nlt_bgc_Fed, nlt_bgc_Fep, nlt_bgc_hum use icepack_zbgc_shared, only: remap_zbgc, regrid_stationary use icepack_zbgc_shared, only: merge_bgc_fluxes use icepack_zbgc_shared, only: merge_bgc_fluxes_skl + use icepack_zbgc_shared, only: bgrid, cgrid, igrid, icgrid use icepack_zbgc_shared, only: phi_sk, bgc_tracer_type use icepack_zbgc_shared, only: zbgc_init_frac use icepack_zbgc_shared, only: zbgc_frac_init use icepack_zbgc_shared, only: tau_rel, tau_ret, thinS - use icepack_zbgc_shared, only: r_Si2N, R_Fe2N, R_S2N, R_chl2N + use icepack_zbgc_shared, only: r_Si2N, R_Fe2N, R_S2N, R_C2N_DON use icepack_zbgc_shared, only: chlabs, alpha2max_low, beta2max, mu_max use icepack_zbgc_shared, only: k_exude, K_Nit, K_Am, K_Sil, K_Fe use icepack_zbgc_shared, only: grow_Tdep, fr_graze, mort_pre, mort_Tdep use icepack_zbgc_shared, only: f_don, kn_bac, f_don_Am use icepack_zbgc_shared, only: f_doc, f_exude, k_bac, R_chl2N, R_C2N + use icepack_zbgc_shared, only: graze_exponent, graze_conc, large_bgc use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -66,63 +71,53 @@ module icepack_algae public :: zbio, sklbio real (kind=dbl_kind), parameter :: & - exp_argmax = c10 ! maximum argument of exponential - + exp_argmax = c10, & ! maximum argument of exponential + accuracy = 1.0e-13_dbl_kind ! accuracy parameter for bgc tracers !======================================================================= contains !======================================================================= - subroutine zbio (dt, nblyr, & - nslyr, nilyr, & + subroutine zbio (dt, & meltt, melts, & meltb, congel, & - snoice, nbtrcr, & - fsnow, ntrcr, & + snoice, fsnow, & trcrn, bio_index, & - aice_old, & + bio_index_o, aice_old, & vice_old, vsno_old, & vicen, vsnon, & aicen, flux_bio_atm,& - n_cat, n_algae, & - n_doc, n_dic, & - n_don, & - n_fed, n_fep, & - n_zaero, first_ice, & + n_cat, first_ice, & hice_old, ocean_bio, & + ocean_bio_dh, & bphin, iphin, & - iDin, & + iDin, & fswthrul, & dh_top, dh_bot, & zfswin, & hbri, hbri_old, & -! darcy_V, darcy_V_chl, & - darcy_V, & - bgrid, & - igrid, icgrid, & + darcy_V, & bphi_min, & - iTin, & + iTin, & Zoo, & flux_bio, dh_direct, & upNO, upNH, & fbio_snoice, fbio_atmice, & PP_net, ice_bio_net, & - snow_bio_net, grow_net ) + snow_bio_net, grow_net, & + totalChla, & + flux_bion, iSin, & + bioPorosityIceCell, & + bioSalinityIceCell, & + bioTemperatureIceCell ) integer (kind=int_kind), intent(in) :: & - nblyr, & ! number of bio layers - nslyr, & ! number of snow layers - nilyr, & ! number of ice layers - nbtrcr, & ! number of distinct bio tracers - n_cat, & ! category number - n_algae, & ! number of autotrophs - n_zaero, & ! number of aerosols - n_doc, n_dic, n_don, n_fed, n_fep, & - ntrcr ! number of tracers + n_cat ! category number integer (kind=int_kind), dimension (nbtrcr), intent(in) :: & - bio_index + bio_index, & ! references index of bio tracer (nbtrcr) to tracer array (ntrcr) + bio_index_o ! references index of data arrays (eg. kscavz) real (kind=dbl_kind), intent(in) :: & dt, & ! time step @@ -152,22 +147,19 @@ subroutine zbio (dt, nblyr, & ice_bio_net, & ! net bio tracer in ice (mmol/m^2) fbio_atmice, & ! bio flux from atm to ice (mmol/m^2/s) fbio_snoice, & ! bio flux from snow to ice (mmol/m^2/s) - flux_bio ! total ocean tracer flux (mmol/m^2/s) + flux_bio, & ! total ocean tracer flux (mmol/m^2/s) + flux_bion ! category ocean tracer flux (mmol/m^2/s) - real (kind=dbl_kind), intent(inout) :: & + real (kind=dbl_kind), intent(in) :: & hbri_old ! brine height (m) - real (kind=dbl_kind), dimension (nblyr+2), intent(inout) :: & - bgrid ! biology nondimensional vertical grid points - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - igrid , & ! biology vertical interface points iTin , & ! salinity vertical interface points iphin , & ! Porosity on the igrid - iDin ! Diffusivity/h on the igrid (1/s) + iDin , & ! Diffusivity/h on the igrid (1/s) + iSin ! Salinity on vertical interface points (ppt) real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: & - icgrid , & ! CICE interface coordinate fswthrul ! visible short wave radiation on icgrid (W/m^2) real (kind=dbl_kind), dimension(nbtrcr), intent(in) :: & @@ -187,6 +179,10 @@ subroutine zbio (dt, nblyr, & !change to inout when updating ocean fields ocean_bio ! ocean concentrations (mmol/m^3) + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + !change to inout when updating ocean fields + ocean_bio_dh ! ocean concentrations * hbrine * phi (mmol/m^2) + real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & bphin ! Porosity on the bgrid @@ -196,6 +192,14 @@ subroutine zbio (dt, nblyr, & upNO , & ! tot nitrate uptake rate (mmol/m^2/d) times aice upNH ! tot ammonium uptake rate (mmol/m^2/d) times aice + real (kind=dbl_kind), optional, intent(inout):: & + totalChla ! total chla (mg chla/m^2) + + real (kind=dbl_kind), optional, dimension (:), intent(inout):: & ! diagnostics (nblyr+1) + bioPorosityIceCell , & ! porosity on vertical interface points + bioSalinityIceCell , & ! salinity on vertical interface points (ppt) + bioTemperatureIceCell ! temperature on vertical interface points (oC) + logical (kind=log_kind), intent(in) :: & first_ice ! initialized values should be used @@ -209,9 +213,6 @@ subroutine zbio (dt, nblyr, & upNHn , & ! algal ammonium uptake rate (mmol/m^3/s) grow_alg ! algal growth rate (mmol/m^3/s) - real (kind=dbl_kind), dimension (nbtrcr) :: & - flux_bion !tracer flux to ocean - real (kind=dbl_kind),dimension(nbtrcr) :: & zbgc_snown, & ! aerosol contribution from snow to ice zbgc_atmn ! and atm to ice concentration * volume (mmol/m^3*m) @@ -223,13 +224,17 @@ subroutine zbio (dt, nblyr, & real (kind=dbl_kind) :: & hsnow_i, & ! initial snow thickness (m) - hsnow_f ! final snow thickness (m) - - logical (kind=log_kind) :: & - write_flux_diag + hsnow_f, & ! final snow thickness (m) + carbonError ! carbon conservation error (mmol/m2) real (kind=dbl_kind) :: & - a_ice + carbonInitial, & ! initial carbon content (mmol/m2) + carbonFinal, & ! final carbon content (mmol/m2) + carbonFlux ! carbon flux (mmol/m2/s) + + logical (kind=log_kind) :: & + write_flux_diag, & + write_carbon_errors character(len=*),parameter :: subname='(zbio)' @@ -239,58 +244,55 @@ subroutine zbio (dt, nblyr, & flux_bio_sno(:) = c0 Tot_BGC_i (:) = c0 Tot_BGC_f (:) = c0 + Zoo (:) = c0 hsnow_i = c0 hsnow_f = c0 write_flux_diag = .false. + write_carbon_errors = .true. + if (.not. tr_bgc_C) write_carbon_errors = .false. - if (write_flux_diag) then - if (aice_old > c0) then - hsnow_i = vsno_old/aice_old - do mm = 1,nbtrcr - call bgc_column_sum (nblyr, nslyr, hsnow_i, hbri_old, & + call bgc_carbon_sum(hbri_old, trcrn(:), carbonInitial) + if (icepack_warnings_aborted(subname)) return + + if (aice_old > puny) then + hsnow_i = vsno_old/aice_old + do mm = 1,nbtrcr + call bgc_column_sum (hsnow_i, hbri_old, & trcrn(bio_index(mm):bio_index(mm)+nblyr+2), & Tot_BGC_i(mm)) - if (icepack_warnings_aborted(subname)) return - enddo - endif + if (icepack_warnings_aborted(subname)) return + enddo endif - call update_snow_bgc (dt, nblyr, & - nslyr, & + call update_snow_bgc (dt, & meltt, melts, & meltb, congel, & - snoice, nbtrcr, & - fsnow, ntrcr, & + snoice, fsnow, & trcrn, bio_index, & aice_old, zbgc_snown, & vice_old, vsno_old, & vicen, vsnon, & aicen, flux_bio_atm, & - zbgc_atmn, flux_bio_sno) + zbgc_atmn, flux_bio_sno, & + bio_index_o) + if (icepack_warnings_aborted(subname)) return call z_biogeochemistry (n_cat, dt, & - nilyr, & - nblyr, nbtrcr, & - n_algae, n_doc, & - n_dic, n_don, & - n_fed, n_fep, & - n_zaero, first_ice, & + first_ice, & aicen, vicen, & hice_old, ocean_bio, & + ocean_bio_dh, & flux_bion, bphin, & iphin, trcrn, & - iDin, & + iDin, & fswthrul, grow_alg, & upNOn, upNHn, & dh_top, dh_bot, & zfswin, hbri, & hbri_old, darcy_V, & -! darcy_V_chl, bgrid, & - bgrid, & - igrid, icgrid, & bphi_min, zbgc_snown,& - zbgc_atmn, & + zbgc_atmn, & iTin, dh_direct, & Zoo, meltb, & congel ) @@ -300,11 +302,71 @@ subroutine zbio (dt, nblyr, & flux_bion(mm) = flux_bion(mm) + flux_bio_sno(mm) enddo + call bgc_carbon_sum(hbri, trcrn(:), carbonFinal) + if (icepack_warnings_aborted(subname)) return + call bgc_carbon_flux(flux_bio_atm,flux_bion,carbonFlux) + if (icepack_warnings_aborted(subname)) return + + carbonError = carbonInitial-carbonFlux*dt-carbonFinal + + if (abs(carbonError) > max(puny,accuracy * maxval ((/carbonInitial, carbonFinal/))) .and. write_carbon_errors) then + write(warnstr,*) subname, 'carbonError:', carbonError + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'carbonInitial:', carbonInitial + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'carbonFinal:', carbonFinal + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'carbonFlux (positive into ocean):', carbonFlux + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'accuracy * maxval ((/carbonInitial, carbonFinal/:)', accuracy * maxval ((/carbonInitial, carbonFinal/)) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'puny', puny + call icepack_warnings_add(warnstr) + if (aicen > c0) then + hsnow_f = vsnon/aicen + write(warnstr,*) subname, 'after z_biogeochemistry' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Remaining carbon after algal_dyn: Zoo' + call icepack_warnings_add(warnstr) + do mm = 1,nblyr+1 + write(warnstr,*) subname, 'layer mm, Zoo(mm)' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, mm,Zoo(mm) + call icepack_warnings_add(warnstr) + end do + do mm = 1,nbtrcr + call bgc_column_sum (hsnow_f, hbri, & + trcrn(bio_index(mm):bio_index(mm)+nblyr+2), & + Tot_BGC_f(mm)) + write(warnstr,*) subname, 'mm, Tot_BGC_i(mm), Tot_BGC_f(mm)' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, mm, Tot_BGC_i(mm), Tot_BGC_f(mm) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'flux_bion(mm), flux_bio_atm(mm)' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, flux_bion(mm), flux_bio_atm(mm) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'zbgc_snown(mm),zbgc_atmn(mm)' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, zbgc_snown(mm),zbgc_atmn(mm) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Tot_BGC_i(mm) + flux_bio_atm(mm)*dt - flux_bion(mm)*dt' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, Tot_BGC_i(mm) + flux_bio_atm(mm)*dt - flux_bion(mm)*dt + call icepack_warnings_add(warnstr) + enddo + endif + !call icepack_warnings_add(warnstr) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + call icepack_warnings_add(subname//" zbio: Carbon conservation failure after z_biogeochemistry") + endif + if (icepack_warnings_aborted(subname)) return + if (write_flux_diag) then if (aicen > c0) then hsnow_f = vsnon/aicen do mm = 1,nbtrcr - call bgc_column_sum (nblyr, nslyr, hsnow_f, hbri, & + call bgc_column_sum (hsnow_f, hbri, & trcrn(bio_index(mm):bio_index(mm)+nblyr+2), & Tot_BGC_f(mm)) write(warnstr,*) subname, 'mm, Tot_BGC_i(mm), Tot_BGC_f(mm)' @@ -326,16 +388,14 @@ subroutine zbio (dt, nblyr, & enddo endif endif - if (icepack_warnings_aborted(subname)) return - call merge_bgc_fluxes (dt, nblyr, & - nslyr, & - bio_index, n_algae, & - nbtrcr, aicen, & + call merge_bgc_fluxes (dt, & + bio_index, & + aicen, & vicen, vsnon, & - iphin, & - trcrn, & + iphin, &! ntrcr + trcrn, aice_old, &!aice_old flux_bion, flux_bio, & upNOn, upNHn, & upNO, upNH, & @@ -343,13 +403,15 @@ subroutine zbio (dt, nblyr, & fbio_snoice, fbio_atmice,& PP_net, ice_bio_net,& snow_bio_net, grow_alg, & - grow_net) + grow_net, totalChla, & + iTin, iSin, & + bioPorosityIceCell, & + bioSalinityIceCell, & + bioTemperatureIceCell) if (icepack_warnings_aborted(subname)) return if (write_flux_diag) then if (aicen > c0) then - if (n_cat .eq. 1) a_ice = c0 - a_ice = a_ice + aicen write(warnstr,*) subname, 'after merge_bgc_fluxes, n_cat:', n_cat call icepack_warnings_add(warnstr) do mm = 1,nbtrcr @@ -361,21 +423,18 @@ subroutine zbio (dt, nblyr, & call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'flux_bio_atm(mm)', flux_bio_atm(mm) call icepack_warnings_add(warnstr) - write(warnstr,*) subname, 'flux_bio_atm(mm)*a_ice', flux_bio_atm(mm)*a_ice + write(warnstr,*) subname, 'flux_bio_atm(mm)*aicen', flux_bio_atm(mm)*aicen call icepack_warnings_add(warnstr) enddo endif endif + if (icepack_warnings_aborted(subname)) return end subroutine zbio !======================================================================= - subroutine sklbio (dt, ntrcr, & - nbtrcr, n_algae, & - n_doc, & - n_dic, n_don, & - n_fed, n_fep, & + subroutine sklbio (dt, Tf, & flux_bio, ocean_bio, & aicen, & meltb, congel, & @@ -384,19 +443,12 @@ subroutine sklbio (dt, ntrcr, & PP_net, upNO, & upNH, grow_net ) - integer (kind=int_kind), intent(in) :: & - nbtrcr, & ! number of distinct bio tracers - n_algae, & ! number of autotrophs - n_doc, n_dic, & ! number of dissolved organic, inorganic carbon - n_don, & ! number of dissolved organic nitrogen - n_fed, n_fep, & ! number of iron - ntrcr ! number of tracers - logical (kind=log_kind), intent(in) :: & first_ice ! initialized values should be used real (kind=dbl_kind), intent(in) :: & dt, & ! time step + Tf, & ! basal freezing temperature (C) ! hmix, & ! mixed layer depth (m) aicen, & ! ice area fraction meltb, & ! bottom melt (m) @@ -437,19 +489,16 @@ subroutine sklbio (dt, ntrcr, & grow_alg (:) = c0 call skl_biogeochemistry (dt, & - n_doc, & - n_dic, n_don, & - n_fed, n_fep, & - nbtrcr, n_algae, & flux_bion, ocean_bio, & ! hmix, aicen, & meltb, congel, & fswthru, first_ice, & trcrn, upNOn, & - upNHn, grow_alg) + upNHn, grow_alg, & + Tf) if (icepack_warnings_aborted(subname)) return - call merge_bgc_fluxes_skl (nbtrcr, n_algae, & + call merge_bgc_fluxes_skl ( & aicen, trcrn, & flux_bion, flux_bio, & PP_net, upNOn, & @@ -465,20 +514,13 @@ end subroutine sklbio ! skeletal layer biochemistry ! subroutine skl_biogeochemistry (dt, & - n_doc, & - n_dic, n_don, & - n_fed, n_fep, & - nbtrcr, n_algae, & flux_bio, ocean_bio, & ! hmix, aicen, & meltb, congel, & fswthru, first_ice, & trcrn, upNOn, & - upNHn, grow_alg_skl) - - integer (kind=int_kind), intent(in) :: & - n_doc, n_dic, n_don, n_fed, n_fep, & - nbtrcr , n_algae ! number of bgc tracers and number algae + upNHn, grow_alg_skl, & + Tf) real (kind=dbl_kind), intent(in) :: & dt , & ! time step @@ -486,6 +528,7 @@ subroutine skl_biogeochemistry (dt, & ! aicen , & ! ice area meltb , & ! bottom ice melt congel , & ! bottom ice growth + Tf , & ! bottom freezing temperature fswthru ! shortwave passing through ice to ocean logical (kind=log_kind), intent(in) :: & @@ -530,20 +573,20 @@ subroutine skl_biogeochemistry (dt, & grow_val , & ! (m/x) rphi_sk , & ! 1 / skeletal layer porosity cinit_tmp , & ! temporary variable for concentration (mmol/m^2) - Nerror ! change in total nitrogen from reactions + Cerror , & ! change in total carbon from reactions (mmol/m^3) + nitrification ! nitrate from nitrification (mmol/m^3) real (kind=dbl_kind), parameter :: & PVc = 1.e-6_dbl_kind , & ! type 'constant' piston velocity for interface (m/s) PV_scale_growth = p5 , & ! scale factor in Jin code PV during ice growth PV_scale_melt = p05 , & ! scale factor in Jin code PV during ice melt growth_max = 1.85e-5_dbl_kind , & ! PVt function reaches maximum here. (m/s) - Tin_bot = -1.8_dbl_kind , & ! temperature of the ice bottom (oC) MJ1 = 9.667e-9_dbl_kind , & ! (m/s) coefficients in Jin2008 MJ2 = 38.8_dbl_kind , & ! (1) from:4.49e-4_dbl_kind*secday MJ3 = 1.04e7_dbl_kind , & ! 1/(m/s) from: 1.39e-3_dbl_kind*secday^2 PV_frac_max = 0.9_dbl_kind ! Maximum Piston velocity is 90% of skeletal layer/dt - logical (kind=log_kind) :: conserve_N + logical (kind=log_kind) :: conserve_C character(len=*),parameter :: subname='(skl_biogeochemistry)' @@ -551,11 +594,12 @@ subroutine skl_biogeochemistry (dt, & ! Initialize !----------------------------------------------------------------- - conserve_N = .true. + conserve_C = .true. Zoo_skl = c0 rphi_sk = c1/phi_sk PVt = c0 - iTin = Tin_bot + iTin = Tf + ice_growth = (congel-meltb)/dt do nn = 1, nbtrcr cinit (nn) = c0 @@ -577,10 +621,6 @@ subroutine skl_biogeochemistry (dt, & cling (nn) = c1 endif - ice_growth = (congel-meltb)/dt - if (first_ice) then - trcrn(bio_index(nn)) = ocean_bio(nn) ! * sk_l*rphi_sk - endif ! first_ice cinit (nn) = trcrn(bio_index(nn)) * sk_l * rphi_sk cinit_v(nn) = cinit(nn)/sk_l if (cinit(nn) < c0) then @@ -588,7 +628,7 @@ subroutine skl_biogeochemistry (dt, & nn,nbtrcr,cinit(nn) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' cinit < c0') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) return endif enddo ! nbtrcr @@ -657,16 +697,16 @@ subroutine skl_biogeochemistry (dt, & react(:) = c0 grow_alg_skl(:) = c0 - call algal_dyn (dt, & - n_doc, n_dic, n_don, n_fed, n_fep, & - dEdd_algae, & + call algal_dyn (dt, & + dEdd_algae, & fswthru, react, & - cinit_v, & - grow_alg_skl(:), n_algae, & + cinit_v, & + grow_alg_skl(:), & iTin, & - upNOn(:), upNHn(:), & + upNOn(:), upNHn(:), & Zoo_skl, & - Nerror, conserve_N) + Cerror, conserve_C,& + nitrification) if (icepack_warnings_aborted(subname)) return !----------------------------------------------------------------- @@ -697,8 +737,8 @@ subroutine skl_biogeochemistry (dt, & ! Currently not coupled with ocean biogeochemistry ! ocean_bio(nn) = ocean_bio(nn) + flux_bio(nn)/hmix*aicen - if (.not. conserve_N) then - write(warnstr,*) subname, 'N not conserved in skl_bgc, Nerror:',Nerror + if (.not. conserve_C) then + write(warnstr,*) subname, 'C not conserved in skl_bgc, Cerror:',Cerror call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'sk_bgc < 0 after algal fluxes, nn,cinit,flux_bio',& nn,cinit(nn),flux_bio(nn) @@ -711,7 +751,7 @@ subroutine skl_biogeochemistry (dt, & write(warnstr,*) subname, 'congel, meltb: ',congel,meltb call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' N not conserved in skl_bgc') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) elseif (cinit(nn) < c0) then write(warnstr,*) subname, 'sk_bgc < 0 after algal fluxes, nn,cinit,flux_bio',& nn,cinit(nn),flux_bio(nn) @@ -724,7 +764,7 @@ subroutine skl_biogeochemistry (dt, & write(warnstr,*) subname, 'congel, meltb: ',congel,meltb call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//'sk_bgc < 0 after algal fluxes') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif if (icepack_warnings_aborted(subname)) return @@ -751,38 +791,26 @@ end subroutine skl_biogeochemistry ! subroutine z_biogeochemistry (n_cat, dt, & - nilyr, & - nblyr, nbtrcr, & - n_algae, n_doc, & - n_dic, n_don, & - n_fed, n_fep, & - n_zaero, first_ice, & + first_ice, & aicen, vicen, & hice_old, ocean_bio, & + ocean_bio_dh, & flux_bio, bphin, & iphin, trcrn, & - iDin, & + iDin, & fswthrul, grow_alg, & upNOn, upNHn, & dh_top, dh_bot, & zfswin, hbri, & hbri_old, darcy_V, & -! darcy_V_chl, bgrid, & - bgrid, & - i_grid, ic_grid, & bphi_min, zbgc_snow, & - zbgc_atm, & + zbgc_atm, & iTin, dh_direct, & Zoo, meltb, & congel ) integer (kind=int_kind), intent(in) :: & - n_cat, & ! category number - nilyr, & ! number of ice layers - nblyr, & ! number of bio layers - nbtrcr, n_algae, & ! number of bgc tracers, number of autotrophs - n_zaero, & ! number of aerosols - n_doc, n_dic, n_don, n_fed, n_fep + n_cat ! category number logical (kind=log_kind), intent(in) :: & first_ice ! initialized values should be used @@ -797,13 +825,11 @@ subroutine z_biogeochemistry (n_cat, dt, & meltb , & ! bottom melt in dt (m) congel , & ! bottom growth in dt (m) darcy_V , & ! darcy velocity -! darcy_V_chl, & ! darcy velocity for algae dh_bot , & ! change in brine bottom (m) dh_top , & ! change in brine top (m) dh_direct ! surface flooding or runoff (m) real (kind=dbl_kind), dimension (:), intent(inout) :: & - bgrid , & ! biology nondimensional vertical grid points flux_bio , & ! total ocean tracer flux (mmol/m^2/s) zfswin , & ! visible Short wave flux on igrid (W/m^2) Zoo , & ! N losses to the system from reaction terms @@ -811,18 +837,19 @@ subroutine z_biogeochemistry (n_cat, dt, & trcrn ! bulk tracer concentration (mmol/m^3) real (kind=dbl_kind), dimension (:), intent(in) :: & - i_grid , & ! biology vertical interface points iTin , & ! salinity vertical interface points iphin , & ! Porosity on the igrid iDin , & ! Diffusivity/h on the igrid (1/s) - ic_grid , & ! CICE interface coordinate fswthrul , & ! visible short wave radiation on icgrid (W/m^2) zbgc_snow , & ! tracer input from snow (mmol/m^3*m) zbgc_atm , & ! tracer input from atm (mmol/m^3 *m) ocean_bio , & ! ocean concentrations (mmol/m^3) bphin ! Porosity on the bgrid - real (kind=dbl_kind), intent(inout) :: & + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + ocean_bio_dh ! ocean concentrations * hbrine * phi (mmol/m^2) + + real (kind=dbl_kind), intent(in) :: & hbri_old ! brine height (m) real (kind=dbl_kind), dimension (:,:), intent(out) :: & @@ -846,6 +873,7 @@ subroutine z_biogeochemistry (n_cat, dt, & hin , & ! ice thickness (m) hin_old , & ! ice thickness before current melt/growth (m) ice_conc , & ! algal concentration in ice above hin > hinS + sum_initial , & ! sum_old , & ! sum_new , & ! sum_tot , & ! @@ -869,7 +897,7 @@ subroutine z_biogeochemistry (n_cat, dt, & D_spdiag , & ! artificial diffusion matrix D_sbdiag , & ! artificial diffusion matrix biomat_low , & ! Low order solution - Nerror ! Change in N after reactions + Cerror ! Change in N after reactions real (kind=dbl_kind), dimension(nblyr+1,nbtrcr):: & react ! biological sources and sinks for equation matrix @@ -897,7 +925,7 @@ subroutine z_biogeochemistry (n_cat, dt, & trtmp ! temporary, remapped tracers logical (kind=log_kind), dimension(nblyr+1) :: & - conserve_N + conserve_C real (kind=dbl_kind), dimension(nblyr+1):: & ! temporary variables for Diff , & ! diffusivity @@ -905,7 +933,9 @@ subroutine z_biogeochemistry (n_cat, dt, & biocons , & ! new concentration dmobile , & ! initcons_mobile,&! - initcons_stationary + initcons_stationary, & + dz , & ! normalized vertical grid spacing + nitrification ! nitrate produced from nitrification (mmol/m3) real (kind=dbl_kind):: & top_conc ! 1% (min_bgc) of surface concentration @@ -924,20 +954,21 @@ subroutine z_biogeochemistry (n_cat, dt, & V_alg ! volume of algae (um^3) real (kind=dbl_kind), dimension(nbtrcr) :: & - mobile ! c1 if mobile, c0 otherwise + mobile , & ! c1 if mobile, c0 otherwise + flux_bio_tmp ! local parameters real (kind=dbl_kind), parameter :: & - accuracy = 1.0e-14_dbl_kind, & r_c = 3.0e3_dbl_kind , & ! ice crystal radius (um) - r_bac= 15.0_dbl_kind , & ! diatom large radius (um) + r_bac= 4.7_dbl_kind , & ! diatom large radius (um) r_alg= 10.0_dbl_kind , & ! diatom small radius (um) - N_vol = 0.04e-12_dbl_kind , & ! (g) Nitrogen per um^3 - Ng_to_mmol =0.0140067_dbl_kind , & ! (g/mmol) Nitrogen - f_s = c1 , & ! fracton of sites available for saturation - f_a = c1 , & ! fraction of collector available for attachment - f_v = 0.7854 ! fraction of algal coverage on area availabel for attachment + Nquota_A = 0.88_dbl_kind, & ! slope in Nitrogen quota to cell volume fit + ! (Lomas et al. 2019, Edwards et al. 2012) + Nquota_I = 0.0408_dbl_kind, & ! Intercept in N quota to cell volume fit + f_s = p1, & ! fracton of sites available for saturation + f_a = 0.3_dbl_kind, & !c1 , & ! fraction of collector available for attachment + f_v = 0.7854_dbl_kind ! fraction of algal coverage on area availabel for attachment ! 4(pi r^2)/(4r)^2 [Johnson et al, 1995, water res. research] integer, parameter :: & @@ -945,19 +976,32 @@ subroutine z_biogeochemistry (n_cat, dt, & character(len=*),parameter :: subname='(z_biogeochemistry)' + logical (kind=log_kind) :: & + write_carbon_errors + !------------------------------------- ! Initialize !----------------------------------- + write_carbon_errors = .true. + if (.not. tr_bgc_C) write_carbon_errors = .false. + zspace = c1/real(nblyr,kind=dbl_kind) + dz(:) = zspace + dz(1) = zspace/c2 + dz(nblyr+1) = zspace/c2 in_init_cons(:,:) = c0 atm_add_cons(:) = c0 dhtop = c0 dhbot = c0 darcyV = c0 C_top(:) = c0 + C_bot(:) = c0 + if (present(ocean_bio_dh)) ocean_bio_dh(:) = c0 mobile(:) = c0 - conserve_N(:) = .true. + conserve_C(:) = .true. + nitrification(:) = c0 + flux_bio_tmp(:) = c0 do m = 1, nbtrcr do k = 1, nblyr+1 @@ -967,15 +1011,13 @@ subroutine z_biogeochemistry (n_cat, dt, & iphin_N(k) = iphin(k) bphin_N(1) = bphi_min - if (first_ice) then - trcrn(bio_index(m) + k-1) = ocean_bio(m)*zbgc_init_frac(m) - in_init_cons(k,m) = trcrn(bio_index(m) + k-1)*hbri_old - elseif (abs(trcrn(bio_index(m) + k-1)) < puny) then + if (abs(trcrn(bio_index(m) + k-1)) < accuracy) then + flux_bio_tmp(m) = trcrn(bio_index(m) + k-1)* hbri_old * dz(k)/dt trcrn(bio_index(m) + k-1) = c0 in_init_cons(k,m) = c0 else in_init_cons(k,m) = trcrn(bio_index(m) + k-1)* hbri_old - endif ! first_ice + endif if (trcrn(bio_index(m) + k-1) < c0 ) then write(warnstr,*) subname,'zbgc initialization error, first ice = ', first_ice @@ -991,7 +1033,7 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname, trcrn(bio_index(m) + k-1) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' zbgc initialization error') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif if (icepack_warnings_aborted(subname)) return enddo !k @@ -1012,18 +1054,17 @@ subroutine z_biogeochemistry (n_cat, dt, & phi_max = maxval(bphin_N(2:nblyr+1)) S_col = 4.0_dbl_kind*pi*r_c**2 P_b = pi*r_bac**2 !*10-6 for colloids - V_c = 4.0_dbl_kind*pi*r_c**3/3.0_dbl_kind*(1.0e-6_dbl_kind)**3 ! (m^3) sphere + V_c = 4.0_dbl_kind*pi*r_c**3/3.0_dbl_kind ! (m^3) sphere V_alg = pi/6.0_dbl_kind*r_bac*r_alg**2 ! prolate spheroid (*10-9 for colloids) - Sat_conc= f_s*f_a*f_v*(c1-phi_max)/V_c*S_col/P_b*N_vol*V_alg/Ng_to_mmol - !mmol/m^3 (algae, don, hum...) and umols/m^3 for colloids - + Sat_conc= f_s*f_a*f_v*(c1-phi_max)/V_c*S_col/P_b*(V_alg)**Nquota_A*Nquota_I * 1.0e9_dbl_kind + !mmol/m^3 (algae, don, hum...) and umols/m^3 for colloids !----------------------------------------------------------------- ! convert surface dust flux (n_zaero > 2) to dFe(1) flux !----------------------------------------------------------------- dust_Fe(:) = c0 - if (tr_zaero .and. n_zaero > 2 .and. tr_bgc_Fe) then + if (tr_zaero .and. n_zaero > 2 .and. tr_bgc_Fe .and. use_atm_dust_iron) then do m = 3,n_zaero dust_Fe(nlt_bgc_Fed(1)) = dust_Fe(nlt_bgc_Fed(1)) + & (zbgc_snow(nlt_zaero(m)) + zbgc_atm(nlt_zaero(m))) * & @@ -1080,6 +1121,7 @@ subroutine z_biogeochemistry (n_cat, dt, & endif C_bot(m) = ocean_bio(m)*hbri_old*iphin_N(nblyr+1) + if (present(ocean_bio_dh)) ocean_bio_dh(m) = C_bot(m) enddo ! m @@ -1103,8 +1145,8 @@ subroutine z_biogeochemistry (n_cat, dt, & trtmp0(1:ntrcr), trtmp(1:ntrcr+2), & 0, nblyr+1, & hin, hbri, & - ic_grid(1:nilyr+1), & - i_grid(1:nblyr+1),ice_conc ) + icgrid(1:nilyr+1), & + igrid(1:nblyr+1),ice_conc ) if (icepack_warnings_aborted(subname)) return @@ -1134,14 +1176,16 @@ subroutine z_biogeochemistry (n_cat, dt, & if (hbri_old > thinS .and. hbri > thinS) then do k = 1,nblyr+1 initcons_mobile(k) = in_init_cons(k,mm)*trcrn(nt_zbgc_frac+mm-1) - initcons_stationary(k) = mobile(mm)*(in_init_cons(k,mm)-initcons_mobile(k)) + initcons_stationary(k) = max(c0,in_init_cons(k,mm)-initcons_mobile(k)) + ! Allow release of Nitrate/silicate to mobile phase, but not adsorption dmobile(k) = mobile(mm)*(initcons_mobile(k)*(exp_ret(mm)-c1) + & - initcons_stationary(k)*(c1-exp_rel(mm))) + initcons_stationary(k)*(c1-exp_rel(mm))) + & + (1-mobile(mm))*initcons_stationary(k)*(c1-exp_rel(mm)) initcons_mobile(k) = max(c0,initcons_mobile(k) + dmobile(k)) initcons_stationary(k) = max(c0,initcons_stationary(k) - dmobile(k)) if (initcons_stationary(k)/hbri_old > Sat_conc) then initcons_mobile(k) = initcons_mobile(k) + initcons_stationary(k) - Sat_conc*hbri_old - initcons_stationary(k) = Sat_conc*hbri_old + initcons_stationary(k) = Sat_conc*hbri_old endif Diff(k) = iDin(k) @@ -1150,9 +1194,9 @@ subroutine z_biogeochemistry (n_cat, dt, & enddo call compute_FCT_matrix & - (initcons,sbdiagz, dt, nblyr, & - diagz, spdiagz, rhsz, bgrid, & - darcyV, dhtop, & + (initcons,sbdiagz, dt, & + diagz, spdiagz, rhsz, & + darcyV, dhtop, & dhbot, iphin_N, & Diff, hbri_old, & atm_add_cons(mm), bphin_N, & @@ -1177,13 +1221,11 @@ subroutine z_biogeochemistry (n_cat, dt, & Sink_bot(mm), & Sink_top(mm), & dt, flux_bio(mm), & - nblyr, & source(mm)) if (icepack_warnings_aborted(subname)) return call compute_FCT_corr & - (initcons, & - biocons, dt, nblyr, & + (initcons, biocons, dt, & D_sbdiag, D_spdiag, ML_diag) if (icepack_warnings_aborted(subname)) return @@ -1196,9 +1238,8 @@ subroutine z_biogeochemistry (n_cat, dt, & call regrid_stationary & (initcons_stationary, hbri_old, & hbri, dt, & - ntrcr, & - nblyr, top_conc, & - i_grid, flux_bio(mm),& + top_conc, & + igrid, flux_bio(mm),& meltb, congel) if (icepack_warnings_aborted(subname)) return @@ -1208,9 +1249,8 @@ subroutine z_biogeochemistry (n_cat, dt, & call regrid_stationary & (initcons_stationary, hbri_old, & hbri, dt, & - ntrcr, & - nblyr, top_conc, & - i_grid, flux_bio(mm),& + top_conc, & + igrid, flux_bio(mm),& meltb, congel) if (icepack_warnings_aborted(subname)) return @@ -1219,40 +1259,38 @@ subroutine z_biogeochemistry (n_cat, dt, & biomat_cons(:,mm) = biocons(:) + initcons_stationary(:) + sum_initial = (in_init_cons(1,mm) + in_init_cons(nblyr+1,mm))*zspace/c2 sum_old = (biomat_low(1) + biomat_low(nblyr+1))*zspace/c2 sum_new = (biocons(1)+ biocons(nblyr+1))*zspace/c2 sum_tot = (biomat_cons(1,mm) + biomat_cons(nblyr+1,mm))*zspace/c2 do k = 2,nblyr + sum_initial = sum_initial + in_init_cons(k,mm)*zspace sum_old = sum_old + biomat_low(k)*zspace sum_new = sum_new + biocons(k)*zspace sum_tot = sum_tot + biomat_cons(k,mm)*zspace enddo trcrn(nt_zbgc_frac+mm-1) = zbgc_frac_init(mm) - if (sum_tot > c0 .and. mobile(mm) > c0) trcrn(nt_zbgc_frac+mm-1) = sum_new/sum_tot + if (sum_tot > c0) trcrn(nt_zbgc_frac+mm-1) = sum_new/sum_tot - if (abs(sum_new-sum_old) > accuracy*sum_old .or. & - minval(biocons(:)) < c0 .or. minval(initcons_stationary(:)) < c0 & + if ((abs((sum_initial-sum_tot+source(mm))/dt-flux_bio(mm)) > max(puny, accuracy*abs(flux_bio(mm)))) & + .or. (minval(biocons(:)) < c0) .or. (minval(initcons_stationary(:)) < c0) & .or. icepack_warnings_aborted()) then - write(warnstr,*) subname,'zbgc FCT tracer solution failed' + write(warnstr,*) subname,'zbgc FCT tracer solution failed, mm:', mm call icepack_warnings_add(warnstr) - write(warnstr,*) subname,'sum_new,sum_old:',sum_new,sum_old + write(warnstr,*)'sum_new,sum_tot,sum_initial,flux_bio(mm),source(mm):' call icepack_warnings_add(warnstr) - write(warnstr,*) subname,'mm,biocons(:):',mm,biocons(:) + write(warnstr,*)sum_new,sum_tot,sum_initial,flux_bio(mm),source(mm) call icepack_warnings_add(warnstr) - write(warnstr,*) subname,'biomat_low:',biomat_low + write(warnstr,*)'error = (sum_initial-sum_tot+source(mm))/dt-flux_bio(mm)' call icepack_warnings_add(warnstr) - write(warnstr,*) subname,'Diff(:):',Diff(:) + write(warnstr,*)(sum_initial-sum_tot+source(mm))/dt-flux_bio(mm) call icepack_warnings_add(warnstr) - write(warnstr,*) subname,'dmobile(:):',dmobile(:) + write(warnstr,*) subname,'sum_new,sum_old:',sum_new,sum_old call icepack_warnings_add(warnstr) write(warnstr,*) subname,'mobile(mm):',mobile(mm) call icepack_warnings_add(warnstr) - write(warnstr,*) subname,'initcons_stationary(:):',initcons_stationary(:) - call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'trcrn(nt_zbgc_frac+mm-1):',trcrn(nt_zbgc_frac+mm-1) call icepack_warnings_add(warnstr) - write(warnstr,*) subname, 'in_init_cons(:,mm):',in_init_cons(:,mm) - call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'exp_ret( mm),exp_rel( mm)',exp_ret( mm),exp_rel( mm) call icepack_warnings_add(warnstr) write(warnstr,*) subname,'darcyV,dhtop,dhbot' @@ -1262,7 +1300,7 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname,'Category,mm:',n_cat,mm call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//'zbgc FCT tracer solution failed') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif if (icepack_warnings_aborted(subname)) return @@ -1270,7 +1308,7 @@ subroutine z_biogeochemistry (n_cat, dt, & call thin_ice_flux(hbri,hbri_old,biomat_cons(:,mm), & flux_bio(mm),source(mm), & - dt, nblyr,ocean_bio(mm)) + dt, ocean_bio(mm)) if (icepack_warnings_aborted(subname)) return endif ! thin or not @@ -1285,16 +1323,16 @@ subroutine z_biogeochemistry (n_cat, dt, & if (solve_zbgc) then do k = 1, nblyr+1 - call algal_dyn (dt, & - n_doc, n_dic, n_don, n_fed, n_fep, & - dEdd_algae, & + call algal_dyn (dt, & + dEdd_algae, & zfswin(k), react(k,:), & - biomat_brine(k,:), & - grow_alg(k,:), n_algae, & + biomat_brine(k,:), & + grow_alg(k,:), & iTin(k), & upNOn(k,:), upNHn(k,:), & Zoo(k), & - Nerror(k), conserve_N(k)) + Cerror(k), conserve_C(k), & + nitrification(k)) if (icepack_warnings_aborted(subname)) return enddo ! k @@ -1304,14 +1342,46 @@ subroutine z_biogeochemistry (n_cat, dt, & ! Update the tracer variable !----------------------------------------------------------------- + sum_new = c0 + sum_tot = c0 + do m = 1,nbtrcr do k = 1,nblyr+1 ! back to bulk quantity bio_tmp = (biomat_brine(k,m) + react(k,m))*iphin_N(k) - if (.not. conserve_N(k)) then - write(warnstr,*) subname, 'N in algal_dyn not conserved' + if (tr_bgc_C .and. m .eq. nlt_bgc_DIC(1) .and. bio_tmp .le. -accuracy) then ! satisfy DIC demands from ocean + !Uncomment for additional diagnostics + !write(warnstr,*) subname, 'DIC demand from ocean' + !call icepack_warnings_add(warnstr) + !write(warnstr,*) subname, 'm, k, nlt_bgc_DIC(1), bio_tmp, react(k,m):' + !call icepack_warnings_add(warnstr) + !write(warnstr,*) subname, m, k, nlt_bgc_DIC(1), bio_tmp, react(k,m) + !call icepack_warnings_add(warnstr) + !write(warnstr,*) subname, 'flux_bio(m), hbri, hbri_old:' + !call icepack_warnings_add(warnstr) + !write(warnstr,*) subname, flux_bio(m), hbri, hbri_old + !call icepack_warnings_add(warnstr) + flux_bio(m) = flux_bio(m) + bio_tmp*dz(k)*hbri/dt + bio_tmp = c0 + !write(warnstr,*) subname, 'flux_bio(m) Final:' + !call icepack_warnings_add(warnstr) + !write(warnstr,*) subname, flux_bio(m) + !call icepack_warnings_add(warnstr) + end if + if (m .eq. nlt_bgc_Nit) then + initcons_mobile(k) = max(c0,(biomat_brine(k,m)-nitrification(k) + & + react(k,m))*iphin_N(k)*trcrn(nt_zbgc_frac+m-1)) + initcons_stationary(k) = max(c0,((c1-trcrn(nt_zbgc_frac+m-1))*(biomat_brine(k,m)- & + nitrification(k) + react(k,m)) + nitrification(k))*iphin_N(k)) + + sum_new = sum_new + initcons_mobile(k)*dz(k) + sum_tot = sum_tot + (initcons_mobile(k) + initcons_stationary(k))*dz(k) + + end if ! m .eq. nlt_bgc_Nit + if (.not. conserve_C(k) .and. write_carbon_errors) then + write(warnstr,*) subname, 'C in algal_dyn not conserved' call icepack_warnings_add(warnstr) - write(warnstr,*) subname, 'Nerror(k):', Nerror(k) + write(warnstr,*) subname, 'Cerror(k):', Cerror(k) call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'k,m,hbri,hbri_old,bio_tmp,biomat_cons(k,m),ocean_bio(m)' call icepack_warnings_add(warnstr) @@ -1321,11 +1391,12 @@ subroutine z_biogeochemistry (n_cat, dt, & call icepack_warnings_add(warnstr) write(warnstr,*) subname, react(k,m),iphin_N(k),biomat_brine(k,m) call icepack_warnings_add(warnstr) - call icepack_warnings_add(subname//' N in algal_dyn not conserved') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - elseif (abs(bio_tmp) < puny) then + call icepack_warnings_add(subname//' C in algal_dyn not conserved') + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + elseif (abs(bio_tmp) < accuracy) then + flux_bio(m) = flux_bio(m) + bio_tmp*dz(k)*hbri/dt bio_tmp = c0 - elseif (bio_tmp > 1.0e6_dbl_kind) then + elseif (bio_tmp > large_bgc) then write(warnstr,*) subname, 'very large bgc value' call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'k,m,hbri,hbri_old,bio_tmp,biomat_cons(k,m),ocean_bio(m)' @@ -1337,7 +1408,7 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname, react(k,m),iphin_N(k),biomat_brine(k,m) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//' very large bgc value') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) elseif (bio_tmp < c0) then write(warnstr,*) subname, 'negative bgc' call icepack_warnings_add(warnstr) @@ -1356,38 +1427,28 @@ subroutine z_biogeochemistry (n_cat, dt, & write(warnstr,*) subname, 'exp_ret( m),exp_ret( m)',exp_ret( m),exp_ret( m) call icepack_warnings_add(warnstr) call icepack_warnings_add(subname//'negative bgc') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif + trcrn(bio_index(m)+k-1) = max(c0, bio_tmp) if (icepack_warnings_aborted()) then write(warnstr,*) subname, 'trcrn(nt_zbgc_frac+m-1):',trcrn(nt_zbgc_frac+m-1) call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'in_init_cons(k,m):',in_init_cons(k,m) call icepack_warnings_add(warnstr) - write(warnstr,*) subname, 'trcrn(bio_index(m) + k-1)' + write(warnstr,*) subname, 'trcrn(bio_index(m) + k-1), bio_tmp' call icepack_warnings_add(warnstr) - write(warnstr,*) subname, trcrn(bio_index(m) + k-1) + write(warnstr,*) subname, trcrn(bio_index(m) + k-1), bio_tmp call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'Category,m:',n_cat,m call icepack_warnings_add(warnstr) return endif - trcrn(bio_index(m)+k-1) = max(c0, bio_tmp) - if (ocean_bio(m) .le. c0 .and. flux_bio(m) < c0) then - ! if (flux_bio(m) < -1.0e-12_dbl_kind) then - ! write(warnstr,*) subname, 'no ocean_bio but flux_bio < c0' - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, 'm,ocean_bio(m),flux_bio(m)' - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, m,ocean_bio(m),flux_bio(m) - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, 'setting flux_bio(m) = c0' - ! call icepack_warnings_add(warnstr) - ! call icepack_warnings_add(subname//' flux_bio < 0 when ocean_bio = 0') - ! call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - ! endif - flux_bio(m) = max(c0,flux_bio(m)) - endif enddo ! k + if (m .eq. nlt_bgc_Nit .and. MAXVAL(nitrification) > c0) then + trcrn(nt_zbgc_frac+m-1) = zbgc_frac_init(m) + if (sum_tot > c0) trcrn(nt_zbgc_frac+m-1) = sum_new/sum_tot + end if + flux_bio(m) = flux_bio(m) + flux_bio_tmp(m) enddo ! m end subroutine z_biogeochemistry @@ -1398,20 +1459,16 @@ end subroutine z_biogeochemistry ! authors: Scott Elliott, LANL ! Nicole Jeffery, LANL - subroutine algal_dyn (dt, & - n_doc, n_dic, n_don, n_fed, n_fep, & - dEdd_algae, & + subroutine algal_dyn (dt, & + dEdd_algae, & fswthru, reactb, & - ltrcrn, & - grow_alg, n_algae, & + ltrcrn, & + grow_alg, & T_bot, & upNOn, upNHn, & Zoo, & - Nerror, conserve_N) - - integer (kind=int_kind), intent(in) :: & - n_doc, n_dic, n_don, n_fed, n_fep, & - n_algae ! number of autotrophic types + Cerror, conserve_C, & + nitrification) real (kind=dbl_kind), intent(in) :: & dt , & ! time step @@ -1420,7 +1477,8 @@ subroutine algal_dyn (dt, & real (kind=dbl_kind), intent(inout) :: & Zoo, & ! N losses from zooplankton/bacteria... (mmol/m^3) - Nerror ! Change in N after reactions (mmol/m^3) + Cerror, & ! Change in C after reactions (mmol/m^3) + nitrification ! nitrate produced through nitrification (mmol/m3) real (kind=dbl_kind), dimension (:), intent(out) :: & grow_alg,& ! algal growth rate (mmol/m^3/s) @@ -1434,7 +1492,7 @@ subroutine algal_dyn (dt, & ltrcrn ! brine concentrations in layer (mmol/m^3) logical (kind=log_kind), intent(inout) :: & - conserve_N + conserve_C logical (kind=log_kind), intent(in) :: & dEdd_algae ! .true. chla impact on shortwave computed in dEdd @@ -1451,21 +1509,18 @@ subroutine algal_dyn (dt, & ! nt_bgc_Sil -> silicate, nt_bgc_Fe -> dissolved iron ! -------------------------------------------------------------------------------------- -! real (kind=dbl_kind), parameter, dimension(max_algae) :: & -! alpha2max_high = (/ 0.25_dbl_kind, 0.25_dbl_kind, 0.25_dbl_kind/) ! light limitation (1/(W/m^2)) - integer (kind=int_kind) :: k, n real (kind=dbl_kind), dimension(n_algae) :: & Nin , & ! algal nitrogen concentration on volume (mmol/m^3) -! Cin , & ! algal carbon concentration on volume (mmol/m^3) + Cin , & ! algal carbon concentration on volume (mmol/m^3) chlin ! algal chlorophyll concentration on volume (mg/m^3) real (kind=dbl_kind), dimension(n_doc) :: & DOCin ! dissolved organic carbon concentration on volume (mmolC/m^3) -! real (kind=dbl_kind), dimension(n_dic) :: & -! DICin ! dissolved inorganic carbon concentration on volume (mmolC/m^3) + real (kind=dbl_kind), dimension(n_dic) :: & + DICin ! dissolved inorganic carbon concentration on volume (mmolC/m^3) real (kind=dbl_kind), dimension(n_don) :: & !proteins DONin ! dissolved organic nitrogen concentration on volume (mmolN/m^3) @@ -1483,7 +1538,7 @@ subroutine algal_dyn (dt, & ! DMSPpin , & ! DMSPp concentration on volume (mmol/m^3) DMSPdin , & ! DMSPd concentration on volume (mmol/m^3) DMSin , & ! DMS concentration on volume (mmol/m^3) -! PONin , & ! PON concentration on volume (mmol/m^3) + ! PONin , & ! PON concentration on volume (mmol/m^3) op_dep , & ! bottom layer attenuation exponent (optical depth) Iavg_loc ! bottom layer attenuated Fswthru (W/m^2) @@ -1498,7 +1553,6 @@ subroutine algal_dyn (dt, & fr_Am , & ! fraction of local ecological growth as ammonia growmax_N, & ! maximum growth rate in N currency (mmol/m^3/s) grow_N , & ! true growth rate in N currency (mmol/m^3/s) -! potU_Nit , & ! potential nitrate uptake (mmol/m^3/s) potU_Am , & ! potential ammonium uptake (mmol/m^3/s) U_Nit , & ! actual nitrate uptake (mmol/m^3/s) U_Am , & ! actual ammonium uptake (mmol/m^3/s) @@ -1523,11 +1577,6 @@ subroutine algal_dyn (dt, & exude_C , & ! total carbon exuded by algae (mmol C/m^3) resp_N , & ! total N in respiration (mmol N/m^3) growth_N ! total algal growth (mmol N/m^3) -! fr_graze_p , & ! fraction of N grazed that becomes protein -! ! (rest is assimilated) < (1-fr_graze_a) -! ! and fr_graze_a*fr_graze_e becomes ammonia -! fr_mort_p ! fraction of N mortality that becomes protein -! ! < (1-fr_mort2min) real (kind=dbl_kind), dimension(n_algae) :: & resp , & ! respiration (mmol/m^3/s) @@ -1544,6 +1593,10 @@ subroutine algal_dyn (dt, & DOC_r , & ! net DOC removal (mmol/m^3) DOC_s ! net DOC sources (mmol/m^3) + real (kind=dbl_kind), dimension(n_dic) :: & + DIC_r , & ! net DIC removal (mmol/m^3) + DIC_s ! net DIC sources (mmol/m^3) + real (kind=dbl_kind), dimension(n_don) :: & DON_r , & ! net DON removal (mmol/m^3) DON_s ! net DON sources (mmol/m^3) @@ -1561,12 +1614,12 @@ subroutine algal_dyn (dt, & real (kind=dbl_kind) :: & dN , & ! change in N (mmol/m^3) -! N_s_p , & ! algal nitrogen photosynthesis (mmol/m^3) -! N_r_g , & ! algal nitrogen losses to grazing (mmol/m^3) -! N_r_r , & ! algal nitrogen losses to respiration (mmol/m^3) -! N_r_mo , & ! algal nitrogen losses to mortality (mmol/m^3) + dC , & ! change in Carbon (mmol C/m^3) + N_s_p , & ! algal nitrogen photosynthesis (mmol/m^3) + N_r_g , & ! algal nitrogen losses to grazing (mmol/m^3) + N_r_r , & ! algal nitrogen losses to respiration (mmol/m^3) + N_r_mo , & ! algal nitrogen losses to mortality (mmol/m^3) Nit_s_n , & ! nitrate from nitrification (mmol/m^3) -! Nit_s_r , & ! nitrate from respiration (mmol/m^3) Nit_r_p , & ! nitrate uptake by algae (mmol/m^3) Nit_s , & ! net nitrate sources (mmol/m^3) Nit_r , & ! net nitrate removal (mmol/m^3) @@ -1609,19 +1662,18 @@ subroutine algal_dyn (dt, & ! Initialize !----------------------------------------------------------------------- - conserve_N = .true. + conserve_C = .true. Nin(:) = c0 -! Cin(:) = c0 + Cin(:) = c0 chlin(:) = c0 DOCin(:) = c0 -! DICin(:) = c0 + DICin(:) = c0 DONin(:) = c0 Fedin(:) = c0 Fepin(:) = c0 Nitin = c0 Amin = c0 Silin = c0 -! DMSPpin = c0 DMSPdin = c0 DMSin = c0 U_Am_tot = c0 @@ -1634,7 +1686,6 @@ subroutine algal_dyn (dt, & U_Fe_f(:) = c0 DOC_s(:) = c0 DOC_r(:) = c0 -! DOC_r_c = c0 nitrif = c0 mort_N = c0 mort_C = c0 @@ -1658,9 +1709,11 @@ subroutine algal_dyn (dt, & Fed_tot_s = c0 rFed(:) = c0 Fep_tot = c0 -! Fep_tot_r = c0 Fep_tot_s = c0 rFep(:) = c0 + DIC_r(:) = c0 + DIC_s(:) = c0 + Zoo = c0 Nitin = ltrcrn(nlt_bgc_Nit) op_dep = c0 @@ -1676,9 +1729,9 @@ subroutine algal_dyn (dt, & do k = 1, n_doc DOCin(k)= ltrcrn(nlt_bgc_DOC(k)) enddo -! do k = 1, n_dic -! DICin(k)= ltrcrn(nlt_bgc_DIC(k)) -! enddo + do k = 1, n_dic + DICin(k)= ltrcrn(nlt_bgc_DIC(k)) + enddo endif if (tr_bgc_Am) Amin = ltrcrn(nlt_bgc_Am) if (tr_bgc_Sil) Silin = ltrcrn(nlt_bgc_Sil) @@ -1687,10 +1740,10 @@ subroutine algal_dyn (dt, & DMSPdin = ltrcrn(nlt_bgc_DMSPd) DMSin = ltrcrn(nlt_bgc_DMS) endif -! if (tr_bgc_PON) then +! if (tr_bgc_PON) then ! PONin = c0 ! PONin = ltrcrn(nlt_bgc_PON) -! endif +! endif if (tr_bgc_DON) then do k = 1, n_don DONin(k) = ltrcrn(nlt_bgc_DON(k)) @@ -1773,7 +1826,11 @@ subroutine algal_dyn (dt, & !---------------------------------------------------------------------------- growmax_N(k) = mu_max(k) / secday * exp(grow_Tdep(k) * dTemp)* Nin(k) *fsal - grow_N(k) = min(L_lim(k), N_lim(k), Sil_lim(k), Fe_lim(k)) * growmax_N(k) + if (n_fed == 0) then + grow_N(k) = min(L_lim(k), N_lim(k), Sil_lim(k)) * growmax_N(k) + else + grow_N(k) = min(L_lim(k), N_lim(k), Sil_lim(k), Fe_lim(k)) * growmax_N(k) + endif ! potU_Nit(k) = Nit_lim(k)* growmax_N(k) potU_Am(k) = Am_lim(k)* growmax_N(k) U_Am(k) = min(grow_N(k), potU_Am(k)) @@ -1804,10 +1861,12 @@ subroutine algal_dyn (dt, & U_Sil(k) = U_Sil_f(k)*U_Sil_tot U_Fe(k) = U_Fe_f(k)*U_Fe_tot - if (R_Si2N(k) > c0) then - grow_N(k) = min(U_Sil(k)/R_Si2N(k),U_Nit(k) + U_Am(k), U_Fe(k)/R_Fe2N(k)) - else - grow_N(k) = min(U_Nit(k) + U_Am(k),U_Fe(k)/R_Fe2N(k)) + if (n_fed == 0) then + if (R_Si2N(k) > c0) then + grow_N(k) = min(U_Sil(k)/R_Si2N(k),U_Nit(k) + U_Am(k), U_Fe(k)/R_Fe2N(k)) + else + grow_N(k) = min(U_Nit(k) + U_Am(k),U_Fe(k)/R_Fe2N(k)) + endif endif fr_Am(k) = c0 @@ -1834,11 +1893,13 @@ subroutine algal_dyn (dt, & !-------------------------------------------------------------------- ! Algal reaction term - ! N_react = (grow_N*(c1 - fr_graze-fr_resp) - mort)*dt + ! v1: N_react = (grow_N*(c1 - fr_graze-fr_resp) - mort)*dt + ! v2: N_react = (grow_N*(c1 - fr_graze * (N/graze_conc)**graze_exp-fr_resp) - mort)*dt + ! with maximum grazing less than max_loss * Nin(k)/dt !-------------------------------------------------------------------- resp(k) = fr_resp * grow_N(k) - graze(k) = fr_graze(k) * grow_N(k) + graze(k) = min(max_loss * Nin(k)/dt, grow_N(k) * fr_graze(k) * (Nin(k)/graze_conc)**graze_exponent(k)) mort(k) = min(max_loss * Nin(k)/dt, & mort_pre(k)*exp(mort_Tdep(k)*dTemp) * Nin(k)/secday) @@ -1847,13 +1908,12 @@ subroutine algal_dyn (dt, & upNOn(k) = U_Nit(k) upNHn(k) = U_Am(k) -! N_s_p = grow_N(k) * dt -! N_r_g = graze(k) * dt -! N_r_r = resp(k) * dt -! N_r_mo = mort(k) * dt - N_s(k) = (c1- fr_resp - fr_graze(k)) * grow_N(k) *dt !N_s_p - N_r(k) = mort(k) * dt !N_r_g + N_r_mo + N_r_r - + N_s_p = grow_N(k) * dt + N_r_g = graze(k) * dt + N_r_r = resp(k) * dt + N_r_mo = mort(k) * dt + N_s(k) = N_s_p + N_r(k) = N_r_g + N_r_mo + N_r_r graze_N = graze_N + graze(k) graze_C = graze_C + R_C2N(k)*graze(k) mort_N = mort_N + mort(k) @@ -1885,16 +1945,18 @@ subroutine algal_dyn (dt, & Fe_r_p = U_Fe (k) * dt Fed_tot_r = Fed_tot_r + Fe_r_p exude_C = exude_C + k_exude(k)* R_C2N(k)*Nin(k) / secday + DIC_r(1) = DIC_r(1) + (c1-fr_resp)*grow_N(k) * R_C2N(k) * dt enddo !-------------------------------------------------------------------- ! nitrification !-------------------------------------------------------------------- - nitrif = k_nitrif /secday * Amin - Am_r = Am_r + nitrif*dt - Nit_s_n = nitrif * dt ! source from NH4 - Nit_s = Nit_s_n + nitrification = c0 + nitrif = k_nitrif /secday * Amin + Am_r = Am_r + nitrif*dt + Nit_s_n = nitrif * dt ! source from NH4 + Nit_s = Nit_s_n !-------------------------------------------------------------------- ! PON: currently using PON to shadow nitrate @@ -1928,10 +1990,11 @@ subroutine algal_dyn (dt, & if (tr_bgc_DON) then do n = 1, n_don DON_r(n) = kn_bac(n)/secday * DONin(n) * dt - DON_s(n) = graze_N*f_don(n)*fr_graze_s * dt + DON_s(n) = graze_N*dt - Am_s_e + mort_N*dt - Am_s_mo Zoo_s_s = Zoo_s_s - DON_s(n) Zoo_s_b = Zoo_s_b + DON_r(n)*(c1-f_don_Am(n)) - !Am_s = Am_s + DON_r(n)*f_don_Am(n) + Am_s = Am_s + DON_r(n)*f_don_Am(n) + DIC_s(1) = DIC_s(1) + DON_r(n) * R_C2N_DON(n) enddo endif @@ -1945,8 +2008,10 @@ subroutine algal_dyn (dt, & do n = 1, n_doc DOC_r(n) = k_bac(n)/secday * DOCin(n) * dt - DOC_s(n) = f_doc(n)*(fr_graze_s *graze_C + mort_C)*dt & - + f_exude(n)*exude_C +! DOC_s(n) = f_doc(n)*(fr_graze_s *graze_C + mort_C)*dt & +! + f_exude(n)*exude_C + DOC_s(n) = f_doc(n) * (graze_C*dt + mort_C*dt - DON_s(1) * R_C2N_DON(1)) + DIC_s(1) = DIC_s(1) + DOC_r(n) enddo !-------------------------------------------------------------------- @@ -1963,16 +2028,16 @@ subroutine algal_dyn (dt, & if (tr_bgc_C .and. tr_bgc_Fe) then if (DOCin(1) > c0) then - if (Fed_tot/DOCin(1) > max_dfe_doc1) then - do n = 1,n_fed ! low saccharid:dFe ratio leads to - Fed_r_l(n) = Fedin(n)/t_iron_conv*dt/secday ! loss of bioavailable Fe to particulate fraction - Fep_tot_s = Fep_tot_s + Fed_r_l(n) - Fed_r(n) = Fed_r_l(n) ! removal due to particulate scavenging - enddo - do n = 1,n_fep - Fep_s(n) = rFep(n)* Fep_tot_s ! source from dissolved Fe - enddo - elseif (Fed_tot/DOCin(1) < max_dfe_doc1) then + !if (Fed_tot/DOCin(1) > max_dfe_doc1) then + ! do n = 1,n_fed ! low saccharid:dFe ratio leads to + ! Fed_r_l(n) = Fedin(n)/t_iron_conv*dt/secday ! loss of bioavailable Fe to particulate fraction + ! Fep_tot_s = Fep_tot_s + Fed_r_l(n) + ! Fed_r(n) = Fed_r_l(n) ! removal due to particulate scavenging + ! enddo + ! do n = 1,n_fep + ! Fep_s(n) = rFep(n)* Fep_tot_s ! source from dissolved Fe + ! enddo + if (Fed_tot/DOCin(1) < max_dfe_doc1) then do n = 1,n_fep ! high saccharid:dFe ratio leads to Fep_r(n) = Fepin(n)/t_iron_conv*dt/secday ! gain of bioavailable Fe from particulate fraction Fed_tot_s = Fed_tot_s + Fep_r(n) @@ -1982,7 +2047,8 @@ subroutine algal_dyn (dt, & enddo endif endif !Docin(1) > c0 - elseif (tr_bgc_Fe) then + endif + if (tr_bgc_Fe) then do n = 1,n_fed Fed_r(n) = Fed_r(n) + rFed(n)*Fed_tot_r ! scavenging + uptake enddo @@ -2032,9 +2098,11 @@ subroutine algal_dyn (dt, & !----------------------------------------------------------------------- dN = c0 + dC = c0 do k = 1,n_algae reactb(nlt_bgc_N(k)) = N_s(k) - N_r(k) dN = dN + reactb(nlt_bgc_N(k)) + dC = dC + reactb(nlt_bgc_N(k)) * R_C2N(k) enddo if (tr_bgc_C) then ! do k = 1,n_algae @@ -2042,10 +2110,16 @@ subroutine algal_dyn (dt, & ! enddo do k = 1,n_doc reactb(nlt_bgc_DOC(k))= DOC_s(k) - DOC_r(k) + dC = dC + reactb(nlt_bgc_DOC(k)) + enddo + do k = 1,n_dic + reactb(nlt_bgc_DIC(k))= DIC_s(k) - DIC_r(k) + dC = dC + reactb(nlt_bgc_DIC(k)) enddo endif - reactb(nlt_bgc_Nit) = Nit_s - Nit_r - dN = dN + reactb(nlt_bgc_Nit) + reactb(nlt_bgc_Nit) = Nit_s - Nit_r + nitrification = Nit_s_n + dN = dN + reactb(nlt_bgc_Nit) if (tr_bgc_Am) then reactb(nlt_bgc_Am) = Am_s - Am_r dN = dN + reactb(nlt_bgc_Am) @@ -2057,8 +2131,10 @@ subroutine algal_dyn (dt, & do k = 1,n_don reactb(nlt_bgc_DON(k))= DON_s(k) - DON_r(k) dN = dN + reactb(nlt_bgc_DON(k)) + dC = dC + reactb(nlt_bgc_DON(k)) * R_C2N_DON(k) enddo endif + Cerror = dC if (tr_bgc_Fe ) then do k = 1,n_fed reactb(nlt_bgc_Fed(k))= Fed_s (k) - Fed_r (k) @@ -2071,25 +2147,75 @@ subroutine algal_dyn (dt, & reactb(nlt_bgc_DMSPd) = DMSPd_s - DMSPd_r reactb(nlt_bgc_DMS) = DMS_s - DMS_r endif - Nerror = dN + Zoo - ! if (abs(Nerror) > max(reactb(:))*1.0e-5) then - ! conserve_N = .false. - ! write(warnstr,*) subname, 'Conservation error!' - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, 'Nerror,dN, DONin(1),kn_bac(1),secday,dt,n_doc' - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, Nerror,dN, DONin(1),kn_bac(1),secday,dt,n_doc - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, 'reactb(nlt_bgc_Nit),reactb(nlt_bgc_N(1)),reactb(nlt_bgc_N(2)' - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, reactb(nlt_bgc_Nit),reactb(nlt_bgc_N(1)),reactb(nlt_bgc_N(2)) - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, 'reactb(nlt_bgc_Am),reactb(nlt_bgc_DON(1)), DON_r(1),DON_s(1)' - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, reactb(nlt_bgc_Am),reactb(nlt_bgc_DON(1)),DON_r(1),DON_s(1) - ! call icepack_warnings_add(warnstr) - ! write(warnstr,*) subname, 'Zoo:',Zoo - ! endif + + if (tr_bgc_C) then + if (abs(dC) > max(puny,maxval(abs(reactb(:)))*accuracy) .or. & + abs(dN) > max(puny,maxval(abs(reactb(:)))*accuracy)) then + conserve_C = .false. + write(warnstr,*) subname, 'Conservation error!' + call icepack_warnings_add(warnstr) + if (tr_bgc_DON) then + write(warnstr,*) subname, 'dN,DONin(1), kn_bac(1),secday,dt,n_doc' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, dN, DONin(1),kn_bac(1),secday,dt,n_doc + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'reactb(nlt_bgc_DON(1)), DON_r(1),DON_s(1)' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, reactb(nlt_bgc_DON(1)),DON_r(1),DON_s(1) + call icepack_warnings_add(warnstr) + end if + write(warnstr,*) subname, 'dN,secday,dt,n_doc' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, dN,secday,dt,n_doc + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'reactb(nlt_bgc_Nit),reactb(nlt_bgc_N(n_algae))' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, reactb(nlt_bgc_Nit),reactb(nlt_bgc_N(n_algae)) + call icepack_warnings_add(warnstr) + if (tr_bgc_Am) then + write(warnstr,*) subname, 'reactb(nlt_bgc_Am),Am_r, Am_s' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, reactb(nlt_bgc_Am),Am_r, Am_s + call icepack_warnings_add(warnstr) + end if + write(warnstr,*) subname, 'dC' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, dC + call icepack_warnings_add(warnstr) + do k = 1,n_doc + write(warnstr,*) subname, 'DOCin' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, DOCin(k) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'reactb(nlt_bgc_DOC)' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, reactb(nlt_bgc_DOC(k)) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'DOC_r(k),DOC_s(k),k' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, DOC_r(k),DOC_s(k),k + call icepack_warnings_add(warnstr) + end do + do k = 1,n_dic + write(warnstr,*) subname, 'DICin' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, DICin(k) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'reactb(nlt_bgc_DIC)' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, reactb(nlt_bgc_DIC(k)) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'DIC_r(k),DIC_s(k),k' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, DIC_r(k),DIC_s(k),k + call icepack_warnings_add(warnstr) + end do + write(warnstr,*) subname, 'Zoo' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, Zoo + call icepack_warnings_add(warnstr) + endif + endif end subroutine algal_dyn @@ -2101,11 +2227,7 @@ end subroutine algal_dyn ! authors Nicole Jeffery, LANL subroutine thin_ice_flux (hin, hin_old, Cin, flux_o_tot, & - source, dt, nblyr, & - ocean_bio) - - integer (kind=int_kind), intent(in) :: & - nblyr ! number of bio layers + source, dt, ocean_bio) real (kind=dbl_kind), dimension(nblyr+1), intent(inout) :: & Cin ! initial concentration*hin_old*phin @@ -2141,7 +2263,7 @@ subroutine thin_ice_flux (hin, hin_old, Cin, flux_o_tot, & sum_bio = c0 dh = hin-hin_old - if (dh .le. c0) then ! keep the brine concentration fixed + if (dh .le. c0 .and. hin_old > puny) then ! keep the brine concentration fixed sum_bio = (Cin(1)+Cin(nblyr+1))/hin_old*zspace*p5 Cin(1) = Cin(1)/hin_old*hin Cin(nblyr+1) = Cin(nblyr+1)/hin_old*hin @@ -2149,7 +2271,7 @@ subroutine thin_ice_flux (hin, hin_old, Cin, flux_o_tot, & sum_bio = sum_bio + Cin(k)/hin_old*zspace Cin(k) = Cin(k)/hin_old*hin + dC enddo - else + else ! spread evenly in ice layers dC = dh*ocean_bio do k = 1, nblyr+1 Cin(k) = Cin(k) + dC @@ -2167,21 +2289,18 @@ end subroutine thin_ice_flux ! ! July, 2014 by N. Jeffery ! - subroutine compute_FCT_matrix (C_in, sbdiag, dt, nblyr, & - diag, spdiag, rhs, bgrid, & - darcyV, dhtop, dhbot, & + subroutine compute_FCT_matrix (C_in, sbdiag, dt, & + diag, spdiag, rhs, & + darcyV, dhtop, dhbot, & iphin_N, iDin, hbri_old, & atm_add, bphin_N, & C_top, C_bot, Qbot, Qtop, & Sink_bot, Sink_top, & D_sbdiag, D_spdiag, ML) - integer (kind=int_kind), intent(in) :: & - nblyr ! number of bio layers - real (kind=dbl_kind), dimension(nblyr+1), intent(in) :: & C_in ! Initial (bulk) concentration*hbri_old (mmol/m^2) - ! conserved quantity on i_grid + ! conserved quantity on igrid real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -2193,8 +2312,7 @@ subroutine compute_FCT_matrix (C_in, sbdiag, dt, nblyr, & iphin_N ! Porosity with min condition on igrid real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - bphin_N, & ! Porosity with min condition on igrid - bgrid + bphin_N ! Porosity with min condition on igrid real (kind=dbl_kind), dimension (nblyr+1), intent(out) :: & sbdiag , & ! sub-diagonal matrix elements @@ -2366,11 +2484,8 @@ end subroutine compute_FCT_matrix ! ! July, 2014 by N. Jeffery ! - subroutine compute_FCT_corr (C_in, C_low, dt, nblyr, & - D_sbdiag, D_spdiag, ML) - - integer (kind=int_kind), intent(in) :: & - nblyr ! number of bio layers + subroutine compute_FCT_corr(C_in, C_low, dt, & + D_sbdiag, D_spdiag, ML) real (kind=dbl_kind), dimension(nblyr+1), intent(in) :: & C_in ! Initial (bulk) concentration*hbri_old (mmol/m^2) @@ -2494,7 +2609,7 @@ end subroutine compute_FCT_corr ! authors William H. Lipscomb, LANL ! C. M. Bitz, UW ! - subroutine tridiag_solverz (nmat, sbdiag, & + subroutine tridiag_solverz(nmat, sbdiag, & diag, spdiag, & rhs, xout) @@ -2544,11 +2659,7 @@ end subroutine tridiag_solverz subroutine check_conservation_FCT (C_init, C_new, C_low, S_top, & S_bot, L_bot, L_top, dt, & - fluxbio, nblyr, & - source) - - integer (kind=int_kind), intent(in) :: & - nblyr ! number of bio layers + fluxbio, source) real (kind=dbl_kind), dimension(nblyr+1), intent(in) :: & C_init , & ! initial bulk concentration * h_old (mmol/m^2) @@ -2578,7 +2689,8 @@ subroutine check_conservation_FCT (C_init, C_new, C_low, S_top, & C_init_tot , & C_new_tot , & zspace , & !1/nblyr - accuracy ! centered difference is Order(zspace^2) + accuracyC , & ! centered difference is Order(zspace^2) + var_tmp ! temporary variable character(len=*),parameter :: subname='(check_conservation_FCT)' @@ -2598,33 +2710,82 @@ subroutine check_conservation_FCT (C_init, C_new, C_low, S_top, & C_low(k) = C_new(k) enddo - accuracy = 1.0e-14_dbl_kind*max(c1, C_init_tot, C_new_tot) - fluxbio = (C_init_tot - C_new_tot + source)/dt + accuracyC = 1.0e-11_dbl_kind*max(c1, C_init_tot, C_new_tot) + fluxbio = fluxbio + (C_init_tot - C_new_tot + source)/dt diff_dt =C_new_tot - C_init_tot - (S_top+S_bot+L_bot*C_new(nblyr+1)+L_top*C_new(1))*dt if (minval(C_low) < c0) then write(warnstr,*) subname, 'Positivity of zbgc low order solution failed: C_low:',C_low - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + call icepack_warnings_add(warnstr) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif - if (abs(diff_dt) > accuracy ) then - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - write(warnstr,*) subname, 'Conservation of zbgc low order solution failed: diff_dt:',& - diff_dt - write(warnstr,*) subname, 'Total initial tracer', C_init_tot - write(warnstr,*) subname, 'Total final1 tracer', C_new_tot - write(warnstr,*) subname, 'bottom final tracer', C_new(nblyr+1) - write(warnstr,*) subname, 'top final tracer', C_new(1) - write(warnstr,*) subname, 'Near bottom final tracer', C_new(nblyr) - write(warnstr,*) subname, 'Near top final tracer', C_new(2) - write(warnstr,*) subname, 'Top flux*dt into ice:', S_top*dt - write(warnstr,*) subname, 'Bottom flux*dt into ice:', S_bot*dt - write(warnstr,*) subname, 'Remaining bot flux*dt into ice:', L_bot*C_new(nblyr+1)*dt + if (abs(diff_dt) > accuracyC ) then + write(warnstr,*) subname, '' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Conservation of zbgc low order solution failed: diff_dt:' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, diff_dt + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Total initial tracer' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, C_init_tot + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Total final1 tracer' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, C_new_tot + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'bottom final tracer' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, C_new(nblyr+1) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'top final tracer' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, C_new(1) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Near bottom final tracer' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, C_new(nblyr) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Near top final tracer' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, C_new(2) + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Top flux*dt into ice:' + call icepack_warnings_add(warnstr) + var_tmp = S_top*dt + write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Bottom flux*dt into ice:' + call icepack_warnings_add(warnstr) + var_tmp = S_bot*dt + write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Remaining bot flux*dt into ice:' + call icepack_warnings_add(warnstr) + var_tmp = L_bot*C_new(nblyr+1)*dt + write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) write(warnstr,*) subname, 'S_bot*dt + L_bot*C_new(nblyr+1)*dt' - write(warnstr,*) subname, S_bot*dt + L_bot*C_new(nblyr+1)*dt - write(warnstr,*) subname, 'fluxbio*dt:', fluxbio*dt - write(warnstr,*) subname, 'fluxbio:', fluxbio - write(warnstr,*) subname, 'Remaining top flux*dt into ice:', L_top*C_new(1)*dt + call icepack_warnings_add(warnstr) + var_tmp = S_bot*dt + L_bot*C_new(nblyr+1)*dt + write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'fluxbio*dt:' + call icepack_warnings_add(warnstr) + var_tmp = fluxbio*dt + write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'fluxbio:' + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, fluxbio + call icepack_warnings_add(warnstr) + write(warnstr,*) subname, 'Remaining top flux*dt into ice:' + call icepack_warnings_add(warnstr) + var_tmp = L_top*C_new(1)*dt + write(warnstr,*) subname, var_tmp + call icepack_warnings_add(warnstr) + !call icepack_warnings_setabort(.true.,__FILE__,__LINE__) endif end subroutine check_conservation_FCT @@ -2635,11 +2796,7 @@ end subroutine check_conservation_FCT ! ! author: Nicole Jeffery, LANL - subroutine bgc_column_sum (nblyr, nslyr, hsnow, hbrine, xin, xout) - - integer (kind=int_kind), intent(in) :: & - nblyr, & ! number of ice layers - nslyr ! number of snow layers + subroutine bgc_column_sum (hsnow, hbrine, xin, xout) real (kind=dbl_kind), dimension(nblyr+3), intent(in) :: & xin ! input field @@ -2665,7 +2822,7 @@ subroutine bgc_column_sum (nblyr, nslyr, hsnow, hbrine, xin, xout) character(len=*),parameter :: subname='(bgc_column_sum)' hslyr = hsnow/real(nslyr,kind=dbl_kind) - dzssl = min(hslyr*p5, hs_ssl) + dzssl = hslyr*p5 dzint = max(c0,hsnow - dzssl) zspace = c1/real(nblyr,kind=dbl_kind) @@ -2678,6 +2835,138 @@ subroutine bgc_column_sum (nblyr, nslyr, hsnow, hbrine, xin, xout) end subroutine bgc_column_sum +!======================================================================= + +! Find the total carbon concentration by summing the appropriate +! biogeochemical tracers in units of mmol C/m2 +! +! author: Nicole Jeffery, LANL + + subroutine bgc_carbon_sum (hbrine, xin, xout) + + real (kind=dbl_kind), dimension(:), intent(in) :: & + xin ! input field, all tracers and column + + real (kind=dbl_kind), intent(in) :: & + hbrine ! brine height + + real (kind=dbl_kind), intent(out) :: & + xout ! output field mmol/m2 carbon + + ! local variables + + real (kind=dbl_kind), dimension(nblyr+1) :: & + zspace ! brine layer thickness/hbrine + + integer (kind=int_kind) :: & + n, m, iBioCount, iLayer, nBGC ! category/layer index + + character(len=*),parameter :: subname='(bgc_carbon_sum)' + + zspace(:) = c1/real(nblyr,kind=dbl_kind) + zspace(1) = p5*zspace(1) + zspace(nblyr+1) = zspace(1) + + xout = c0 + + if (tr_bgc_N) then + iBioCount = c0 + do m = 1, n_algae + nBGC = nt_bgc_N(1) + do n = 1, nblyr+1 + iLayer = iBioCount + n-1 + xout = xout + xin(nBGC+iLayer)*zspace(n)*hbrine*R_C2N(m) + enddo + iBioCount = iBioCount + nblyr+3 + enddo + endif + if (tr_bgc_C) then + iBioCount = c0 + nBGC = nt_bgc_DOC(1) + do m = 1, n_doc + do n = 1, nblyr+1 + iLayer = iBioCount + n-1 + xout = xout + xin(nBGC+iLayer)*zspace(n)*hbrine + enddo + iBioCount = iBioCount + nblyr+3 + enddo + do m = 1, n_dic + do n = 1, nblyr+1 + iLayer = iBioCount + n-1 + xout = xout + xin(nBGC+iLayer)*zspace(n)*hbrine + enddo + iBioCount = iBioCount + nblyr+3 + enddo + endif + + if (tr_bgc_DON) then + iBioCount = c0 + do m = 1, n_don + nBGC = nt_bgc_DON(1) + do n = 1, nblyr+1 + iLayer = iBioCount + n-1 + xout = xout + xin(nBGC+iLayer)*zspace(n)*hbrine*R_C2N_DON(m) + enddo + iBioCount = iBioCount + nblyr+3 + enddo + endif + if (tr_bgc_hum) then + nBGC = nt_bgc_hum + do n = 1, nblyr+1 + iLayer = n-1 + xout = xout + xin(nBGC+iLayer)*zspace(n)*hbrine + enddo + endif + + end subroutine bgc_carbon_sum + +!======================================================================= + +! Find the total carbon flux by summing the fluxes for the appropriate +! biogeochemical each grid cell, sum field over all ice and snow layers +! +! author: Nicole Jeffery, LANL + + subroutine bgc_carbon_flux (flux_bio_atm, flux_bion, Tot_Carbon_flux) + + real (kind=dbl_kind), dimension(:), intent(in) :: & + flux_bio_atm, & ! input field, all tracers and column + flux_bion + + real (kind=dbl_kind), intent(out) :: & + Tot_Carbon_flux ! output field mmol/m2/s carbon + + ! local variables + integer (kind=int_kind) :: & + m ! biology index + + character(len=*),parameter :: subname='(bgc_carbon_flux)' + + Tot_Carbon_flux = c0 + + if (tr_bgc_N) then + do m = 1, n_algae + Tot_Carbon_flux = Tot_Carbon_flux - (flux_bio_atm(nlt_bgc_N(m)) - flux_bion(nlt_bgc_N(m)))*R_C2N(m) + enddo + endif + if (tr_bgc_C) then + do m = 1, n_doc + Tot_Carbon_flux = Tot_Carbon_flux - flux_bio_atm(nlt_bgc_DOC(m)) + flux_bion(nlt_bgc_DOC(m)) + enddo + do m = 1, n_dic + Tot_Carbon_flux = Tot_Carbon_flux - flux_bio_atm(nlt_bgc_DIC(m)) + flux_bion(nlt_bgc_DIC(m)) + enddo + endif + if (tr_bgc_DON) then + do m = 1, n_don + Tot_Carbon_flux = Tot_Carbon_flux - (flux_bio_atm(nlt_bgc_DON(m)) - flux_bion(nlt_bgc_DON(m)))*R_C2N_DON(m) + enddo + endif + if (tr_bgc_hum) & + Tot_Carbon_flux = Tot_Carbon_flux - flux_bio_atm(nlt_bgc_hum) + flux_bion(nlt_bgc_hum) + + end subroutine bgc_carbon_flux + !======================================================================= end module icepack_algae diff --git a/columnphysics/icepack_atmo.F90 b/columnphysics/icepack_atmo.F90 index b4a97e0a..f85b7794 100644 --- a/columnphysics/icepack_atmo.F90 +++ b/columnphysics/icepack_atmo.F90 @@ -21,7 +21,7 @@ module icepack_atmo use icepack_parameters, only: pih, dragio, rhoi, rhos, rhow use icepack_parameters, only: atmbndy, calc_strair, formdrag use icepack_parameters, only: icepack_chkoptargflag - use icepack_tracers, only: n_iso + use icepack_tracers, only: ncat, n_iso use icepack_tracers, only: tr_iso use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -521,13 +521,10 @@ subroutine neutral_drag_coeffs (apnd, hpnd, & hdraft, hridge, & distrdg, hkeel, & dkeel, lfloe, & - dfloe, ncat) + dfloe) use icepack_tracers, only: tr_pond - integer (kind=int_kind), intent(in) :: & - ncat - real (kind=dbl_kind), dimension (:), intent(in) :: & apnd ,& ! melt pond fraction of sea ice hpnd ,& ! mean melt pond depth over sea ice diff --git a/columnphysics/icepack_brine.F90 b/columnphysics/icepack_brine.F90 index 98aea58d..f4738a4d 100644 --- a/columnphysics/icepack_brine.F90 +++ b/columnphysics/icepack_brine.F90 @@ -7,19 +7,19 @@ module icepack_brine use icepack_kinds - use icepack_parameters, only: p01, p001, p5, c0, c1, c2, c1p5, puny + use icepack_parameters, only: p01, p001, p5, c0, c1, c2, c1p5, puny, p25 use icepack_parameters, only: gravit, rhoi, rhow, rhos, depressT use icepack_parameters, only: salt_loss, min_salin, rhosi use icepack_parameters, only: dts_b, l_sk - use icepack_tracers, only: ntrcr, nt_qice, nt_sice + use icepack_tracers, only: nilyr, nblyr, ntrcr, nt_qice, nt_sice use icepack_tracers, only: nt_Tsfc use icepack_zbgc_shared, only: k_o, exp_h, Dm, Ra_c, viscos_dynamic, thinS + use icepack_zbgc_shared, only: bgrid, cgrid, igrid, swgrid, icgrid use icepack_zbgc_shared, only: remap_zbgc use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted use icepack_mushy_physics, only: icepack_mushy_temperature_mush, icepack_mushy_liquid_fraction - use icepack_therm_shared, only: calculate_Tin_from_qin implicit none @@ -62,7 +62,7 @@ subroutine preflushing_changes (aicen, vicen, vsnon, & meltb, meltt, congel, & snoice, hice_old, dhice, & fbri, dhbr_top, dhbr_bot, & - hbr_old, hin,hsn, firstice ) + hbr_old, hin, hsn) real (kind=dbl_kind), intent(in) :: & aicen , & ! concentration of ice @@ -87,9 +87,6 @@ subroutine preflushing_changes (aicen, vicen, vsnon, & dhbr_bot , & ! brine change in bottom for diagnostics (m) hice_old ! old ice thickness (m) - logical (kind=log_kind), intent(in) :: & - firstice ! if true, initialized values should be used - ! local variables real (kind=dbl_kind) :: & @@ -117,14 +114,6 @@ subroutine preflushing_changes (aicen, vicen, vsnon, & dhbr_top = meltt - snoice - dhice dhbr_bot = congel - meltb - if ((hice_old < puny) .OR. (hin_old < puny) .OR. firstice) then - hice_old = hin - dhbr_top = c0 - dhbr_bot = c0 - dhice = c0 - fbri = c1 - endif - hbr_old = fbri * hice_old end subroutine preflushing_changes @@ -135,28 +124,13 @@ end subroutine preflushing_changes ! NOTE: This subroutine uses thermosaline_vertical output to compute ! average ice permeability and the surface ice porosity - subroutine compute_microS_mushy (nilyr, nblyr, & - bgrid, cgrid, igrid, & - trcrn, hice_old, hbr_old, & + subroutine compute_microS_mushy (trcrn, hice_old, hbr_old, & sss, sst, bTin, & iTin, bphin, & - kperm, bphi_min, & + kperm, bphi_min, & bSin, brine_sal, brine_rho, & iphin, ibrine_rho, ibrine_sal, & - sice_rho, iDin ) - - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nblyr ! number of bio 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 + iDin, iSin) real (kind=dbl_kind), intent(in) :: & hice_old , & ! previous timestep ice height (m) @@ -170,7 +144,7 @@ subroutine compute_microS_mushy (nilyr, nblyr, & kperm , & ! average ice permeability (m^2) bphi_min ! surface porosity - real (kind=dbl_kind), intent(inout) :: & + real (kind=dbl_kind), intent(in) :: & hbr_old ! previous timestep brine height (m) real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: & @@ -180,7 +154,8 @@ subroutine compute_microS_mushy (nilyr, nblyr, & iphin , & ! porosity on the igrid ibrine_rho , & ! brine rho on interface ibrine_sal , & ! brine sal on interface - iTin ! Temperature on the igrid (oC) + iTin , & ! Temperature on the igrid (oC) + iSin ! Salinity on the igrid (ppt) real (kind=dbl_kind), dimension (nblyr+2), intent(inout) :: & bSin , & ! bulk salinity (ppt) on bgrid @@ -191,10 +166,15 @@ subroutine compute_microS_mushy (nilyr, nblyr, & bTin , & ! Temperature on bgrid bphin ! porosity on bgrid - real (kind=dbl_kind), intent(inout) :: & - sice_rho ! average ice density + ! local variables + + real (kind=dbl_kind), dimension (nilyr) :: & + cSin , & ! bulk salinity (ppt) + cqin ! enthalpy () real (kind=dbl_kind), dimension (nblyr+2) :: & + zTin , & ! Temperature of ice layers on bgrid (C) + zSin , & ! Salinity of ice layers on bgrid (C) bqin ! enthalpy on the bgrid () real (kind=dbl_kind), dimension (nblyr+1) :: & @@ -205,7 +185,8 @@ subroutine compute_microS_mushy (nilyr, nblyr, & real (kind=dbl_kind) :: & surface_S , & ! salinity of ice above hin > hbr - hinc_old ! mean ice thickness before current melt/growth (m) + hinc_old , & ! mean ice thickness before current melt/growth (m) + hbrc_old ! mean brine thickness before current melt/growth (m) real (kind=dbl_kind), dimension (ntrcr+2) :: & ! nblyr+2) trtmp_s , & ! temporary, remapped tracers @@ -227,9 +208,13 @@ subroutine compute_microS_mushy (nilyr, nblyr, & trtmp_q(:) = c0 iDin(:) = c0 + do k = 1, nilyr + cSin(k) = trcrn(nt_sice+k-1) + cqin(k) = trcrn(nt_qice+k-1) + enddo + ! map Sin and qin (cice) profiles to bgc grid surface_S = min_salin - hbr_old = min(hbr_old, maxhbr*hice_old) hinc_old = hice_old call remap_zbgc(nilyr, & @@ -269,18 +254,15 @@ subroutine compute_microS_mushy (nilyr, nblyr, & ! Define ice multiphase structure !----------------------------------------------------------------- - call prepare_hbrine (nblyr, & - bSin, bTin, iTin, & + call prepare_hbrine (bSin, bTin, iTin, & brine_sal, brine_rho, & ibrine_sal, ibrine_rho, & - sice_rho, & bphin, iphin, & - kperm, bphi_min, & - igrid, sss) + kperm, bphi_min, & + sss, iSin) if (icepack_warnings_aborted(subname)) return - call calculate_drho(nblyr, igrid, bgrid, & - brine_rho, ibrine_rho, drho) + call calculate_drho(brine_rho, ibrine_rho, drho) if (icepack_warnings_aborted(subname)) return do k= 2, nblyr+1 @@ -295,21 +277,16 @@ end subroutine compute_microS_mushy !======================================================================= - subroutine prepare_hbrine (nblyr, & - bSin, bTin, iTin, & + subroutine prepare_hbrine (bSin, bTin, iTin, & brine_sal, brine_rho, & ibrine_sal, ibrine_rho, & - sice_rho, bphin, iphin,& + bphin, iphin, & kperm, bphi_min, & - i_grid, sss) - - integer (kind=int_kind), intent(in) :: & - nblyr ! number of bio layers + sss, iSin) real (kind=dbl_kind), dimension (:), intent(in) :: & bSin , & ! salinity of ice layers on bio grid (ppt) - bTin , & ! temperature of ice layers on bio grid for history (C) - i_grid ! biology grid interface points + bTin ! temperature of ice layers on bio grid for history (C) real (kind=dbl_kind), dimension (:), intent(inout) :: & brine_sal , & ! equilibrium brine salinity (ppt) @@ -318,7 +295,8 @@ subroutine prepare_hbrine (nblyr, & ibrine_sal , & ! brine salinity on interface (ppt) iphin , & ! porosity on interface iTin , & ! Temperature on interface - bphin ! porosity of layers + bphin , & ! porosity of layers + iSin ! Bulk salinity on interface real (kind=dbl_kind), intent(in) :: & sss ! sea surface salinity (ppt) @@ -327,9 +305,6 @@ subroutine prepare_hbrine (nblyr, & kperm , & ! harmonic average permeability (m^2) bphi_min ! minimum porosity - real (kind=dbl_kind), intent(inout) :: & - sice_rho ! avg sea ice density - ! local variables real (kind=dbl_kind), dimension(nblyr+1) :: & @@ -348,14 +323,12 @@ subroutine prepare_hbrine (nblyr, & ! calculate equilibrium brine density and gradients !----------------------------------------------------------------- - sice_rho = c0 - do k = 1, nblyr+1 if (k == 1) then igrm = 0 else - igrm = i_grid(k) - i_grid(k-1) + igrm = igrid(k) - igrid(k-1) endif brine_sal(k) = a1*bTin(k) & @@ -366,8 +339,6 @@ subroutine prepare_hbrine (nblyr, & / (brine_sal(k)*brine_rho(k))) bphin (k) = min(c1, bphin(k)) kin (k) = k_o*bphin(k)**exp_h - sice_rho = sice_rho + (rhoi*(c1-bphin(k)) & - + brine_rho(k)*bphin(k))*igrm enddo ! k brine_sal (nblyr+2) = sss @@ -379,6 +350,8 @@ subroutine prepare_hbrine (nblyr, & ibrine_rho(nblyr+1) = brine_rho (nblyr+2) iTin (1) = bTin(2) iTin (nblyr+1) = bTin(nblyr+1) + iSin (1) = bSin(2) + iSin (nblyr+1) = bSin(nblyr+1) iphin (1) = bphin (2) iphin (nblyr+1) = bphin (nblyr+1) k_min = MINVAL(kin(2:nblyr+1)) @@ -394,13 +367,14 @@ subroutine prepare_hbrine (nblyr, & kperm = k_min endif - igrp = i_grid(k+1) - i_grid(k ) - igrm = i_grid(k ) - i_grid(k-1) - rigr = c1 / (i_grid(k+1)-i_grid(k-1)) + igrp = igrid(k+1) - igrid(k ) + igrm = igrid(k ) - igrid(k-1) + rigr = c1 / (igrid(k+1)-igrid(k-1)) ibrine_sal(k) = (brine_sal(k+1)*igrp + brine_sal(k)*igrm) * rigr ibrine_rho(k) = (brine_rho(k+1)*igrp + brine_rho(k)*igrm) * rigr iTin (k) = (bTin (k+1)*igrp + bTin (k)*igrm) * rigr + iSin (k) = (bSin (k+1)*igrp + bSin (k)*igrm) * rigr iphin (k) = max(puny, & (bphin (k+1)*igrp + bphin (k)*igrm) * rigr) iphin (k) = min(c1, iphin (k)) @@ -426,12 +400,12 @@ end subroutine prepare_hbrine ! ice. This volume fraction may be > 1 in which case there is brine ! above the ice surface (ponds). - subroutine update_hbrine (meltt, & + subroutine update_hbrine (meltt, & melts, dt, & hin, hsn, & hin_old, hbr, & - hbr_old, & - fbri, & + hbr_old, & + fbri, & dhS_top, dhS_bottom, & dh_top_chl, dh_bot_chl, & kperm, bphi_min, & @@ -561,17 +535,7 @@ end subroutine update_hbrine ! Find density difference about interface grid points ! for gravity drainage parameterization - subroutine calculate_drho (nblyr, i_grid, b_grid, & - brine_rho, ibrine_rho, drho) - - integer (kind=int_kind), intent(in) :: & - nblyr ! number of bio layers - - real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - b_grid ! biology nondimensional grid layer points - - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - i_grid ! biology grid interface points + subroutine calculate_drho (brine_rho, ibrine_rho, drho) real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & brine_rho ! Internal brine density (kg/m^3) @@ -606,29 +570,29 @@ subroutine calculate_drho (nblyr, i_grid, b_grid, & rho_2b(:) = c0 drho (:) = c0 ! surface is snow or atmosphere - do k = 1, nblyr+1 ! i_grid values + do k = 1, nblyr+1 ! igrid values !---------------------------------------------- - ! h_avg(k) = i_grid(k) - ! Calculate rho_a(k), ie average rho above i_grid(k) + ! h_avg(k) = igrid(k) + ! Calculate rho_a(k), ie average rho above igrid(k) ! first part is good !---------------------------------------------- if (k == 2) then - rho_a(2) = (brine_rho(2)*b_grid(2) & + rho_a(2) = (brine_rho(2)*bgrid(2) & + (ibrine_rho(2) + brine_rho(2)) & - * p5*(i_grid(2)-b_grid(2)) )/i_grid(2) + * p5*(igrid(2)-bgrid(2)) )/igrid(2) rho_b(2) = brine_rho(2) elseif (k > 2 .AND. k < nblyr+1) then - rho_a(k) = (rho_a(k-1)*i_grid(k-1) + (ibrine_rho(k-1) + brine_rho(k)) & - * p5*(b_grid(k)-i_grid(k-1)) + (ibrine_rho(k ) + brine_rho(k)) & - * p5*(i_grid(k)-b_grid(k)))/i_grid(k) + rho_a(k) = (rho_a(k-1)*igrid(k-1) + (ibrine_rho(k-1) + brine_rho(k)) & + * p5*(bgrid(k)-igrid(k-1)) + (ibrine_rho(k ) + brine_rho(k)) & + * p5*(igrid(k)-bgrid(k)))/igrid(k) rho_b(k) = brine_rho(k) else - rho_a(nblyr+1) = (rho_a(nblyr)*i_grid(nblyr) + (ibrine_rho(nblyr) + & - brine_rho(nblyr+1))*p5*(b_grid(nblyr+1)-i_grid(nblyr)) + & - brine_rho(nblyr+1)*(i_grid(nblyr+1)-b_grid(nblyr+1)))/i_grid(nblyr+1) + rho_a(nblyr+1) = (rho_a(nblyr)*igrid(nblyr) + (ibrine_rho(nblyr) + & + brine_rho(nblyr+1))*p5*(bgrid(nblyr+1)-igrid(nblyr)) + & + brine_rho(nblyr+1)*(igrid(nblyr+1)-bgrid(nblyr+1)))/igrid(nblyr+1) rho_a(1) = brine_rho(2) !for k == 1 use grid point value rho_b(nblyr+1) = brine_rho(nblyr+1) rho_b(1) = brine_rho(2) @@ -640,10 +604,10 @@ subroutine calculate_drho (nblyr, i_grid, b_grid, & ! Calculate average above and below k rho_2a !---------------------------------------------- - do k = 1, nblyr+1 !i_grid values + do k = 1, nblyr+1 !igrid values if (k == 1) then - rho_2a(1) = (rho_a(1)*b_grid(2) + p5*(brine_rho(2) + ibrine_rho(2)) & - * (i_grid(2)-b_grid(2)))/i_grid(2) + rho_2a(1) = (rho_a(1)*bgrid(2) + p5*(brine_rho(2) + ibrine_rho(2)) & + * (igrid(2)-bgrid(2)))/igrid(2) rho_2b(1) = brine_rho(2) else mstop = 2*(k-1) + 1 @@ -657,7 +621,7 @@ subroutine calculate_drho (nblyr, i_grid, b_grid, & endif do mm = mstart,mstop - rho_2a(k) =(rho_a(nblyr+1) + rhow*(c2*i_grid(k)-c1))*p5/i_grid(k) + rho_2a(k) =(rho_a(nblyr+1) + rhow*(c2*igrid(k)-c1))*p5/igrid(k) enddo rho_2b(k) = brine_rho(k+1) endif @@ -671,26 +635,22 @@ end subroutine calculate_drho !autodocument_start icepack_init_hbrine ! Initialize brine height tracer - subroutine icepack_init_hbrine(bgrid, igrid, cgrid, & - icgrid, swgrid, nblyr, nilyr, phi_snow) - - integer (kind=int_kind), intent(in) :: & - nilyr, & ! number of ice layers - nblyr ! number of bio layers + subroutine icepack_init_hbrine(bgrid_out, igrid_out, cgrid_out, & + icgrid_out, swgrid_out, phi_snow) - 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 !autodocument_end @@ -704,8 +664,17 @@ subroutine icepack_init_hbrine(bgrid, igrid, cgrid, & character(len=*),parameter :: subname='(icepack_init_hbrine)' + !----------------------------------------------------------------- - if (phi_snow .le. c0) phi_snow = c1-rhos/rhoi + if (present(phi_snow)) then + if (phi_snow .le. c0) phi_snow = c1-rhos/rhoi + endif + + allocate(bgrid (nblyr+2)) + allocate(igrid (nblyr+1)) + allocate(cgrid (nilyr+1)) + allocate(icgrid(nilyr+1)) + allocate(swgrid(nilyr+1)) !----------------------------------------------------------------- ! Calculate bio gridn: 0 to 1 corresponds to ice top to bottom @@ -755,12 +724,18 @@ subroutine icepack_init_hbrine(bgrid, igrid, cgrid, & ! swgrid represents the layer index of the delta-eddington ice layer index !------------------------------------------------------------------------ zspace = c1/(real(nilyr,kind=dbl_kind)) ! CICE grid spacing - swgrid(1) = min(c1/60.0_dbl_kind, zspace/c2) + swgrid(1) = min(c1/60.0_dbl_kind, zspace*p25) !p5 to p25. NJ: allows thinner surface layers swgrid(2) = zspace/c2 !+ swgrid(1) do k = 3, nilyr+1 swgrid(k) = zspace * (real(k,kind=dbl_kind)-c1p5) enddo + if (present( bgrid_out)) bgrid_out=bgrid + if (present( cgrid_out)) cgrid_out=cgrid + if (present( igrid_out)) igrid_out=igrid + if (present(icgrid_out)) icgrid_out=icgrid + if (present(swgrid_out)) swgrid_out=swgrid + end subroutine icepack_init_hbrine !======================================================================= @@ -768,14 +743,8 @@ end subroutine icepack_init_hbrine ! **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 diff --git a/columnphysics/icepack_flux.F90 b/columnphysics/icepack_flux.F90 index ce0b4b72..27a9f0f8 100644 --- a/columnphysics/icepack_flux.F90 +++ b/columnphysics/icepack_flux.F90 @@ -68,7 +68,9 @@ subroutine merge_fluxes (aicen, & ! single category fluxes real (kind=dbl_kind), intent(in) :: & - aicen , & ! concentration of ice + aicen ! concentration of ice + + real (kind=dbl_kind), optional, intent(in) :: & flw , & ! downward longwave flux (W/m**2) strairxn, & ! air/ice zonal strss, (N/m**2) strairyn, & ! air/ice merdnl strss, (N/m**2) @@ -95,9 +97,7 @@ subroutine merge_fluxes (aicen, & meltsliqn,& ! mass of snow melt (kg/m^2) dsnown , & ! change in snow depth (m) congeln , & ! congelation ice growth (m) - snoicen ! snow-ice growth (m) - - real (kind=dbl_kind), optional, intent(in):: & + snoicen , & ! snow-ice growth (m) fswthrun_vdr, & ! vis dir sw radiation through ice bot (W/m**2) fswthrun_vdf, & ! vis dif sw radiation through ice bot (W/m**2) fswthrun_idr, & ! nir dir sw radiation through ice bot (W/m**2) @@ -105,7 +105,7 @@ subroutine merge_fluxes (aicen, & Urefn ! air speed reference level (m/s) ! cumulative fluxes - real (kind=dbl_kind), intent(inout) :: & + real (kind=dbl_kind), optional, intent(inout) :: & strairxT, & ! air/ice zonal strss, (N/m**2) strairyT, & ! air/ice merdnl strss, (N/m**2) Cdn_atm_ratio, & ! ratio of total drag over neutral drag @@ -130,28 +130,24 @@ subroutine merge_fluxes (aicen, & melts , & ! snow melt (m) meltsliq, & ! mass of snow melt (kg/m^2) congel , & ! congelation ice growth (m) - snoice ! snow-ice growth (m) - - real (kind=dbl_kind), intent(inout), optional :: & - fswthru_vdr , & ! vis dir sw radiation through ice bot (W/m**2) - fswthru_vdf , & ! vis dif sw radiation through ice bot (W/m**2) - fswthru_idr , & ! nir dir sw radiation through ice bot (W/m**2) - fswthru_idf ! nir dif sw radiation through ice bot (W/m**2) - - real (kind=dbl_kind), intent(inout), optional :: & + snoice , & ! snow-ice growth (m) + fswthru_vdr, & ! vis dir sw radiation through ice bot (W/m**2) + fswthru_vdf, & ! vis dif sw radiation through ice bot (W/m**2) + fswthru_idr, & ! nir dir sw radiation through ice bot (W/m**2) + fswthru_idf, & ! nir dif sw radiation through ice bot (W/m**2) dsnow, & ! change in snow depth (m) Uref ! air speed reference level (m/s) - real (kind=dbl_kind), dimension(:), intent(inout), optional :: & - Qref_iso, & ! isotope air sp hum ref level (kg/kg) - fiso_ocn, & ! isotope fluxes to ocean (kg/m2/s) - fiso_evap ! isotope evaporation (kg/m2/s) - real (kind=dbl_kind), dimension(:), intent(in), optional :: & Qrefn_iso, & ! isotope air sp hum ref level (kg/kg) fiso_ocnn, & ! isotope fluxes to ocean (kg/m2/s) fiso_evapn ! isotope evaporation (kg/m2/s) + real (kind=dbl_kind), dimension(:), intent(inout), optional :: & + Qref_iso, & ! isotope air sp hum ref level (kg/kg) + fiso_ocn, & ! isotope fluxes to ocean (kg/m2/s) + fiso_evap ! isotope evaporation (kg/m2/s) + character(len=*),parameter :: subname='(merge_fluxes)' !----------------------------------------------------------------- @@ -163,23 +159,38 @@ subroutine merge_fluxes (aicen, & ! atmo fluxes - strairxT = strairxT + strairxn * aicen - strairyT = strairyT + strairyn * aicen - Cdn_atm_ratio = Cdn_atm_ratio + & - Cdn_atm_ratio_n * aicen - fsurf = fsurf + fsurfn * aicen - fcondtop = fcondtop + fcondtopn * aicen - fcondbot = fcondbot + fcondbotn * aicen - fsens = fsens + fsensn * aicen - flat = flat + flatn * aicen - fswabs = fswabs + fswabsn * aicen - flwout = flwout & - + (flwoutn - (c1-emissivity)*flw) * aicen - evap = evap + evapn * aicen - evaps = evaps + evapsn * aicen - evapi = evapi + evapin * aicen - Tref = Tref + Trefn * aicen - Qref = Qref + Qrefn * aicen + if (present(strairxn) .and. present(strairxT)) & + strairxT = strairxT + strairxn * aicen + if (present(strairyn) .and. present(strairyT)) & + strairyT = strairyT + strairyn * aicen + if (present(Cdn_atm_ratio_n) .and. present(Cdn_atm_ratio)) & + Cdn_atm_ratio = Cdn_atm_ratio + & + Cdn_atm_ratio_n * aicen + if (present(fsurfn) .and. present(fsurf)) & + fsurf = fsurf + fsurfn * aicen + if (present(fcondtopn) .and. present(fcondtop)) & + fcondtop = fcondtop + fcondtopn * aicen + if (present(fcondbotn) .and. present(fcondbot)) & + fcondbot = fcondbot + fcondbotn * aicen + if (present(fsensn) .and. present(fsens)) & + fsens = fsens + fsensn * aicen + if (present(flatn) .and. present(flat)) & + flat = flat + flatn * aicen + if (present(fswabsn) .and. present(fswabs)) & + fswabs = fswabs + fswabsn * aicen + if (present(flwoutn) .and. present(flwout) .and. present(flw)) & + flwout = flwout & + + (flwoutn - (c1-emissivity)*flw) * aicen + if (present(evapn) .and. present(evap)) & + evap = evap + evapn * aicen + if (present(evapsn) .and. present(evaps)) & + evaps = evaps + evapsn * aicen + if (present(evapin) .and. present(evapi)) & + evapi = evapi + evapin * aicen + if (present(Trefn) .and. present(Tref)) & + Tref = Tref + Trefn * aicen + if (present(Qrefn) .and. present(Qref)) & + Qref = Qref + Qrefn * aicen ! Isotopes if (tr_iso) then @@ -196,35 +207,46 @@ subroutine merge_fluxes (aicen, & ! ocean fluxes if (present(Urefn) .and. present(Uref)) then - Uref = Uref + Urefn * aicen + Uref = Uref + Urefn * aicen endif - fresh = fresh + freshn * aicen - fsalt = fsalt + fsaltn * aicen - fhocn = fhocn + fhocnn * aicen - fswthru = fswthru + fswthrun * aicen - if (present(fswthru_vdr)) & - fswthru_vdr = fswthru_vdr + fswthrun_vdr * aicen - if (present(fswthru_vdf)) & - fswthru_vdf = fswthru_vdf + fswthrun_vdf * aicen - if (present(fswthru_idr)) & - fswthru_idr = fswthru_idr + fswthrun_idr * aicen - if (present(fswthru_idf)) & - fswthru_idf = fswthru_idf + fswthrun_idf * aicen + if (present(freshn) .and. present(fresh)) & + fresh = fresh + freshn * aicen + if (present(fsaltn) .and. present(fsalt)) & + fsalt = fsalt + fsaltn * aicen + if (present(fhocnn) .and. present(fhocn)) & + fhocn = fhocn + fhocnn * aicen + if (present(fswthrun) .and. present(fswthru)) & + fswthru = fswthru + fswthrun * aicen + + if (present(fswthrun_vdr) .and. present(fswthru_vdr)) & + fswthru_vdr = fswthru_vdr + fswthrun_vdr * aicen + if (present(fswthrun_vdf) .and. present(fswthru_vdf)) & + fswthru_vdf = fswthru_vdf + fswthrun_vdf * aicen + if (present(fswthrun_idr) .and. present(fswthru_idr)) & + fswthru_idr = fswthru_idr + fswthrun_idr * aicen + if (present(fswthrun_idf) .and. present(fswthru_idf)) & + fswthru_idf = fswthru_idf + fswthrun_idf * aicen ! ice/snow thickness - meltt = meltt + melttn * aicen - meltb = meltb + meltbn * aicen - melts = melts + meltsn * aicen + if (present(melttn) .and. present(meltt)) & + meltt = meltt + melttn * aicen + if (present(meltbn) .and. present(meltb)) & + meltb = meltb + meltbn * aicen + if (present(meltsn) .and. present(melts)) & + melts = melts + meltsn * aicen if (snwgrain) then - meltsliq = meltsliq + meltsliqn * aicen + if (present(meltsliqn) .and. present(meltsliq)) & + meltsliq = meltsliq + meltsliqn * aicen endif - if (present(dsnow)) then + if (present(dsnown) .and. present(dsnow)) then dsnow = dsnow + dsnown * aicen endif - congel = congel + congeln * aicen - snoice = snoice + snoicen * aicen + if (present(congeln) .and. present(congel)) & + congel = congel + congeln * aicen + if (present(snoicen) .and. present(snoice)) & + snoice = snoice + snoicen * aicen end subroutine merge_fluxes diff --git a/columnphysics/icepack_fsd.F90 b/columnphysics/icepack_fsd.F90 index 1454fdef..28f12d92 100644 --- a/columnphysics/icepack_fsd.F90 +++ b/columnphysics/icepack_fsd.F90 @@ -45,7 +45,7 @@ module icepack_fsd use icepack_kinds use icepack_parameters, only: c0, c1, c2, c4, p01, p1, p5, puny use icepack_parameters, only: pi, floeshape, wave_spec, bignum, gravit, rhoi - use icepack_tracers, only: nt_fsd, tr_fsd + use icepack_tracers, only: nt_fsd, tr_fsd, nfsd, ncat use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -84,16 +84,13 @@ module icepack_fsd ! ! 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) @@ -259,14 +256,11 @@ end subroutine icepack_init_fsd_bounds ! ! 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 @@ -316,11 +310,7 @@ end subroutine icepack_init_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 @@ -337,7 +327,7 @@ subroutine icepack_cleanup_fsd (ncat, nfsd, afsdn) if (tr_fsd) then do n = 1, ncat - call icepack_cleanup_fsdn(nfsd, afsdn(:,n)) + call icepack_cleanup_fsdn(afsdn(:,n)) if (icepack_warnings_aborted(subname)) return enddo @@ -352,10 +342,7 @@ end subroutine icepack_cleanup_fsd ! authors: Elizabeth Hunke, LANL ! - subroutine icepack_cleanup_fsdn (nfsd, afsd) - - integer (kind=int_kind), intent(in) :: & - nfsd ! number of floe size categories + subroutine icepack_cleanup_fsdn (afsd) real (kind=dbl_kind), dimension(:), intent(inout) :: & afsd ! floe size distribution tracer @@ -391,16 +378,11 @@ end subroutine icepack_cleanup_fsdn ! ! authors: Lettie Roach, NIWA/VUW - subroutine partition_area (ncat, nfsd, & - floe_rad_c, aice, & + subroutine partition_area (floe_rad_c, aice, & aicen, vicen, & afsdn, lead_area, & latsurf_area) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nfsd ! number of floe size categories - real (kind=dbl_kind), dimension(:), intent(in) :: & floe_rad_c ! fsd size bin centre in m (radius) @@ -491,8 +473,7 @@ end subroutine partition_area ! ! authors: Lettie Roach, NIWA/VUW ! - subroutine fsd_lateral_growth (ncat, nfsd, & - dt, aice, & + subroutine fsd_lateral_growth (dt, aice, & aicen, vicen, & vi0new, & frazil, floe_rad_c, & @@ -501,10 +482,6 @@ subroutine fsd_lateral_growth (ncat, nfsd, & G_radial, d_an_latg, & tot_latg) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nfsd ! number of floe size categories - real (kind=dbl_kind), intent(in) :: & dt , & ! time step (s) aice ! total concentration of ice @@ -552,8 +529,7 @@ subroutine fsd_lateral_growth (ncat, nfsd, & d_an_latg = c0 ! partition volume into lateral growth and frazil - call partition_area (ncat, nfsd, & - floe_rad_c, aice, & + call partition_area (floe_rad_c, aice, & aicen, vicen, & afsdn, lead_area, & latsurf_area) @@ -610,7 +586,7 @@ end subroutine fsd_lateral_growth ! ! authors: Lettie Roach, NIWA/VUW ! - subroutine fsd_add_new_ice (ncat, n, nfsd, & + subroutine fsd_add_new_ice (n, & dt, ai0new, & d_an_latg, d_an_newi, & floe_rad_c, floe_binwidth, & @@ -625,9 +601,7 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, & aicen, trcrn) integer (kind=int_kind), intent(in) :: & - n , & ! thickness category number - ncat , & ! number of thickness categories - nfsd ! number of floe size categories + n ! thickness category number real (kind=dbl_kind), intent(in) :: & dt , & ! time step (s) @@ -722,7 +696,7 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, & end do ! timestep required for this - subdt = get_subdt_fsd(nfsd, afsdn_latg(:,n), dafsd_tmp(:)) + subdt = get_subdt_fsd(afsdn_latg(:,n), dafsd_tmp(:)) subdt = MIN(subdt, dt) ! update fsd and elapsed time @@ -731,7 +705,7 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, & END DO - call icepack_cleanup_fsdn (nfsd, afsdn_latg(:,n)) + call icepack_cleanup_fsdn (afsdn_latg(:,n)) if (icepack_warnings_aborted(subname)) return trcrn(nt_fsd:nt_fsd+nfsd-1,n) = afsdn_latg(:,n) @@ -748,7 +722,7 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, & if (wave_spec) then if (wave_sig_ht > puny) then - call wave_dep_growth (nfsd, wave_spectrum, & + call wave_dep_growth (wave_spectrum, & wavefreq, dwavefreq, & new_size) if (icepack_warnings_aborted(subname)) return @@ -776,7 +750,7 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, & if (wave_spec) then if (wave_sig_ht > puny) then - call wave_dep_growth (nfsd, wave_spectrum, & + call wave_dep_growth (wave_spectrum, & wavefreq, dwavefreq, & new_size) if (icepack_warnings_aborted(subname)) return @@ -790,7 +764,7 @@ subroutine fsd_add_new_ice (ncat, n, nfsd, & endif ! entirely new ice or not trcrn(nt_fsd:nt_fsd+nfsd-1,n) = afsd_ni(:) - call icepack_cleanup_fsdn (nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,n)) + call icepack_cleanup_fsdn (trcrn(nt_fsd:nt_fsd+nfsd-1,n)) if (icepack_warnings_aborted(subname)) return endif ! d_an_newi > puny endif ! n = 1 @@ -818,13 +792,10 @@ end subroutine fsd_add_new_ice ! ! authors: Lettie Roach, NIWA/VUW ! - subroutine wave_dep_growth (nfsd, local_wave_spec, & + subroutine wave_dep_growth (local_wave_spec, & wavefreq, dwavefreq, & new_size) - integer (kind=int_kind), intent(in) :: & - nfsd ! number of floe size categories - real (kind=dbl_kind), dimension(:), intent(in) :: & local_wave_spec ! ocean surface wave spectrum as a function of frequency ! power spectral density of surface elevation, E(f) (units m^2 s) @@ -879,15 +850,10 @@ end subroutine wave_dep_growth ! authors: Lettie Roach, NIWA/VUW ! - subroutine fsd_weld_thermo (ncat, nfsd, & - dt, frzmlt, & + subroutine fsd_weld_thermo (dt, frzmlt, & aicen, trcrn, & d_afsd_weld) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nfsd ! number of floe size categories - real (kind=dbl_kind), intent(in) :: & dt ! time step (s) @@ -948,7 +914,7 @@ subroutine fsd_weld_thermo (ncat, nfsd, & d_afsd_weld (:) = c0 d_afsdn_weld(:,n) = c0 afsdn(:,n) = trcrn(nt_fsd:nt_fsd+nfsd-1,n) - call icepack_cleanup_fsdn (nfsd, afsdn(:,n)) + call icepack_cleanup_fsdn (afsdn(:,n)) if (icepack_warnings_aborted(subname)) return ! If there is some ice in the lower (nfsd-1) categories @@ -1010,7 +976,7 @@ subroutine fsd_weld_thermo (ncat, nfsd, & END DO ! time afsdn(:,n) = afsd_tmp(:) - call icepack_cleanup_fsdn (nfsd, afsdn(:,n)) + call icepack_cleanup_fsdn (afsdn(:,n)) if (icepack_warnings_aborted(subname)) return do k = 1, nfsd @@ -1039,12 +1005,9 @@ end subroutine fsd_weld_thermo ! authors: 2018 Lettie Roach, NIWA/VUW ! ! - function get_subdt_fsd(nfsd, afsd_init, d_afsd) & + function get_subdt_fsd(afsd_init, d_afsd) & result(subdt) - integer (kind=int_kind), intent(in) :: & - nfsd ! number of floe size categories - real (kind=dbl_kind), dimension (nfsd), intent(in) :: & afsd_init, d_afsd ! floe size distribution tracer diff --git a/columnphysics/icepack_isotope.F90 b/columnphysics/icepack_isotope.F90 index 1db64055..616a2870 100644 --- a/columnphysics/icepack_isotope.F90 +++ b/columnphysics/icepack_isotope.F90 @@ -45,8 +45,7 @@ module icepack_isotope ! ! Increase isotope in ice or snow surface due to deposition and loss ! - subroutine update_isotope (dt, & - nilyr, nslyr, & + subroutine update_isotope(dt, & meltt, melts, & meltb, congel, & snoice, evap, & @@ -63,9 +62,6 @@ subroutine update_isotope (dt, & ! use water_isotopes, only: wiso_alpi use icepack_parameters, only: ktherm, rhoi, rhos, Tffresh - integer (kind=int_kind), intent(in) :: & - nilyr, nslyr - real (kind=dbl_kind), intent(in) :: & dt ! time step diff --git a/columnphysics/icepack_itd.F90 b/columnphysics/icepack_itd.F90 index 0da1f159..1870ec4a 100644 --- a/columnphysics/icepack_itd.F90 +++ b/columnphysics/icepack_itd.F90 @@ -29,6 +29,7 @@ module icepack_itd use icepack_parameters, only: c0, c1, c2, c3, c15, c25, c100, p1, p01, p001, p5, puny use icepack_parameters, only: Lfresh, rhos, ice_ref_salinity, hs_min, cp_ice, rhoi use icepack_parameters, only: rhosi, sk_l, hs_ssl, min_salin, rsnw_fall, rhosnew + use icepack_tracers, only: ncat, nilyr, nslyr, nblyr, ntrcr, nbtrcr, n_aero use icepack_tracers, only: nt_Tsfc, nt_qice, nt_qsno, nt_aero, nt_isosno, nt_isoice use icepack_tracers, only: nt_apnd, nt_hpnd, nt_fbri, tr_brine, bio_index use icepack_tracers, only: n_iso, tr_iso, nt_smice, nt_rsnw, nt_rhos, nt_sice @@ -64,10 +65,7 @@ module icepack_itd ! ! authors: William H. Lipscomb, LANL - subroutine aggregate_area (ncat, aicen, aice, aice0) - - integer (kind=int_kind), intent(in) :: & - ncat ! number of thickness categories + subroutine aggregate_area (aicen, aice, aice0) real (kind=dbl_kind), dimension(:), intent(in) :: & aicen ! concentration of ice @@ -102,17 +100,13 @@ end subroutine aggregate_area ! ! authors: William H. Lipscomb and Elizabeth C. Hunke, LANL - subroutine rebin (ntrcr, trcr_depend, & + subroutine rebin (trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, & aicen, trcrn, & vicen, vsnon, & - ncat, hin_max, Tf ) - - integer (kind=int_kind), intent(in) :: & - ntrcr , & ! number of tracers in use - ncat ! number of thickness categories + hin_max, Tf ) integer (kind=int_kind), dimension (:), intent(in) :: & trcr_depend, & ! = 0 for aicen tracers, 1 for vicen, 2 for vsnon @@ -216,8 +210,7 @@ subroutine rebin (ntrcr, trcr_depend, & ! shift ice between categories !----------------------------------------------------------------- - call shift_ice (ntrcr, ncat, & - trcr_depend, & + call shift_ice (trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, & @@ -264,8 +257,7 @@ subroutine rebin (ntrcr, trcr_depend, & ! shift ice between categories !----------------------------------------------------------------- - call shift_ice (ntrcr, ncat, & - trcr_depend, & + call shift_ice (trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, & @@ -356,8 +348,7 @@ end subroutine reduce_area ! ! authors: William H. Lipscomb and Elizabeth C. Hunke, LANL - subroutine shift_ice (ntrcr, ncat, & - trcr_depend, & + subroutine shift_ice (trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, & @@ -366,10 +357,6 @@ subroutine shift_ice (ntrcr, ncat, & hicen, donor, & daice, dvice, Tf ) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - ntrcr ! number of tracers in use - integer (kind=int_kind), dimension (:), intent(in) :: & trcr_depend, & ! = 0 for aicen tracers, 1 for vicen, 2 for vsnon n_trcr_strata ! number of underlying tracer layers @@ -665,7 +652,7 @@ subroutine shift_ice (ntrcr, ncat, & ! Compute new tracers !----------------------------------------------------------------- - call icepack_compute_tracers (ntrcr, trcr_depend, & + call icepack_compute_tracers(trcr_depend, & atrcrn(:,n), aicen(n), & vicen(n), vsnon(n), & trcr_base, n_trcr_strata, & @@ -759,14 +746,10 @@ end subroutine column_conservation_check ! ! author: William H. Lipscomb, LANL - subroutine cleanup_itd (dt, ntrcr, & - nilyr, nslyr, & - ncat, hin_max, & + subroutine cleanup_itd (dt, hin_max, & aicen, trcrn, & vicen, vsnon, & aice0, aice, & - n_aero, & - nbtrcr, nblyr, & tr_aero, & tr_pond_topo, & first_ice, & @@ -777,15 +760,6 @@ subroutine cleanup_itd (dt, ntrcr, & faero_ocn, fiso_ocn, & flux_bio, Tf, limit_aice_in) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nblyr , & ! number of bio layers - nslyr , & ! number of snow layers - ntrcr , & ! number of tracers in use - nbtrcr, & ! number of bio tracers in use - n_aero ! number of aerosol tracers - real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -894,7 +868,7 @@ subroutine cleanup_itd (dt, ntrcr, & ! Compute total ice area. !----------------------------------------------------------------- - call aggregate_area (ncat, aicen, aice, aice0) + call aggregate_area (aicen, aice, aice0) if (icepack_warnings_aborted(subname)) return if (limit_aice) then ! check for aice out of bounds @@ -924,13 +898,13 @@ subroutine cleanup_itd (dt, ntrcr, & ! correctly (e.g., very fast ice growth). !----------------------------------------------------------------- - call rebin (ntrcr, trcr_depend, & + call rebin (trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, & aicen, trcrn, & vicen, vsnon, & - ncat, hin_max, Tf ) + hin_max, Tf ) if (icepack_warnings_aborted(subname)) return endif ! aice > puny @@ -940,21 +914,17 @@ subroutine cleanup_itd (dt, ntrcr, & !----------------------------------------------------------------- if (limit_aice) then - call zap_small_areas (dt, ntrcr, & - ncat, & - n_aero, & - nblyr, & - nilyr, nslyr, & + call zap_small_areas (dt, & aice, aice0, & aicen, trcrn, & vicen, vsnon, & dfpond, & dfresh, dfsalt, & - dfhocn, & + dfhocn, & dfaero_ocn, dfiso_ocn, & tr_aero, & tr_pond_topo, & - first_ice, nbtrcr, & + first_ice, & dflux_bio, Tf ) if (icepack_warnings_aborted(subname)) then @@ -973,15 +943,12 @@ subroutine cleanup_itd (dt, ntrcr, & ! Zap snow that has out of bounds temperatures !------------------------------------------------------------------- - call zap_snow_temperature(dt, ncat, & - nblyr, & - nslyr, aicen, & + call zap_snow_temperature(dt, aicen, & trcrn, vsnon, & dfresh, dfhocn, & dfaero_ocn, tr_aero, & dfiso_ocn, & - dflux_bio, nbtrcr, & - n_aero) + dflux_bio) if (icepack_warnings_aborted(subname)) return !------------------------------------------------------------------- @@ -1023,11 +990,7 @@ end subroutine cleanup_itd ! ! author: William H. Lipscomb, LANL - subroutine zap_small_areas (dt, ntrcr, & - ncat, & - n_aero, & - nblyr, & - nilyr, nslyr, & + subroutine zap_small_areas (dt, & aice, aice0, & aicen, trcrn, & vicen, vsnon, & @@ -1037,18 +1000,9 @@ subroutine zap_small_areas (dt, ntrcr, & dfaero_ocn, dfiso_ocn, & tr_aero, & tr_pond_topo, & - first_ice, nbtrcr, & + first_ice, & dflux_bio, Tf ) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nblyr , & ! number of bio layers - nslyr , & ! number of snow layers - ntrcr , & ! number of tracers in use - n_aero , & ! number of aerosol tracers - nbtrcr ! number of biology tracers - real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -1096,6 +1050,7 @@ subroutine zap_small_areas (dt, ntrcr, & blevels real (kind=dbl_kind) :: xtmp, sicen ! temporary variables + real (kind=dbl_kind) :: dvssl, dvint ! temporary variables real (kind=dbl_kind) , dimension (1):: trcr_skl real (kind=dbl_kind) , dimension (nblyr+1):: bvol @@ -1146,7 +1101,6 @@ subroutine zap_small_areas (dt, ntrcr, & if (skl_bgc .and. nbtrcr > 0) then blevels = 1 bvol(1) = aicen(n)*sk_l - it = 1 do it = 1, nbtrcr trcr_skl(1) = trcrn(bio_index(it),n) call zap_small_bgc(blevels, dflux_bio(it), & @@ -1202,14 +1156,13 @@ subroutine zap_small_areas (dt, ntrcr, & !----------------------------------------------------------------- ! Zap snow !----------------------------------------------------------------- - call zap_snow(dt, nslyr, & + call zap_snow(dt, & trcrn(:,n), vsnon(n), & dfresh, dfhocn, & dfaero_ocn, tr_aero, & dfiso_ocn, & - dflux_bio, nbtrcr, & - n_aero, & - aicen(n), nblyr) + dflux_bio, & + aicen(n)) if (icepack_warnings_aborted(subname)) return !----------------------------------------------------------------- @@ -1273,6 +1226,36 @@ subroutine zap_small_areas (dt, ntrcr, & enddo ! it endif + if (skl_bgc .and. nbtrcr > 0) then + blevels = 1 + bvol(1) = (aice-c1)/aice * sk_l + do it = 1, nbtrcr + trcr_skl(1) = trcrn(bio_index(it),n) + call zap_small_bgc(blevels, dflux_bio(it), & + dt, bvol(1:blevels), trcr_skl(blevels)) + enddo + elseif (z_tracers .and. nbtrcr > 0) then + blevels = nblyr + 1 + bvol(:) = (aice-c1)/aice*vicen(n)/real(nblyr,kind=dbl_kind)*trcrn(nt_fbri,n) + bvol(1) = p5*bvol(1) + bvol(blevels) = p5*bvol(blevels) + do it = 1, nbtrcr + call zap_small_bgc(blevels, dflux_bio(it), & + dt, bvol(1:blevels),trcrn(bio_index(it):bio_index(it)+blevels-1,n)) + if (icepack_warnings_aborted(subname)) return + enddo + ! zap snow zaerosols + dvssl = p5*vsnon(n)/real(nslyr,kind=dbl_kind) ! snow surface layer + dvint = vsnon(n) - dvssl ! snow interior + + do it = 1, nbtrcr + xtmp = (trcrn(bio_index(it)+nblyr+1,n)*dvssl + & + trcrn(bio_index(it)+nblyr+2,n)*dvint)*(aice-c1)/aice/dt + dflux_bio(it) = dflux_bio(it) + xtmp + enddo ! it + + endif + if (tr_iso) then do it = 1, n_iso xtmp = (vsnon(n)*trcrn(nt_isosno+it-1,n) & @@ -1346,20 +1329,12 @@ end subroutine zap_small_areas !======================================================================= - subroutine zap_snow(dt, nslyr, & + subroutine zap_snow(dt, & trcrn, vsnon, & dfresh, dfhocn, & dfaero_ocn, tr_aero, & dfiso_ocn, & - dflux_bio, nbtrcr, & - n_aero, & - aicen, nblyr) - - integer (kind=int_kind), intent(in) :: & - nslyr , & ! number of snow layers - n_aero , & ! number of aerosol tracers - nblyr , & ! number of bio layers - nbtrcr + dflux_bio, aicen) real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -1414,8 +1389,8 @@ subroutine zap_snow(dt, nslyr, & endif ! tr_iso if (z_tracers) then - dvssl = min(p5*vsnon/real(nslyr,kind=dbl_kind), hs_ssl*aicen) ! snow surface layer - dvint = vsnon - dvssl ! snow interior + dvssl = p5*vsnon/real(nslyr,kind=dbl_kind) ! snow surface layer + dvint = vsnon - dvssl ! snow interior do it = 1, nbtrcr xtmp = (trcrn(bio_index(it)+nblyr+1)*dvssl + & @@ -1442,22 +1417,12 @@ end subroutine zap_snow !======================================================================= - subroutine zap_snow_temperature(dt, ncat, & - nblyr, & - nslyr, aicen, & + subroutine zap_snow_temperature(dt, aicen, & trcrn, vsnon, & dfresh, dfhocn, & dfaero_ocn, tr_aero, & dfiso_ocn, & - dflux_bio, nbtrcr, & - n_aero ) - - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nslyr , & ! number of snow layers - n_aero, & ! number of aerosol tracers - nbtrcr, & ! number of z-tracers in use - nblyr ! number of bio layers in ice + dflux_bio) real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -1560,14 +1525,13 @@ subroutine zap_snow_temperature(dt, ncat, & ! Zap the cells !----------------------------------------------------------------- if (l_zap) & - call zap_snow(dt, nslyr, & + call zap_snow(dt, & trcrn(:,n), vsnon(n), & dfresh, dfhocn, & dfaero_ocn, tr_aero, & dfiso_ocn, & - dflux_bio, nbtrcr, & - n_aero, & - aicen(n), nblyr) + dflux_bio, & + aicen(n)) if (icepack_warnings_aborted(subname)) return enddo ! n @@ -1581,10 +1545,7 @@ end subroutine zap_snow_temperature ! 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) @@ -1760,10 +1721,7 @@ end subroutine icepack_init_itd ! 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) @@ -1815,22 +1773,16 @@ end subroutine icepack_init_itd_hist ! 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) @@ -1919,7 +1871,7 @@ subroutine icepack_aggregate (ncat, & aice0 = max (c1 - aice, c0) ! Tracers - call icepack_compute_tracers (ntrcr, trcr_depend, & + call icepack_compute_tracers(trcr_depend, & atrcr, aice, & vice , vsno, & trcr_base, n_trcr_strata, & diff --git a/columnphysics/icepack_mechred.F90 b/columnphysics/icepack_mechred.F90 index d897dba4..6205b581 100644 --- a/columnphysics/icepack_mechred.F90 +++ b/columnphysics/icepack_mechred.F90 @@ -40,12 +40,13 @@ module icepack_mechred use icepack_parameters, only: icepack_chkoptargflag use icepack_parameters, only: kstrength, krdg_partic, krdg_redist, mu_rdg - use icepack_parameters, only: conserv_check + use icepack_parameters, only: conserv_check, z_tracers + use icepack_tracers, only: ncat, nilyr, nslyr, nblyr, n_aero 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 use icepack_tracers, only: nt_alvl, nt_vlvl, nt_aero, nt_isosno, nt_isoice use icepack_tracers, only: nt_apnd, nt_hpnd - use icepack_tracers, only: n_iso + use icepack_tracers, only: n_iso, bio_index use icepack_tracers, only: icepack_compute_tracers use icepack_warnings, only: warnstr, icepack_warnings_add @@ -87,9 +88,7 @@ module icepack_mechred ! author: William H. Lipscomb, LANL subroutine ridge_ice (dt, ndtd, & - ncat, n_aero, & - nilyr, nslyr, & - ntrcr, hin_max, & + hin_max, & rdg_conv, rdg_shear, & aicen, trcrn, & vicen, vsnon, & @@ -101,7 +100,7 @@ subroutine ridge_ice (dt, ndtd, & mu_rdg, tr_brine, & dardg1dt, dardg2dt, & dvirdgdt, opening, & - fpond, & + fpond, flux_bio, & fresh, fhocn, & faero_ocn, fiso_ocn, & aparticn, krdgn, & @@ -112,12 +111,7 @@ subroutine ridge_ice (dt, ndtd, & closing ) integer (kind=int_kind), intent(in) :: & - ndtd , & ! number of dynamics subcycles - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nslyr , & ! number of snow layers - n_aero, & ! number of aerosol tracers - ntrcr ! number of tracers in use + ndtd ! number of dynamics subcycles real (kind=dbl_kind), intent(in) :: & mu_rdg , & ! gives e-folding scale of ridged ice (m^.5) @@ -187,6 +181,9 @@ subroutine ridge_ice (dt, ndtd, & real (kind=dbl_kind), dimension(:), intent(inout), optional :: & faero_ocn ! aerosol flux to ocean (kg/m^2/s) + real (kind=dbl_kind), dimension(:), intent(inout), optional :: & + flux_bio ! biological and zaerosol flux to ocean (kg/m^2/s) + real (kind=dbl_kind), dimension(:), intent(inout), optional :: & fiso_ocn ! isotope flux to ocean (kg/m^2/s) @@ -220,6 +217,9 @@ subroutine ridge_ice (dt, ndtd, & real (kind=dbl_kind), dimension (n_aero) :: & maero ! aerosol mass added to ocean (kg m-2) + real (kind=dbl_kind), dimension (nbtrcr) :: & + mbio ! bio mass added to ocean (mmol or kg m-2) + real (kind=dbl_kind), dimension (n_iso) :: & miso ! isotope mass added to ocean (kg m-2) @@ -272,6 +272,7 @@ subroutine ridge_ice (dt, ndtd, & msnow_mlt = c0 esnow_mlt = c0 maero (:) = c0 + mbio (:) = c0 miso (:) = c0 mpond = c0 ardg1 = c0 @@ -287,7 +288,7 @@ subroutine ridge_ice (dt, ndtd, & ! Compute area of ice plus open water before ridging. !----------------------------------------------------------------- - call asum_ridging (ncat, aicen, aice0, asum) + call asum_ridging (aicen, aice0, asum) if (icepack_warnings_aborted(subname)) return !----------------------------------------------------------------- @@ -302,8 +303,7 @@ subroutine ridge_ice (dt, ndtd, & else - call ridge_prep (dt, & - ncat, hin_max, & + call ridge_prep (dt, hin_max, & rdg_conv, rdg_shear, & asum, closing_net, & divu_adv, opning) @@ -366,10 +366,10 @@ subroutine ridge_ice (dt, ndtd, & ! and various quantities associated with the new ridged ice. !----------------------------------------------------------------- - call ridge_itd (ncat, aice0, & + call ridge_itd (aice0, & aicen, vicen, & - krdg_partic, krdg_redist, & - mu_rdg, & + krdg_partic, krdg_redist,& + mu_rdg, & aksum, apartic, & hrmin, hrmax, & hrexp, krdg, & @@ -381,8 +381,7 @@ subroutine ridge_ice (dt, ndtd, & ! Redistribute area, volume, and energy. !----------------------------------------------------------------- - call ridge_shift (ntrcr, dt, & - ncat, hin_max, & + call ridge_shift (dt, hin_max, & aicen, trcrn, & vicen, vsnon, & aice0, trcr_depend, & @@ -396,11 +395,11 @@ subroutine ridge_ice (dt, ndtd, & virdg, aopen, & ardg1n, ardg2n, & virdgn, & - nslyr, n_aero, & msnow_mlt, esnow_mlt, & maero, miso, & mpond, Tf, & - aredistn, vredistn) + aredistn, vredistn, & + mbio) if (icepack_warnings_aborted(subname)) return !----------------------------------------------------------------- @@ -409,7 +408,7 @@ subroutine ridge_ice (dt, ndtd, & ! with new rates. !----------------------------------------------------------------- - call asum_ridging (ncat, aicen, aice0, asum) + call asum_ridging (aicen, aice0, asum) if (icepack_warnings_aborted(subname)) return if (abs(asum - c1) < puny) then @@ -590,6 +589,11 @@ subroutine ridge_ice (dt, ndtd, & faero_ocn(it) = faero_ocn(it) + maero(it)*dti enddo endif + if (present(flux_bio)) then + do it = 1, nbtrcr + flux_bio(it) = flux_bio(it) + mbio(it)*dti + enddo + endif if (present(fiso_ocn)) then if (tr_iso) then ! check size fiso_ocn vs n_iso ??? @@ -639,10 +643,7 @@ end subroutine ridge_ice ! ! author: William H. Lipscomb, LANL - subroutine asum_ridging (ncat, aicen, aice0, asum) - - integer (kind=int_kind), intent(in) :: & - ncat ! number of thickness categories + subroutine asum_ridging (aicen, aice0, asum) real (kind=dbl_kind), dimension (:), intent(in) :: & aicen ! concentration of ice in each category @@ -672,15 +673,11 @@ end subroutine asum_ridging ! ! author: William H. Lipscomb, LANL - subroutine ridge_prep (dt, & - ncat, hin_max, & + subroutine ridge_prep (dt, hin_max, & rdg_conv, rdg_shear, & asum, closing_net, & divu_adv, opning) - integer (kind=int_kind), intent(in) :: & - ncat ! number of thickness categories - real (kind=dbl_kind), intent(in) :: & dt ! time step (s) @@ -774,7 +771,7 @@ end subroutine ridge_prep ! 2006: Changed subroutine name to ridge_itd ! Added new options for ridging participation and redistribution. - subroutine ridge_itd (ncat, aice0, & + subroutine ridge_itd (aice0, & aicen, vicen, & krdg_partic, krdg_redist, & mu_rdg, & @@ -784,9 +781,6 @@ subroutine ridge_itd (ncat, aice0, & aparticn, krdgn, & mraft) - integer (kind=int_kind), intent(in) :: & - ncat ! number of thickness categories - real (kind=dbl_kind), intent(in) :: & mu_rdg , & ! gives e-folding scale of ridged ice (m^.5) aice0 ! concentration of open water @@ -1066,8 +1060,7 @@ end subroutine ridge_itd ! ! author: William H. Lipscomb, LANL - subroutine ridge_shift (ntrcr, dt, & - ncat, hin_max, & + subroutine ridge_shift (dt, hin_max, & aicen, trcrn, & vicen, vsnon, & aice0, trcr_depend, & @@ -1081,17 +1074,13 @@ subroutine ridge_shift (ntrcr, dt, & virdg, aopen, & ardg1nn, ardg2nn, & virdgnn, & - nslyr, n_aero, & msnow_mlt, esnow_mlt, & maero, miso, & mpond, Tf, & - aredistn, vredistn) + aredistn, vredistn, & + mbio) integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nslyr , & ! number of snow layers - ntrcr , & ! number of tracers in use - n_aero, & ! number of aerosol tracers krdg_redist ! selects redistribution function real (kind=dbl_kind), intent(in) :: & @@ -1162,6 +1151,9 @@ subroutine ridge_shift (ntrcr, dt, & real (kind=dbl_kind), dimension(:), intent(inout) :: & miso ! isotope mass added to ocean (kg m-2) + real (kind=dbl_kind), dimension(:), intent(inout) :: & + mbio ! biology and zaerosol mass added to ocean (kg m-2) + real (kind=dbl_kind), dimension (:), intent(inout), optional :: & aredistn , & ! redistribution function: fraction of new ridge area vredistn ! redistribution function: fraction of new ridge volume @@ -1214,7 +1206,9 @@ subroutine ridge_shift (ntrcr, dt, & hL, hR , & ! left and right limits of integration expL, expR , & ! exponentials involving hL, hR tmpfac , & ! factor by which opening/closing rates are cut - wk1 ! work variable + wk1 , & ! work variable + dzssl , & ! fraction of snow surface biotracers + dzint ! fraction of interior snow biotracers character(len=*),parameter :: subname='(ridge_shift)' @@ -1385,6 +1379,16 @@ subroutine ridge_shift (ntrcr, dt, & enddo endif + if (z_tracers .and. nbtrcr > 0) then + dzssl = p5/real(nslyr,kind=dbl_kind) + dzint = c1-dzssl + do it = 1, nbtrcr + mbio(it) = mbio(it) + vsrdgn*(c1-fsnowrdg) & + * (trcrn(bio_index(it) + nblyr + 1,n) * dzssl & + + trcrn(bio_index(it) + nblyr + 2,n) * dzint) + enddo + endif + if (tr_pond_topo) then mpond = mpond + ardg1n * trcrn(nt_apnd,n) & * trcrn(nt_hpnd,n) @@ -1570,7 +1574,7 @@ subroutine ridge_shift (ntrcr, dt, & !----------------------------------------------------------------- do n = 1, ncat - call icepack_compute_tracers (ntrcr, trcr_depend, & + call icepack_compute_tracers (trcr_depend, & atrcrn(:,n), aicen(n), & vicen(n), vsnon(n), & trcr_base, n_trcr_strata, & @@ -1596,15 +1600,11 @@ end subroutine ridge_shift ! 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) @@ -1652,13 +1652,13 @@ subroutine icepack_ice_strength (ncat, & ! Compute thickness distribution of ridging and ridged ice. !----------------------------------------------------------------- - call asum_ridging (ncat, aicen, aice0, asum) + call asum_ridging (aicen, aice0, asum) if (icepack_warnings_aborted(subname)) return - call ridge_itd (ncat, aice0, & + call ridge_itd (aice0, & aicen, vicen, & krdg_partic, krdg_redist, & - mu_rdg, & + mu_rdg, & aksum, apartic, & hrmin, hrmax, & hrexp, krdg) @@ -1719,10 +1719,8 @@ end subroutine icepack_ice_strength ! 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, & @@ -1734,7 +1732,6 @@ subroutine icepack_step_ridge (dt, ndtd, & dvirdgdt, opening, & fpond, & fresh, fhocn, & - n_aero, & faero_ocn, fiso_ocn, & aparticn, krdgn, & aredistn, vredistn, & @@ -1752,12 +1749,7 @@ subroutine icepack_step_ridge (dt, ndtd, & 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) @@ -1858,9 +1850,7 @@ subroutine icepack_step_ridge (dt, ndtd, & !----------------------------------------------------------------- call ridge_ice (dt, ndtd, & - ncat, n_aero, & - nilyr, nslyr, & - ntrcr, hin_max, & + hin_max, & rdg_conv, rdg_shear, & aicen, & trcrn, & @@ -1874,7 +1864,7 @@ subroutine icepack_step_ridge (dt, ndtd, & mu_rdg, tr_brine, & dardg1dt, dardg2dt, & dvirdgdt, opening, & - fpond, & + fpond, flux_bio, & fresh, fhocn, & faero_ocn, fiso_ocn, & aparticn, krdgn, & @@ -1891,14 +1881,10 @@ subroutine icepack_step_ridge (dt, ndtd, & !----------------------------------------------------------------- dtt = dt * ndtd ! for proper averaging over thermo timestep - call cleanup_itd (dtt, ntrcr, & - nilyr, nslyr, & - ncat, hin_max, & + call cleanup_itd (dtt, hin_max, & aicen, trcrn, & vicen, vsnon, & aice0, aice, & - n_aero, & - nbtrcr, nblyr, & tr_aero, & tr_pond_topo, & first_ice, & diff --git a/columnphysics/icepack_meltpond_topo.F90 b/columnphysics/icepack_meltpond_topo.F90 index 830c7a0b..23928fef 100644 --- a/columnphysics/icepack_meltpond_topo.F90 +++ b/columnphysics/icepack_meltpond_topo.F90 @@ -23,6 +23,7 @@ module icepack_meltpond_topo use icepack_parameters, only: c0, c1, c2, p01, p1, p15, p4, p6 use icepack_parameters, only: puny, viscosity_dyn, rhoi, rhos, rhow, Timelt, Lfresh use icepack_parameters, only: gravit, depressT, kice, ice_ref_salinity + use icepack_tracers, only: ncat, nilyr use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted use icepack_therm_shared, only: calculate_Tin_from_qin @@ -38,7 +39,7 @@ module icepack_meltpond_topo !======================================================================= - subroutine compute_ponds_topo(dt, ncat, nilyr, & + subroutine compute_ponds_topo(dt, & ktherm, & aice, aicen, & vice, vicen, & @@ -50,8 +51,6 @@ subroutine compute_ponds_topo(dt, ncat, nilyr, & apnd, hpnd, ipnd ) integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr, & ! number of ice layers ktherm ! type of thermodynamics (0 0-layer, 1 BL99, 2 mushy) real (kind=dbl_kind), intent(in) :: & @@ -159,7 +158,7 @@ subroutine compute_ponds_topo(dt, ncat, nilyr, & !-------------------------------------------------------------- ! calculate pond area and depth !-------------------------------------------------------------- - call pond_area(dt, ncat, nilyr, & + call pond_area(dt, & ktherm, & aice, vice, vsno, & aicen, vicen, vsnon, & @@ -291,7 +290,7 @@ end subroutine compute_ponds_topo ! Computes melt pond area, pond depth and melting rates - subroutine pond_area(dt, ncat, nilyr,& + subroutine pond_area(dt, & ktherm, & aice, vice, vsno, & aicen, vicen, vsnon,& @@ -300,8 +299,6 @@ subroutine pond_area(dt, ncat, nilyr,& apondn,hpondn,dvolp ) integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr, & ! number of ice layers ktherm ! type of thermodynamics (-1 none, 1 BL99, 2 mushy) real (kind=dbl_kind), intent(in) :: & @@ -469,7 +466,7 @@ subroutine pond_area(dt, ncat, nilyr,& ! height and area corresponding to the remaining volume - call calc_hpond(ncat, reduced_aicen, asnon, hsnon, & + call calc_hpond(reduced_aicen, asnon, hsnon, & alfan, volp, cum_max_vol, hpond, m_index) if (icepack_warnings_aborted(subname)) return @@ -495,7 +492,7 @@ subroutine pond_area(dt, ncat, nilyr,& if (ktherm /= 2 .and. pressure_head > c0) then do n = 1, ncat-1 if (hicen(n) > c0) then - call permeability_phi(nilyr, qicen(:,n), sicen(:,n), perm) + call permeability_phi(qicen(:,n), sicen(:,n), perm) if (icepack_warnings_aborted(subname)) return if (perm > c0) permflag = 1 drain = perm*apondn(n)*pressure_head*dt / (viscosity_dyn*hicen(n)) @@ -511,7 +508,7 @@ subroutine pond_area(dt, ncat, nilyr,& ! adjust melt pond dimensions if (permflag > 0) then ! recompute pond depth - call calc_hpond(ncat, reduced_aicen, asnon, hsnon, & + call calc_hpond(reduced_aicen, asnon, hsnon, & alfan, volp, cum_max_vol, hpond, m_index) if (icepack_warnings_aborted(subname)) return do n=1, m_index @@ -569,12 +566,9 @@ end subroutine pond_area !======================================================================= - subroutine calc_hpond(ncat, aicen, asnon, hsnon, & + subroutine calc_hpond(aicen, asnon, hsnon, & alfan, volp, cum_max_vol, hpond, m_index) - integer (kind=int_kind), intent(in) :: & - ncat ! number of thickness categories - real (kind=dbl_kind), dimension(:), intent(in) :: & aicen, & asnon, & @@ -734,10 +728,7 @@ end subroutine calc_hpond ! determine the liquid fraction of brine in the ice and the permeability - subroutine permeability_phi(nilyr, qicen, sicen, perm) - - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers + subroutine permeability_phi(qicen, sicen, perm) real (kind=dbl_kind), dimension(:), intent(in) :: & qicen, & ! energy of melting for each ice layer (J/m2) diff --git a/columnphysics/icepack_mushy_physics.F90 b/columnphysics/icepack_mushy_physics.F90 index 8ab81976..244faa72 100644 --- a/columnphysics/icepack_mushy_physics.F90 +++ b/columnphysics/icepack_mushy_physics.F90 @@ -5,6 +5,7 @@ module icepack_mushy_physics use icepack_parameters, only: puny use icepack_parameters, only: rhow, rhoi, rhos, cp_ocn, cp_ice, Lfresh use icepack_parameters, only: ksno + use icepack_tracers, only: nilyr use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -70,10 +71,7 @@ module icepack_mushy_physics !======================================================================= ! Detemine the conductivity of the mush from enthalpy and salinity - subroutine conductivity_mush_array(nilyr, zqin, zSin, km) - - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers + subroutine conductivity_mush_array(zqin, zSin, km) real(kind=dbl_kind), dimension(:), intent(in) :: & zqin, & ! ice layer enthalpy (J m-3) diff --git a/columnphysics/icepack_parameters.F90 b/columnphysics/icepack_parameters.F90 index e76b23b0..ef82b069 100644 --- a/columnphysics/icepack_parameters.F90 +++ b/columnphysics/icepack_parameters.F90 @@ -192,6 +192,7 @@ module icepack_parameters kappav = 1.4_dbl_kind ,&! vis extnctn coef in ice, wvlngth<700nm (1/m) hi_ssl = 0.050_dbl_kind,&! ice surface scattering layer thickness (m) hs_ssl = 0.040_dbl_kind,&! snow surface scattering layer thickness (m) + hs_ssl_min = 5.e-4_dbl_kind,&! minimum snow surface scattering layer thickness for aerosol (m) ! baseline albedos for ccsm3 shortwave, set in namelist albicev = 0.78_dbl_kind ,&! visible ice albedo for h > ahmax albicei = 0.36_dbl_kind ,&! near-ir ice albedo for h > ahmax @@ -205,8 +206,9 @@ module icepack_parameters dT_mlt = c1p5 ,&! change in temp for non-melt to melt snow grain ! radius change (C) rsnw_mlt = 1500._dbl_kind,&! maximum melting snow grain radius (10^-6 m) - kalg = 0.60_dbl_kind ! algae absorption coefficient for 0.5 m thick layer + kalg = 0.60_dbl_kind, &! algae absorption coefficient for 0.5 m thick layer ! 0.5 m path of 75 mg Chl a / m2 + R_gC2molC = 12.0107_dbl_kind! g carbon per mol carbon ! weights for albedos ! 4 Jan 2007 BPB Following are appropriate for complete cloud ! in a summer polar atmosphere with 1.5m bare sea ice surface: @@ -398,19 +400,23 @@ module icepack_parameters scale_bgc = .false., & ! if .true., initialize bgc tracers proportionally with salinity solve_zbgc = .false., & ! if .true., solve vertical biochemistry portion of code dEdd_algae = .false., & ! if .true., algal absorption of shortwave is computed in the - skl_bgc = .false. ! if true, solve skeletal biochemistry + skl_bgc = .false., & ! if true, solve skeletal biochemistry + use_macromolecules = .false., & ! if true, ocean DOC already split into + ! polysaccharids, lipid and protein fractions + use_atm_dust_iron = .false., & ! if .true., compute iron contribution from dust + restartbgc = .false. real (kind=dbl_kind), public :: & - phi_snow = p5 , & ! snow porosity - grid_o = c5 , & ! for bottom flux + phi_snow = -1.0_dbl_kind , & ! snow porosity (compute from snow density if negative) + grid_o = 0.006_dbl_kind , & ! for bottom flux initbio_frac = c1 , & ! fraction of ocean trcr concentration in bio trcrs - l_sk = 7.0_dbl_kind , & ! characteristic diffusive scale (m) - grid_oS = c5 , & ! for bottom flux - l_skS = 7.0_dbl_kind , & ! characteristic skeletal layer thickness (m) (zsalinity) - algal_vel = 1.11e-8_dbl_kind, & ! 0.5 cm/d(m/s) Lavoie 2005 1.5 cm/day + l_sk = 2.0_dbl_kind , & ! characteristic diffusive scale (m) + grid_oS = c0 , & ! for bottom flux + l_skS = 0.028_dbl_kind , & ! characteristic skeletal layer thickness (m) (zsalinity) + algal_vel = 1.0e-7_dbl_kind , & ! 0.5 cm/d(m/s) Lavoie 2005 1.5 cm/day R_dFe2dust = 0.035_dbl_kind , & ! g/g (3.5% content) Tagliabue 2009 dustFe_sol = 0.005_dbl_kind , & ! solubility fraction - frazil_scav = c1 , & ! fraction or multiple of bgc concentrated in frazil ice + frazil_scav = 0.8_dbl_kind , & ! fraction or multiple of bgc concentrated in frazil ice sk_l = 0.03_dbl_kind , & ! skeletal layer thickness (m) min_bgc = 0.01_dbl_kind , & ! fraction of ocean bgc concentration in surface melt T_max = c0 , & ! maximum temperature (C) @@ -418,20 +424,116 @@ module icepack_parameters op_dep_min = p1 , & ! light attenuates for optical depths exceeding min fr_graze_s = p5 , & ! fraction of grazing spilled or slopped fr_graze_e = p5 , & ! fraction of assimilation excreted - fr_mort2min = p5 , & ! fractionation of mortality to Am - fr_dFe = 0.3_dbl_kind , & ! fraction of remineralized nitrogen + fr_mort2min = 0.9_dbl_kind , & ! fractionation of mortality to Am + fr_dFe = 1.0_dbl_kind , & ! fraction of remineralized nitrogen ! (in units of algal iron) - k_nitrif = c0 , & ! nitrification rate (1/day) + k_nitrif = 0.046_dbl_kind , & ! nitrification rate (1/day) t_iron_conv = 3065.0_dbl_kind , & ! desorption loss pFe to dFe (day) max_loss = 0.9_dbl_kind , & ! restrict uptake to % of remaining value max_dfe_doc1 = 0.2_dbl_kind , & ! max ratio of dFe to saccharides in the ice ! (nM Fe/muM C) fr_resp = 0.05_dbl_kind , & ! fraction of algal growth lost due to respiration - fr_resp_s = 0.75_dbl_kind , & ! DMSPd fraction of respiration loss as DMSPd - y_sk_DMS = p5 , & ! fraction conversion given high yield - t_sk_conv = 3.0_dbl_kind , & ! Stefels conversion time (d) - t_sk_ox = 10.0_dbl_kind ! DMS oxidation time (d) - + fr_resp_s = 0.90_dbl_kind , & ! DMSPd fraction of respiration loss as DMSPd + y_sk_DMS = 0.7_dbl_kind , & ! fraction conversion given high yield + t_sk_conv = 5.0_dbl_kind , & ! Stefels conversion time (d) + t_sk_ox = 12.0_dbl_kind , & ! DMS oxidation time (d) + grid_o_t = 0.006_dbl_kind , & ! ice surface molecular sublayer thickness (m) + ratio_Si2N_diatoms = 1.8_dbl_kind , & ! algal Si to N (mol/mol) + ratio_Si2N_sp = c0 , & + ratio_Si2N_phaeo = c0 , & + ratio_S2N_diatoms = 0.03_dbl_kind , & ! algal S to N (mol/mol) + ratio_S2N_sp = 0.03_dbl_kind , & + ratio_S2N_phaeo = 0.03_dbl_kind , & + ratio_Fe2C_diatoms = 0.0033_dbl_kind, & ! algal Fe to C (umol/mol) + ratio_Fe2C_sp = 0.0033_dbl_kind, & + ratio_Fe2C_phaeo = 0.1_dbl_kind , & + ratio_Fe2N_diatoms = 0.023_dbl_kind , & ! algal Fe to N (umol/mol) + ratio_Fe2N_sp = 0.023_dbl_kind , & + ratio_Fe2N_phaeo = 0.7_dbl_kind , & + ratio_Fe2DON = 0.023_dbl_kind , & ! Fe to N of DON (nmol/umol) + ratio_Fe2DOC_s = 0.1_dbl_kind , & ! Fe to C of DOC (nmol/umol) saccharids + ratio_Fe2DOC_l = 0.033_dbl_kind , & ! Fe to C of DOC (nmol/umol) lipids + tau_min = 3600.0_dbl_kind, & ! rapid timescale for mobile to stationary exchanges (s) + tau_max = 604800.0_dbl_kind, & ! short timescale for mobile to stationary exchanges (s) + chlabs_diatoms = 0.03_dbl_kind , & ! absorptivity for diatoms (1/m/(mg/m3)) + chlabs_sp = 0.01_dbl_kind , & ! absorptivity for small plankton (1/m/(mg/m3)) + chlabs_phaeo = 0.05_dbl_kind , & ! absorptivity for phaeocystis (1/m/(mg/m3)) + alpha2max_low_diatoms = 0.3_dbl_kind, & ! light limitation for diatoms (1/(W/m2)) + alpha2max_low_sp = 0.2_dbl_kind , & ! light limitation for small plankton (1/(W/m2)) + alpha2max_low_phaeo = 0.17_dbl_kind , & ! light limitation for phaeocystis(1/(W/m2)) + beta2max_diatoms = 0.001_dbl_kind , & ! light inhibition (1/(W/m^2)) + beta2max_sp = 0.001_dbl_kind , & + beta2max_phaeo = 0.04_dbl_kind , & + mu_max_diatoms = 1.44_dbl_kind , & ! maximum growth rate (1/day) + mu_max_sp = 0.41_dbl_kind , & + mu_max_phaeo = 0.63_dbl_kind , & + grow_Tdep_diatoms = 0.063_dbl_kind , & ! Temperature dependence of growth (1/C) + grow_Tdep_sp = 0.063_dbl_kind , & + grow_Tdep_phaeo = 0.063_dbl_kind , & + fr_graze_diatoms = 0.19_dbl_kind , & ! Fraction grazed + fr_graze_sp = 0.19_dbl_kind , & + fr_graze_phaeo = 0.19_dbl_kind , & + mort_pre_diatoms = 0.007_dbl_kind , & ! Mortality (1/day) + mort_pre_sp = 0.007_dbl_kind , & + mort_pre_phaeo = 0.007_dbl_kind , & + mort_Tdep_diatoms = 0.03_dbl_kind , & ! T dependence of mortality (1/C) + mort_Tdep_sp = 0.03_dbl_kind , & + mort_Tdep_phaeo = 0.03_dbl_kind , & + k_exude_diatoms = c0 , & ! algal exudation (1/d) + k_exude_sp = c0 , & + k_exude_phaeo = c0 , & + K_Nit_diatoms = c1 , & ! nitrate half saturation (mmol/m^3) + K_Nit_sp = c1 , & + K_Nit_phaeo = c1 , & + K_Am_diatoms = 0.3_dbl_kind , & ! ammonium half saturation (mmol/m^3) + K_Am_sp = 0.3_dbl_kind , & + K_Am_phaeo = 0.3_dbl_kind , & + K_Sil_diatoms = 4.0_dbl_kind , & ! silicate half saturation (mmol/m^3) + K_Sil_sp = c0 , & + K_Sil_phaeo = c0 , & + K_Fe_diatoms = c1 , & ! iron half saturation (nM) + K_Fe_sp = 0.2_dbl_kind , & + K_Fe_phaeo = 0.1_dbl_kind , & + f_don_protein = 0.6_dbl_kind , & ! fraction of spilled grazing to proteins + kn_bac_protein = 0.2_dbl_kind , & ! Bacterial degredation of DON (1/d) + f_don_Am_protein = c1 , & ! fraction of remineralized DON to ammonium + f_doc_s = 0.5_dbl_kind , & ! fraction of mortality to DOC + f_doc_l = 0.5_dbl_kind , & + f_exude_s = c1 , & ! fraction of exudation to DOC + f_exude_l = c1 , & + k_bac_s = 0.03_dbl_kind , & ! Bacterial degredation of DOC (1/d) + k_bac_l = 0.03_dbl_kind , & + algaltype_diatoms = c0 , & ! mobility type + algaltype_sp = c0 , & ! algal groups + algaltype_phaeo = c0 , & ! + nitratetype = -1.0_dbl_kind , & ! nitrate + ammoniumtype = c0 , & ! ammonium + silicatetype = -1.0_dbl_kind , & ! silicate + dmspptype = 0.5_dbl_kind , & ! DMS + dmspdtype = c0 , & ! + humtype = c0 , & ! humics + doctype_s = c0 , & ! DOC + doctype_l = c0 , & ! + dictype_1 = -1.0_dbl_kind , & ! DIC + dontype_protein = c0 , & ! DON + fedtype_1 = c0 , & ! Iron + feptype_1 = 0.5_dbl_kind , & ! + zaerotype_bc1 = -1.0_dbl_kind , & ! Aerosols + zaerotype_bc2 = -1.0_dbl_kind , & ! + zaerotype_dust1 = -1.0_dbl_kind , & ! + zaerotype_dust2 = -1.0_dbl_kind , & ! + zaerotype_dust3 = -1.0_dbl_kind , & ! + zaerotype_dust4 = -1.0_dbl_kind , & ! + ratio_C2N_diatoms = 7.0_dbl_kind , & ! algal carbon to nitrogen mole ratio + ratio_C2N_sp = 7.0_dbl_kind , & + ratio_C2N_phaeo = 7.0_dbl_kind , & + ratio_chl2N_diatoms = 2.1_dbl_kind , & ! algal chlorophyll to nitrogen ratio (g chla/mol) + ratio_chl2N_sp = 1.1_dbl_kind , & + ratio_chl2N_phaeo = 0.84_dbl_kind , & + ratio_C2N_proteins = 5.0_dbl_kind , &! Ratio of carbon to nitrogen in proteins + F_abs_chl_diatoms = 2.0_dbl_kind , & ! scales absorbed radiation for dEdd + F_abs_chl_sp = 4.0_dbl_kind , & ! + F_abs_chl_phaeo = 5.0_dbl_kind !======================================================================= contains @@ -455,7 +557,7 @@ subroutine 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, & @@ -466,7 +568,7 @@ subroutine 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, & @@ -474,9 +576,10 @@ subroutine icepack_init_parameters( & 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, & @@ -488,7 +591,38 @@ subroutine 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 @@ -606,7 +740,8 @@ subroutine 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 @@ -633,7 +768,8 @@ subroutine 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 @@ -742,6 +878,10 @@ subroutine 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 :: & @@ -751,12 +891,112 @@ subroutine 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 @@ -912,6 +1152,7 @@ subroutine icepack_init_parameters( & if (present(dSin0_frazil_in) ) dSin0_frazil = dSin0_frazil_in if (present(hi_ssl_in) ) hi_ssl = hi_ssl_in if (present(hs_ssl_in) ) hs_ssl = hs_ssl_in + if (present(hs_ssl_min_in) ) hs_ssl_min = hs_ssl_min_in if (present(awtvdr_in) ) awtvdr = awtvdr_in if (present(awtidr_in) ) awtidr = awtidr_in if (present(awtvdf_in) ) awtvdf = awtvdf_in @@ -949,6 +1190,7 @@ subroutine icepack_init_parameters( & if (present(dT_mlt_in) ) dT_mlt = dT_mlt_in if (present(rsnw_mlt_in) ) rsnw_mlt = rsnw_mlt_in if (present(kalg_in) ) kalg = kalg_in + if (present(R_gC2molC_in) ) R_gC2molC = R_gC2molC_in if (present(kstrength_in) ) kstrength = kstrength_in if (present(krdg_partic_in) ) krdg_partic = krdg_partic_in if (present(krdg_redist_in) ) krdg_redist = krdg_redist_in @@ -1115,6 +1357,9 @@ 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(use_macromolecules_in)) use_macromolecules = use_macromolecules_in + if (present(use_atm_dust_iron_in) ) use_atm_dust_iron = use_atm_dust_iron_in + if (present(restartbgc_in) ) restartbgc = restartbgc_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)) then @@ -1125,10 +1370,145 @@ subroutine icepack_init_parameters( & endif if (present(grid_o_in) ) grid_o = grid_o_in if (present(l_sk_in) ) l_sk = l_sk_in + if (present(grid_o_t_in) ) grid_o_t = grid_o_t_in + if (present(frazil_scav_in) ) frazil_scav = frazil_scav_in if (present(initbio_frac_in) ) initbio_frac = initbio_frac_in if (present(grid_oS_in) ) grid_oS = grid_oS_in if (present(l_skS_in) ) l_skS = l_skS_in if (present(phi_snow_in) ) phi_snow = phi_snow_in + + if (present(ratio_Si2N_diatoms_in) ) ratio_Si2N_diatoms = ratio_Si2N_diatoms_in + if (present(ratio_Si2N_sp_in) ) ratio_Si2N_sp = ratio_Si2N_sp_in + if (present(ratio_Si2N_phaeo_in) ) ratio_Si2N_phaeo = ratio_Si2N_phaeo_in + if (present(ratio_S2N_diatoms_in) ) ratio_S2N_diatoms = ratio_S2N_diatoms_in + if (present(ratio_S2N_sp_in ) ) ratio_S2N_sp = ratio_S2N_sp_in + if (present(ratio_S2N_phaeo_in) ) ratio_S2N_phaeo = ratio_S2N_phaeo_in + if (present(ratio_Fe2C_diatoms_in) ) ratio_Fe2C_diatoms = ratio_Fe2C_diatoms_in + if (present(ratio_Fe2C_sp_in) ) ratio_Fe2C_sp = ratio_Fe2C_sp_in + if (present(ratio_Fe2C_phaeo_in) ) ratio_Fe2C_phaeo = ratio_Fe2C_phaeo_in + if (present(ratio_Fe2N_diatoms_in) ) ratio_Fe2N_diatoms = ratio_Fe2N_diatoms_in + if ((solve_zbgc .or. skl_bgc) .and. (ratio_Fe2N_diatoms .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: ratio_Fe2N_diatoms < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(ratio_Fe2N_sp_in) ) ratio_Fe2N_sp = ratio_Fe2N_sp_in + if ((solve_zbgc .or. skl_bgc) .and. (ratio_Fe2N_sp .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: ratio_Fe2N_sp < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(ratio_Fe2N_phaeo_in) ) ratio_Fe2N_phaeo = ratio_Fe2N_phaeo_in + if ((solve_zbgc .or. skl_bgc) .and. (ratio_Fe2N_phaeo .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: ratio_Fe2N_phaeo < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(ratio_Fe2DON_in) ) ratio_Fe2DON = ratio_Fe2DON_in + if (present(ratio_Fe2DOC_s_in) ) ratio_Fe2DOC_s = ratio_Fe2DOC_s_in + if (present(ratio_Fe2DOC_l_in) ) ratio_Fe2DOC_l = ratio_Fe2DOC_l_in + if (present(tau_min_in) ) tau_min = tau_min_in + if (present(tau_max_in) ) tau_max = tau_max_in + if (present(chlabs_diatoms_in) ) chlabs_diatoms = chlabs_diatoms_in + if (present(chlabs_sp_in) ) chlabs_sp = chlabs_sp_in + if (present(chlabs_phaeo_in) ) chlabs_phaeo = chlabs_phaeo_in + if (present(alpha2max_low_diatoms_in) ) alpha2max_low_diatoms = alpha2max_low_diatoms_in + if (present(alpha2max_low_sp_in) ) alpha2max_low_sp = alpha2max_low_sp_in + if (present(alpha2max_low_phaeo_in) ) alpha2max_low_phaeo = alpha2max_low_phaeo_in + if (present(beta2max_diatoms_in) ) beta2max_diatoms = beta2max_diatoms_in + if (present(beta2max_sp_in) ) beta2max_sp = beta2max_sp_in + if (present(beta2max_phaeo_in) ) beta2max_phaeo = beta2max_phaeo_in + if (present(mu_max_diatoms_in) ) mu_max_diatoms = mu_max_diatoms_in + if (present(mu_max_sp_in) ) mu_max_sp = mu_max_sp_in + if (present(mu_max_phaeo_in) ) mu_max_phaeo = mu_max_phaeo_in + if (present(grow_Tdep_diatoms_in) ) grow_Tdep_diatoms = grow_Tdep_diatoms_in + if (present(grow_Tdep_sp_in) ) grow_Tdep_sp = grow_Tdep_sp_in + if (present(grow_Tdep_phaeo_in) ) grow_Tdep_phaeo = grow_Tdep_phaeo_in + if (present(fr_graze_diatoms_in) ) fr_graze_diatoms = fr_graze_diatoms_in + if (present(fr_graze_sp_in) ) fr_graze_sp = fr_graze_sp_in + if (present(fr_graze_phaeo_in) ) fr_graze_phaeo = fr_graze_phaeo_in + if (present(mort_pre_diatoms_in) ) mort_pre_diatoms = mort_pre_diatoms_in + if (present(mort_pre_sp_in) ) mort_pre_sp = mort_pre_sp_in + if (present(mort_pre_phaeo_in) ) mort_pre_phaeo = mort_pre_phaeo_in + if (present(mort_Tdep_diatoms_in) ) mort_Tdep_diatoms = mort_Tdep_diatoms_in + if (present(mort_Tdep_sp_in) ) mort_Tdep_sp = mort_Tdep_sp_in + if (present(mort_Tdep_phaeo_in) ) mort_Tdep_phaeo = mort_Tdep_phaeo_in + if (present(k_exude_diatoms_in) ) k_exude_diatoms = k_exude_diatoms_in + if (present(k_exude_sp_in) ) k_exude_sp = k_exude_sp_in + if (present(k_exude_phaeo_in) ) k_exude_phaeo = k_exude_phaeo_in + if (present(K_Nit_diatoms_in) ) K_Nit_diatoms = K_Nit_diatoms_in + if ((solve_zbgc .or. skl_bgc) .and. (K_Nit_diatoms .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: K_Nit_diatoms < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(K_Nit_sp_in) ) K_Nit_sp = K_Nit_sp_in + if ((solve_zbgc .or. skl_bgc) .and. (K_Nit_sp .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: K_Nit_sp < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(K_Nit_phaeo_in) ) K_Nit_phaeo = K_Nit_phaeo_in + if ((solve_zbgc .or. skl_bgc) .and. (K_Nit_phaeo .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: K_Nit_phaeo < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(K_Am_diatoms_in) ) K_Am_diatoms = K_Am_diatoms_in + if ((solve_zbgc .or. skl_bgc) .and. (K_Am_diatoms .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: K_Am_diatoms < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(K_Am_sp_in) ) K_Am_sp = K_Am_sp_in + if ((solve_zbgc .or. skl_bgc) .and. (K_Am_sp .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: K_Am_sp < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(K_Am_phaeo_in) ) K_Am_phaeo = K_Am_phaeo_in + if ((solve_zbgc .or. skl_bgc) .and. (K_Am_phaeo .LE. c0)) then + call icepack_warnings_add(subname//' WARNING: K_Am_phaeo < = 0') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (present(K_Sil_diatoms_in) ) K_Sil_diatoms = K_Sil_diatoms_in + if (present(K_Sil_sp_in) ) K_Sil_sp = K_Sil_sp_in + if (present(K_Sil_phaeo_in) ) K_Sil_phaeo = K_Sil_phaeo_in + if (present(K_Fe_diatoms_in) ) K_Fe_diatoms = K_Fe_diatoms_in + if (present(K_Fe_sp_in) ) K_Fe_sp = K_Fe_sp_in + if (present(K_Fe_phaeo_in) ) K_Fe_phaeo = K_Fe_phaeo_in + if (present(f_don_protein_in) ) f_don_protein = f_don_protein_in + if (present(kn_bac_protein_in) ) kn_bac_protein = kn_bac_protein_in + if (present(f_don_Am_protein_in) ) f_don_Am_protein = f_don_Am_protein_in + if (present(f_doc_s_in) ) f_doc_s = f_doc_s_in + if (present(f_doc_l_in) ) f_doc_l = f_doc_l_in + if (present(f_exude_s_in) ) f_exude_s = f_exude_s_in + if (present(f_exude_l_in) ) f_exude_l = f_exude_l_in + if (present(k_bac_s_in) ) k_bac_s = k_bac_s_in + if (present(k_bac_l_in) ) k_bac_l = k_bac_l_in + if (present(algaltype_diatoms_in) ) algaltype_diatoms = algaltype_diatoms_in + if (present(algaltype_sp_in) ) algaltype_sp = algaltype_sp_in + if (present(algaltype_phaeo_in) ) algaltype_phaeo = algaltype_phaeo_in + if (present(nitratetype_in) ) nitratetype = nitratetype_in + if (present(ammoniumtype_in) ) ammoniumtype = ammoniumtype_in + if (present(silicatetype_in) ) silicatetype = silicatetype_in + if (present(dmspptype_in) ) dmspptype = dmspptype_in + if (present(dmspdtype_in) ) dmspdtype = dmspdtype_in + if (present(humtype_in) ) humtype = humtype_in + if (present(doctype_s_in) ) doctype_s = doctype_s_in + if (present(doctype_l_in) ) doctype_l = doctype_l_in + if (present(dictype_1_in) ) dictype_1 = dictype_1_in + if (present(dontype_protein_in) ) dontype_protein = dontype_protein_in + if (present(fedtype_1_in) ) fedtype_1 = fedtype_1_in + if (present(feptype_1_in) ) feptype_1 = feptype_1_in + if (present(zaerotype_bc1_in) ) zaerotype_bc1 = zaerotype_bc1_in + if (present(zaerotype_bc2_in) ) zaerotype_bc2 = zaerotype_bc2_in + if (present(zaerotype_dust1_in) ) zaerotype_dust1 = zaerotype_dust1_in + if (present(zaerotype_dust2_in) ) zaerotype_dust2 = zaerotype_dust2_in + if (present(zaerotype_dust3_in) ) zaerotype_dust3 = zaerotype_dust3_in + if (present(zaerotype_dust4_in) ) zaerotype_dust4 = zaerotype_dust4_in + if (present(ratio_C2N_diatoms_in) ) ratio_C2N_diatoms = ratio_C2N_diatoms_in + if (present(ratio_C2N_sp_in) ) ratio_C2N_sp = ratio_C2N_sp_in + if (present(ratio_C2N_phaeo_in) ) ratio_C2N_phaeo = ratio_C2N_phaeo_in + if (present(ratio_chl2N_diatoms_in)) ratio_chl2N_diatoms = ratio_chl2N_diatoms_in + if (present(ratio_chl2N_sp_in) ) ratio_chl2N_sp = ratio_chl2N_sp_in + if (present(ratio_chl2N_phaeo_in) ) ratio_chl2N_phaeo = ratio_chl2N_phaeo_in + if (present(F_abs_chl_diatoms_in) ) F_abs_chl_diatoms = F_abs_chl_diatoms_in + if (present(F_abs_chl_sp_in) ) F_abs_chl_sp = F_abs_chl_sp_in + if (present(F_abs_chl_phaeo_in) ) F_abs_chl_phaeo = F_abs_chl_phaeo_in + if (present(ratio_C2N_proteins_in) ) ratio_C2N_proteins = ratio_C2N_proteins_in if (present(fr_resp_in) ) fr_resp = fr_resp_in if (present(algal_vel_in) ) algal_vel = algal_vel_in if (present(R_dFe2dust_in) ) R_dFe2dust = R_dFe2dust_in @@ -1148,7 +1528,6 @@ subroutine icepack_init_parameters( & if (present(y_sk_DMS_in) ) y_sk_DMS = y_sk_DMS_in if (present(t_sk_conv_in) ) t_sk_conv = t_sk_conv_in if (present(t_sk_ox_in) ) t_sk_ox = t_sk_ox_in - if (present(frazil_scav_in) ) frazil_scav = frazil_scav_in if (present(sw_redist_in) ) sw_redist = sw_redist_in if (present(sw_frac_in) ) sw_frac = sw_frac_in if (present(sw_dtemp_in) ) sw_dtemp = sw_dtemp_in @@ -1189,7 +1568,7 @@ subroutine 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, & @@ -1199,7 +1578,7 @@ subroutine 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, & @@ -1207,7 +1586,8 @@ subroutine icepack_query_parameters( & 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, & @@ -1221,7 +1601,37 @@ subroutine 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 @@ -1350,7 +1760,8 @@ subroutine 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 @@ -1377,7 +1788,8 @@ subroutine 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 @@ -1486,6 +1898,10 @@ subroutine 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 :: & @@ -1495,12 +1911,112 @@ subroutine 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 @@ -1688,6 +2204,7 @@ subroutine icepack_query_parameters( & if (present(dSin0_frazil_out) ) dSin0_frazil_out = dSin0_frazil if (present(hi_ssl_out) ) hi_ssl_out = hi_ssl if (present(hs_ssl_out) ) hs_ssl_out = hs_ssl + if (present(hs_ssl_min_out) ) hs_ssl_min_out = hs_ssl_min if (present(awtvdr_out) ) awtvdr_out = awtvdr if (present(awtidr_out) ) awtidr_out = awtidr if (present(awtvdf_out) ) awtvdf_out = awtvdf @@ -1725,6 +2242,7 @@ subroutine icepack_query_parameters( & if (present(dT_mlt_out) ) dT_mlt_out = dT_mlt if (present(rsnw_mlt_out) ) rsnw_mlt_out = rsnw_mlt if (present(kalg_out) ) kalg_out = kalg + if (present(R_gC2molC_out) ) R_gC2molC_out = R_gC2molC if (present(kstrength_out) ) kstrength_out = kstrength if (present(krdg_partic_out) ) krdg_partic_out = krdg_partic if (present(krdg_redist_out) ) krdg_redist_out = krdg_redist @@ -1780,15 +2298,116 @@ 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(use_macromolecules_out)) use_macromolecules_out = use_macromolecules + if (present(use_atm_dust_iron_out) ) use_atm_dust_iron_out = use_atm_dust_iron + if (present(restartbgc_out) ) restartbgc_out= restartbgc 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 if (present(l_sk_out) ) l_sk_out = l_sk if (present(initbio_frac_out) ) initbio_frac_out = initbio_frac + if (present(frazil_scav_out) ) frazil_scav_out = frazil_scav if (present(grid_oS_out) ) grid_oS_out = grid_oS if (present(l_skS_out) ) l_skS_out = l_skS + if (present(grid_o_t_out) ) grid_o_t_out = grid_o_t if (present(phi_snow_out) ) phi_snow_out = phi_snow + if (present(ratio_Si2N_diatoms_out) ) ratio_Si2N_diatoms_out = ratio_Si2N_diatoms + if (present(ratio_Si2N_sp_out) ) ratio_Si2N_sp_out = ratio_Si2N_sp + if (present(ratio_Si2N_phaeo_out) ) ratio_Si2N_phaeo_out = ratio_Si2N_phaeo + if (present(ratio_S2N_diatoms_out) ) ratio_S2N_diatoms_out = ratio_S2N_diatoms + if (present(ratio_S2N_sp_out) ) ratio_S2N_sp_out = ratio_S2N_sp + if (present(ratio_S2N_phaeo_out) ) ratio_S2N_phaeo_out = ratio_S2N_phaeo + if (present(ratio_Fe2C_diatoms_out) ) ratio_Fe2C_diatoms_out = ratio_Fe2C_diatoms + if (present(ratio_Fe2C_sp_out) ) ratio_Fe2C_sp_out = ratio_Fe2C_sp + if (present(ratio_Fe2C_phaeo_out) ) ratio_Fe2C_phaeo_out = ratio_Fe2C_phaeo + if (present(ratio_Fe2N_diatoms_out) ) ratio_Fe2N_diatoms_out = ratio_Fe2N_diatoms + if (present(ratio_Fe2N_sp_out) ) ratio_Fe2N_sp_out = ratio_Fe2N_sp + if (present(ratio_Fe2N_phaeo_out) ) ratio_Fe2N_phaeo_out = ratio_Fe2N_phaeo + if (present(ratio_Fe2DON_out) ) ratio_Fe2DON_out = ratio_Fe2DON + if (present(ratio_Fe2DOC_s_out) ) ratio_Fe2DOC_s_out = ratio_Fe2DOC_s + if (present(ratio_Fe2DOC_l_out) ) ratio_Fe2DOC_l_out = ratio_Fe2DOC_l + if (present(tau_min_out) ) tau_min_out = tau_min + if (present(tau_max_out) ) tau_max_out = tau_max + if (present(chlabs_diatoms_out) ) chlabs_diatoms_out = chlabs_diatoms + if (present(chlabs_sp_out) ) chlabs_sp_out = chlabs_sp + if (present(chlabs_phaeo_out) ) chlabs_phaeo_out = chlabs_phaeo + if (present(alpha2max_low_diatoms_out) ) alpha2max_low_diatoms_out = alpha2max_low_diatoms + if (present(alpha2max_low_sp_out) ) alpha2max_low_sp_out = alpha2max_low_sp + if (present(alpha2max_low_phaeo_out) ) alpha2max_low_phaeo_out = alpha2max_low_phaeo + if (present(beta2max_diatoms_out) ) beta2max_diatoms_out = beta2max_diatoms + if (present(beta2max_sp_out) ) beta2max_sp_out = beta2max_sp + if (present(beta2max_phaeo_out) ) beta2max_phaeo_out = beta2max_phaeo + if (present(mu_max_diatoms_out) ) mu_max_diatoms_out = mu_max_diatoms + if (present(mu_max_sp_out) ) mu_max_sp_out = mu_max_sp + if (present(mu_max_phaeo_out) ) mu_max_phaeo_out = mu_max_phaeo + if (present(grow_Tdep_diatoms_out) ) grow_Tdep_diatoms_out = grow_Tdep_diatoms + if (present(grow_Tdep_sp_out) ) grow_Tdep_sp_out = grow_Tdep_sp + if (present(grow_Tdep_phaeo_out) ) grow_Tdep_phaeo_out = grow_Tdep_phaeo + if (present(fr_graze_diatoms_out) ) fr_graze_diatoms_out = fr_graze_diatoms + if (present(fr_graze_sp_out) ) fr_graze_sp_out = fr_graze_sp + if (present(fr_graze_phaeo_out) ) fr_graze_phaeo_out = fr_graze_phaeo + if (present(mort_pre_diatoms_out) ) mort_pre_diatoms_out = mort_pre_diatoms + if (present(mort_pre_sp_out) ) mort_pre_sp_out = mort_pre_sp + if (present(mort_pre_phaeo_out) ) mort_pre_phaeo_out = mort_pre_phaeo + if (present(mort_Tdep_diatoms_out) ) mort_Tdep_diatoms_out = mort_Tdep_diatoms + if (present(mort_Tdep_sp_out) ) mort_Tdep_sp_out = mort_Tdep_sp + if (present(mort_Tdep_phaeo_out) ) mort_Tdep_phaeo_out = mort_Tdep_phaeo + if (present(k_exude_diatoms_out) ) k_exude_diatoms_out = k_exude_diatoms + if (present(k_exude_sp_out) ) k_exude_sp_out = k_exude_sp + if (present(k_exude_phaeo_out) ) k_exude_phaeo_out = k_exude_phaeo + if (present(K_Nit_diatoms_out) ) K_Nit_diatoms_out = K_Nit_diatoms + if (present(K_Nit_sp_out) ) K_Nit_sp_out = K_Nit_sp + if (present(K_Nit_phaeo_out) ) K_Nit_phaeo_out = K_Nit_phaeo + if (present(K_Am_diatoms_out) ) K_Am_diatoms_out = K_Am_diatoms + if (present(K_Am_sp_out) ) K_Am_sp_out = K_Am_sp + if (present(K_Am_phaeo_out) ) K_Am_phaeo_out = K_Am_phaeo + if (present(K_Sil_diatoms_out) ) K_Sil_diatoms_out = K_Sil_diatoms + if (present(K_Sil_sp_out) ) K_Sil_sp_out = K_Sil_sp + if (present(K_Sil_phaeo_out) ) K_Sil_phaeo_out = K_Sil_phaeo + if (present(K_Fe_diatoms_out) ) K_Fe_diatoms_out = K_Fe_diatoms + if (present(K_Fe_sp_out) ) K_Fe_sp_out = K_Fe_sp + if (present(K_Fe_phaeo_out) ) K_Fe_phaeo_out = K_Fe_phaeo + if (present(f_don_protein_out) ) f_don_protein_out = f_don_protein + if (present(kn_bac_protein_out) ) kn_bac_protein_out = kn_bac_protein + if (present(f_don_Am_protein_out) ) f_don_Am_protein_out = f_don_Am_protein + if (present(f_doc_s_out) ) f_doc_s_out = f_doc_s + if (present(f_doc_l_out) ) f_doc_l_out = f_doc_l + if (present(f_exude_s_out) ) f_exude_s_out = f_exude_s + if (present(f_exude_l_out) ) f_exude_l_out = f_exude_l + if (present(k_bac_s_out) ) k_bac_s_out = k_bac_s + if (present(k_bac_l_out) ) k_bac_l_out = k_bac_l + if (present(algaltype_diatoms_out) ) algaltype_diatoms_out = algaltype_diatoms + if (present(algaltype_sp_out) ) algaltype_sp_out = algaltype_sp + if (present(algaltype_phaeo_out) ) algaltype_phaeo_out = algaltype_phaeo + if (present(nitratetype_out) ) nitratetype_out = nitratetype + if (present(ammoniumtype_out) ) ammoniumtype_out = ammoniumtype + if (present(silicatetype_out) ) silicatetype_out = silicatetype + if (present(dmspptype_out) ) dmspptype_out = dmspptype + if (present(dmspdtype_out) ) dmspdtype_out = dmspdtype + if (present(humtype_out) ) humtype_out = humtype + if (present(doctype_s_out) ) doctype_s_out = doctype_s + if (present(doctype_l_out) ) doctype_l_out = doctype_l + if (present(dictype_1_out) ) dictype_1_out = dictype_1 + if (present(dontype_protein_out) ) dontype_protein_out = dontype_protein + if (present(fedtype_1_out) ) fedtype_1_out = fedtype_1 + if (present(feptype_1_out) ) feptype_1_out = feptype_1 + if (present(zaerotype_bc1_out) ) zaerotype_bc1_out = zaerotype_bc1 + if (present(zaerotype_bc2_out) ) zaerotype_bc2_out = zaerotype_bc2 + if (present(zaerotype_dust1_out) ) zaerotype_dust1_out = zaerotype_dust1 + if (present(zaerotype_dust2_out) ) zaerotype_dust2_out = zaerotype_dust2 + if (present(zaerotype_dust3_out) ) zaerotype_dust3_out = zaerotype_dust3 + if (present(zaerotype_dust4_out) ) zaerotype_dust4_out = zaerotype_dust4 + if (present(ratio_C2N_diatoms_out) ) ratio_C2N_diatoms_out = ratio_C2N_diatoms + if (present(ratio_C2N_sp_out) ) ratio_C2N_sp_out = ratio_C2N_sp + if (present(ratio_C2N_phaeo_out) ) ratio_C2N_phaeo_out = ratio_C2N_phaeo + if (present(ratio_chl2N_diatoms_out)) ratio_chl2N_diatoms_out = ratio_chl2N_diatoms + if (present(ratio_chl2N_sp_out) ) ratio_chl2N_sp_out = ratio_chl2N_sp + if (present(ratio_chl2N_phaeo_out) ) ratio_chl2N_phaeo_out = ratio_chl2N_phaeo + if (present(F_abs_chl_diatoms_out) ) F_abs_chl_diatoms_out = F_abs_chl_diatoms + if (present(F_abs_chl_sp_out) ) F_abs_chl_sp_out = F_abs_chl_sp + if (present(F_abs_chl_phaeo_out) ) F_abs_chl_phaeo_out = F_abs_chl_phaeo + if (present(ratio_C2N_proteins_out) ) ratio_C2N_proteins_out = ratio_C2N_proteins if (present(fr_resp_out) ) fr_resp_out = fr_resp if (present(algal_vel_out) ) algal_vel_out = algal_vel if (present(R_dFe2dust_out) ) R_dFe2dust_out = R_dFe2dust @@ -1808,7 +2427,6 @@ subroutine icepack_query_parameters( & if (present(y_sk_DMS_out) ) y_sk_DMS_out = y_sk_DMS if (present(t_sk_conv_out) ) t_sk_conv_out = t_sk_conv if (present(t_sk_ox_out) ) t_sk_ox_out = t_sk_ox - if (present(frazil_scav_out) ) frazil_scav_out = frazil_scav if (present(Lfresh_out) ) Lfresh_out = Lfresh if (present(cprho_out) ) cprho_out = cprho if (present(Cp_out) ) Cp_out = Cp @@ -1885,6 +2503,7 @@ subroutine icepack_write_parameters(iounit) write(iounit,*) " dSin0_frazil = ",dSin0_frazil write(iounit,*) " hi_ssl = ",hi_ssl write(iounit,*) " hs_ssl = ",hs_ssl + write(iounit,*) " hs_ssl_min = ",hs_ssl_min write(iounit,*) " awtvdr = ",awtvdr write(iounit,*) " awtidr = ",awtidr write(iounit,*) " awtvdf = ",awtvdf @@ -1933,6 +2552,7 @@ subroutine icepack_write_parameters(iounit) write(iounit,*) " dT_mlt = ", dT_mlt write(iounit,*) " rsnw_mlt = ", rsnw_mlt write(iounit,*) " kalg = ", kalg + write(iounit,*) " R_gC2molC = ", R_gC2molC write(iounit,*) " kstrength = ", kstrength write(iounit,*) " krdg_partic= ", krdg_partic write(iounit,*) " krdg_redist= ", krdg_redist @@ -1988,15 +2608,117 @@ 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,*) " use_macromolecules = ", use_macromolecules + write(iounit,*) " use_atm_dust_iron = ", use_atm_dust_iron + write(iounit,*) " restartbgc = ", restartbgc write(iounit,*) " conserv_check = ", conserv_check write(iounit,*) " skl_bgc = ", skl_bgc write(iounit,*) " solve_zsal = ", solve_zsal write(iounit,*) " grid_o = ", grid_o write(iounit,*) " l_sk = ", l_sk + write(iounit,*) " grid_o_t = ", grid_o_t write(iounit,*) " initbio_frac = ", initbio_frac + write(iounit,*) " frazil_scav= ", frazil_scav write(iounit,*) " grid_oS = ", grid_oS write(iounit,*) " l_skS = ", l_skS write(iounit,*) " phi_snow = ", phi_snow + + write(iounit,*) " ratio_Si2N_diatoms = ", ratio_Si2N_diatoms + write(iounit,*) " ratio_Si2N_sp = ", ratio_Si2N_sp + write(iounit,*) " ratio_Si2N_phaeo = ", ratio_Si2N_phaeo + write(iounit,*) " ratio_S2N_diatoms = ", ratio_S2N_diatoms + write(iounit,*) " ratio_S2N_sp = ", ratio_S2N_sp + write(iounit,*) " ratio_S2N_phaeo = ", ratio_S2N_phaeo + write(iounit,*) " ratio_Fe2C_diatoms = ", ratio_Fe2C_diatoms + write(iounit,*) " ratio_Fe2C_sp = ", ratio_Fe2C_sp + write(iounit,*) " ratio_Fe2C_phaeo = ", ratio_Fe2C_phaeo + write(iounit,*) " ratio_Fe2N_diatoms = ", ratio_Fe2N_diatoms + write(iounit,*) " ratio_Fe2N_sp = ", ratio_Fe2N_sp + write(iounit,*) " ratio_Fe2N_phaeo = ", ratio_Fe2N_phaeo + write(iounit,*) " ratio_Fe2DON = ", ratio_Fe2DON + write(iounit,*) " ratio_Fe2DOC_s = ", ratio_Fe2DOC_s + write(iounit,*) " ratio_Fe2DOC_l = ", ratio_Fe2DOC_l + write(iounit,*) " tau_min = ", tau_min + write(iounit,*) " tau_max = ", tau_max + write(iounit,*) " chlabs_diatoms = ", chlabs_diatoms + write(iounit,*) " chlabs_sp = ", chlabs_sp + write(iounit,*) " chlabs_phaeo = ", chlabs_phaeo + write(iounit,*) " alpha2max_low_diatoms = ", alpha2max_low_diatoms + write(iounit,*) " alpha2max_low_sp = ", alpha2max_low_sp + write(iounit,*) " alpha2max_low_phaeo = ", alpha2max_low_phaeo + write(iounit,*) " beta2max_diatoms = ", beta2max_diatoms + write(iounit,*) " beta2max_sp = ", beta2max_sp + write(iounit,*) " beta2max_phaeo = ", beta2max_phaeo + write(iounit,*) " mu_max_diatoms = ", mu_max_diatoms + write(iounit,*) " mu_max_sp = ", mu_max_sp + write(iounit,*) " mu_max_phaeo = ", mu_max_phaeo + write(iounit,*) " grow_Tdep_diatoms = ", grow_Tdep_diatoms + write(iounit,*) " grow_Tdep_sp = ", grow_Tdep_sp + write(iounit,*) " grow_Tdep_phaeo = ", grow_Tdep_phaeo + write(iounit,*) " fr_graze_diatoms = ", fr_graze_diatoms + write(iounit,*) " fr_graze_sp = ", fr_graze_sp + write(iounit,*) " fr_graze_phaeo = ", fr_graze_phaeo + write(iounit,*) " mort_pre_diatoms = ", mort_pre_diatoms + write(iounit,*) " mort_pre_sp = ", mort_pre_sp + write(iounit,*) " mort_pre_phaeo = ", mort_pre_phaeo + write(iounit,*) " mort_Tdep_diatoms = ", mort_Tdep_diatoms + write(iounit,*) " mort_Tdep_sp = ", mort_Tdep_sp + write(iounit,*) " mort_Tdep_phaeo = ", mort_Tdep_phaeo + write(iounit,*) " k_exude_diatoms = ", k_exude_diatoms + write(iounit,*) " k_exude_sp = ", k_exude_sp + write(iounit,*) " k_exude_phaeo = ", k_exude_phaeo + write(iounit,*) " K_Nit_diatoms = ", K_Nit_diatoms + write(iounit,*) " K_Nit_sp = ", K_Nit_sp + write(iounit,*) " K_Nit_phaeo = ", K_Nit_phaeo + write(iounit,*) " K_Am_diatoms = ", K_Am_diatoms + write(iounit,*) " K_Am_sp = ", K_Am_sp + write(iounit,*) " K_Am_phaeo = ", K_Am_phaeo + write(iounit,*) " K_Sil_diatoms = ", K_Sil_diatoms + write(iounit,*) " K_Sil_sp = ", K_Sil_sp + write(iounit,*) " K_Sil_phaeo = ", K_Sil_phaeo + write(iounit,*) " K_Fe_diatoms = ", K_Fe_diatoms + write(iounit,*) " K_Fe_sp = ", K_Fe_sp + write(iounit,*) " K_Fe_phaeo = ", K_Fe_phaeo + write(iounit,*) " f_don_protein = ", f_don_protein + write(iounit,*) " kn_bac_protein = ", kn_bac_protein + write(iounit,*) " f_don_Am_protein = ", f_don_Am_protein + write(iounit,*) " f_doc_s = ", f_doc_s + write(iounit,*) " f_doc_l = ", f_doc_l + write(iounit,*) " f_exude_s = ", f_exude_s + write(iounit,*) " f_exude_l = ", f_exude_l + write(iounit,*) " k_bac_s = ", k_bac_s + write(iounit,*) " k_bac_l = ", k_bac_l + write(iounit,*) " algaltype_diatoms = ", algaltype_diatoms + write(iounit,*) " algaltype_sp = ", algaltype_sp + write(iounit,*) " algaltype_phaeo = ", algaltype_phaeo + write(iounit,*) " nitratetype = ", nitratetype + write(iounit,*) " ammoniumtype = ", ammoniumtype + write(iounit,*) " silicatetype = ", silicatetype + write(iounit,*) " dmspptype = ", dmspptype + write(iounit,*) " dmspdtype = ", dmspdtype + write(iounit,*) " humtype = ", humtype + write(iounit,*) " doctype_s = ", doctype_s + write(iounit,*) " doctype_l = ", doctype_l + write(iounit,*) " dictype_1 = ", dictype_1 + write(iounit,*) " dontype_protein = ", dontype_protein + write(iounit,*) " fedtype_1 = ", fedtype_1 + write(iounit,*) " feptype_1 = ", feptype_1 + write(iounit,*) " zaerotype_bc1 = ", zaerotype_bc1 + write(iounit,*) " zaerotype_bc2 = ", zaerotype_bc2 + write(iounit,*) " zaerotype_dust1 = ", zaerotype_dust1 + write(iounit,*) " zaerotype_dust2 = ", zaerotype_dust2 + write(iounit,*) " zaerotype_dust3 = ", zaerotype_dust3 + write(iounit,*) " zaerotype_dust4 = ", zaerotype_dust4 + write(iounit,*) " ratio_C2N_diatoms = ", ratio_C2N_diatoms + write(iounit,*) " ratio_C2N_sp = ", ratio_C2N_sp + write(iounit,*) " ratio_C2N_phaeo = ", ratio_C2N_phaeo + write(iounit,*) " ratio_chl2N_diatoms = ", ratio_chl2N_diatoms + write(iounit,*) " ratio_chl2N_sp = ", ratio_chl2N_sp + write(iounit,*) " ratio_chl2N_phaeo = ", ratio_chl2N_phaeo + write(iounit,*) " F_abs_chl_diatoms = ", F_abs_chl_diatoms + write(iounit,*) " F_abs_chl_sp = ", F_abs_chl_sp + write(iounit,*) " F_abs_chl_phaeo = ", F_abs_chl_phaeo + write(iounit,*) " ratio_C2N_proteins = ", ratio_C2N_proteins write(iounit,*) " fr_resp = ", fr_resp write(iounit,*) " algal_vel = ", algal_vel write(iounit,*) " R_dFe2dust = ", R_dFe2dust @@ -2016,7 +2738,6 @@ subroutine icepack_write_parameters(iounit) write(iounit,*) " y_sk_DMS = ", y_sk_DMS write(iounit,*) " t_sk_conv = ", t_sk_conv write(iounit,*) " t_sk_ox = ", t_sk_ox - write(iounit,*) " frazil_scav= ", frazil_scav write(iounit,*) " sw_redist = ", sw_redist write(iounit,*) " sw_frac = ", sw_frac write(iounit,*) " sw_dtemp = ", sw_dtemp diff --git a/columnphysics/icepack_shortwave.F90 b/columnphysics/icepack_shortwave.F90 index 236e25f8..7a3e5a4e 100644 --- a/columnphysics/icepack_shortwave.F90 +++ b/columnphysics/icepack_shortwave.F90 @@ -64,7 +64,7 @@ module icepack_shortwave use icepack_tracers, only: nmodal1, nmodal2, max_aero use icepack_shortwave_data, only: nspint_3bd, nspint_5bd, rsnw_datatype use icepack_zbgc_shared,only: R_chl2N, F_abs_chl - use icepack_zbgc_shared,only: remap_zbgc + use icepack_zbgc_shared,only: remap_zbgc, igrid, swgrid use icepack_orbital, only: compute_coszen use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -3492,9 +3492,10 @@ subroutine compute_shortwave_trcr(bgcN, zaero, & do k = 1,nilyr+1 icegrid(k) = sw_grid(k) enddo - if (sw_grid(1)*hin*c2 > hi_ssl) then + if (sw_grid(1)*hin*c2 > hi_ssl .and. hin > puny) then icegrid(1) = hi_ssl/c2/hin endif + icegrid(2) = c2*sw_grid(1) + (sw_grid(2) - sw_grid(1)) if (z_tracers) then if (tr_bgc_N) then @@ -3704,7 +3705,6 @@ end subroutine icepack_prep_radiation ! Elizabeth C. Hunke, LANL subroutine icepack_step_radiation (dt, & - swgrid, igrid, & fbri, & aicen, vicen, & vsnon, Tsfcn, & @@ -3766,12 +3766,6 @@ subroutine icepack_step_radiation (dt, & 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) diff --git a/columnphysics/icepack_snow.F90 b/columnphysics/icepack_snow.F90 index 8def9b45..3987d292 100644 --- a/columnphysics/icepack_snow.F90 +++ b/columnphysics/icepack_snow.F90 @@ -17,6 +17,7 @@ module icepack_snow use icepack_parameters, only: snowage_rhos, snowage_Tgrd, snowage_T use icepack_parameters, only: snowage_tau, snowage_kappa, snowage_drdt0 use icepack_parameters, only: snw_aging_table, use_smliq_pnd + use icepack_tracers, only: ncat, nilyr, nslyr use icepack_therm_shared, only: icepack_ice_temperature use icepack_therm_shared, only: adjust_enthalpy @@ -240,8 +241,7 @@ end subroutine icepack_init_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, & @@ -253,11 +253,6 @@ subroutine icepack_step_snow(dt, nilyr, & 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) @@ -329,7 +324,6 @@ subroutine icepack_step_snow(dt, nilyr, & if (snwredist(1:3) == 'ITD' .and. aice > puny) then call snow_redist(dt, & - nslyr, ncat, & wind, aicen(:), & vicen(:), vsnon(:), & zqsn(:,:), & @@ -368,8 +362,7 @@ subroutine icepack_step_snow(dt, nilyr, & endif enddo - call update_snow_radius (dt, ncat, & - nslyr, nilyr, & + call update_snow_radius (dt, & rsnw, hin, & Tsfc, zTin1, & hsn, zqsn, & @@ -397,13 +390,9 @@ end subroutine icepack_step_snow ! volume, mass and energy include factor of ain ! thickness does not - subroutine snow_redist(dt, nslyr, ncat, wind, ain, vin, vsn, zqsn, & + subroutine snow_redist(dt, wind, ain, vin, vsn, zqsn, & alvl, vlvl, fresh, fhocn, fsloss, rhos_cmpn, fsnow) - integer (kind=int_kind), intent(in) :: & - nslyr , & ! number of snow layers - ncat ! number of thickness categories - real (kind=dbl_kind), intent(in) :: & dt , & ! time step (s) wind , & ! wind speed (m/s) @@ -682,13 +671,13 @@ subroutine snow_redist(dt, nslyr, ncat, wind, ain, vin, vsn, zqsn, & zs2(k+1) = zs2(k) + hslyr ! new layer depths (equal thickness) enddo - call adjust_enthalpy (nslyr, & - zs1(:), zs2(:), & - hslyr, hsn_new(n), & + call adjust_enthalpy (nslyr, & + zs1(:), zs2(:), & + hslyr , hsn_new(n), & zqsn(:,n)) if (icepack_warnings_aborted(subname)) return else - hsn_new(1) = hsn_new(1) + dhsn + hsn_new(n) = hsn_new(n) + dhsn endif ! nslyr > 1 endif ! |dhsn| > puny endif ! ain > puny @@ -824,14 +813,9 @@ end subroutine snow_redist ! Snow grain metamorphism - subroutine update_snow_radius (dt, ncat, nslyr, nilyr, rsnw, hin, & + subroutine update_snow_radius (dt, rsnw, hin, & Tsfc, zTin, hsn, zqsn, smice, smliq) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of categories - nslyr , & ! number of snow layers - nilyr ! number of ice layers - real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -871,7 +855,7 @@ subroutine update_snow_radius (dt, ncat, nslyr, nilyr, rsnw, hin, & !----------------------------------------------------------------- ! dry metamorphism !----------------------------------------------------------------- - call snow_dry_metamorph (nslyr, nilyr, dt, rsnw(:,n), & + call snow_dry_metamorph (dt, rsnw(:,n), & drsnw_dry, zqsn(:,n), Tsfc(n), & zTin(n), hsn(n), hin(n)) if (icepack_warnings_aborted(subname)) return @@ -902,7 +886,7 @@ end subroutine update_snow_radius ! Snow grain metamorphism - subroutine snow_dry_metamorph (nslyr,nilyr, dt, rsnw, drsnw_dry, zqsn, & + subroutine snow_dry_metamorph (dt, rsnw, drsnw_dry, zqsn, & Tsfc, zTin1, hsn, hin) ! Vapor redistribution: Method is to retrieve 3 best-fit parameters that @@ -918,10 +902,6 @@ subroutine snow_dry_metamorph (nslyr,nilyr, dt, rsnw, drsnw_dry, zqsn, & ! dr_fresh is the difference between the current and fresh snow states ! (r_current - r_fresh). - integer (kind=int_kind), intent(in) :: & - nslyr, & ! number of snow layers - nilyr ! number of ice layers - real (kind=dbl_kind), intent(in) :: & dt ! time step (s) @@ -1175,12 +1155,9 @@ end subroutine snowtable_check_dimension ! Conversions between ice mass, liquid water mass in snow - subroutine drain_snow (nslyr, vsnon, aicen, & + subroutine drain_snow (vsnon, aicen, & massice, massliq, meltsliq) - integer (kind=int_kind), intent(in) :: & - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & vsnon, & ! snow volume (m) aicen ! aice area fraction diff --git a/columnphysics/icepack_therm_bl99.F90 b/columnphysics/icepack_therm_bl99.F90 index 36ec1268..30c247ac 100644 --- a/columnphysics/icepack_therm_bl99.F90 +++ b/columnphysics/icepack_therm_bl99.F90 @@ -16,6 +16,7 @@ module icepack_therm_bl99 use icepack_parameters, only: rhoi, rhos, hs_min, cp_ice, cp_ocn, depressT, Lfresh, ksno, kice use icepack_parameters, only: conduct, calc_Tsfc use icepack_parameters, only: sw_redist, sw_frac, sw_dtemp + use icepack_tracers, only: nilyr, nslyr use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -53,7 +54,6 @@ module icepack_therm_bl99 ! C. M. Bitz, UW subroutine temperature_changes (dt, & - nilyr, nslyr, & rhoa, flw, & potT, Qa, & shcoef, lhcoef, & @@ -69,10 +69,6 @@ subroutine temperature_changes (dt, & fcondtopn,fcondbot, & einit ) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -243,7 +239,6 @@ subroutine temperature_changes (dt, & !----------------------------------------------------------------- call conductivity (l_snow, & - nilyr, nslyr, & hilyr, hslyr, & zTin, kh, zSin) if (icepack_warnings_aborted(subname)) return @@ -405,7 +400,7 @@ subroutine temperature_changes (dt, & ! Compute elements of tridiagonal matrix. !----------------------------------------------------------------- - call get_matrix_elements_calc_Tsfc (nilyr, nslyr, & + call get_matrix_elements_calc_Tsfc ( & l_snow, l_cold, & Tsf, Tbot, & fsurfn, dfsurf_dT, & @@ -419,7 +414,7 @@ subroutine temperature_changes (dt, & else - call get_matrix_elements_know_Tsfc (nilyr, nslyr, & + call get_matrix_elements_know_Tsfc ( & l_snow, Tbot, & Tin_init, Tsn_init, & kh, Sswabs, & @@ -801,17 +796,12 @@ end subroutine temperature_changes ! C. M. Bitz, UW subroutine conductivity (l_snow, & - nilyr, nslyr, & hilyr, hslyr, & zTin, kh, zSin) logical (kind=log_kind), intent(in) :: & l_snow ! true if snow temperatures are computed - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & hilyr , & ! ice layer thickness (same for all ice layers) hslyr ! snow layer thickness (same for all snow layers) @@ -969,7 +959,7 @@ end subroutine surface_fluxes ! March 2004 by William H. Lipscomb for multiple snow layers ! April 2008 by E. C. Hunke, divided into two routines based on calc_Tsfc - subroutine get_matrix_elements_calc_Tsfc (nilyr, nslyr, & + subroutine get_matrix_elements_calc_Tsfc ( & l_snow, l_cold, & Tsf, Tbot, & fsurfn, dfsurf_dT, & @@ -980,10 +970,6 @@ subroutine get_matrix_elements_calc_Tsfc (nilyr, nslyr, & sbdiag, diag, & spdiag, rhs) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - logical (kind=log_kind), intent(in) :: & l_snow , & ! true if snow temperatures are computed l_cold ! true if surface temperature is computed @@ -1216,7 +1202,7 @@ end subroutine get_matrix_elements_calc_Tsfc ! March 2004 by William H. Lipscomb for multiple snow layers ! April 2008 by E. C. Hunke, divided into two routines based on calc_Tsfc - subroutine get_matrix_elements_know_Tsfc (nilyr, nslyr, & + subroutine get_matrix_elements_know_Tsfc ( & l_snow, Tbot, & Tin_init, Tsn_init, & kh, Sswabs, & @@ -1226,10 +1212,6 @@ subroutine get_matrix_elements_know_Tsfc (nilyr, nslyr, & spdiag, rhs, & fcondtopn) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - logical (kind=log_kind), intent(in) :: & l_snow ! true if snow temperatures are computed diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index 047b921b..02a9ab4b 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -23,7 +23,7 @@ module icepack_therm_itd use icepack_parameters, only: c0, c1, c2, c3, c4, c6, c10 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: phi_init, dsin0_frazil, salt_loss use icepack_parameters, only: Tliquidus_max use icepack_parameters, only: rhosi, conserv_check, rhosmin, snwredist use icepack_parameters, only: kitd, ktherm @@ -31,7 +31,7 @@ module icepack_therm_itd use icepack_parameters, only: cpl_frazil, update_ocn_f, saltflux_option use icepack_parameters, only: icepack_chkoptargflag - use icepack_tracers, only: ntrcr, nbtrcr + use icepack_tracers, only: ncat, nilyr, nslyr, nblyr, ntrcr, nbtrcr, nfsd use icepack_tracers, only: nt_qice, nt_qsno, nt_fbri, nt_sice use icepack_tracers, only: nt_apnd, nt_hpnd, nt_aero, nt_isosno, nt_isoice use icepack_tracers, only: nt_Tsfc, nt_iage, nt_FY, nt_fsd, nt_rhos, nt_sice @@ -52,6 +52,7 @@ module icepack_therm_itd use icepack_mushy_physics, only: liquidus_temperature_mush, icepack_enthalpy_mush use icepack_zbgc, only: add_new_ice_bgc use icepack_zbgc, only: lateral_melt_bgc + use icepack_zbgc_shared, only: bgrid, cgrid, igrid implicit none @@ -87,9 +88,7 @@ module icepack_therm_itd ! authors: William H. Lipscomb, LANL ! Elizabeth C. Hunke, LANL - subroutine linear_itd (ncat, hin_max, & - nilyr, nslyr, & - ntrcr, trcr_depend, & + subroutine linear_itd (hin_max, trcr_depend, & trcr_base, n_trcr_strata,& nt_strata, & aicen_init, vicen_init, & @@ -98,12 +97,6 @@ subroutine linear_itd (ncat, hin_max, & aice, aice0, & fpond, Tf ) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nslyr , & ! number of snow layers - ntrcr ! number of tracers in use - real (kind=dbl_kind), dimension(0:ncat), intent(in) :: & hin_max ! category boundaries (m) @@ -318,7 +311,7 @@ subroutine linear_itd (ncat, hin_max, & write(warnstr,*) subname, & 'ITD Thermodynamics: hicen_init(n+1) <= hicen_init(n)' - call icepack_warnings_setabort(.true.) + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) call icepack_warnings_add(warnstr) endif @@ -579,8 +572,7 @@ subroutine linear_itd (ncat, hin_max, & enddo endif - call shift_ice (ntrcr, ncat, & - trcr_depend, & + call shift_ice (trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, & @@ -626,7 +618,7 @@ subroutine linear_itd (ncat, hin_max, & ! Update fractional ice area in each grid cell. !----------------------------------------------------------------- - call aggregate_area (ncat, aicen, aice, aice0) + call aggregate_area (aicen, aice, aice0) if (icepack_warnings_aborted(subname)) return !----------------------------------------------------------------- @@ -795,10 +787,7 @@ end subroutine fit_line ! ! author: A. K. Turner, LANL ! - subroutine update_vertical_tracers(nilyr, trc, h1, h2, trc0) - - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers + subroutine update_vertical_tracers(trc, h1, h2, trc0) real (kind=dbl_kind), dimension(:), intent(inout) :: & trc ! vertical tracer @@ -877,10 +866,7 @@ end subroutine update_vertical_tracers ! 2003: Modified by William H. Lipscomb and Elizabeth C. Hunke, LANL ! 2016 Lettie Roach, NIWA/VUW, added floe size dependence ! - subroutine lateral_melt (dt, ncat, & - nilyr, nslyr, & - n_aero, & - fpond, & + subroutine lateral_melt (dt, fpond, & fresh, fsalt, & fhocn, faero_ocn, & fiso_ocn, & @@ -888,25 +874,12 @@ subroutine lateral_melt (dt, ncat, & fside, wlat, & aicen, vicen, & vsnon, trcrn, & - flux_bio, & - nbtrcr, nblyr, & - nfsd, d_afsd_latm,& + flux_bio, d_afsd_latm,& floe_rad_c, floe_binwidth) real (kind=dbl_kind), intent(in) :: & dt ! time step (s) - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nblyr , & ! number of bio layers - nslyr , & ! number of snow layers - n_aero , & ! number of aerosol tracers - nbtrcr ! number of bio tracers - - integer (kind=int_kind), intent(in), optional :: & - nfsd ! number of floe size categories - real (kind=dbl_kind), dimension (:), intent(inout) :: & aicen , & ! concentration of ice vicen , & ! volume per unit area of ice (m) @@ -970,6 +943,7 @@ subroutine lateral_melt (dt, ncat, & real (kind=dbl_kind), dimension (ncat) :: & aicen_init, & ! initial area fraction vicen_init, & ! volume per unit area of ice (m) + vsnon_init, & ! initial volume of snow (m) G_radialn , & ! rate of lateral melt (m/s) delta_an , & ! change in the ITD rsiden ! delta_an/aicen @@ -1001,13 +975,13 @@ subroutine lateral_melt (dt, ncat, & dvint = c0 bin1_arealoss = c0 tmp = c0 - vicen_init = c0 + vicen_init = vicen(:) G_radialn = c0 delta_an = c0 rsiden = c0 if (tr_fsd) then - call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:)) + call icepack_cleanup_fsd (trcrn(nt_fsd:nt_fsd+nfsd-1,:)) if (icepack_warnings_aborted(subname)) return allocate(afsdn(nfsd,ncat)) @@ -1127,6 +1101,7 @@ subroutine lateral_melt (dt, ncat, & ! state variables vicen_init(n) = vicen(n) + vsnon_init(n) = vsnon(n) aicen(n) = aicen(n) * (c1 - rsiden(n)) vicen(n) = vicen(n) * (c1 - rsiden(n)) vsnon(n) = vsnon(n) * (c1 - rsiden(n)) @@ -1176,7 +1151,7 @@ subroutine lateral_melt (dt, ncat, & end do ! timestep required for this - subdt = get_subdt_fsd(nfsd, afsd_tmp(:), d_afsd_tmp(:)) + subdt = get_subdt_fsd(afsd_tmp(:), d_afsd_tmp(:)) subdt = MIN(subdt, dt) ! update fsd and elapsed time @@ -1236,8 +1211,8 @@ subroutine lateral_melt (dt, ncat, & !----------------------------------------------------------------- if (z_tracers) then ! snow tracers - dvssl = min(p5*vsnon(n)/real(nslyr,kind=dbl_kind), hs_ssl*aicen(n)) ! snow surface layer - dvint = vsnon(n) - dvssl ! snow interior + dvssl = p5*vsnon_init(n)/real(nslyr,kind=dbl_kind) ! snow surface layer + dvint = vsnon_init(n) - dvssl ! snow interior do k = 1, nbtrcr flux_bio(k) = flux_bio(k) & + (trcrn(bio_index(k)+nblyr+1,n)*dvssl & @@ -1250,10 +1225,8 @@ subroutine lateral_melt (dt, ncat, & if (z_tracers) & call lateral_melt_bgc(dt, & - ncat, nblyr, & - rside, vicen_init, & !echmod: use rsiden - trcrn, & - flux_bio, nbtrcr) + rsiden, vicen_init, & + trcrn, flux_bio) if (icepack_warnings_aborted(subname)) return endif ! flag @@ -1262,7 +1235,7 @@ subroutine lateral_melt (dt, ncat, & trcrn(nt_fsd:nt_fsd+nfsd-1,:) = afsdn - call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:) ) + call icepack_cleanup_fsd (trcrn(nt_fsd:nt_fsd+nfsd-1,:) ) if (icepack_warnings_aborted(subname)) return ! diagnostics @@ -1306,13 +1279,10 @@ end subroutine lateral_melt ! Adrian Turner, LANL ! Lettie Roach, NIWA/VUW ! - subroutine add_new_ice (ncat, nilyr, & - nfsd, nblyr, & - n_aero, dt, & - ntrcr, nltrcr, & + subroutine add_new_ice (dt, & hin_max, ktherm, & aicen, trcrn, & - vicen, vsnon1, & + vicen, & aice0, aice, & frzmlt, frazil, & frz_onset, yday, & @@ -1320,8 +1290,7 @@ subroutine add_new_ice (ncat, nilyr, & Tf, sss, & salinz, phi_init, & dSin0_frazil, & - bgrid, cgrid, igrid, & - nbtrcr, flux_bio, & + flux_bio, & ocean_bio, & frazil_diag, & fiso_ocn, & @@ -1338,17 +1307,8 @@ subroutine add_new_ice (ncat, nilyr, & use icepack_fsd, only: fsd_lateral_growth, fsd_add_new_ice integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nblyr , & ! number of bio layers - ntrcr , & ! number of tracers - nltrcr, & ! number of zbgc tracers - n_aero, & ! number of aerosol tracers ktherm ! type of thermodynamics (-1 none, 1 BL99, 2 mushy) - integer (kind=int_kind), intent(in), optional :: & - nfsd ! number of floe size categories - real (kind=dbl_kind), dimension(0:ncat), intent(in) :: & hin_max ! category boundaries (m) @@ -1357,8 +1317,7 @@ subroutine add_new_ice (ncat, nilyr, & aice , & ! total concentration of ice frzmlt, & ! freezing/melting potential (W/m^2) Tf , & ! freezing temperature (C) - sss , & ! sea surface salinity (ppt) - vsnon1 ! category 1 snow volume per ice area (m) + sss ! sea surface salinity (ppt) real (kind=dbl_kind), dimension (:), intent(inout) :: & aicen , & ! concentration of ice @@ -1389,17 +1348,6 @@ subroutine add_new_ice (ncat, nilyr, & dSin0_frazil ! initial frazil bulk salinity reduction from sss ! BGC - 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 - - integer (kind=int_kind), intent(in) :: & - nbtrcr ! number of biology tracers real (kind=dbl_kind), dimension (:), intent(inout) :: & flux_bio ! tracer flux to ocean from biology (mmol/m^2/s) @@ -1539,7 +1487,7 @@ subroutine add_new_ice (ncat, nilyr, & if (tr_fsd) then allocate(afsdn(nfsd,ncat)) afsdn(:,:) = c0 - call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:)) + call icepack_cleanup_fsd (trcrn(nt_fsd:nt_fsd+nfsd-1,:)) if (icepack_warnings_aborted(subname)) return endif @@ -1657,8 +1605,7 @@ subroutine add_new_ice (ncat, nilyr, & if (tr_fsd) then ! lateral growth of existing ice ! calculate change in conc due to lateral growth ! update vi0new, without change to afsdn or aicen - call fsd_lateral_growth (ncat, nfsd, & - dt, aice, & + call fsd_lateral_growth(dt, aice, & aicen, vicen, & vi0new, frazil, & floe_rad_c, afsdn, & @@ -1777,11 +1724,11 @@ subroutine add_new_ice (ncat, nilyr, & vsurp = hsurp * aicen(n) ! note - save this above? vtmp = vicen(n) - vsurp ! vicen is the new volume if (vicen(n) > c0) then - call update_vertical_tracers(nilyr, & + call update_vertical_tracers( & trcrn(nt_qice:nt_qice+nilyr-1,n), & vtmp, vicen(n), qi0new) if (icepack_warnings_aborted(subname)) return - call update_vertical_tracers(nilyr, & + call update_vertical_tracers( & trcrn(nt_sice:nt_sice+nilyr-1,n), & vtmp, vicen(n), Si0new) if (icepack_warnings_aborted(subname)) return @@ -1818,7 +1765,6 @@ subroutine add_new_ice (ncat, nilyr, & ncats = 1 ! add new ice to category 1 by default if (tr_fsd) ncats = ncat ! add new ice laterally to all categories - do n = 1, ncats if (d_an_tot(n) > c0 .and. vin0new(n) > c0) then ! add ice to category n @@ -1841,7 +1787,7 @@ subroutine add_new_ice (ncat, nilyr, & if (tr_fsd) then ! evolve the floe size distribution ! both new frazil ice and lateral growth - call fsd_add_new_ice (ncat, n, nfsd, & + call fsd_add_new_ice (n, & dt, ai0new, & d_an_latg, d_an_newi, & floe_rad_c, floe_binwidth, & @@ -1887,7 +1833,7 @@ subroutine add_new_ice (ncat, nilyr, & fiso_ocn(it) = fiso_ocn(it) & - frazil_conc*rhoi*vi0new/dt enddo - endif + endif ! if iso if (tr_lvl) then alvl = trcrn(nt_alvl,n) @@ -1906,7 +1852,7 @@ subroutine add_new_ice (ncat, nilyr, & trcrn(nt_apnd,n) * alvl*area1 / (trcrn(nt_alvl,n)*aicen(n)) endif endif - endif + endif ! vicen > 0 do k = 1, nilyr if (vicen(n) > c0) then @@ -1918,11 +1864,9 @@ subroutine add_new_ice (ncat, nilyr, & trcrn(nt_sice+k-1,n) = & (trcrn(nt_sice+k-1,n)*vice1 + Sprofile(k)*vin0new(n))/vicen(n) endif - enddo - - endif ! vi0new > 0 - - enddo ! ncats + enddo ! nilyr + endif ! vin0new > c0 + enddo ! n if (conserv_check) then @@ -1955,14 +1899,12 @@ subroutine add_new_ice (ncat, nilyr, & ! Biogeochemistry !----------------------------------------------------------------- if (tr_brine .or. nbtrcr > 0) then - call add_new_ice_bgc(dt, nblyr, & - ncat, nilyr, nltrcr, & - bgrid, cgrid, igrid, & + call add_new_ice_bgc(dt, ncats, & aicen_init, vicen_init, vi0_init, & - aicen, vicen, vsnon1, & - vi0new, ntrcr, trcrn, & - nbtrcr, sss, ocean_bio,& - flux_bio, hsurp) + aicen, vicen, vin0new, & + trcrn, & + ocean_bio, flux_bio, hsurp, & + d_an_tot) if (icepack_warnings_aborted(subname)) return endif @@ -1980,9 +1922,7 @@ end subroutine add_new_ice ! 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, & @@ -1999,15 +1939,14 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & 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, & @@ -2017,16 +1956,6 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & 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 @@ -2051,15 +1980,6 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & 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 @@ -2162,8 +2082,7 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & endif endif if (tr_fsd) then - if (.not.(present(nfsd) .and. & - present(wlat) .and. & + if (.not.(present(wlat) .and. & present(wave_sig_ht) .and. & present(wave_spectrum) .and. & present(wavefreq) .and. & @@ -2198,7 +2117,9 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & ! Compute fractional ice area in each grid cell. !----------------------------------------------------------------- - call aggregate_area (ncat, aicen, aice, aice0) + flux_bio(:) = c0 + + call aggregate_area (aicen, aice, aice0) if (icepack_warnings_aborted(subname)) return if (kitd == 1) then @@ -2209,9 +2130,8 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & if (aice > puny) then - call linear_itd (ncat, hin_max, & - nilyr, nslyr, & - ntrcr, trcr_depend, & + call linear_itd (hin_max, & + trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, & @@ -2238,22 +2158,18 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & ! identify ice-ocean cells - call add_new_ice (ncat, nilyr, & - nfsd, nblyr, & - n_aero, dt, & - ntrcr, nltrcr, & + call add_new_ice (dt, & hin_max, ktherm, & aicen, trcrn, & - vicen, vsnon(1), & + vicen, & aice0, aice, & frzmlt, frazil, & frz_onset, yday, & fresh, fsalt, & Tf, sss, & salinz, phi_init, & - dSin0_frazil, bgrid, & - cgrid, igrid, & - nbtrcr, flux_bio, & + dSin0_frazil, & + flux_bio, & ocean_bio, & frazil_diag, fiso_ocn, & HDO_ocn, H2_16O_ocn, & @@ -2270,9 +2186,7 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & ! Melt ice laterally. !----------------------------------------------------------------- - call lateral_melt (dt, ncat, & - nilyr, nslyr, & - n_aero, fpond, & + call lateral_melt (dt, fpond, & fresh, fsalt, & fhocn, faero_ocn, & fiso_ocn, & @@ -2281,15 +2195,13 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & aicen, vicen, & vsnon, trcrn, & flux_bio, & - nbtrcr, nblyr, & - nfsd, d_afsd_latm, & + d_afsd_latm, & floe_rad_c,floe_binwidth) if (icepack_warnings_aborted(subname)) return ! Floe welding during freezing conditions if (tr_fsd) then - call fsd_weld_thermo (ncat, nfsd, & - dt, frzmlt, & + call fsd_weld_thermo (dt, frzmlt, & aicen, trcrn, & d_afsd_weld) if (icepack_warnings_aborted(subname)) return @@ -2312,14 +2224,10 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & ! categories with very small areas. !----------------------------------------------------------------- - call cleanup_itd (dt, ntrcr, & - nilyr, nslyr, & - ncat, hin_max, & + call cleanup_itd (dt, hin_max, & aicen, trcrn(1:ntrcr,:), & vicen, vsnon, & aice0, aice, & - n_aero, & - nbtrcr, nblyr, & tr_aero, & tr_pond_topo, & first_ice, & diff --git a/columnphysics/icepack_therm_mushy.F90 b/columnphysics/icepack_therm_mushy.F90 index c5a79ffd..00438e8d 100644 --- a/columnphysics/icepack_therm_mushy.F90 +++ b/columnphysics/icepack_therm_mushy.F90 @@ -10,13 +10,13 @@ module icepack_therm_mushy use icepack_parameters, only: a_rapid_mode, Rac_rapid_mode, tscale_pnd_drain use icepack_parameters, only: aspect_rapid_mode, dSdt_slow_mode, phi_c_slow_mode use icepack_parameters, only: sw_redist, sw_frac, sw_dtemp + use icepack_tracers, only: nilyr, nslyr, tr_pond use icepack_mushy_physics, only: icepack_mushy_density_brine, enthalpy_brine, icepack_enthalpy_snow use icepack_mushy_physics, only: enthalpy_mush_liquid_fraction use icepack_mushy_physics, only: icepack_mushy_temperature_mush, icepack_mushy_liquid_fraction use icepack_mushy_physics, only: temperature_snow, temperature_mush_liquid_fraction use icepack_mushy_physics, only: liquidus_brine_salinity_mush, liquidus_temperature_mush use icepack_mushy_physics, only: conductivity_mush_array, conductivity_snow_array - use icepack_tracers, only: tr_pond use icepack_therm_shared, only: surface_heat_flux, dsurface_heat_flux_dTsf use icepack_therm_shared, only: ferrmax use icepack_warnings, only: warnstr, icepack_warnings_add @@ -40,7 +40,6 @@ module icepack_therm_mushy !======================================================================= subroutine temperature_changes_salinity(dt, & - nilyr, nslyr, & rhoa, flw, & potT, Qa, & shcoef, lhcoef, & @@ -61,10 +60,6 @@ subroutine temperature_changes_salinity(dt, & ! solve the enthalpy and bulk salinity of the ice for a single column - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & dt ! time step (s) @@ -185,8 +180,7 @@ subroutine temperature_changes_salinity(dt, & enddo ! k ! calculate vertical bulk darcy flow - call flushing_velocity(zTin, & - phi, nilyr, & + call flushing_velocity(zTin, phi, & hin, hsn, & hilyr, & hpond, apond, & @@ -194,7 +188,7 @@ subroutine temperature_changes_salinity(dt, & if (icepack_warnings_aborted(subname)) return ! calculate quantities related to drainage - call explicit_flow_velocities(nilyr, zSin, & + call explicit_flow_velocities(zSin, & zTin, Tsf, & Tbot, q, & dSdt, Sbr, & @@ -204,7 +198,7 @@ subroutine temperature_changes_salinity(dt, & if (icepack_warnings_aborted(subname)) return ! calculate the conductivities - call conductivity_mush_array(nilyr, zqin0, zSin0, km) + call conductivity_mush_array(zqin0, zSin0, km) if (icepack_warnings_aborted(subname)) return !----------------------------------------------------------------- @@ -251,8 +245,7 @@ subroutine temperature_changes_salinity(dt, & if (icepack_warnings_aborted(subname)) return ! run the two stage solver - call two_stage_solver_snow(nilyr, nslyr, & - Tsf, Tsf0, & + call two_stage_solver_snow(Tsf, Tsf0, & zqsn, zqsn0, & zqin, zqin0, & zSin, zSin0, & @@ -296,8 +289,7 @@ subroutine temperature_changes_salinity(dt, & ! case without snow ! run the two stage solver - call two_stage_solver_nosnow(nilyr, nslyr, & - Tsf, Tsf0, & + call two_stage_solver_nosnow(Tsf, Tsf0, & zqsn, & zqin, zqin0, & zSin, zSin0, & @@ -341,7 +333,6 @@ subroutine temperature_changes_salinity(dt, & ! flood snow ice call flood_ice(hsn, hin, & - nslyr, nilyr, & hslyr, hilyr, & zqsn, zqin, & phi, dt, & @@ -355,8 +346,7 @@ end subroutine temperature_changes_salinity !======================================================================= - subroutine two_stage_solver_snow(nilyr, nslyr, & - Tsf, Tsf0, & + subroutine two_stage_solver_snow(Tsf, Tsf0, & zqsn, zqsn0, & zqin, zqin0, & zSin, zSin0, & @@ -386,10 +376,6 @@ subroutine two_stage_solver_snow(nilyr, nslyr, & ! 4) If the surface condition is inconsistent resolve for the other surface condition ! 5) If neither solution is consistent the resolve the inconsistency - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), intent(inout) :: & Tsf ! snow surface temperature (C) @@ -463,8 +449,7 @@ subroutine two_stage_solver_snow(nilyr, nslyr, & ! initially cold ! solve the system for cold and snow - call picard_solver(nilyr, nslyr, & - .true., .true., & + call picard_solver(.true., .true., & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -508,8 +493,7 @@ subroutine two_stage_solver_snow(nilyr, nslyr, & zSin = zSin0 ! solve the system for melting and snow - call picard_solver(nilyr, nslyr, & - .true., .false., & + call picard_solver(.true., .false., & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -561,8 +545,7 @@ subroutine two_stage_solver_snow(nilyr, nslyr, & Tsf = c0 ! solve the system for melting and snow - call picard_solver(nilyr, nslyr, & - .true., .false., & + call picard_solver(.true., .false., & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -610,8 +593,7 @@ subroutine two_stage_solver_snow(nilyr, nslyr, & zSin = zSin0 ! solve the system for cold and snow - call picard_solver(nilyr, nslyr, & - .true., .true., & + call picard_solver(.true., .true., & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -662,8 +644,7 @@ end subroutine two_stage_solver_snow !======================================================================= - subroutine two_stage_solver_nosnow(nilyr, nslyr, & - Tsf, Tsf0, & + subroutine two_stage_solver_nosnow(Tsf, Tsf0, & zqsn, & zqin, zqin0, & zSin, zSin0, & @@ -693,10 +674,6 @@ subroutine two_stage_solver_nosnow(nilyr, nslyr, & ! 4) If the surface condition is inconsistent resolve for the other surface condition ! 5) If neither solution is consistent the resolve the inconsistency - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), intent(inout) :: & Tsf ! ice surface temperature (C) @@ -772,8 +749,7 @@ subroutine two_stage_solver_nosnow(nilyr, nslyr, & ! initially cold ! solve the system for cold and no snow - call picard_solver(nilyr, nslyr, & - .false., .true., & + call picard_solver(.false., .true., & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -815,8 +791,7 @@ subroutine two_stage_solver_nosnow(nilyr, nslyr, & zSin = zSin0 ! solve the system for melt and no snow - call picard_solver(nilyr, nslyr, & - .false., .false., & + call picard_solver(.false., .false., & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -869,8 +844,7 @@ subroutine two_stage_solver_nosnow(nilyr, nslyr, & ! solve the system for melt and no snow Tsf = Tmlt - call picard_solver(nilyr, nslyr, & - .false., .false., & + call picard_solver(.false., .false., & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -917,8 +891,7 @@ subroutine two_stage_solver_nosnow(nilyr, nslyr, & zSin = zSin0 ! solve the system for cold and no snow - call picard_solver(nilyr, nslyr, & - .false., .true., & + call picard_solver(.false., .true., & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -1039,8 +1012,7 @@ end subroutine two_stage_inconsistency ! Picard/TDMA based solver !======================================================================= - subroutine prep_picard(nilyr, nslyr, & - lsnow, zqsn, & + subroutine prep_picard(lsnow, zqsn, & zqin, zSin, & hilyr, hslyr, & km, ks, & @@ -1049,10 +1021,6 @@ subroutine prep_picard(nilyr, nslyr, & dxp, kcstar, & einit) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - logical, intent(in) :: & lsnow ! snow presence: T: has snow, F: no snow @@ -1098,17 +1066,15 @@ subroutine prep_picard(nilyr, nslyr, & endif ! lsnow ! interface distances - call calc_intercell_thickness(nilyr, nslyr, lsnow, hilyr, hslyr, dxp) + call calc_intercell_thickness(lsnow, hilyr, hslyr, dxp) if (icepack_warnings_aborted(subname)) return ! interface conductivities - call calc_intercell_conductivity(lsnow, nilyr, nslyr, & - km, ks, hilyr, hslyr, kcstar) + call calc_intercell_conductivity(lsnow, km, ks, hilyr, hslyr, kcstar) if (icepack_warnings_aborted(subname)) return ! total energy content call total_energy_content(lsnow, & - nilyr, nslyr, & zqin, zqsn, & hilyr, hslyr, & einit) @@ -1118,8 +1084,7 @@ end subroutine prep_picard !======================================================================= - subroutine picard_solver(nilyr, nslyr, & - lsnow, lcold, & + subroutine picard_solver(lsnow, lcold, & Tsf, zqsn, & zqin, zSin, & zTin, zTsn, & @@ -1141,10 +1106,6 @@ subroutine picard_solver(nilyr, nslyr, & q, dSdt, & w ) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - logical, intent(in) :: & lsnow , & ! snow presence: T: has snow, F: no snow lcold ! surface cold: T: surface is cold, F: surface is melting @@ -1243,8 +1204,7 @@ subroutine picard_solver(nilyr, nslyr, & lconverged = .false. ! prepare quantities for picard iteration - call prep_picard(nilyr, nslyr, & - lsnow, zqsn, & + call prep_picard(lsnow, zqsn, & zqin, zSin, & hilyr, hslyr, & km, ks, & @@ -1287,7 +1247,6 @@ subroutine picard_solver(nilyr, nslyr, & ! tridiagonal solve of new temperatures call solve_heat_conduction(lsnow, lcold, & - nilyr, nslyr, & Tsf, Tbot, & zqin0, zqsn0, & phi, dt, & @@ -1301,26 +1260,22 @@ subroutine picard_solver(nilyr, nslyr, & if (icepack_warnings_aborted(subname)) return ! update brine enthalpy - call picard_updates_enthalpy(nilyr, zTin, qbr) + call picard_updates_enthalpy(zTin, qbr) if (icepack_warnings_aborted(subname)) return ! drainage fluxes call picard_drainage_fluxes(fadvheat_nit, q, & - qbr, qocn, & - nilyr) + qbr, qocn) if (icepack_warnings_aborted(subname)) return ! flushing fluxes - call picard_flushing_fluxes(nilyr, & - fadvheat_nit, w, & + call picard_flushing_fluxes(fadvheat_nit, w, & qbr, & qpond) if (icepack_warnings_aborted(subname)) return ! perform convergence check - call check_picard_convergence(nilyr, nslyr, & - lsnow, & - lconverged, & + call check_picard_convergence(lsnow, lconverged, & Tsf, Tsf_prev, & zTin, zTin_prev,& zTsn, zTsn_prev,& @@ -1345,8 +1300,7 @@ subroutine picard_solver(nilyr, nslyr, & fadvheat = fadvheat_nit ! update the picard iterants - call picard_updates(nilyr, zTin, & - Sbr, qbr) + call picard_updates(zTin, Sbr, qbr) if (icepack_warnings_aborted(subname)) return ! solve for the salinity @@ -1354,7 +1308,7 @@ subroutine picard_solver(nilyr, nslyr, & Spond, sss, & q, dSdt, & w, hilyr, & - dt, nilyr) + dt) if (icepack_warnings_aborted(subname)) return ! final surface heat flux @@ -1369,8 +1323,7 @@ subroutine picard_solver(nilyr, nslyr, & ! if not converged if (.not. lconverged) then - call picard_nonconvergence(nilyr, nslyr, & - Tsf0, Tsf, & + call picard_nonconvergence(Tsf0, Tsf, & zTsn0, zTsn, & zTin0, zTin, & zSin0, zSin, & @@ -1405,8 +1358,7 @@ end subroutine picard_solver !======================================================================= - subroutine picard_nonconvergence(nilyr, nslyr, & - Tsf0, Tsf, & + subroutine picard_nonconvergence(Tsf0, Tsf, & zTsn0, zTsn, & zTin0, zTin, & zSin0, zSin, & @@ -1430,10 +1382,6 @@ subroutine picard_nonconvergence(nilyr, nslyr, & q, dSdt, & w) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), intent(in) :: & Tsf0 , & ! snow surface temperature (C) at beginning of timestep Tsf ! snow surface temperature (C) @@ -1604,8 +1552,7 @@ end subroutine picard_nonconvergence !======================================================================= - subroutine check_picard_convergence(nilyr, nslyr, & - lsnow, & + subroutine check_picard_convergence(lsnow, & lconverged, & Tsf, Tsf_prev, & zTin, zTin_prev,& @@ -1619,10 +1566,6 @@ subroutine check_picard_convergence(nilyr, nslyr, & fcondtop, fcondbot, & fadvheat) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - logical, intent(inout) :: & lconverged ! has Picard solver converged? @@ -1671,14 +1614,12 @@ subroutine check_picard_convergence(nilyr, nslyr, & character(len=*),parameter :: subname='(check_picard_convergence)' call picard_final(lsnow, & - nilyr, nslyr, & zqin, zqsn, & zTin, zTsn, & phi) if (icepack_warnings_aborted(subname)) return call total_energy_content(lsnow, & - nilyr, nslyr, & zqin, zqsn, & hilyr, hslyr, & efinal) @@ -1710,11 +1651,7 @@ end subroutine check_picard_convergence !======================================================================= subroutine picard_drainage_fluxes(fadvheat, q, & - qbr, qocn, & - nilyr) - - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers + qbr, qocn) real(kind=dbl_kind), intent(out) :: & fadvheat ! flow of heat to ocean due to advection (W m-2) @@ -1750,14 +1687,10 @@ end subroutine picard_drainage_fluxes !======================================================================= - subroutine picard_flushing_fluxes(nilyr, & - fadvheat, w, & + subroutine picard_flushing_fluxes(fadvheat, w, & qbr, & qpond) - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers - real(kind=dbl_kind), intent(inout) :: & fadvheat ! flow of heat to ocean due to advection (W m-2) @@ -1816,7 +1749,6 @@ end subroutine maximum_variables_changes !======================================================================= subroutine total_energy_content(lsnow, & - nilyr, nslyr, & zqin, zqsn, & hilyr, hslyr, & energy) @@ -1824,10 +1756,6 @@ subroutine total_energy_content(lsnow, & logical, intent(in) :: & lsnow ! snow presence: T: has snow, F: no snow - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zqin , & ! ice layer enthalpy (J m-3) zqsn ! snow layer enthalpy (J m-3) @@ -1866,14 +1794,11 @@ end subroutine total_energy_content !======================================================================= - subroutine picard_updates(nilyr, zTin, & + subroutine picard_updates(zTin, & Sbr, qbr) ! update brine salinity and liquid fraction based on new temperatures - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zTin ! ice layer temperature (C) @@ -1897,13 +1822,10 @@ end subroutine picard_updates !======================================================================= - subroutine picard_updates_enthalpy(nilyr, zTin, qbr) + subroutine picard_updates_enthalpy(zTin, qbr) ! update brine salinity and liquid fraction based on new temperatures - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zTin ! ice layer temperature (C) @@ -1926,15 +1848,10 @@ end subroutine picard_updates_enthalpy !======================================================================= subroutine picard_final(lsnow, & - nilyr, nslyr, & zqin, zqsn, & zTin, zTsn, & phi) - integer (kind=int_kind), intent(in) :: & - nilyr, & ! number of ice layers - nslyr ! number of snow layers - logical, intent(in) :: & lsnow ! snow presence: T: has snow, F: no snow @@ -1968,11 +1885,7 @@ end subroutine picard_final !======================================================================= - subroutine calc_intercell_thickness(nilyr, nslyr, lsnow, hilyr, hslyr, dxp) - - integer (kind=int_kind), intent(in) :: & - nilyr, & ! number of ice layers - nslyr ! number of snow layers + subroutine calc_intercell_thickness(lsnow, hilyr, hslyr, dxp) logical, intent(in) :: & lsnow ! snow presence: T: has snow, F: no snow @@ -2034,15 +1947,10 @@ end subroutine calc_intercell_thickness !======================================================================= subroutine calc_intercell_conductivity(lsnow, & - nilyr, nslyr, & km, ks, & hilyr, hslyr, & kcstar) - integer (kind=int_kind), intent(in) :: & - nilyr, & ! number of ice layers - nslyr ! number of snow layers - logical, intent(in) :: & lsnow ! snow presence: T: has snow, F: no snow @@ -2115,7 +2023,6 @@ end subroutine calc_intercell_conductivity !======================================================================= subroutine solve_heat_conduction(lsnow, lcold, & - nilyr, nslyr, & Tsf, Tbot, & zqin0, zqsn0, & phi, dt, & @@ -2131,10 +2038,6 @@ subroutine solve_heat_conduction(lsnow, lcold, & lsnow , & ! snow presence: T: has snow, F: no snow lcold ! surface cold: T: surface is cold, F: surface is melting - integer (kind=int_kind), intent(in) :: & - nilyr, & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zqin0 , & ! ice layer enthalpy (J m-3) at beggining of timestep Iswabs , & ! SW radiation absorbed in ice layers (W m-2) @@ -2187,7 +2090,6 @@ subroutine solve_heat_conduction(lsnow, lcold, & if (lcold) then call matrix_elements_snow_cold(Ap, As, An, b, nyn, & - nilyr, nslyr, & Tsf, Tbot, & zqin0, zqsn0, & qpond, qocn, & @@ -2203,7 +2105,6 @@ subroutine solve_heat_conduction(lsnow, lcold, & else ! lcold call matrix_elements_snow_melt(Ap, As, An, b, nyn, & - nilyr, nslyr, & Tsf, Tbot, & zqin0, zqsn0, & qpond, qocn, & @@ -2222,7 +2123,6 @@ subroutine solve_heat_conduction(lsnow, lcold, & if (lcold) then call matrix_elements_nosnow_cold(Ap, As, An, b, nyn, & - nilyr, & Tsf, Tbot, & zqin0, & qpond, qocn, & @@ -2238,7 +2138,6 @@ subroutine solve_heat_conduction(lsnow, lcold, & else ! lcold call matrix_elements_nosnow_melt(Ap, As, An, b, nyn, & - nilyr, & Tsf, Tbot, & zqin0, & qpond, qocn, & @@ -2255,12 +2154,11 @@ subroutine solve_heat_conduction(lsnow, lcold, & endif ! lsnow ! tridiag to get new temperatures - call tdma_solve_sparse(nilyr, nslyr, & + call tdma_solve_sparse( & An(1:nyn), Ap(1:nyn), As(1:nyn), b(1:nyn), T(1:nyn), nyn) if (icepack_warnings_aborted(subname)) return call update_temperatures(lsnow, lcold, & - nilyr, nslyr, & T, Tsf, & zTin, zTsn) if (icepack_warnings_aborted(subname)) return @@ -2270,7 +2168,6 @@ end subroutine solve_heat_conduction !======================================================================= subroutine update_temperatures(lsnow, lcold, & - nilyr, nslyr, & T, Tsf, & zTin, zTsn) @@ -2278,10 +2175,6 @@ subroutine update_temperatures(lsnow, lcold, & lsnow , & ! snow presence: T: has snow, F: no snow lcold ! surface cold: T: surface is cold, F: surface is melting - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), dimension(:), intent(in) :: & T ! matrix solution vector @@ -2355,7 +2248,6 @@ end subroutine update_temperatures !======================================================================= subroutine matrix_elements_nosnow_melt(Ap, As, An, b, nyn, & - nilyr, & Tsf, Tbot, & zqin0, & qpond, qocn, & @@ -2375,9 +2267,6 @@ subroutine matrix_elements_nosnow_melt(Ap, As, An, b, nyn, & integer, intent(out) :: & nyn ! matrix size - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zqin0 , & ! ice layer enthalpy (J m-3) at beggining of timestep Iswabs , & ! SW radiation absorbed in ice layers (W m-2) @@ -2462,7 +2351,6 @@ end subroutine matrix_elements_nosnow_melt !======================================================================= subroutine matrix_elements_nosnow_cold(Ap, As, An, b, nyn, & - nilyr, & Tsf, Tbot, & zqin0, & qpond, qocn, & @@ -2483,9 +2371,6 @@ subroutine matrix_elements_nosnow_cold(Ap, As, An, b, nyn, & integer, intent(out) :: & nyn ! matrix size - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zqin0 , & ! ice layer enthalpy (J m-3) at beggining of timestep Iswabs , & ! SW radiation absorbed in ice layers (W m-2) @@ -2578,7 +2463,6 @@ end subroutine matrix_elements_nosnow_cold !======================================================================= subroutine matrix_elements_snow_melt(Ap, As, An, b, nyn, & - nilyr, nslyr, & Tsf, Tbot, & zqin0, zqsn0, & qpond, qocn, & @@ -2598,10 +2482,6 @@ subroutine matrix_elements_snow_melt(Ap, As, An, b, nyn, & integer, intent(out) :: & nyn ! matrix size - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zqin0 , & ! ice layer enthalpy (J m-3) at beggining of timestep Iswabs , & ! SW radiation absorbed in ice layers (W m-2) @@ -2714,7 +2594,6 @@ end subroutine matrix_elements_snow_melt !======================================================================= subroutine matrix_elements_snow_cold(Ap, As, An, b, nyn, & - nilyr, nslyr, & Tsf, Tbot, & zqin0, zqsn0, & qpond, qocn, & @@ -2735,10 +2614,6 @@ subroutine matrix_elements_snow_cold(Ap, As, An, b, nyn, & integer, intent(out) :: & nyn ! matrix size - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zqin0 , & ! ice layer enthalpy (J m-3) at beggining of timestep Iswabs , & ! SW radiation absorbed in ice layers (W m-2) @@ -2864,14 +2739,11 @@ end subroutine matrix_elements_snow_cold !======================================================================= - subroutine solve_salinity(zSin, Sbr, & + subroutine solve_salinity(zSin, Sbr, & Spond, sss, & q, dSdt, & w, hilyr, & - dt, nilyr) - - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers + dt) real(kind=dbl_kind), dimension(:), intent(inout) :: & zSin ! ice layer bulk salinity (ppt) @@ -2949,14 +2821,10 @@ end subroutine solve_salinity !======================================================================= - subroutine tdma_solve_sparse(nilyr, nslyr, a, b, c, d, x, n) + subroutine tdma_solve_sparse(a, b, c, d, x, n) ! perform a tri-diagonal solve with TDMA using a sparse tridiagoinal matrix - integer (kind=int_kind), intent(in) :: & - nilyr, & ! number of ice layers - nslyr ! number of snow layers - integer(kind=int_kind), intent(in) :: & n ! matrix size @@ -3023,7 +2891,7 @@ end function permeability !======================================================================= - subroutine explicit_flow_velocities(nilyr, zSin, & + subroutine explicit_flow_velocities(zSin, & zTin, Tsf, & Tbot, q, & dSdt, Sbr, & @@ -3034,9 +2902,6 @@ subroutine explicit_flow_velocities(nilyr, zSin, & ! calculate the rapid gravity drainage mode Darcy velocity and the ! slow mode drainage rate - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zSin, & ! ice layer bulk salinity (ppt) zTin ! ice layer temperature (C) @@ -3197,8 +3062,7 @@ end subroutine explicit_flow_velocities ! Flushing !======================================================================= - subroutine flushing_velocity(zTin, & - phi, nilyr, & + subroutine flushing_velocity(zTin, phi, & hin, hsn, & hilyr, & hpond, apond, & @@ -3206,9 +3070,6 @@ subroutine flushing_velocity(zTin, & ! calculate the vertical flushing Darcy velocity (positive downward) - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers - real(kind=dbl_kind), dimension(:), intent(in) :: & zTin , & ! ice layer temperature (C) phi ! ice layer liquid fraction @@ -3353,7 +3214,6 @@ end subroutine flush_pond !======================================================================= subroutine flood_ice(hsn, hin, & - nslyr, nilyr, & hslyr, hilyr, & zqsn, zqin, & phi, dt, & @@ -3365,10 +3225,6 @@ subroutine flood_ice(hsn, hin, & ! given upwards flushing brine flow calculate amount of snow ice and ! convert snow to ice with appropriate properties - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real(kind=dbl_kind), intent(in) :: & dt , & ! time step (s) hsn , & ! snow thickness (m) @@ -3476,7 +3332,7 @@ subroutine flood_ice(hsn, hin, & dh = max(min(dh,hsn),c0) ! enthalpy of snow that becomes snow-ice - call enthalpy_snow_snowice(nslyr, dh, hsn, zqsn, zqsn_snowice) + call enthalpy_snow_snowice(dh, hsn, zqsn, zqsn_snowice) if (icepack_warnings_aborted(subname)) return ! change thicknesses @@ -3491,23 +3347,23 @@ subroutine flood_ice(hsn, hin, & zqin_snowice = phi_snowice * qocn + zqsn_snowice ! change snow properties - call update_vertical_tracers_snow(nslyr, zqsn, hslyr, hslyr2) + call update_vertical_tracers_snow(zqsn, hslyr, hslyr2) if (icepack_warnings_aborted(subname)) return if (snwgrain .and. hslyr2 > puny) then - call update_vertical_tracers_snow(nslyr, smice, hslyr, hslyr2) - call update_vertical_tracers_snow(nslyr, smliq, hslyr, hslyr2) + call update_vertical_tracers_snow(smice, hslyr, hslyr2) + call update_vertical_tracers_snow(smliq, hslyr, hslyr2) if (icepack_warnings_aborted(subname)) return endif ! change ice properties - call update_vertical_tracers_ice(nilyr, zqin, hilyr, hilyr2, & + call update_vertical_tracers_ice(zqin, hilyr, hilyr2, & hin, hin2, zqin_snowice) if (icepack_warnings_aborted(subname)) return - call update_vertical_tracers_ice(nilyr, zSin, hilyr, hilyr2, & + call update_vertical_tracers_ice(zSin, hilyr, hilyr2, & hin, hin2, zSin_snowice) if (icepack_warnings_aborted(subname)) return - call update_vertical_tracers_ice(nilyr, phi, hilyr, hilyr2, & + call update_vertical_tracers_ice(phi, hilyr, hilyr2, & hin, hin2, phi_snowice) if (icepack_warnings_aborted(subname)) return @@ -3532,13 +3388,10 @@ end subroutine flood_ice !======================================================================= - subroutine enthalpy_snow_snowice(nslyr, dh, hsn, zqsn, zqsn_snowice) + subroutine enthalpy_snow_snowice(dh, hsn, zqsn, zqsn_snowice) ! determine enthalpy of the snow being converted to snow ice - integer (kind=int_kind), intent(in) :: & - nslyr ! number of snow layers - real(kind=dbl_kind), intent(in) :: & dh , & ! thickness of new snowice formation (m) hsn ! initial snow thickness @@ -3580,13 +3433,10 @@ end subroutine enthalpy_snow_snowice !======================================================================= - subroutine update_vertical_tracers_snow(nslyr, trc, hlyr1, hlyr2) + subroutine update_vertical_tracers_snow(trc, hlyr1, hlyr2) ! given some snow ice formation regrid snow layers - integer (kind=int_kind), intent(in) :: & - nslyr ! number of snow layers - real(kind=dbl_kind), dimension(:), intent(inout) :: & trc ! vertical tracer @@ -3648,14 +3498,11 @@ end subroutine update_vertical_tracers_snow !======================================================================= - subroutine update_vertical_tracers_ice(nilyr, trc, hlyr1, hlyr2, & + subroutine update_vertical_tracers_ice(trc, hlyr1, hlyr2, & h1, h2, trc0) ! given some snow ice formation regrid ice layers - integer (kind=int_kind), intent(in) :: & - nilyr ! number of ice layers - real(kind=dbl_kind), dimension(:), intent(inout) :: & trc ! vertical tracer diff --git a/columnphysics/icepack_therm_shared.F90 b/columnphysics/icepack_therm_shared.F90 index eed1677a..8f566bb9 100644 --- a/columnphysics/icepack_therm_shared.F90 +++ b/columnphysics/icepack_therm_shared.F90 @@ -14,6 +14,7 @@ module icepack_therm_shared use icepack_parameters, only: saltmax, min_salin, depressT use icepack_parameters, only: ktherm, tfrz_option use icepack_parameters, only: calc_Tsfc + use icepack_tracers, only: nilyr, nslyr use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -215,10 +216,7 @@ end subroutine dsurface_heat_flux_dTsf ! 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_thermo(sprofile) real (kind=dbl_kind), dimension(:), intent(out) :: & sprofile ! vertical salinity profile @@ -296,13 +294,8 @@ end function icepack_salinity_profile subroutine icepack_init_trcr(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) diff --git a/columnphysics/icepack_therm_vertical.F90 b/columnphysics/icepack_therm_vertical.F90 index 233e3854..6dda193a 100644 --- a/columnphysics/icepack_therm_vertical.F90 +++ b/columnphysics/icepack_therm_vertical.F90 @@ -30,6 +30,7 @@ module icepack_therm_vertical use icepack_parameters, only: saltflux_option, congel_freeze use icepack_parameters, only: icepack_chkoptargflag + use icepack_tracers, only: ncat, nilyr, nslyr use icepack_tracers, only: tr_iage, tr_FY, tr_aero, tr_pond, tr_fsd, tr_iso use icepack_tracers, only: tr_pond_lvl, tr_pond_topo use icepack_tracers, only: n_aero, n_iso @@ -75,8 +76,7 @@ module icepack_therm_vertical ! authors: William H. Lipscomb, LANL ! C. M. Bitz, UW - subroutine thermo_vertical (nilyr, nslyr, & - dt, aicen, & + subroutine thermo_vertical (dt, aicen, & vicen, vsnon, & Tsf, zSin, & zqin, zqsn, & @@ -106,10 +106,6 @@ subroutine thermo_vertical (nilyr, nslyr, & yday, dsnow, & prescribed_ice) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & dt , & ! time step frain ! rainfall rate (kg/m2/s) @@ -279,8 +275,7 @@ subroutine thermo_vertical (nilyr, nslyr, & ! Compute variables needed for vertical thermo calculation !----------------------------------------------------------------- - call init_vertical_profile (nilyr, nslyr, & - aicen, & + call init_vertical_profile (aicen, & vicen, vsnon, & hin, hilyr, & hsn, hslyr, & @@ -310,7 +305,6 @@ subroutine thermo_vertical (nilyr, nslyr, & if (ktherm == 2) then call temperature_changes_salinity(dt, & - nilyr, nslyr, & rhoa, flw, & potT, Qa, & shcoef, lhcoef, & @@ -333,7 +327,6 @@ subroutine thermo_vertical (nilyr, nslyr, & else ! ktherm call temperature_changes(dt, & - nilyr, nslyr, & rhoa, flw, & potT, Qa, & shcoef, lhcoef, & @@ -385,8 +378,7 @@ subroutine thermo_vertical (nilyr, nslyr, & ! Repartition ice into equal-thickness layers, conserving energy. !----------------------------------------------------------------- - call thickness_changes(nilyr, nslyr, & - dt, yday, & + call thickness_changes(dt, yday, & efinal, & hin, hilyr, & hsn, hslyr, & @@ -464,8 +456,7 @@ subroutine thermo_vertical (nilyr, nslyr, & ! state variables. !----------------------------------------------------------------- - call update_state_vthermo(nilyr, nslyr, & - Tbot, Tsf, & + call update_state_vthermo(Tbot, Tsf, & hin, hsn, & zqin, zSin, & zqsn, & @@ -484,8 +475,7 @@ end subroutine thermo_vertical ! William H. Lipscomb, LANL ! Elizabeth C. Hunke, LANL - subroutine frzmlt_bottom_lateral (dt, ncat, & - nilyr, nslyr, & + subroutine frzmlt_bottom_lateral (dt, & aice, frzmlt, & vicen, vsnon, & qicen, qsnon, & @@ -497,11 +487,6 @@ subroutine frzmlt_bottom_lateral (dt, ncat, & rside, Cdn_ocn, & fside, wlat) - 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 @@ -662,8 +647,7 @@ end subroutine frzmlt_bottom_lateral ! authors William H. Lipscomb, LANL ! C. M. Bitz, UW - subroutine init_vertical_profile(nilyr, nslyr, & - aicen, vicen, & + subroutine init_vertical_profile(aicen, vicen, & vsnon, & hin, hilyr, & hsn, hslyr, & @@ -672,10 +656,6 @@ subroutine init_vertical_profile(nilyr, nslyr, & zSin, & einit ) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & aicen , & ! concentration of ice vicen , & ! volume per unit area of ice (m) @@ -996,8 +976,7 @@ end subroutine init_vertical_profile ! authors William H. Lipscomb, LANL ! C. M. Bitz, UW - subroutine thickness_changes (nilyr, nslyr, & - dt, yday, & + subroutine thickness_changes (dt, yday, & efinal, & hin, hilyr, & hsn, hslyr, & @@ -1019,10 +998,6 @@ subroutine thickness_changes (nilyr, nslyr, & sst, & dsnow, rsnw) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & dt , & ! time step yday ! day of the year @@ -1266,15 +1241,17 @@ subroutine thickness_changes (nilyr, nslyr, & qbotp = qbotm - qbotw dhi = ebot_gro / qbotp ! dhi > 0 hstot = dzi(nilyr)*zSin(nilyr) + dhi*sss*phi_i_mushy + hqtot = dzi(nilyr)*zqin(nilyr) + dhi*qbotm + emlt_ocn = emlt_ocn - qbotw * dhi else ! two-step qbotm = icepack_enthalpy_mush(Tbot, sss) qbotp = -Lfresh * rhoi * (c1 - phi_i_mushy) qbotw = qbotm - qbotp dhi = ebot_gro / qbotp ! dhi > 0 hstot = dzi(nilyr)*zSin(nilyr) + dhi*sss + hqtot = dzi(nilyr)*zqin(nilyr) + dhi*qbotm + emlt_ocn = emlt_ocn - qbotw * dhi endif - hqtot = dzi(nilyr)*zqin(nilyr) + dhi*qbotm - emlt_ocn = emlt_ocn - qbotw * dhi else @@ -1533,7 +1510,7 @@ subroutine thickness_changes (nilyr, nslyr, & !------------------------------------------------------------------- if (ktherm /= 2) & - call freeboard (nslyr, snoice, & + call freeboard (snoice, & hin, hsn, & zqin, zqsn, & dzi, dzs, & @@ -1768,17 +1745,13 @@ end subroutine thickness_changes ! authors William H. Lipscomb, LANL ! Elizabeth C. Hunke, LANL - subroutine freeboard (nslyr, & - snoice, & + subroutine freeboard (snoice, & hin, hsn, & zqin, zqsn, & dzi, dzs, & dsnow, & massice, massliq) - integer (kind=int_kind), intent(in) :: & - nslyr ! number of snow layers - ! real (kind=dbl_kind), intent(in) :: & ! dt ! time step @@ -2011,18 +1984,13 @@ end subroutine conservation_check_vthermo ! C. M. Bitz, UW ! Elizabeth C. Hunke, LANL - subroutine update_state_vthermo(nilyr, nslyr, & - Tf, Tsf, & + subroutine update_state_vthermo(Tf, Tsf, & hin, hsn, & zqin, zSin, & zqsn, & aicen, vicen, & vsnon) - integer (kind=int_kind), intent(in) :: & - nilyr , & ! number of ice layers - nslyr ! number of snow layers - real (kind=dbl_kind), intent(in) :: & Tf ! freezing temperature (C) @@ -2082,7 +2050,7 @@ end subroutine update_state_vthermo ! 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 , & @@ -2171,11 +2139,6 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & 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) @@ -2524,7 +2487,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & hdraft , hridge , & distrdg , hkeel , & dkeel , lfloe , & - dfloe , ncat) + dfloe) if (icepack_warnings_aborted(subname)) return endif @@ -2534,8 +2497,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & ! Compute lateral and bottom heat fluxes. !----------------------------------------------------------------- - call frzmlt_bottom_lateral (dt, ncat, & - nilyr, nslyr, & + call frzmlt_bottom_lateral (dt, & aice, frzmlt, & vicen, vsnon, & zqin, zqsn, & @@ -2654,8 +2616,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & smliq(:) = smliqn(:,n) endif - call thermo_vertical(nilyr=nilyr, nslyr=nslyr, & - dt=dt, aicen=aicen (n), & + call thermo_vertical(dt=dt, aicen=aicen (n), & vicen=vicen (n), vsnon=vsnon (n), & Tsf=Tsfc (n), zSin=zSin (:,n), & zqin=zqin (:,n), zqsn=zqsn (:,n), & @@ -2709,7 +2670,6 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & if (tr_aero) then call update_aerosol (dt, & - nilyr, nslyr, n_aero, & melttn (n), meltsn (n), & meltbn (n), congeln (n), & snoicen (n), fsnow, & @@ -2724,7 +2684,6 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & if (tr_iso) then call update_isotope (dt = dt, & - nilyr = nilyr, nslyr = nslyr, & meltt = melttn(n),melts = meltsn(n), & meltb = meltbn(n),congel=congeln(n), & snoice=snoicen(n),evap=evapn, & @@ -2749,8 +2708,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & endif ! aicen_init if (snwgrain) then - call drain_snow (nslyr = nslyr, & - vsnon = vsnon(n), & + call drain_snow (vsnon = vsnon(n), & aicen = aicen(n), & massice = massicen(:,n), & massliq = massliqn(:,n), & @@ -2920,12 +2878,12 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & !----------------------------------------------------------------- !call ice_timer_start(timer_ponds) if (tr_pond_topo) then - call compute_ponds_topo(dt, ncat, nilyr, & + call compute_ponds_topo(dt, & ktherm, & aice, aicen, & vice, vicen, & vsno, vsnon, & - meltt, & + meltt, & fsurf, fpond, & Tsfc, Tf, & zqin, zSin, & diff --git a/columnphysics/icepack_tracers.F90 b/columnphysics/icepack_tracers.F90 index 8414e0c9..fc3fafa8 100644 --- a/columnphysics/icepack_tracers.F90 +++ b/columnphysics/icepack_tracers.F90 @@ -31,15 +31,14 @@ module icepack_tracers !----------------------------------------------------------------- integer (kind=int_kind), parameter, public :: & max_iso = 3 , & ! maximum number of isotopes + nmodal1 = 10 , & ! dimension for modal aerosol radiation parameters + nmodal2 = 8 , & ! dimension for modal aerosol radiation parameters max_algae = 3 , & ! maximum number of algal types max_dic = 1 , & ! maximum number of dissolved inorganic carbon types max_doc = 3 , & ! maximum number of dissolved organic carbon types max_don = 1 , & ! maximum number of dissolved organic nitrogen types max_fe = 2 , & ! maximum number of iron types - nmodal1 = 10 , & ! dimension for modal aerosol radiation parameters - nmodal2 = 8 , & ! dimension for modal aerosol radiation parameters max_aero = 6 , & ! maximum number of aerosols - max_nbtrcr = max_algae*2 & ! algal nitrogen and chlorophyll + max_dic & ! dissolved inorganic carbon + max_doc & ! dissolved organic carbon @@ -1198,15 +1197,12 @@ end subroutine icepack_write_tracer_sizes ! 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 diff --git a/columnphysics/icepack_warnings.F90 b/columnphysics/icepack_warnings.F90 index 459f2dc8..76858e9a 100644 --- a/columnphysics/icepack_warnings.F90 +++ b/columnphysics/icepack_warnings.F90 @@ -1,8 +1,20 @@ module icepack_warnings - use icepack_kinds +! Provides a logging and abort package for Icepack. +! Icepack has no idea about MPI, OpenMP, or IO. +! Store error message and provide methods for the driver +! to write these messages to a Fortran unit number. +! Needs to be thread safe. This could be called within +! a threaded or non-threaded region or both. Need to make +! sure multiple threads are not adding to the warnings +! buffer at the same time. Also need to make sure warnings +! buffers are not added at the same time messages are +! cleared by a different thread. Use multiple critical +! regions using the same ID to allow threads to block +! each other during multiple operations. + use icepack_kinds implicit none private @@ -10,7 +22,7 @@ module icepack_warnings ! warning messages character(len=char_len_long), dimension(:), allocatable :: warnings integer :: nWarnings = 0 - integer, parameter :: nWarningsBuffer = 10 ! incremental number of messages + integer :: nWarningsBuffer = 10 ! incremental number of messages ! abort flag, accessed via icepack_warnings_setabort and icepack_warnings_aborted logical :: warning_abort = .false. @@ -30,6 +42,10 @@ module icepack_warnings private :: & icepack_warnings_getone +! variables are shared by default +! have warnstr be private +!$OMP THREADPRIVATE(warnstr) + !======================================================================= contains @@ -68,9 +84,15 @@ subroutine icepack_warnings_setabort(abortflag,file,line) if (abortflag) then write(warnstr,*) subname,abortflag - if (present(file)) write(warnstr,*) trim(warnstr)//' :file '//trim(file) - if (present(line)) write(warnstr,*) trim(warnstr)//' :line ',line call icepack_warnings_add(warnstr) + if (present(file)) then + write(warnstr,*) trim(warnstr)//' :file '//trim(file) + call icepack_warnings_add(warnstr) + endif + if (present(line)) then + write(warnstr,*) trim(warnstr)//' :line ',line + call icepack_warnings_add(warnstr) + endif endif warning_abort = abortflag @@ -127,14 +149,9 @@ subroutine icepack_warnings_print(iounit) integer :: iWarning character(len=*),parameter :: subname='(icepack_warnings_print)' -! tcraig -! this code intermittenly aborts on recursive IO errors with intel -! not sure if it's OMP or something else causing this -!$OMP MASTER do iWarning = 1, nWarnings write(iounit,*) trim(icepack_warnings_getone(iWarning)) enddo -!$OMP END MASTER end subroutine icepack_warnings_print @@ -150,10 +167,12 @@ subroutine icepack_warnings_flush(iounit) character(len=*),parameter :: subname='(icepack_warnings_flush)' +!$OMP CRITICAL (omp_warnings) if (nWarnings > 0) then call icepack_warnings_print(iounit) endif call icepack_warnings_clear() +!$OMP END CRITICAL (omp_warnings) end subroutine icepack_warnings_flush @@ -171,7 +190,7 @@ subroutine icepack_warnings_add(warning) iWarning ! warning index character(len=*),parameter :: subname='(icepack_warnings_add)' -!$OMP CRITICAL (omp_warnings_add) +!$OMP CRITICAL (omp_warnings) ! check if warnings array is not allocated if (.not. allocated(warnings)) then @@ -181,7 +200,6 @@ subroutine icepack_warnings_add(warning) ! set initial number of nWarnings nWarnings = 0 - ! already allocated else ! find the size of the warnings array at the start @@ -210,16 +228,18 @@ subroutine icepack_warnings_add(warning) ! deallocate the temporary storage deallocate(warningsTmp) + ! increase nWarningsBuffer for next reallocation + nWarningsBuffer = nWarningsBuffer * 2 endif endif ! increase warning number nWarnings = nWarnings + 1 -!$OMP END CRITICAL (omp_warnings_add) ! add the new warning warnings(nWarnings) = trim(warning) +!$OMP END CRITICAL (omp_warnings) end subroutine icepack_warnings_add diff --git a/columnphysics/icepack_wavefracspec.F90 b/columnphysics/icepack_wavefracspec.F90 index 540ab672..1beb7a23 100644 --- a/columnphysics/icepack_wavefracspec.F90 +++ b/columnphysics/icepack_wavefracspec.F90 @@ -31,7 +31,7 @@ module icepack_wavefracspec use icepack_kinds use icepack_parameters, only: p01, p5, c0, c1, c2, c3, c4, c10 use icepack_parameters, only: bignum, puny, gravit, pi - use icepack_tracers, only: nt_fsd + use icepack_tracers, only: nt_fsd, ncat, nfsd use icepack_warnings, only: warnstr, icepack_warnings_add, icepack_warnings_aborted use icepack_fsd @@ -128,12 +128,9 @@ end subroutine icepack_init_wave ! ! authors: 2017 Lettie Roach, NIWA/VUW ! - function get_dafsd_wave(nfsd, afsd_init, fracture_hist, frac) & + function get_dafsd_wave(afsd_init, fracture_hist, frac) & result(d_afsd) - integer (kind=int_kind), intent(in) :: & - nfsd ! number of floe size categories - real (kind=dbl_kind), dimension (:), intent(in) :: & afsd_init, fracture_hist @@ -183,8 +180,7 @@ end function get_dafsd_wave ! 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, & @@ -192,12 +188,10 @@ subroutine icepack_step_wavefracture(wave_spec_type, & 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 @@ -269,7 +263,7 @@ subroutine icepack_step_wavefracture(wave_spec_type, & hbar = vice / aice ! calculate fracture histogram - call wave_frac(nfsd, nfreq, wave_spec_type, & + call wave_frac(nfreq, wave_spec_type, & floe_rad_l, floe_rad_c, & wavefreq, dwavefreq, & hbar, wave_spectrum, fracture_hist) @@ -279,7 +273,7 @@ subroutine icepack_step_wavefracture(wave_spec_type, & ! if fracture occurs if (MAXVAL(fracture_hist) > puny) then ! protect against small numerical errors - call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:) ) + call icepack_cleanup_fsd (trcrn(nt_fsd:nt_fsd+nfsd-1,:) ) if (icepack_warnings_aborted(subname)) return do n = 1, ncat @@ -312,7 +306,7 @@ subroutine icepack_step_wavefracture(wave_spec_type, & if (afsd_tmp(1).ge.c1-puny) EXIT ! calculate d_afsd using current afstd - d_afsd_tmp = get_dafsd_wave(nfsd, afsd_tmp, fracture_hist, frac) + d_afsd_tmp = get_dafsd_wave(afsd_tmp, fracture_hist, frac) ! check in case wave fracture struggles to converge if (nsubt>100) then @@ -322,7 +316,7 @@ subroutine icepack_step_wavefracture(wave_spec_type, & endif ! required timestep - subdt = get_subdt_fsd(nfsd, afsd_tmp, d_afsd_tmp) + subdt = get_subdt_fsd(afsd_tmp, d_afsd_tmp) subdt = MIN(subdt, dt) ! update afsd @@ -367,7 +361,7 @@ subroutine icepack_step_wavefracture(wave_spec_type, & ! update trcrn trcrn(nt_fsd:nt_fsd+nfsd-1,n) = afsd_tmp/SUM(afsd_tmp) - call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:) ) + call icepack_cleanup_fsd (trcrn(nt_fsd:nt_fsd+nfsd-1,:) ) if (icepack_warnings_aborted(subname)) return ! for diagnostics @@ -398,13 +392,12 @@ end subroutine icepack_step_wavefracture ! ! authors: 2018 Lettie Roach, NIWA/VUW - subroutine wave_frac(nfsd, nfreq, wave_spec_type, & + subroutine wave_frac(nfreq, wave_spec_type, & floe_rad_l, floe_rad_c, & wavefreq, dwavefreq, & hbar, spec_efreq, frac_local) integer (kind=int_kind), intent(in) :: & - nfsd, & ! number of floe size categories nfreq ! number of wave frequency categories character (len=char_len), intent(in) :: & diff --git a/columnphysics/icepack_zbgc.F90 b/columnphysics/icepack_zbgc.F90 index 928b4ca6..1cb7a6c3 100644 --- a/columnphysics/icepack_zbgc.F90 +++ b/columnphysics/icepack_zbgc.F90 @@ -9,24 +9,42 @@ module icepack_zbgc use icepack_kinds - use icepack_parameters, only: c0, c1, c2, p001, p1, p5, puny - use icepack_parameters, only: depressT, rhosi, min_salin, salt_loss - use icepack_parameters, only: fr_resp, algal_vel, R_dFe2dust, dustFe_sol, T_max - use icepack_parameters, only: op_dep_min, fr_graze_s, fr_graze_e, fr_mort2min, fr_dFe - 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 - use icepack_parameters, only: z_tracers, fsal, conserv_check - - use icepack_tracers, only: nt_sice, bio_index + use icepack_parameters + + !use icepack_parameters, only: c0, c1, c2, p001, p1, p5, puny + !use icepack_parameters, only: depressT, rhosi, min_salin, salt_loss + !use icepack_parameters, only: fr_resp, algal_vel, R_dFe2dust, dustFe_sol, T_max + !use icepack_parameters, only: op_dep_min, fr_graze_s, fr_graze_e, fr_mort2min, fr_dFe + !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 + !use icepack_parameters, only: z_tracers, fsal, conserv_check + + use icepack_tracers, only: max_algae, max_dic, max_doc, max_don, max_fe + use icepack_tracers, only: max_aero, max_nbtrcr + use icepack_tracers, only: ncat, nilyr, nslyr, nblyr, nbtrcr, ntrcr, ntrcr_o use icepack_tracers, only: tr_brine, nt_fbri, nt_qice, nt_Tsfc - use icepack_tracers, only: nt_zbgc_frac - use icepack_tracers, only: bio_index_o, bio_index + use icepack_tracers, only: tr_zaero, tr_bgc_Nit, tr_bgc_N + use icepack_tracers, only: tr_bgc_DON, tr_bgc_C, tr_bgc_chl + use icepack_tracers, only: tr_bgc_Am, tr_bgc_Sil, tr_bgc_DMS + use icepack_tracers, only: tr_bgc_Fe, tr_bgc_hum, tr_bgc_PON + use icepack_tracers, only: nt_bgc_Nit, nlt_bgc_Nit + use icepack_tracers, only: nt_bgc_N, nlt_bgc_N, nt_bgc_Am, nlt_bgc_Am + use icepack_tracers, only: nt_bgc_DMSPp, nlt_bgc_DMSPp, nt_bgc_Sil, nlt_bgc_Sil + use icepack_tracers, only: nt_bgc_DMSPd, nlt_bgc_DMSPd, nt_bgc_DMS, nlt_bgc_DMS + use icepack_tracers, only: nt_bgc_hum, nlt_bgc_hum, nt_bgc_PON, nlt_bgc_PON + use icepack_tracers, only: nt_bgc_C, nlt_bgc_C, nt_bgc_chl, nlt_bgc_chl + use icepack_tracers, only: nt_bgc_DOC, nlt_bgc_DOC, nt_bgc_DON, nlt_bgc_DON + use icepack_tracers, only: nt_bgc_DIC, nlt_bgc_DIC, nt_bgc_Fed, nlt_bgc_Fed + use icepack_tracers, only: nt_sice, bio_index, bio_index_o + use icepack_tracers, only: nt_zaero, nlt_zaero, nt_bgc_Fep, nlt_bgc_Fep + use icepack_tracers, only: nlt_zaero_sw, nlt_chl_sw, nt_zbgc_frac + use icepack_tracers, only: n_algae, n_doc, n_dic, n_don, n_fed, n_fep, n_zaero use icepack_zbgc_shared, only: zbgc_init_frac use icepack_zbgc_shared, only: zbgc_frac_init + use icepack_zbgc_shared, only: bgrid, cgrid, igrid, icgrid use icepack_zbgc_shared, only: bgc_tracer_type, remap_zbgc - use icepack_zbgc_shared, only: regrid_stationary use icepack_zbgc_shared, only: R_S2N, R_Si2N, R_Fe2C, R_Fe2N, R_Fe2DON, R_Fe2DOC use icepack_zbgc_shared, only: chlabs, alpha2max_low, beta2max use icepack_zbgc_shared, only: mu_max, grow_Tdep, fr_graze @@ -35,7 +53,10 @@ module icepack_zbgc use icepack_zbgc_shared, only: f_don, kn_bac, f_don_Am, f_doc use icepack_zbgc_shared, only: f_exude, k_bac use icepack_zbgc_shared, only: tau_ret, tau_rel - use icepack_zbgc_shared, only: R_C2N, R_CHL2N, f_abs_chl, R_C2N_DON + use icepack_zbgc_shared, only: R_C2N, R_chl2N, f_abs_chl, R_C2N_DON + use icepack_zbgc_shared, only: doc_pool_fractions + use icepack_zbgc_shared, only: algaltype, doctype, dictype + use icepack_zbgc_shared, only: dontype, fedtype, feptype, zaerotype use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -65,54 +86,34 @@ module icepack_zbgc ! Adjust biogeochemical tracers when new frazil ice forms - subroutine add_new_ice_bgc (dt, nblyr, & - ncat, nilyr, nltrcr, & - bgrid, cgrid, igrid, & + subroutine add_new_ice_bgc (dt, ncats, & aicen_init, vicen_init, vi0_init, & - aicen, vicen, vsnon1, & - vi0new, & - ntrcr, trcrn, nbtrcr, & - sss, ocean_bio, flux_bio, & - hsurp) + aicen, vicen, vin0new, & + trcrn, & + ocean_bio, flux_bio, hsurp, & + d_an_tot) integer (kind=int_kind), intent(in) :: & - nblyr , & ! number of bio layers - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nltrcr , & ! number of zbgc tracers - nbtrcr , & ! number of biology tracers - ntrcr ! number of tracers in use - - 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 + ncats ! 1 without floe size distribution or ncat real (kind=dbl_kind), intent(in) :: & dt ! time step (s) real (kind=dbl_kind), dimension (:), intent(in) :: & aicen_init , & ! initial concentration of ice - vicen_init , & ! intiial volume per unit area of ice (m) + vicen_init , & ! initial volume per unit area of ice (m) aicen , & ! concentration of ice - vicen ! volume per unit area of ice (m) - - real (kind=dbl_kind), intent(in) :: & - vsnon1 ! category 1 snow volume per unit area (m) + vicen , & ! volume per unit area of ice (m) + d_an_tot real (kind=dbl_kind), dimension (:,:), intent(inout) :: & trcrn ! ice tracers - real (kind=dbl_kind), intent(in) :: & - sss !sea surface salinity (ppt) + real (kind=dbl_kind), dimension (:), intent(in) :: & + vin0new ! ice tracers real (kind=dbl_kind), intent(in) :: & - vi0_init , & ! volume of new ice added to cat 1 (intial) - vi0new ! volume of new ice added to cat 1 + vi0_init ! volume of new ice added to cat 1 (intial) real (kind=dbl_kind), intent(in) :: & hsurp ! thickness of new ice added to each cat @@ -127,8 +128,10 @@ subroutine add_new_ice_bgc (dt, nblyr, & integer (kind=int_kind) :: & location , & ! 1 (add frazil to bottom), 0 (add frazil throughout) + m , & ! bio index n , & ! ice category index - k ! ice layer index + k , & ! ice layer index + nbiolayer real (kind=dbl_kind) :: & vbri1 , & ! starting volume of existing brine @@ -143,7 +146,8 @@ subroutine add_new_ice_bgc (dt, nblyr, & vbrin ! trcrn(nt_fbri,n)*vicen(n) real (kind=dbl_kind) :: & - vice_new ! vicen_init + vsurp + vice_new , & ! vicen_init + vsurp + bio0new ! ocean_bio * zbgc_init_fac real (kind=dbl_kind) :: & Tmlts ! melting temperature (oC) @@ -153,9 +157,15 @@ subroutine add_new_ice_bgc (dt, nblyr, & character(len=*),parameter :: subname='(add_new_ice_bgc)' + real (kind=dbl_kind), dimension (nblyr+1) :: & + zspace ! vertical grid spacing !----------------------------------------------------------------- ! brine !----------------------------------------------------------------- + + zspace(:) = c1/real(nblyr,kind=dbl_kind) + zspace(1) = p5*zspace(2) + zspace(nblyr+1) = zspace(1) vbrin(:) = c0 do n = 1, ncat vbrin(n) = vicen_init(n) @@ -190,67 +200,57 @@ subroutine add_new_ice_bgc (dt, nblyr, & vsurp = hsurp * aicen_init(n) vbrin(n) = vbrin(n) + vsurp vice_new = vicen_init(n) + vsurp - if (tr_brine .and. vicen(n) > c0) then - trcrn(nt_fbri,n) = vbrin(n)/vicen(n) + + if (tr_brine .and. vice_new > puny) then !c0) then + trcrn(nt_fbri,n) = vbrin(n)/vice_new elseif (tr_brine .and. vicen(n) <= c0) then trcrn(nt_fbri,n) = c1 endif - if (nltrcr > 0) then - location = 1 - call adjust_tracer_profile(nbtrcr, dt, ntrcr, & - aicen_init(n), & - vbrin(n), & - vice_new, & - trcrn(:,n), & - vtmp, & - vsurp, sss, & - nilyr, nblyr, & - bgrid, & - cgrid, & - ocean_bio, igrid, & - location) + if (nbtrcr > 0) then + do m = 1, nbtrcr + bio0new = ocean_bio(m)*zbgc_init_frac(m) + nbiolayer = nblyr+1 + call update_vertical_bio_tracers(nbiolayer, trcrn(bio_index(m):bio_index(m) + nblyr,n), & + vtmp, vbrin(n), bio0new,zspace(:)) + enddo !nbtrcr if (icepack_warnings_aborted(subname)) return - endif ! nltrcr + endif ! nbtrcr endif ! hsurp > 0 enddo ! n !----------------------------------------------------------------- ! Combine bgc in new ice grown in open water with category 1 ice. !----------------------------------------------------------------- + do n = 1, ncats + if (vin0new(n) > c0 .and. d_an_tot(n) > c0) then - if (vi0new > c0) then - - vbri1 = vbrin(1) - vbrin(1) = vbrin(1) + vi0new - if (tr_brine .and. vicen(1) > c0) then - trcrn(nt_fbri,1) = vbrin(1)/vicen(1) - elseif (tr_brine .and. vicen(1) <= c0) then - trcrn(nt_fbri,1) = c1 + vbri1 = vbrin(n) + vbrin(n) = vbrin(n) + vin0new(n) + if (tr_brine .and. vicen(n) > puny) then + trcrn(nt_fbri,n) = vbrin(n)/vicen(n) + elseif (tr_brine .and. vicen(n) <= puny) then + trcrn(nt_fbri,n) = c1 endif ! Diffuse_bio handles concentration changes from ice growth/melt ! ice area changes ! add salt throughout, location = 0 - if (nltrcr > 0) then - location = 0 - call adjust_tracer_profile(nbtrcr, dt, ntrcr, & - aicen(1), & - vbrin(1), & - vicen(1), & - trcrn(:,1), & - vbri1, & - vi0new, sss, & - nilyr, nblyr, & - bgrid, & - cgrid, & - ocean_bio, igrid, & - location) + if (nbtrcr > 0 .and. vbrin(n) > puny) then + do m = 1, nbtrcr + bio0new = ocean_bio(m)*zbgc_init_frac(m) + do k = 1, nblyr+1 + trcrn(bio_index(m) + k-1,n) = & + (trcrn(bio_index(m) + k-1,n)*vbri1 + bio0new * vin0new(n))/vbrin(n) + enddo + enddo + if (icepack_warnings_aborted(subname)) return - endif ! nltrcr > 0 - endif ! vi0new > 0 + endif ! nbtrcr > 0 + endif ! vin0new(n) > 0 + enddo ! n = 1,ncats if (tr_brine .and. conserv_check) then call column_sum (ncat, vbrin, vbri_final) @@ -270,196 +270,62 @@ end subroutine add_new_ice_bgc ! When sea ice melts laterally, flux bgc to ocean - subroutine lateral_melt_bgc (dt, & - ncat, nblyr, & - rside, vicen, & - trcrn, & - flux_bio, nbltrcr) - - integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nblyr , & ! number of bio layers - nbltrcr ! number of biology tracers + subroutine lateral_melt_bgc (dt, & + rsiden, vicen_init,& + trcrn, flux_bio) real (kind=dbl_kind), intent(in) :: & dt ! time step (s) real (kind=dbl_kind), dimension(:), intent(in) :: & - vicen ! volume per unit area of ice (m) + vicen_init! volume per unit area of ice (m) real (kind=dbl_kind), dimension (:,:), intent(in) :: & trcrn ! tracer array - real (kind=dbl_kind), intent(in) :: & - rside ! fraction of ice that melts laterally + real (kind=dbl_kind), dimension(:), intent(in) :: & + rsiden ! fraction of ice that melts laterally real (kind=dbl_kind), dimension(:), intent(inout) :: & flux_bio ! biology tracer flux from layer bgc (mmol/m^2/s) ! local variables + real (kind=dbl_kind) :: & + total_bio_initial, & ! initial column tracer concentration (mmol/m2) + total_bio_final ! final column tracer concentration (mmol/m20 + integer (kind=int_kind) :: & k , & ! layer index m , & ! n ! category index - real (kind=dbl_kind) :: & - zspace ! bio grid spacing + real (kind=dbl_kind), dimension (nblyr+1) :: & + zspace ! vertical grid spacing character(len=*),parameter :: subname='(lateral_melt_bgc)' - zspace = c1/(real(nblyr,kind=dbl_kind)) + zspace(:) = c1/real(nblyr,kind=dbl_kind) + zspace(1) = p5*zspace(2) + zspace(nblyr+1) = zspace(1) - do m = 1, nbltrcr + do m = 1, nbtrcr do n = 1, ncat do k = 1, nblyr+1 flux_bio(m) = flux_bio(m) + trcrn(nt_fbri,n) & - * vicen(n)*zspace*trcrn(bio_index(m)+k-1,n) & - * rside/dt + * vicen_init(n)*zspace(k)*trcrn(bio_index(m)+k-1,n) & + * rsiden(n)/dt enddo enddo enddo end subroutine lateral_melt_bgc -!======================================================================= -! -! Add new ice tracers to the ice bottom and adjust the vertical profile -! -! author: Nicole Jeffery, LANL - - subroutine adjust_tracer_profile (nbtrcr, dt, ntrcr, & - aicen, vbrin, & - vicen, trcrn, & - vtmp, & - vsurp, sss, & - nilyr, nblyr, & - bgrid, & - cgrid, ocean_bio, & - igrid, location) - - integer (kind=int_kind), intent(in) :: & - location , & ! 1 (add frazil to bottom), 0 (add frazil throughout) - ntrcr , & ! number of tracers in use - nilyr , & ! number of ice layers - nbtrcr , & ! number of biology tracers - nblyr ! number of biology layers - - real (kind=dbl_kind), intent(in) :: & - dt ! timestep (s) - - real (kind=dbl_kind), intent(in) :: & - aicen , & ! concentration of ice - vicen , & ! volume of ice - sss , & ! ocean salinity (ppt) - ! hsurp , & ! flags new ice added to each cat - vsurp , & ! volume of new ice added to each cat - vtmp ! total volume of new and old ice - - real (kind=dbl_kind), dimension (nbtrcr), intent(in) :: & - ocean_bio - - real (kind=dbl_kind), intent(in) :: & - vbrin ! fbri*volume per unit area of ice (m) - - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - igrid ! zbio grid - - real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - bgrid ! zsal grid - - real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: & - cgrid ! CICE grid - - real (kind=dbl_kind), dimension (ntrcr), intent(inout) :: & - trcrn ! ice tracers - - ! local variables - - real (kind=dbl_kind), dimension (ntrcr+2) :: & - trtmp0, & ! temporary, remapped tracers - trtmp ! temporary, remapped tracers - - real (kind=dbl_kind) :: & - hin , & ! ice height - hinS_new, & ! brine height - temp_S - - integer (kind=int_kind) :: & - k, m - - real (kind=dbl_kind), dimension (nblyr+1) :: & - C_stationary ! stationary bulk concentration*h (mmol/m^2) - - real (kind=dbl_kind), dimension (nblyr) :: & - S_stationary ! stationary bulk concentration*h (ppt*m) - - real(kind=dbl_kind) :: & - top_conc , & ! salinity or bgc ocean concentration of frazil - fluxb , & ! needed for regrid (set to zero here) - hbri_old , & ! previous timestep brine height - hbri ! brine height - - character(len=*),parameter :: subname='(adjust_tracer_profile)' - - trtmp0(:) = c0 - trtmp(:) = c0 - fluxb = c0 - - if (location == 1 .and. vbrin > c0) then ! add frazil to bottom - - hbri = vbrin - hbri_old = vtmp - - do m = 1, nbtrcr - top_conc = ocean_bio(m)*zbgc_init_frac(m) - do k = 1, nblyr+1 - C_stationary(k) = trcrn(bio_index(m) + k-1)* hbri_old - enddo !k - call regrid_stationary (C_stationary, hbri_old, & - hbri, dt, & - ntrcr, & - nblyr, top_conc, & - igrid, fluxb ) - if (icepack_warnings_aborted(subname)) return - do k = 1, nblyr+1 - trcrn(bio_index(m) + k-1) = C_stationary(k)/hbri - enddo !k - enddo !m - - elseif (vbrin > c0) then ! add frazil throughout location == 0 .and. - - do k = 1, nblyr+1 - do m = 1, nbtrcr - trcrn(bio_index(m) + k-1) = (trcrn(bio_index(m) + k-1) * vtmp & - + ocean_bio(m)*zbgc_init_frac(m) * vsurp) / vbrin - enddo - enddo - - endif ! location - - end subroutine adjust_tracer_profile - !======================================================================= !autodocument_start icepack_init_bgc ! - 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 @@ -470,9 +336,12 @@ subroutine icepack_init_bgc(ncat, nblyr, nilyr, ntrcr_o, & 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 + !autodocument_end ! local variables @@ -493,6 +362,8 @@ subroutine icepack_init_bgc(ncat, nblyr, nilyr, ntrcr_o, & ! The skeletal layer model assumes a constant ! layer depth (sk_l) and porosity (phi_sk) !----------------------------------------------------------------------------- + if (.not. restartbgc) then + if (skl_bgc) then do n = 1,ncat @@ -547,6 +418,16 @@ subroutine icepack_init_bgc(ncat, nblyr, nilyr, ntrcr_o, & endif ! scale_bgc endif ! skl_bgc + endif ! restart + + if (present(DOCPoolFractions)) then + DOCPoolFractions(:) = c1 + if (.not. use_macromolecules) then + do mm = 1,max_doc + DOCPoolFractions(mm) = doc_pool_fractions(mm) + end do + end if + endif end subroutine icepack_init_bgc @@ -554,76 +435,14 @@ end subroutine icepack_init_bgc !autodocument_start 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 !autodocument_end @@ -631,117 +450,176 @@ subroutine icepack_init_zbgc ( & !-------- - if (present(R_C2N_in)) R_C2N(:) = R_C2N_in(:) - if (present(R_chl2N_in)) R_chl2N(:) = R_chl2N_in(:) - if (present(F_abs_chl_in)) F_abs_chl(:) = F_abs_chl_in(:) - if (present(R_C2N_DON_in)) R_C2N_DON(:) = R_C2N_DON_in(:) - if (present(R_Si2N_in)) R_Si2N(:) = R_Si2N_in(:) - if (present(R_S2N_in)) R_S2N(:) = R_S2N_in(:) - if (present(R_Fe2C_in)) R_Fe2C(:) = R_Fe2C_in(:) - if (present(R_Fe2N_in)) R_Fe2N(:) = R_Fe2N_in(:) - if (present(R_Fe2DON_in)) R_Fe2DON(:) = R_Fe2DON_in(:) - if (present(R_Fe2DOC_in)) R_Fe2DOC(:) = R_Fe2DOC_in(:) - - if (present(fr_resp_in)) fr_resp = fr_resp_in - if (present(algal_vel_in)) algal_vel = algal_vel_in - if (present(R_dFe2dust_in)) R_dFe2dust = R_dFe2dust_in - if (present(dustFe_sol_in)) dustFe_sol = dustFe_sol_in - if (present(T_max_in)) T_max = T_max_in - if (present(op_dep_min_in)) op_dep_min = op_dep_min_in - if (present(fr_graze_s_in)) fr_graze_s = fr_graze_s_in - if (present(fr_graze_e_in)) fr_graze_e = fr_graze_e_in - if (present(fr_mort2min_in)) fr_mort2min = fr_mort2min_in - if (present(fr_dFe_in)) fr_dFe = fr_dFe_in - if (present(k_nitrif_in)) k_nitrif = k_nitrif_in - if (present(t_iron_conv_in)) t_iron_conv = t_iron_conv_in - if (present(max_loss_in)) max_loss = max_loss_in - if (present(max_dfe_doc1_in)) max_dfe_doc1 = max_dfe_doc1_in - if (present(fr_resp_s_in)) fr_resp_s = fr_resp_s_in - if (present(y_sk_DMS_in)) y_sk_DMS = y_sk_DMS_in - if (present(t_sk_conv_in)) t_sk_conv = t_sk_conv_in - if (present(t_sk_ox_in)) t_sk_ox = t_sk_ox_in - if (present(fsal_in)) fsal = fsal_in - - if (present(chlabs_in)) chlabs(:) = chlabs_in(:) - if (present(alpha2max_low_in)) alpha2max_low(:) = alpha2max_low_in(:) - if (present(beta2max_in)) beta2max(:) = beta2max_in(:) - if (present(mu_max_in)) mu_max(:) = mu_max_in(:) - if (present(grow_Tdep_in)) grow_Tdep(:) = grow_Tdep_in(:) - if (present(fr_graze_in)) fr_graze(:) = fr_graze_in(:) - if (present(mort_pre_in)) mort_pre(:) = mort_pre_in(:) - if (present(mort_Tdep_in)) mort_Tdep(:) = mort_Tdep_in(:) - if (present(k_exude_in)) k_exude(:) = k_exude_in(:) - if (present(K_Nit_in)) K_Nit(:) = K_Nit_in(:) - if (present(K_Am_in)) K_Am(:) = K_Am_in(:) - if (present(K_Sil_in)) K_Sil(:) = K_Sil_in(:) - if (present(K_Fe_in)) K_Fe(:) = K_Fe_in(:) - if (present(f_don_in)) f_don(:) = f_don_in(:) - if (present(kn_bac_in)) kn_bac(:) = kn_bac_in(:) - if (present(f_don_Am_in)) f_don_Am(:) = f_don_Am_in(:) - if (present(f_doc_in)) f_doc(:) = f_doc_in(:) - if (present(f_exude_in)) f_exude(:) = f_exude_in(:) - if (present(k_bac_in)) k_bac(:) = k_bac_in(:) - if (present(zbgc_frac_init_in)) zbgc_frac_init(:) = zbgc_frac_init_in(:) if (present(bgc_tracer_type_in)) bgc_tracer_type(:) = bgc_tracer_type_in(:) if (present(zbgc_init_frac_in)) zbgc_init_frac(:) = zbgc_init_frac_in(:) if (present(tau_ret_in)) tau_ret(:) = tau_ret_in(:) if (present(tau_rel_in)) tau_rel(:) = tau_rel_in(:) + R_Si2N(1) = ratio_Si2N_diatoms + R_Si2N(2) = ratio_Si2N_sp + R_Si2N(3) = ratio_Si2N_phaeo + + R_S2N(1) = ratio_S2N_diatoms + R_S2N(2) = ratio_S2N_sp + R_S2N(3) = ratio_S2N_phaeo + + R_Fe2C(1) = ratio_Fe2C_diatoms + R_Fe2C(2) = ratio_Fe2C_sp + R_Fe2C(3) = ratio_Fe2C_phaeo + + R_Fe2N(1) = ratio_Fe2N_diatoms + R_Fe2N(2) = ratio_Fe2N_sp + R_Fe2N(3) = ratio_Fe2N_phaeo + + R_C2N(1) = ratio_C2N_diatoms + R_C2N(2) = ratio_C2N_sp + R_C2N(3) = ratio_C2N_phaeo + + R_chl2N(1) = ratio_chl2N_diatoms + R_chl2N(2) = ratio_chl2N_sp + R_chl2N(3) = ratio_chl2N_phaeo + + F_abs_chl(1) = F_abs_chl_diatoms + F_abs_chl(2) = F_abs_chl_sp + F_abs_chl(3) = F_abs_chl_phaeo + + R_Fe2DON(1) = ratio_Fe2DON + R_C2N_DON(1) = ratio_C2N_proteins + + R_Fe2DOC(1) = ratio_Fe2DOC_s + R_Fe2DOC(2) = ratio_Fe2DOC_l + R_Fe2DOC(3) = c0 + + chlabs(1) = chlabs_diatoms + chlabs(2) = chlabs_sp + chlabs(3) = chlabs_phaeo + + alpha2max_low(1) = alpha2max_low_diatoms + alpha2max_low(2) = alpha2max_low_sp + alpha2max_low(3) = alpha2max_low_phaeo + + beta2max(1) = beta2max_diatoms + beta2max(2) = beta2max_sp + beta2max(3) = beta2max_phaeo + + mu_max(1) = mu_max_diatoms + mu_max(2) = mu_max_sp + mu_max(3) = mu_max_phaeo + + grow_Tdep(1) = grow_Tdep_diatoms + grow_Tdep(2) = grow_Tdep_sp + grow_Tdep(3) = grow_Tdep_phaeo + + fr_graze(1) = fr_graze_diatoms + fr_graze(2) = fr_graze_sp + fr_graze(3) = fr_graze_phaeo + + mort_pre(1) = mort_pre_diatoms + mort_pre(2) = mort_pre_sp + mort_pre(3) = mort_pre_phaeo + + mort_Tdep(1) = mort_Tdep_diatoms + mort_Tdep(2) = mort_Tdep_sp + mort_Tdep(3) = mort_Tdep_phaeo + + k_exude(1) = k_exude_diatoms + k_exude(2) = k_exude_sp + k_exude(3) = k_exude_phaeo + + K_Nit(1) = K_Nit_diatoms + K_Nit(2) = K_Nit_sp + K_Nit(3) = K_Nit_phaeo + + K_Am(1) = K_Am_diatoms + K_Am(2) = K_Am_sp + K_Am(3) = K_Am_phaeo + + K_Sil(1) = K_Sil_diatoms + K_Sil(2) = K_Sil_sp + K_Sil(3) = K_Sil_phaeo + + K_Fe(1) = K_Fe_diatoms + K_Fe(2) = K_Fe_sp + K_Fe(3) = K_Fe_phaeo + + f_doc(:) = c0 + f_doc(1) = f_doc_s + f_doc(2) = f_doc_l + + f_don(1) = f_don_protein + kn_bac(1) = kn_bac_protein + f_don_Am(1) = f_don_Am_protein + + f_exude(:) = c0 + f_exude(1) = f_exude_s + f_exude(2) = f_exude_l + + k_bac(:) = c0 + k_bac(1) = k_bac_s + k_bac(2) = k_bac_l + + algaltype(1) = algaltype_diatoms + algaltype(2) = algaltype_sp + algaltype(3) = algaltype_phaeo + + doctype(:) = c0 + doctype(1) = doctype_s + doctype(2) = doctype_l + + dictype(:) = dictype_1 + + dontype(:) = dontype_protein + + fedtype(:) = fedtype_1 + feptype(:) = feptype_1 + + zaerotype(1) = zaerotype_bc1 + zaerotype(2) = zaerotype_bc2 + zaerotype(3) = zaerotype_dust1 + zaerotype(4) = zaerotype_dust2 + zaerotype(5) = zaerotype_dust3 + zaerotype(6) = zaerotype_dust4 end subroutine icepack_init_zbgc !======================================================================= !autodocument_start icepack_biogeochemistry ! - 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) @@ -749,6 +627,14 @@ subroutine icepack_biogeochemistry(dt, & ! 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 @@ -766,15 +652,8 @@ subroutine icepack_biogeochemistry(dt, & 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) @@ -798,17 +677,17 @@ subroutine icepack_biogeochemistry(dt, & 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 - !autodocument_end ! local variables integer (kind=int_kind) :: & - n, mm ! thickness category index + k , & ! vertical index + n, mm ! thickness category index real (kind=dbl_kind) :: & hin , & ! new ice thickness @@ -831,10 +710,14 @@ subroutine icepack_biogeochemistry(dt, & iphin , & ! porosity ibrine_sal , & ! brine salinity (ppt) ibrine_rho , & ! brine_density (kg/m^3) + iSin , & ! Salinity on the interface grid (ppt) iTin ! Temperature on the interface grid (oC) real (kind=dbl_kind) :: & - sloss ! brine flux contribution from surface runoff (g/m^2) + sloss ! brine flux contribution from surface runoff (g/m^2) + + real (kind=dbl_kind), dimension (nbtrcr) :: & + flux_bion_n ! temporary ! for bgc sk real (kind=dbl_kind) :: & @@ -842,14 +725,25 @@ subroutine icepack_biogeochemistry(dt, & dh_top_chl , & ! Chlorophyll may or may not flush darcy_V_chl + real (kind=dbl_kind), dimension (nblyr+1) :: & + zspace ! vertical grid spacing + character(len=*),parameter :: subname='(icepack_biogeochemistry)' + zspace(:) = c1/real(nblyr,kind=dbl_kind) + zspace(1) = p5*zspace(2) + zspace(nblyr+1) = zspace(1) + + if (present(bioPorosityIceCell)) bioPorosityIceCell(:) = c0 + if (present(bioSalinityIceCell)) bioSalinityIceCell(:) = c0 + if (present(bioTemperatureIceCell)) bioTemperatureIceCell(:) = c0 do n = 1, ncat !----------------------------------------------------------------- ! initialize !----------------------------------------------------------------- + flux_bion_n(:) = c0 hin_old(n) = c0 if (aicen_init(n) > puny) then hin_old(n) = vicen_init(n) & @@ -896,7 +790,7 @@ subroutine icepack_biogeochemistry(dt, & trcrn(nt_fbri,n), & dhbr_top(n), dhbr_bot(n), & hbr_old, hin, & - hsn, first_ice(n) ) + hsn) if (icepack_warnings_aborted(subname)) return ! Requires the average ice permeability = kavg(:) @@ -905,22 +799,20 @@ subroutine icepack_biogeochemistry(dt, & iDi(:,n) = c0 - call compute_microS_mushy (nilyr, nblyr, & - bgrid, cgrid, igrid, & + call compute_microS_mushy ( & trcrn(:,n), hin_old(n), hbr_old, & sss, sst, bTiz(:,n), & iTin(:), bphi(:,n), kavg, & bphi_o, bSin(:), & brine_sal(:), brine_rho(:), iphin(:), & - ibrine_rho(:), ibrine_sal(:), sice_rho(n), & - iDi(:,n) ) + ibrine_rho(:), ibrine_sal(:), & + iDi(:,n) , iSin(:)) if (icepack_warnings_aborted(subname)) return call update_hbrine (melttn(n), & meltsn (n), dt, & hin, hsn, & hin_old (n), hbrin, & - hbr_old, & trcrn(nt_fbri,n), & dhbr_top(n), dhbr_bot(n), & @@ -941,50 +833,49 @@ subroutine icepack_biogeochemistry(dt, & if (z_tracers) then - call zbio (dt, nblyr, & - nslyr, nilyr, & + call zbio (dt, & melttn(n), & meltsn(n), meltbn (n), & congeln(n), snoicen(n), & - nbtrcr, fsnow, & - ntrcr, trcrn(1:ntrcr,n), & - bio_index(1:nbtrcr), aicen_init(n), & + fsnow, trcrn(1:ntrcr,n), & + bio_index(1:nbtrcr), bio_index_o(:), & + aicen_init(n), & vicen_init(n), vsnon_init(n), & vicen(n), vsnon(n), & aicen(n), flux_bio_atm(1:nbtrcr), & - n, n_algae, & - n_doc, n_dic, & - n_don, & - n_fed, n_fep, & - n_zaero, first_ice(n), & + n, first_ice(n), & hin_old(n), ocean_bio(1:nbtrcr), & + ocean_bio_dh, & bphi(:,n), iphin, & - iDi(:,n), & + iDi(:,n), & fswpenln(:,n), & dhbr_top(n), dhbr_bot(n), & zfswin(:,n), & hbrin, hbr_old, & -! darcy_V(n), darcy_V_chl, & - darcy_V(n), & - bgrid, & - igrid, icgrid, & + darcy_V(n), & bphi_o, & - iTin, & + iTin, & Zoo(:,n), & flux_bio(1:nbtrcr), dh_direct, & upNO, upNH, & fbio_snoice, fbio_atmice, & PP_net, ice_bio_net (1:nbtrcr), & - snow_bio_net(1:nbtrcr),grow_net ) + snow_bio_net(1:nbtrcr),grow_net, & + totalChla, & + flux_bion_n(1:nbtrcr), iSin, & + bioPorosityIceCell, bioSalinityIceCell, & + bioTemperatureIceCell ) if (icepack_warnings_aborted(subname)) return + if (present(flux_bion)) then + do mm = 1, nbtrcr + flux_bion(mm,n) = flux_bion_n(mm) + enddo + endif + elseif (skl_bgc) then - call sklbio (dt, ntrcr, & - nbtrcr, n_algae, & - n_doc, & - n_dic, n_don, & - n_fed, n_fep, & + call sklbio (dt, Tf, & flux_bio (1:nbtrcr), ocean_bio(1:nbtrcr), & aicen (n), & meltbn (n), congeln (n), & @@ -998,6 +889,20 @@ subroutine icepack_biogeochemistry(dt, & first_ice(n) = .false. + else + if (z_tracers) then + do mm = 1, nbtrcr + do k = 1, nblyr+1 + if (present(flux_bion)) then + flux_bion(mm,n) = flux_bion(mm,n) + trcrn(bio_index(mm) + k-1,n) * & + hin_old(n) * zspace(k)/dt * trcrn(nt_fbri,n) + endif + flux_bio(mm) = flux_bio(mm) + trcrn(bio_index(mm) + k-1,n) * & + vicen_init(n) * zspace(k)/dt * trcrn(nt_fbri,n) + trcrn(bio_index(mm) + k-1,n) = c0 + enddo + enddo + endif endif ! aicen > puny enddo ! ncat @@ -1007,20 +912,10 @@ end subroutine icepack_biogeochemistry !autodocument_start 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) @@ -1029,25 +924,25 @@ subroutine icepack_load_ocean_bio_array(max_nbtrcr, & 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 !autodocument_end @@ -1120,16 +1015,9 @@ end subroutine icepack_load_ocean_bio_array ! 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 @@ -1137,7 +1025,7 @@ subroutine icepack_init_ocean_bio (amm, dmsp, dms, algalN, doc, dic, don, & 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 @@ -1146,7 +1034,7 @@ subroutine icepack_init_ocean_bio (amm, dmsp, dms, algalN, doc, dic, don, & 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 @@ -1160,50 +1048,153 @@ subroutine icepack_init_ocean_bio (amm, dmsp, dms, algalN, doc, dic, don, & character(len=*),parameter :: subname='(icepack_init_ocean_bio)' if (present(CToN)) then - CToN(1) = R_C2N(1) - CToN(2) = R_C2N(2) - CToN(3) = R_C2N(3) + CToN(:) = c0 + CToN(1) = R_C2N(1) + CToN(2) = R_C2N(2) + CToN(3) = R_C2N(3) endif if (present(CToN_DON)) then - CToN_DON(1) = R_C2N_DON(1) + CToN_DON(:) = c0 + CToN_DON(1) = R_C2N_DON(1) endif - amm = c1 ! ISPOL < 1 mmol/m^3 - dmsp = p1 - dms = p1 - algalN(1) = c1 !0.0026_dbl_kind ! ISPOL, Lannuzel 2013(pennate) - algalN(2) = 0.0057_dbl_kind ! ISPOL, Lannuzel 2013(small plankton) - algalN(3) = 0.0027_dbl_kind ! ISPOL, Lannuzel 2013(Phaeocystis) - ! 0.024_dbl_kind ! 5% of 1 mgchl/m^3 - doc(1) = 16.2_dbl_kind ! 18% saccharides - doc(2) = 9.0_dbl_kind ! lipids - doc(3) = c1 ! - do k = 1, max_dic - dic(k) = c1 - enddo - do k = 1, max_don - don(k) = 12.9_dbl_kind - ! 64.3_dbl_kind ! 72% Total DOC~90 mmolC/m^3 ISPOL with N:C of 0.2 - enddo - !ki = 1 - !if (trim(fe_data_type) == 'clim') ki = 2 - do k = 1, max_fe ! ki, max_fe - fed(k) = 0.4_dbl_kind ! c1 (nM) Lannuzel2007 DFe, - ! range 0.14-2.6 (nM) van der Merwe 2011 - ! Tagliabue 2012 (0.4 nM) - fep(k) = c2 ! (nM) van der Merwe 2011 - ! (0.6 to 2.9 nM ocean) - enddo - hum = c1 ! mmol C/m^3 - nit = 12.0_dbl_kind - sil = 25.0_dbl_kind - do k = 1, max_aero - zaeros(k) = c0 - enddo - + if (present(amm)) & + amm = c1 ! ISPOL < 1 mmol/m^3 + if (present(dmsp)) & + dmsp = p1 + if (present(dms)) & + dms = p1 + if (present(algalN)) then + algalN(:) = c0 + algalN(1) = c1 !0.0026_dbl_kind ! ISPOL, Lannuzel 2013(pennate) + algalN(2) = 0.0057_dbl_kind ! ISPOL, Lannuzel 2013(small plankton) + algalN(3) = 0.0027_dbl_kind ! ISPOL, Lannuzel 2013(Phaeocystis) + endif + if (present(doc))then + doc(:) = c0 + doc(1) = 16.2_dbl_kind ! 18% saccharides + doc(2) = 9.0_dbl_kind ! lipids + doc(3) = c1 ! + endif + if (present(dic)) then + dic(:) = c0 + dic(1) = 1950.0_dbl_kind ! 1950-2260 mmol C/m3 (Tynan et al. 2015) + endif + if (present(don)) then + don(:) = c0 + don(1) = 12.9_dbl_kind ! 64.3_dbl_kind ! 72% Total DOC~90 mmolC/m^3 ISPOL with N:C of 0.2 + endif + if (present(fed)) then + fed(:) = c0 + fed(1) = 0.4_dbl_kind ! c1 (nM) Lannuzel2007 DFe,! range 0.14-2.6 (nM) van der Merwe 2011 + ! Tagliabue 2012 (0.4 nM) + endif + if (present(fep)) then + fep(:) = c0 + fep(1) = c2 ! (nM) van der Merwe 2011 + ! (0.6 to 2.9 nM ocean) + endif + if (present(hum)) & + hum = c1 ! mmol C/m^3 + if (present(nit)) & + nit = 12.0_dbl_kind + if (present(sil)) & + sil = 25.0_dbl_kind + if (present(zaeros)) & + zaeros(:) = c0 end subroutine icepack_init_ocean_bio +! +!======================================================================= +! +! Given some added new ice to the base of the existing ice, recalculate +! vertical bio tracer so that new grid cells are all the same size. +! +! author: N. Jeffery, LANL +! date : Mar 3, 2024 +! +! Based on update_vertical_tracers modified for vertical biogeochemistry +! + subroutine update_vertical_bio_tracers(nbiolyr, trc, h1, h2, trc0, zspace) + + integer (kind=int_kind), intent(in) :: & + nbiolyr ! number of bio layers nblyr+1 + + real (kind=dbl_kind), dimension(:), intent(inout) :: & + trc ! vertical tracer + + real (kind=dbl_kind), intent(in) :: & + h1, & ! old thickness + h2, & ! new thickness + trc0 ! tracer value of added ice on ice bottom + + real (kind=dbl_kind), dimension(nbiolyr), intent(in) :: & + zspace + + ! local variables + + real(kind=dbl_kind), dimension(nbiolyr) :: trc2 ! updated tracer temporary + + ! vertical indices for old and new grid + integer :: k1, k2 + + real (kind=dbl_kind) :: & + z1a, z1b, & ! upper, lower boundary of old cell/added new ice at bottom + z2a, z2b, & ! upper, lower boundary of new cell + overlap , & ! overlap between old and new cell + rnilyr + + !rnilyr = real(nilyr,dbl_kind) + z2a = c0 + z2b = c0 + if (h2 > puny) then + ! loop over new grid cells + do k2 = 1, nbiolyr + + ! initialize new tracer + trc2(k2) = c0 + + ! calculate upper and lower boundary of new cell + z2a = z2b !((k2 - 1) * h2) * zspace(k2)+z2b ! / rnilyr + z2b = z2b + h2 * zspace(k2) !(k2 * h2) * zspace(k2)+z2a !/ rnilyr + + z1a = c0 + z1b = c0 + ! loop over old grid cells + do k1 = 1, nbiolyr + + ! calculate upper and lower boundary of old cell + z1a = z1b !((k1 - 1) * h1) * zspace(k1)+z1b !/ rnilyr + z1b = z1b + h1 * zspace(k1) !(k1 * h1) * zspace(k1)+z1a !/ rnilyr + + ! calculate overlap between old and new cell + overlap = max(min(z1b, z2b) - max(z1a, z2a), c0) + + ! aggregate old grid cell contribution to new cell + trc2(k2) = trc2(k2) + overlap * trc(k1) + + enddo ! k1 + + ! calculate upper and lower boundary of added new ice at bottom + z1a = h1 + z1b = h2 + + ! calculate overlap between added ice and new cell + overlap = max(min(z1b, z2b) - max(z1a, z2a), c0) + ! aggregate added ice contribution to new cell + trc2(k2) = trc2(k2) + overlap * trc0 + ! renormalize new grid cell + trc2(k2) = trc2(k2)/zspace(k2)/h2 !(rnilyr * trc2(k2)) / h2 + + enddo ! k2 + else + trc2 = trc + endif + ! update vertical tracer array with the adjusted tracer + trc = trc2 + + end subroutine update_vertical_bio_tracers !======================================================================= diff --git a/columnphysics/icepack_zbgc_shared.F90 b/columnphysics/icepack_zbgc_shared.F90 index 757044a8..08c6753d 100644 --- a/columnphysics/icepack_zbgc_shared.F90 +++ b/columnphysics/icepack_zbgc_shared.F90 @@ -14,9 +14,11 @@ module icepack_zbgc_shared use icepack_parameters, only: rhoi, cp_ocn, cp_ice, Lfresh use icepack_parameters, only: solve_zbgc use icepack_parameters, only: fr_resp - use icepack_tracers, only: max_nbtrcr, max_algae, max_doc - use icepack_tracers, only: max_don - use icepack_tracers, only: nt_bgc_N, nt_fbri + use icepack_tracers, only: nbtrcr, ntrcr, nblyr, nilyr, nslyr + use icepack_tracers, only: n_algae + use icepack_tracers, only: max_nbtrcr, max_algae, max_doc, max_fe + use icepack_tracers, only: max_don, max_aero, max_dic + use icepack_tracers, only: nt_bgc_N, nt_fbri, nlt_bgc_N use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -57,7 +59,7 @@ module icepack_zbgc_shared real (kind=dbl_kind), dimension(max_don), public :: & ! increase compare to algal R_Fe2C R_C2N_DON - real (kind=dbl_kind), dimension(max_algae), public :: & + real (kind=dbl_kind), dimension(max_algae), public :: & R_Si2N , & ! algal Sil to N (mole/mole) R_S2N , & ! algal S to N (mole/mole) ! Marchetti et al 2006, 3 umol Fe/mol C for iron limited Pseudo-nitzschia @@ -100,6 +102,15 @@ module icepack_zbgc_shared ! general biogeochemistry !----------------------------------------------------------------- + real (kind=dbl_kind), parameter, dimension(max_algae), public :: & + graze_exponent = (/ 0.333_dbl_kind, c1, c1/) ! Implicit grazing exponent (Dunneet al. 2005) + + real (kind=dbl_kind), parameter, public :: & + graze_conc = 1.36_dbl_kind, & ! (mmol N/m^3) converted from Dunne et al 2005 + ! data fit for phytoplankton (1.9 mmol C/m^3) to + ! ice algal N with 20% porosity and C/N = 7 + large_bgc = 1.0e8_dbl_kind ! warning value for large bgc concentrations (mmol/m^3) + real (kind=dbl_kind), dimension(max_nbtrcr), public :: & zbgc_frac_init,&! initializes mobile fraction bgc_tracer_type ! described tracer in mobile or stationary phases @@ -141,6 +152,29 @@ module icepack_zbgc_shared f_exude , & ! fraction of exuded carbon to each DOC pool k_bac ! Bacterial degredation of DOC (1/d) + ! polysaccharids, lipids, proteins+nucleic acids (Lonborg et al. 2020) + real (kind=dbl_kind), dimension(max_doc), parameter, public :: & + doc_pool_fractions = (/0.26_dbl_kind, 0.17_dbl_kind, 0.57_dbl_kind/) + + real (kind=dbl_kind), dimension(max_algae), public :: & + algaltype ! mobility type for algae + + real (kind=dbl_kind), dimension(max_doc), public :: & + doctype ! mobility type for DOC + + real (kind=dbl_kind), dimension(max_dic), public :: & + dictype ! mobility type for DIC + + real (kind=dbl_kind), dimension(max_don), public :: & + dontype ! mobility type for DON + + real (kind=dbl_kind), dimension(max_fe), public :: & + fedtype, & ! mobility type for iron + feptype + + real (kind=dbl_kind), dimension(max_aero), public :: & + zaerotype ! mobility type for aerosols + !----------------------------------------------------------------- ! brine !----------------------------------------------------------------- @@ -163,6 +197,13 @@ module icepack_zbgc_shared Dm = 1.0e-9_dbl_kind, & ! molecular diffusion (m^2/s) Ra_c = 0.05_dbl_kind ! critical Rayleigh number for bottom convection + real (kind=dbl_kind), dimension (:), allocatable, public :: & + bgrid , & ! biology nondimensional vertical grid points + igrid , & ! biology vertical interface points + cgrid , & ! CICE vertical coordinate + icgrid , & ! interface grid for CICE (shortwave variable) + swgrid ! grid for ice tracers used in dEdd scheme + !======================================================================= contains @@ -397,15 +438,10 @@ end subroutine zap_small_bgc subroutine regrid_stationary (C_stationary, hbri_old, & hbri, dt, & - ntrcr, nblyr, & top_conc, igrid, & flux_bio, & melt_b, con_gel) - integer (kind=int_kind), intent(in) :: & - ntrcr, & ! number of tracers - nblyr ! number of bio layers - real (kind=dbl_kind), intent(inout) :: & flux_bio ! ocean tracer flux (mmol/m^2/s) positive into ocean @@ -548,13 +584,12 @@ end subroutine regrid_stationary ! Aggregate flux information from all ice thickness categories ! for z layer biogeochemistry ! - subroutine merge_bgc_fluxes (dt, nblyr, & - nslyr, & - bio_index, n_algae, & - nbtrcr, aicen, & + subroutine merge_bgc_fluxes (dt, & + bio_index, & + aicen, & vicen, vsnon, & - iphin, & - trcrn, & + iphin, & + trcrn, aice_init, & flux_bion, flux_bio, & upNOn, upNHn, & upNO, upNH, & @@ -562,28 +597,29 @@ subroutine merge_bgc_fluxes (dt, nblyr, & zbgc_snow, zbgc_atm, & PP_net, ice_bio_net,& snow_bio_net, grow_alg, & - grow_net) + grow_net, totalChla, & + iTin, iSin, & + bioPorosityIceCell, & + bioSalinityIceCell, & + bioTemperatureIceCell) real (kind=dbl_kind), intent(in) :: & dt ! timestep (s) - integer (kind=int_kind), intent(in) :: & - nblyr , & ! number of bio layers - nslyr , & ! number of snow layers - n_algae , & ! number of algal tracers - nbtrcr ! number of biology tracer tracers - integer (kind=int_kind), dimension(:), intent(in) :: & bio_index ! relates bio indices, ie. nlt_bgc_N to nt_bgc_N real (kind=dbl_kind), dimension (:), intent(in) :: & trcrn , & ! input tracer fields - iphin ! porosity + iphin , & ! porosity + iTin , & ! temperature per cat on vertical bio interface points (oC) + iSin ! salinity per cat on vertical bio interface points (ppt) real (kind=dbl_kind), intent(in):: & aicen , & ! concentration of ice vicen , & ! volume of ice (m) - vsnon ! volume of snow(m) + vsnon , & ! volume of snow(m) + aice_init ! initial concentration of ice ! single category rates real (kind=dbl_kind), dimension(:), intent(in):: & @@ -605,6 +641,11 @@ subroutine merge_bgc_fluxes (dt, nblyr, & ice_bio_net, & ! integrated ice tracers mmol or mg/m^2) snow_bio_net ! integrated snow tracers mmol or mg/m^2) + real (kind=dbl_kind), optional, dimension(:), intent(inout):: & + bioPorosityIceCell, & ! average cell porosity on interface points + bioSalinityIceCell, & ! average cell salinity on interface points (ppt) + bioTemperatureIceCell ! average cell temperature on interface points (oC) + ! cumulative variables and rates real (kind=dbl_kind), intent(inout):: & PP_net , & ! net PP (mg C/m^2/d) times aice @@ -612,6 +653,10 @@ subroutine merge_bgc_fluxes (dt, nblyr, & upNO , & ! tot nitrate uptake rate (mmol/m^2/d) times aice upNH ! tot ammonium uptake rate (mmol/m^2/d) times aice + ! cumulative variables and rates + real (kind=dbl_kind), optional, intent(inout):: & + totalChla ! total Chla (mg chla/m^2) + ! local variables real (kind=dbl_kind) :: & @@ -645,18 +690,25 @@ subroutine merge_bgc_fluxes (dt, nblyr, & !----------------------------------------------------------------- ! Merge fluxes !----------------------------------------------------------------- - dvssl = min(p5*vsnon/real(nslyr,kind=dbl_kind), hs_ssl*aicen) ! snow surface layer - dvint = vsnon - dvssl ! snow interior + dvssl = p5*vsnon/real(nslyr,kind=dbl_kind) !snow surface layer + dvint = vsnon - dvssl ! snow interior snow_bio_net(mm) = snow_bio_net(mm) & + trcrn(bio_index(mm)+nblyr+1)*dvssl & + trcrn(bio_index(mm)+nblyr+2)*dvint flux_bio (mm) = flux_bio (mm) + flux_bion (mm)*aicen zbgc_snow (mm) = zbgc_snow(mm) + zbgc_snown(mm)*aicen/dt zbgc_atm (mm) = zbgc_atm (mm) + zbgc_atmn (mm)*aicen/dt - enddo ! mm + enddo ! mm + ! diagnostics : mean cell bio interface grid profiles + do k = 1, nblyr+1 + if (present(bioPorosityIceCell)) bioPorosityIceCell(k) = bioPorosityIceCell(k) + iphin(k)*vicen + if (present(bioSalinityIceCell)) bioSalinityIceCell(k) = bioSalinityIceCell(k) + iSin(k)*vicen + if (present(bioTemperatureIceCell)) bioTemperatureIceCell(k) = bioTemperatureIceCell(k) + iTin(k)*vicen + end do if (solve_zbgc) then do mm = 1, n_algae + if (present(totalChla)) totalChla = totalChla + ice_bio_net(nlt_bgc_N(mm))*R_chl2N(mm) do k = 1, nblyr+1 tmp = iphin(k)*trcrn(nt_fbri)*vicen*zspace(k)*secday PP_net = PP_net + grow_alg(k,mm)*tmp & @@ -678,7 +730,7 @@ end subroutine merge_bgc_fluxes ! ! author: Elizabeth C. Hunke and William H. Lipscomb, LANL - subroutine merge_bgc_fluxes_skl (nbtrcr, n_algae, & + subroutine merge_bgc_fluxes_skl ( & aicen, trcrn, & flux_bion, flux_bio, & PP_net, upNOn, & @@ -686,10 +738,6 @@ subroutine merge_bgc_fluxes_skl (nbtrcr, n_algae, & upNH, grow_net, & grow_alg) - integer (kind=int_kind), intent(in) :: & - nbtrcr , & ! number of bgc tracers - n_algae ! number of autotrophs - ! single category fluxes real (kind=dbl_kind), intent(in):: & aicen ! category ice area fraction diff --git a/configuration/driver/icedrv_InitMod.F90 b/configuration/driver/icedrv_InitMod.F90 index 107ffdc7..c077a920 100644 --- a/configuration/driver/icedrv_InitMod.F90 +++ b/configuration/driver/icedrv_InitMod.F90 @@ -13,7 +13,7 @@ module icedrv_InitMod use icepack_intfc, only: icepack_query_parameters, icepack_query_tracer_flags 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 + use icedrv_system, only: icedrv_system_abort, icedrv_system_flush implicit none private @@ -81,14 +81,14 @@ subroutine icedrv_initialize call init_calendar ! initialize some calendar stuff call init_coupler_flux ! initialize fluxes exchanged with coupler call init_thermo_vertical ! initialize vertical thermodynamics - call icepack_init_itd(ncat=ncat, hin_max=hin_max) + call icepack_init_itd(hin_max=hin_max) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted(subname)) then call icedrv_system_abort(file=__FILE__,line=__LINE__) endif - call icepack_init_itd_hist(ncat=ncat, c_hi_range=c_hi_range, hin_max=hin_max) ! output + call icepack_init_itd_hist(c_hi_range=c_hi_range, hin_max=hin_max) ! output call icepack_query_tracer_flags(tr_fsd_out=tr_fsd) call icepack_warnings_flush(nu_diag) @@ -98,7 +98,6 @@ subroutine icedrv_initialize if (tr_fsd) then call icepack_init_fsd_bounds( & - nfsd=nfsd, & ! floe size distribution floe_rad_l=floe_rad_l, & ! fsd size lower bound in m (radius) floe_rad_c=floe_rad_c, & ! fsd size bin centre in m (radius) floe_binwidth=floe_binwidth, & ! fsd size bin width in m (radius) @@ -166,6 +165,8 @@ subroutine icedrv_initialize call init_flux_atm_ocn ! initialize atmosphere, ocean fluxes + call icedrv_system_flush(nu_diag) + end subroutine icedrv_initialize !======================================================================= @@ -234,8 +235,7 @@ subroutine init_restart !----------------------------------------------------------------- do i = 1, nx if (tmask(i)) & - call icepack_aggregate(ncat=ncat, & - aicen=aicen(i,:), & + call icepack_aggregate(aicen=aicen(i,:), & vicen=vicen(i,:), & vsnon=vsnon(i,:), & trcrn=trcrn(i,:,:), & @@ -244,7 +244,6 @@ subroutine init_restart vsno=vsno (i), & trcr=trcr (i,:), & aice0=aice0(i), & - ntrcr=max_ntrcr, & trcr_depend=trcr_depend, & trcr_base=trcr_base, & n_trcr_strata=n_trcr_strata, & diff --git a/configuration/driver/icedrv_MAIN.F90 b/configuration/driver/icedrv_MAIN.F90 index 8d76f63c..c8564d4e 100644 --- a/configuration/driver/icedrv_MAIN.F90 +++ b/configuration/driver/icedrv_MAIN.F90 @@ -30,11 +30,12 @@ program icedrv use icedrv_constants, only: ice_stdout, nu_diag, nu_diag_out use icedrv_domain_size, only: nx use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted - use icedrv_system, only: icedrv_system_abort + use icedrv_system, only: icedrv_system_abort, icedrv_system_flush implicit none integer n + logical openflag character(len=*), parameter :: subname='(icedrv)' !----------------------------------------------------------------- @@ -55,10 +56,24 @@ program icedrv write(ice_stdout, *) "ICEPACK COMPLETED SUCCESSFULLY " - close (ice_stdout) - close (nu_diag) + inquire(unit=ice_stdout,opened=openflag) + if (openflag) then + call icedrv_system_flush(ice_stdout) + close (ice_stdout) + endif + + inquire(unit=nu_diag,opened=openflag) + if (openflag) then + call icedrv_system_flush(nu_diag) + close (nu_diag) + endif + do n = 1, nx - close (nu_diag_out+n-1) + inquire(unit=nu_diag_out+n-1,opened=openflag) + if (openflag) then + call icedrv_system_flush(nu_diag_out+n-1) + close (nu_diag_out+n-1) + endif enddo end program icedrv diff --git a/configuration/driver/icedrv_RunMod.F90 b/configuration/driver/icedrv_RunMod.F90 index e20ebf87..a7bc82bd 100644 --- a/configuration/driver/icedrv_RunMod.F90 +++ b/configuration/driver/icedrv_RunMod.F90 @@ -13,7 +13,7 @@ module icedrv_RunMod use icepack_intfc, only: icepack_query_parameters use icepack_intfc, only: icepack_query_tracer_flags use icepack_intfc, only: icepack_query_tracer_sizes - use icedrv_system, only: icedrv_system_abort + use icedrv_system, only: icedrv_system_abort, icedrv_system_flush implicit none private @@ -83,6 +83,8 @@ subroutine icedrv_run call init_flux_atm_ocn ! initialize atmosphere, ocean fluxes + call icedrv_system_flush(nu_diag) + enddo timeLoop end subroutine icedrv_run diff --git a/configuration/driver/icedrv_arrays_column.F90 b/configuration/driver/icedrv_arrays_column.F90 index 61017c6b..b55f129f 100644 --- a/configuration/driver/icedrv_arrays_column.F90 +++ b/configuration/driver/icedrv_arrays_column.F90 @@ -122,17 +122,6 @@ module icedrv_arrays_column ! biogeochemistry components - real (kind=dbl_kind), dimension (nblyr+2), public :: & - bgrid ! biology nondimensional vertical grid points - - real (kind=dbl_kind), dimension (nblyr+1), public :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), public :: & - cgrid , & ! CICE vertical coordinate - icgrid , & ! interface grid for CICE (shortwave variable) - swgrid ! grid for ice tracers used in dEdd scheme - real (kind=dbl_kind), dimension (nx,ncat), public :: & first_ice_real ! .true. = c1, .false. = c0 @@ -209,10 +198,6 @@ module icedrv_arrays_column chl_net , & ! Total chla (mg chla/m^2) per grid cell NO_net ! Total nitrate per grid cell - real (kind=dbl_kind), & - dimension (nx,ncat), public :: & - sice_rho ! avg sea ice density (kg/m^3) ! ech: diagnostic only? - real (kind=dbl_kind), dimension (nx,nblyr+1,ncat), public :: & zfswin ! Shortwave flux into layers interpolated on bio grid (W/m^2) diff --git a/configuration/driver/icedrv_diagnostics.F90 b/configuration/driver/icedrv_diagnostics.F90 index eaa44d5e..4ca0cb82 100644 --- a/configuration/driver/icedrv_diagnostics.F90 +++ b/configuration/driver/icedrv_diagnostics.F90 @@ -14,7 +14,7 @@ module icedrv_diagnostics use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted use icepack_intfc, only: icepack_query_parameters use icepack_intfc, only: icepack_query_tracer_flags, icepack_query_tracer_indices - use icedrv_system, only: icedrv_system_abort + use icedrv_system, only: icedrv_system_abort, icedrv_system_flush implicit none private @@ -267,6 +267,7 @@ subroutine runtime_diags (dt) write(nu_diag_out+n-1,901) 'isotopic conc chg = ',pdiso(n,k),k enddo endif + call icedrv_system_flush(nu_diag_out+n-1) end do 899 format (43x,a24) 900 format (a25,2x,f24.17) @@ -612,6 +613,7 @@ subroutine print_state(plabel,i) write(nu_diag,*) ' ' call icepack_warnings_flush(nu_diag) + call icedrv_system_flush(nu_diag) end subroutine print_state diff --git a/configuration/driver/icedrv_domain_size.F90 b/configuration/driver/icedrv_domain_size.F90 index 75bb4d28..51404555 100644 --- a/configuration/driver/icedrv_domain_size.F90 +++ b/configuration/driver/icedrv_domain_size.F90 @@ -34,7 +34,6 @@ module icedrv_domain_size ! *** add to kscavz in icepack_zbgc_shared.F90 n_bgc = (n_algae*2 + n_doc + n_dic + n_don + n_fed + n_fep + n_zaero & + 8) , & ! nit, am, sil, dmspp, dmspd, dms, pon, humic - nltrcr = (n_bgc*TRBGCZ)*TRBRI, & ! number of zbgc (includes zaero) max_nsw = (nilyr+nslyr+2) & ! total chlorophyll plus aerosols * (1+TRZAERO),& ! number of tracers active in shortwave calculation max_ntrcr = 1 & ! 1 = surface temperature diff --git a/configuration/driver/icedrv_init.F90 b/configuration/driver/icedrv_init.F90 index b6428410..ac187349 100644 --- a/configuration/driver/icedrv_init.F90 +++ b/configuration/driver/icedrv_init.F90 @@ -21,7 +21,7 @@ module icedrv_init use icepack_intfc, only: icepack_query_tracer_sizes use icepack_intfc, only: icepack_query_tracer_indices use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted - use icedrv_system, only: icedrv_system_abort + use icedrv_system, only: icedrv_system_abort, icedrv_system_flush implicit none private @@ -925,6 +925,8 @@ subroutine input_data write(nu_diag,1020) 'nx = ', nx write(nu_diag,*)' ' + call icedrv_system_flush(nu_diag) + 1000 format (a30,2x,f9.2) ! a30 to align formatted, unformatted statements 1005 format (a30,2x,f10.6) ! float 1010 format (a30,2x,l6) ! logical @@ -1253,8 +1255,7 @@ subroutine init_state enddo if (tmask(i)) & - call icepack_aggregate(ncat=ncat, & - trcrn=trcrn(i,1:ntrcr,:), & + call icepack_aggregate(trcrn=trcrn(i,1:ntrcr,:), & aicen=aicen(i,:), & vicen=vicen(i,:), & vsnon=vsnon(i,:), & @@ -1263,7 +1264,6 @@ subroutine init_state vice=vice (i), & vsno=vsno (i), & aice0=aice0(i), & - ntrcr=ntrcr, & trcr_depend=trcr_depend(1:ntrcr), & trcr_base=trcr_base (1:ntrcr,:), & n_trcr_strata=n_trcr_strata(1:ntrcr), & @@ -1436,11 +1436,10 @@ subroutine set_state_var (nx, & Sprofile = salinz(i,:), & Tprofile = Tmltz(i,:), & Tsfc = Tsfc, & - nilyr=nilyr, nslyr=nslyr, & qin=qin(:), qsn=qsn(:)) ! floe size distribution - if (tr_fsd) call icepack_init_fsd(nfsd=nfsd, ice_ic=ice_ic, & + if (tr_fsd) call icepack_init_fsd(ice_ic=ice_ic, & floe_rad_c=floe_rad_c, & floe_binwidth=floe_binwidth, & afsd=trcrn(i,nt_fsd:nt_fsd+nfsd-1,n)) @@ -1508,10 +1507,9 @@ subroutine set_state_var (nx, & Sprofile = salinz(i,:), & Tprofile = Tmltz(i,:), & Tsfc = Tsfc, & - nilyr=nilyr, nslyr=nslyr, & qin=qin(:), qsn=qsn(:)) ! floe size distribution - if (tr_fsd) call icepack_init_fsd(nfsd=nfsd, ice_ic=ice_ic, & + if (tr_fsd) call icepack_init_fsd(ice_ic=ice_ic, & floe_rad_c=floe_rad_c, & floe_binwidth=floe_binwidth, & afsd=trcrn(i,nt_fsd:nt_fsd+nfsd-1,n)) diff --git a/configuration/driver/icedrv_init_column.F90 b/configuration/driver/icedrv_init_column.F90 index 9a22a5ff..ef2754b8 100644 --- a/configuration/driver/icedrv_init_column.F90 +++ b/configuration/driver/icedrv_init_column.F90 @@ -29,7 +29,7 @@ module icedrv_init_column use icepack_intfc, only: icepack_init_bgc use icepack_intfc, only: icepack_init_ocean_bio, icepack_load_ocean_bio_array use icepack_intfc, only: icepack_init_hbrine - use icedrv_system, only: icedrv_system_abort + use icedrv_system, only: icedrv_system_abort, icedrv_system_flush implicit none @@ -69,7 +69,7 @@ subroutine init_thermo_vertical !----------------------------------------------------------------- call icepack_query_parameters(depressT_out=depressT) - call icepack_init_thermo(nilyr=nilyr, sprofile=sprofile) + call icepack_init_thermo(sprofile=sprofile) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & file=__FILE__, line=__LINE__) @@ -99,7 +99,6 @@ subroutine init_shortwave use icedrv_arrays_column, only: fswsfcn, ffracn, snowfracn use icedrv_arrays_column, only: fswthrun, fswthrun_vdr, fswthrun_vdf, fswthrun_idr, fswthrun_idf use icedrv_arrays_column, only: fswintn, albpndn, apeffn, trcrn_sw, dhsn - use icedrv_arrays_column, only: swgrid, igrid use icedrv_calendar, only: istep1, dt, yday, sec use icedrv_system, only: icedrv_system_abort use icedrv_forcing, only: snw_ssp_table @@ -247,8 +246,6 @@ subroutine init_shortwave if (tmask(i)) then call icepack_step_radiation ( & dt=dt, & - swgrid=swgrid(:), & - igrid=igrid(:), & fbri=fbri(:), & aicen=aicen(i,:), & vicen=vicen(i,:), & @@ -368,7 +365,7 @@ subroutine init_bgc() use icedrv_arrays_column, only: zfswin, trcrn_sw use icedrv_arrays_column, only: ocean_bio_all, ice_bio_net, snow_bio_net - use icedrv_arrays_column, only: cgrid, igrid, bphi, iDi, bTiz, iki + use icedrv_arrays_column, only: bphi, iDi, bTiz, iki use icedrv_calendar, only: istep1 use icedrv_system, only: icedrv_system_abort use icedrv_flux, only: sss, nit, amm, sil, dmsp, dms, algalN, & @@ -439,9 +436,7 @@ subroutine init_bgc() fed=fed(i,:), fep =fep(i,:), hum=hum(i), & nit=nit(i), sil =sil(i), & zaeros=zaeros(i,:), & - algalN=algalN(i,:), & - max_dic=max_dic, max_don =max_don, & - max_fe =max_fe, max_aero=max_aero) + algalN=algalN(i,:)) enddo ! i call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & @@ -451,9 +446,7 @@ subroutine init_bgc() do i = 1, nx - call icepack_load_ocean_bio_array(max_nbtrcr=max_nbtrcr, & - max_algae=max_algae, max_don=max_don, max_doc=max_doc, & - max_aero =max_aero, max_dic=max_dic, max_fe =max_fe, & + call icepack_load_ocean_bio_array( & nit =nit(i), amm=amm(i), sil =sil(i), & dmsp=dmsp(i), dms=dms(i), algalN=algalN(i,:), & doc =doc(i,:), don=don(i,:), dic =dic(i,:), & @@ -476,10 +469,10 @@ subroutine init_bgc() enddo enddo - call icepack_init_bgc(ncat=ncat, nblyr=nblyr, nilyr=nilyr, ntrcr_o=ntrcr_o, & - cgrid=cgrid, igrid=igrid, ntrcr=ntrcr, nbtrcr=nbtrcr, & - sicen=sicen(:,:), trcrn=trcrn_bgc(:,:), & + call icepack_init_bgc( & + sicen=sicen(:,:), trcrn=trcrn_bgc(:,:), & sss=sss(i), ocean_bio_all=ocean_bio_all(i,:)) +! optional DOCPoolFractions=DOCPoolFractions) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(i, istep1, subname, & __FILE__, __LINE__) @@ -493,8 +486,7 @@ end subroutine init_bgc subroutine init_hbrine() - use icedrv_arrays_column, only: first_ice, bgrid, igrid, cgrid - use icedrv_arrays_column, only: icgrid, swgrid + use icedrv_arrays_column, only: first_ice use icedrv_state, only: trcrn real (kind=dbl_kind) :: phi_snow @@ -515,8 +507,7 @@ subroutine init_hbrine() !----------------------------------------------------------------- - call icepack_init_hbrine(bgrid=bgrid, igrid=igrid, cgrid=cgrid, icgrid=icgrid, & - swgrid=swgrid, nblyr=nblyr, nilyr=nilyr, phi_snow=phi_snow) + call icepack_init_hbrine(phi_snow=phi_snow) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & file=__FILE__, line=__LINE__) @@ -618,9 +609,6 @@ subroutine init_zbgc tr_bgc_DON, tr_bgc_Fe, tr_zaero, & tr_bgc_hum, tr_aero - integer (kind=int_kind) :: & - ktherm - logical (kind=log_kind) :: & solve_zsal, skl_bgc, z_tracers, scale_bgc, solve_zbgc, dEdd_algae, & modal_aero, restore_bgc @@ -629,7 +617,7 @@ subroutine init_zbgc bgc_flux_type real (kind=dbl_kind) :: & - grid_o, l_sk, initbio_frac, & + grid_o, grid_o_t, l_sk, initbio_frac, & frazil_scav, grid_oS, l_skS, & phi_snow, & ratio_Si2N_diatoms , ratio_Si2N_sp , ratio_Si2N_phaeo , & @@ -663,6 +651,7 @@ subroutine init_zbgc algaltype_diatoms , algaltype_sp , algaltype_phaeo , & nitratetype , ammoniumtype , silicatetype , & dmspptype , dmspdtype , humtype , & + dictype_1 , & doctype_s , doctype_l , dontype_protein , & fedtype_1 , feptype_1 , zaerotype_bc1 , & zaerotype_bc2 , zaerotype_dust1 , zaerotype_dust2 , & @@ -779,10 +768,10 @@ subroutine init_zbgc namelist /zbgc_nml/ & tr_brine, tr_zaero, modal_aero, skl_bgc, & z_tracers, dEdd_algae, solve_zbgc, bgc_flux_type, & - restore_bgc, scale_bgc, solve_zsal, bgc_data_type, & + restore_bgc, scale_bgc, solve_zsal, & tr_bgc_Nit, tr_bgc_C, tr_bgc_chl, tr_bgc_Am, tr_bgc_Sil, & tr_bgc_DMS, tr_bgc_PON, tr_bgc_hum, tr_bgc_DON, tr_bgc_Fe, & - grid_o, l_sk, grid_oS, & + grid_o, grid_o_t, l_sk, grid_oS, & l_skS, phi_snow, initbio_frac, frazil_scav, & ratio_Si2N_diatoms , ratio_Si2N_sp , ratio_Si2N_phaeo , & ratio_S2N_diatoms , ratio_S2N_sp , ratio_S2N_phaeo , & @@ -815,6 +804,7 @@ subroutine init_zbgc algaltype_diatoms , algaltype_sp , algaltype_phaeo , & nitratetype , ammoniumtype , silicatetype , & dmspptype , dmspdtype , humtype , & + dictype_1 , & doctype_s , doctype_l , dontype_protein , & fedtype_1 , feptype_1 , zaerotype_bc1 , & zaerotype_bc2 , zaerotype_dust1 , zaerotype_dust2 , & @@ -828,20 +818,138 @@ subroutine init_zbgc !----------------------------------------------------------------- call icepack_query_tracer_sizes(ntrcr_out=ntrcr) - call icepack_query_tracer_flags(tr_aero_out=tr_aero) - call icepack_query_parameters(ktherm_out=ktherm, shortwave_out=shortwave, & + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & + file=__FILE__, line=__LINE__) + + call icepack_query_parameters(shortwave_out=shortwave, & scale_bgc_out=scale_bgc, skl_bgc_out=skl_bgc, z_tracers_out=z_tracers, & - dEdd_algae_out=dEdd_algae, solve_zbgc_out=solve_zbgc, phi_snow_out=phi_snow, & + dEdd_algae_out=dEdd_algae, solve_zbgc_out=solve_zbgc, grid_o_t_out=grid_o_t, & bgc_flux_type_out=bgc_flux_type, grid_o_out=grid_o, l_sk_out=l_sk, & initbio_frac_out=initbio_frac, frazil_scav_out=frazil_scav, & + grid_oS_out=grid_oS, l_skS_out=l_skS, phi_snow_out=phi_snow, & algal_vel_out=algal_vel, R_dFe2dust_out=R_dFe2dust, & dustFe_sol_out=dustFe_sol, T_max_out=T_max, fsal_out=fsal, & op_dep_min_out=op_dep_min, fr_graze_s_out=fr_graze_s, & fr_graze_e_out=fr_graze_e, fr_mort2min_out=fr_mort2min, & fr_dFe_out=fr_dFe, k_nitrif_out=k_nitrif, t_iron_conv_out=t_iron_conv, & - max_loss_out=max_loss, max_dfe_doc1_out=max_dfe_doc1, & + max_loss_out=max_loss, max_dfe_doc1_out=max_dfe_doc1, fr_resp_out=fr_resp, & fr_resp_s_out=fr_resp_s, y_sk_DMS_out=y_sk_DMS, t_sk_conv_out=t_sk_conv, & - t_sk_ox_out=t_sk_ox) + t_sk_ox_out=t_sk_ox, modal_aero_out=modal_aero, solve_zsal_out = solve_zsal) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & + file=__FILE__, line=__LINE__) + + call icepack_query_parameters ( & + ratio_Si2N_diatoms_out = ratio_Si2N_diatoms, & + ratio_Si2N_sp_out = ratio_Si2N_sp , & + ratio_Si2N_phaeo_out = ratio_Si2N_phaeo , & + ratio_S2N_diatoms_out = ratio_S2N_diatoms , & + ratio_S2N_sp_out = ratio_S2N_sp , & + ratio_S2N_phaeo_out = ratio_S2N_phaeo , & + ratio_Fe2C_diatoms_out = ratio_Fe2C_diatoms, & + ratio_Fe2C_sp_out = ratio_Fe2C_sp , & + ratio_Fe2C_phaeo_out = ratio_Fe2C_phaeo , & + ratio_Fe2N_diatoms_out = ratio_Fe2N_diatoms, & + ratio_Fe2N_sp_out = ratio_Fe2N_sp , & + ratio_Fe2N_phaeo_out = ratio_Fe2N_phaeo , & + ratio_C2N_diatoms_out = ratio_C2N_diatoms , & + ratio_C2N_sp_out = ratio_C2N_sp , & + ratio_C2N_phaeo_out = ratio_C2N_phaeo , & + ratio_C2N_proteins_out = ratio_C2N_proteins, & + ratio_chl2N_diatoms_out = ratio_chl2N_diatoms, & + ratio_chl2N_sp_out = ratio_chl2N_sp , & + ratio_chl2N_phaeo_out = ratio_chl2N_phaeo , & + ratio_Fe2DON_out = ratio_Fe2DON , & + ratio_Fe2DOC_s_out = ratio_Fe2DOC_s , & + ratio_Fe2DOC_l_out = ratio_Fe2DOC_l , & + F_abs_chl_diatoms_out = F_abs_chl_diatoms , & + F_abs_chl_sp_out = F_abs_chl_sp , & + F_abs_chl_phaeo_out = F_abs_chl_phaeo , & + tau_min_out = tau_min , & + tau_max_out = tau_max , & + chlabs_diatoms_out = chlabs_diatoms , & + chlabs_sp_out = chlabs_sp , & + chlabs_phaeo_out = chlabs_phaeo , & + alpha2max_low_diatoms_out = alpha2max_low_diatoms, & + alpha2max_low_sp_out = alpha2max_low_sp , & + alpha2max_low_phaeo_out = alpha2max_low_phaeo, & + beta2max_diatoms_out = beta2max_diatoms , & + beta2max_sp_out = beta2max_sp , & + beta2max_phaeo_out = beta2max_phaeo , & + mu_max_diatoms_out = mu_max_diatoms , & + mu_max_sp_out = mu_max_sp , & + mu_max_phaeo_out = mu_max_phaeo , & + grow_Tdep_diatoms_out = grow_Tdep_diatoms , & + grow_Tdep_sp_out = grow_Tdep_sp , & + grow_Tdep_phaeo_out = grow_Tdep_phaeo , & + fr_graze_diatoms_out = fr_graze_diatoms , & + fr_graze_sp_out = fr_graze_sp , & + fr_graze_phaeo_out = fr_graze_phaeo , & + mort_pre_diatoms_out = mort_pre_diatoms , & + mort_pre_sp_out = mort_pre_sp , & + mort_pre_phaeo_out = mort_pre_phaeo , & + mort_Tdep_diatoms_out = mort_Tdep_diatoms , & + mort_Tdep_sp_out = mort_Tdep_sp , & + mort_Tdep_phaeo_out = mort_Tdep_phaeo , & + k_exude_diatoms_out = k_exude_diatoms , & + k_exude_sp_out = k_exude_sp , & + k_exude_phaeo_out = k_exude_phaeo , & + K_Nit_diatoms_out = K_Nit_diatoms , & + K_Nit_sp_out = K_Nit_sp , & + K_Nit_phaeo_out = K_Nit_phaeo , & + K_Am_diatoms_out = K_Am_diatoms , & + K_Am_sp_out = K_Am_sp , & + K_Am_phaeo_out = K_Am_phaeo , & + K_Sil_diatoms_out = K_Sil_diatoms , & + K_Sil_sp_out = K_Sil_sp , & + K_Sil_phaeo_out = K_Sil_phaeo , & + K_Fe_diatoms_out = K_Fe_diatoms , & + K_Fe_sp_out = K_Fe_sp , & + K_Fe_phaeo_out = K_Fe_phaeo , & + f_doc_s_out = f_doc_s , & + f_doc_l_out = f_doc_l , & + f_don_protein_out = f_don_protein , & + kn_bac_protein_out = kn_bac_protein , & + f_don_Am_protein_out = f_don_Am_protein , & + f_exude_s_out = f_exude_s , & + f_exude_l_out = f_exude_l , & + k_bac_s_out = k_bac_s , & + k_bac_l_out = k_bac_l , & + algaltype_diatoms_out = algaltype_diatoms , & + algaltype_sp_out = algaltype_sp , & + algaltype_phaeo_out = algaltype_phaeo , & + dictype_1_out = dictype_1 , & + doctype_s_out = doctype_s , & + doctype_l_out = doctype_l , & + dontype_protein_out = dontype_protein , & + fedtype_1_out = fedtype_1 , & + feptype_1_out = feptype_1 , & + nitratetype_out = nitratetype , & + ammoniumtype_out = ammoniumtype , & + silicatetype_out = silicatetype , & + dmspptype_out = dmspptype , & + dmspdtype_out = dmspdtype , & + humtype_out = humtype , & + zaerotype_bc1_out = zaerotype_bc1 , & + zaerotype_bc2_out = zaerotype_bc2 , & + zaerotype_dust1_out = zaerotype_dust1 , & + zaerotype_dust2_out = zaerotype_dust2 , & + zaerotype_dust3_out = zaerotype_dust3 , & + zaerotype_dust4_out = zaerotype_dust4) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & + file=__FILE__, line=__LINE__) + + call icepack_query_tracer_flags(tr_aero_out = tr_aero, & + tr_zaero_out = tr_zaero, & + tr_brine_out = tr_brine , tr_bgc_Nit_out = tr_bgc_Nit, & + tr_bgc_Am_out = tr_bgc_Am , tr_bgc_Sil_out = tr_bgc_Sil, & + tr_bgc_DMS_out = tr_bgc_DMS, tr_bgc_PON_out = tr_bgc_PON, & + tr_bgc_N_out = tr_bgc_N , tr_bgc_C_out = tr_bgc_C , & + tr_bgc_chl_out = tr_bgc_chl, & + tr_bgc_DON_out = tr_bgc_DON, tr_bgc_Fe_out = tr_bgc_Fe , & + tr_bgc_hum_out = tr_bgc_hum) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & file=__FILE__, line=__LINE__) @@ -849,120 +957,8 @@ subroutine init_zbgc !----------------------------------------------------------------- ! default values !----------------------------------------------------------------- - tr_brine = .false. ! brine height differs from ice height - tr_zaero = .false. ! z aerosol tracers - modal_aero = .false. ! use modal aerosol treatment of aerosols - restore_bgc = .false. ! restore bgc if true - solve_zsal = .false. ! update salinity tracer profile from solve_S_dt - bgc_data_type = 'default'! source of bgc data - tr_bgc_PON = .false. !--------------------------------------------- - tr_bgc_Nit = .false. ! biogeochemistry (skl or zbgc) - tr_bgc_C = .false. ! if skl_bgc = .true. then skl - tr_bgc_chl = .false. ! if z_tracers = .true. then vertically resolved - tr_bgc_Sil = .false. ! if z_tracers + solve_zbgc = .true. then - tr_bgc_Am = .false. ! vertically resolved with reactions - tr_bgc_DMS = .false. !------------------------------------------------ - tr_bgc_DON = .false. ! - tr_bgc_hum = .false. ! - tr_bgc_Fe = .false. ! - tr_bgc_N = .true. ! - - ! z biology parameters - ratio_Si2N_diatoms = 1.8_dbl_kind ! algal Si to N (mol/mol) - ratio_Si2N_sp = c0 ! diatoms, small plankton, phaeocystis - ratio_Si2N_phaeo = c0 - ratio_S2N_diatoms = 0.03_dbl_kind ! algal S to N (mol/mol) - ratio_S2N_sp = 0.03_dbl_kind - ratio_S2N_phaeo = 0.03_dbl_kind - ratio_Fe2C_diatoms = 0.0033_dbl_kind ! algal Fe to C (umol/mol) - ratio_Fe2C_sp = 0.0033_dbl_kind - ratio_Fe2C_phaeo = p1 - ratio_Fe2N_diatoms = 0.023_dbl_kind ! algal Fe to N (umol/mol) - ratio_Fe2N_sp = 0.023_dbl_kind - ratio_Fe2N_phaeo = 0.7_dbl_kind - ratio_Fe2DON = 0.023_dbl_kind ! Fe to N of DON (nmol/umol) - ratio_Fe2DOC_s = p1 ! Fe to C of DOC (nmol/umol) saccharids - ratio_Fe2DOC_l = 0.033_dbl_kind ! Fe to C of DOC (nmol/umol) lipids - tau_min = 5200.0_dbl_kind ! rapid mobile to stationary exchanges (s) - tau_max = 1.73e5_dbl_kind ! long time mobile to stationary exchanges (s) - chlabs_diatoms = 0.03_dbl_kind ! chl absorption (1/m/(mg/m^3)) - chlabs_sp = 0.01_dbl_kind - chlabs_phaeo = 0.05_dbl_kind - alpha2max_low_diatoms = 0.8_dbl_kind ! light limitation (1/(W/m^2)) - alpha2max_low_sp = 0.67_dbl_kind - alpha2max_low_phaeo = 0.67_dbl_kind - beta2max_diatoms = 0.018_dbl_kind ! light inhibition (1/(W/m^2)) - beta2max_sp = 0.0025_dbl_kind - beta2max_phaeo = 0.01_dbl_kind - mu_max_diatoms = 1.2_dbl_kind ! maximum growth rate (1/day) - mu_max_sp = 0.851_dbl_kind - mu_max_phaeo = 0.851_dbl_kind - grow_Tdep_diatoms = 0.06_dbl_kind ! Temperature dependence of growth (1/C) - grow_Tdep_sp = 0.06_dbl_kind - grow_Tdep_phaeo = 0.06_dbl_kind - fr_graze_diatoms = 0.01_dbl_kind ! Fraction grazed - fr_graze_sp = p1 - fr_graze_phaeo = p1 - mort_pre_diatoms = 0.007_dbl_kind! Mortality (1/day) - mort_pre_sp = 0.007_dbl_kind - mort_pre_phaeo = 0.007_dbl_kind - mort_Tdep_diatoms = 0.03_dbl_kind ! T dependence of mortality (1/C) - mort_Tdep_sp = 0.03_dbl_kind - mort_Tdep_phaeo = 0.03_dbl_kind - k_exude_diatoms = c0 ! algal exudation (1/d) - k_exude_sp = c0 - k_exude_phaeo = c0 - K_Nit_diatoms = c1 ! nitrate half saturation (mmol/m^3) - K_Nit_sp = c1 - K_Nit_phaeo = c1 - K_Am_diatoms = 0.3_dbl_kind ! ammonium half saturation (mmol/m^3) - K_Am_sp = 0.3_dbl_kind - K_Am_phaeo = 0.3_dbl_kind - K_Sil_diatoms = 4.0_dbl_kind ! silicate half saturation (mmol/m^3) - K_Sil_sp = c0 - K_Sil_phaeo = c0 - K_Fe_diatoms = c1 ! iron half saturation (nM) - K_Fe_sp = 0.2_dbl_kind - K_Fe_phaeo = p1 - f_don_protein = 0.6_dbl_kind ! fraction of spilled grazing to proteins - kn_bac_protein = 0.03_dbl_kind ! Bacterial degredation of DON (1/d) - f_don_Am_protein = 0.25_dbl_kind ! fraction of remineralized DON to ammonium - f_doc_s = 0.4_dbl_kind ! fraction of mortality to DOC - f_doc_l = 0.4_dbl_kind - f_exude_s = c1 ! fraction of exudation to DOC - f_exude_l = c1 - k_bac_s = 0.03_dbl_kind ! Bacterial degredation of DOC (1/d) - k_bac_l = 0.03_dbl_kind - algaltype_diatoms = c0 ! ------------------ - algaltype_sp = p5 ! - algaltype_phaeo = p5 ! - nitratetype = -c1 ! mobility type between - ammoniumtype = c1 ! stationary <--> mobile - silicatetype = -c1 ! - dmspptype = p5 ! - dmspdtype = -c1 ! - humtype = c1 ! - doctype_s = p5 ! - doctype_l = p5 ! - dontype_protein = p5 ! - fedtype_1 = p5 ! - feptype_1 = p5 ! - zaerotype_bc1 = c1 ! - zaerotype_bc2 = c1 ! - zaerotype_dust1 = c1 ! - zaerotype_dust2 = c1 ! - zaerotype_dust3 = c1 ! - zaerotype_dust4 = c1 !-------------------- - ratio_C2N_diatoms = 7.0_dbl_kind ! algal C to N ratio (mol/mol) - ratio_C2N_sp = 7.0_dbl_kind - ratio_C2N_phaeo = 7.0_dbl_kind - ratio_chl2N_diatoms= 2.1_dbl_kind ! algal chlorophyll to N ratio (mg/mmol) - ratio_chl2N_sp = 1.1_dbl_kind - ratio_chl2N_phaeo = 0.84_dbl_kind - F_abs_chl_diatoms = 2.0_dbl_kind ! scales absorbed radiation for dEdd - F_abs_chl_sp = 4.0_dbl_kind - F_abs_chl_phaeo = 5.0_dbl_kind - ratio_C2N_proteins = 7.0_dbl_kind ! ratio of C to N in proteins (mol/mol) + + tr_bgc_N = .true. ! not a namelist?? !----------------------------------------------------------------- ! read from input file @@ -1022,6 +1018,14 @@ subroutine init_zbgc ! biogeochemistry !----------------------------------------------------------------- + ! deprecate skl bgc (Aug 2024) + ! no skl code removed yet + if (skl_bgc) then + write(nu_diag,*) 'ERROR: skl_bgc is not validate and temporarily DEPRECATED' + write(nu_diag,*) 'ERROR: if you would like to use skl_bgc, please contact the Consortium' + call icedrv_system_abort(file=__FILE__,line=__LINE__) + endif + if (.not. tr_brine) then if (solve_zbgc) then write(nu_diag,*) 'WARNING: tr_brine = F and solve_zbgc = T' @@ -1041,7 +1045,7 @@ subroutine init_zbgc endif if ((skl_bgc .AND. solve_zbgc) .or. (skl_bgc .AND. z_tracers)) then - print*, 'ERROR: skl_bgc and (solve_zbgc or z_tracers) are both true' + write(nu_diag,*) 'ERROR: skl_bgc and (solve_zbgc or z_tracers) are both true' call icedrv_system_abort(file=__FILE__,line=__LINE__) endif @@ -1073,27 +1077,27 @@ subroutine init_zbgc modal_aero = .false. endif if (n_algae > icepack_max_algae) then - print*, 'error:number of algal types exceeds icepack_max_algae' + write(nu_diag,*) 'error:number of algal types exceeds icepack_max_algae' call icedrv_system_abort(file=__FILE__,line=__LINE__) endif if (n_doc > icepack_max_doc) then - print*, 'error:number of algal types exceeds icepack_max_doc' + write(nu_diag,*) 'error:number of algal types exceeds icepack_max_doc' call icedrv_system_abort(file=__FILE__,line=__LINE__) endif if (n_dic > icepack_max_dic) then - print*, 'error:number of dic types exceeds icepack_max_dic' + write(nu_diag,*) 'error:number of dic types exceeds icepack_max_dic' call icedrv_system_abort(file=__FILE__,line=__LINE__) endif if (n_don > icepack_max_don) then - print*, 'error:number of don types exceeds icepack_max_don' + write(nu_diag,*) 'error:number of don types exceeds icepack_max_don' call icedrv_system_abort(file=__FILE__,line=__LINE__) endif if (n_fed > icepack_max_fe) then - print*, 'error:number of dissolved fe types exceeds icepack_max_fe' + write(nu_diag,*) 'error:number of dissolved fe types exceeds icepack_max_fe' call icedrv_system_abort(file=__FILE__,line=__LINE__) endif if (n_fep > icepack_max_fe) then - print*, 'error:number of particulate fe types exceeds icepack_max_fe' + write(nu_diag,*) 'error:number of particulate fe types exceeds icepack_max_fe' call icedrv_system_abort(file=__FILE__,line=__LINE__) endif @@ -1137,7 +1141,7 @@ subroutine init_zbgc if (tr_zaero .and. .not. z_tracers) z_tracers = .true. if (n_zaero > icepack_max_aero) then - print*, 'error:number of z aerosols exceeds icepack_max_aero' + write(nu_diag,*) 'error:number of z aerosols exceeds icepack_max_aero' call icedrv_system_abort(file=__FILE__,line=__LINE__) endif @@ -1169,9 +1173,9 @@ subroutine init_zbgc ! set Icepack values !----------------------------------------------------------------- - call icepack_init_parameters(ktherm_in=ktherm, shortwave_in=shortwave, & + call icepack_init_parameters( & scale_bgc_in=scale_bgc, skl_bgc_in=skl_bgc, z_tracers_in=z_tracers, & - dEdd_algae_in=dEdd_algae, solve_zbgc_in=solve_zbgc, & + dEdd_algae_in=dEdd_algae, solve_zbgc_in=solve_zbgc, grid_o_t_in=grid_o_t, & bgc_flux_type_in=bgc_flux_type, grid_o_in=grid_o, l_sk_in=l_sk, & initbio_frac_in=initbio_frac, frazil_scav_in=frazil_scav, & grid_oS_in=grid_oS, l_skS_in=l_skS, phi_snow_in=phi_snow, & @@ -1182,7 +1186,108 @@ subroutine init_zbgc fr_dFe_in=fr_dFe, k_nitrif_in=k_nitrif, t_iron_conv_in=t_iron_conv, & max_loss_in=max_loss, max_dfe_doc1_in=max_dfe_doc1, fr_resp_in=fr_resp, & fr_resp_s_in=fr_resp_s, y_sk_DMS_in=y_sk_DMS, t_sk_conv_in=t_sk_conv, & - t_sk_ox_in=t_sk_ox, modal_aero_in=modal_aero) + t_sk_ox_in=t_sk_ox, modal_aero_in=modal_aero, solve_zsal_in = solve_zsal) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & + file=__FILE__, line=__LINE__) + + call icepack_init_parameters ( & + ratio_Si2N_diatoms_in = ratio_Si2N_diatoms, & + ratio_Si2N_sp_in = ratio_Si2N_sp , & + ratio_Si2N_phaeo_in = ratio_Si2N_phaeo , & + ratio_S2N_diatoms_in = ratio_S2N_diatoms , & + ratio_S2N_sp_in = ratio_S2N_sp , & + ratio_S2N_phaeo_in = ratio_S2N_phaeo , & + ratio_Fe2C_diatoms_in = ratio_Fe2C_diatoms, & + ratio_Fe2C_sp_in = ratio_Fe2C_sp , & + ratio_Fe2C_phaeo_in = ratio_Fe2C_phaeo , & + ratio_Fe2N_diatoms_in = ratio_Fe2N_diatoms, & + ratio_Fe2N_sp_in = ratio_Fe2N_sp , & + ratio_Fe2N_phaeo_in = ratio_Fe2N_phaeo , & + ratio_C2N_diatoms_in = ratio_C2N_diatoms , & + ratio_C2N_sp_in = ratio_C2N_sp , & + ratio_C2N_phaeo_in = ratio_C2N_phaeo , & + ratio_C2N_proteins_in = ratio_C2N_proteins, & + ratio_chl2N_diatoms_in = ratio_chl2N_diatoms, & + ratio_chl2N_sp_in = ratio_chl2N_sp , & + ratio_chl2N_phaeo_in = ratio_chl2N_phaeo , & + ratio_Fe2DON_in = ratio_Fe2DON , & + ratio_Fe2DOC_s_in = ratio_Fe2DOC_s , & + ratio_Fe2DOC_l_in = ratio_Fe2DOC_l , & + F_abs_chl_diatoms_in = F_abs_chl_diatoms , & + F_abs_chl_sp_in = F_abs_chl_sp , & + F_abs_chl_phaeo_in = F_abs_chl_phaeo , & + tau_min_in = tau_min , & + tau_max_in = tau_max , & + chlabs_diatoms_in = chlabs_diatoms , & + chlabs_sp_in = chlabs_sp , & + chlabs_phaeo_in = chlabs_phaeo , & + alpha2max_low_diatoms_in = alpha2max_low_diatoms, & + alpha2max_low_sp_in = alpha2max_low_sp , & + alpha2max_low_phaeo_in = alpha2max_low_phaeo, & + beta2max_diatoms_in = beta2max_diatoms , & + beta2max_sp_in = beta2max_sp , & + beta2max_phaeo_in = beta2max_phaeo , & + mu_max_diatoms_in = mu_max_diatoms , & + mu_max_sp_in = mu_max_sp , & + mu_max_phaeo_in = mu_max_phaeo , & + grow_Tdep_diatoms_in = grow_Tdep_diatoms , & + grow_Tdep_sp_in = grow_Tdep_sp , & + grow_Tdep_phaeo_in = grow_Tdep_phaeo , & + fr_graze_diatoms_in = fr_graze_diatoms , & + fr_graze_sp_in = fr_graze_sp , & + fr_graze_phaeo_in = fr_graze_phaeo , & + mort_pre_diatoms_in = mort_pre_diatoms , & + mort_pre_sp_in = mort_pre_sp , & + mort_pre_phaeo_in = mort_pre_phaeo , & + mort_Tdep_diatoms_in = mort_Tdep_diatoms , & + mort_Tdep_sp_in = mort_Tdep_sp , & + mort_Tdep_phaeo_in = mort_Tdep_phaeo , & + k_exude_diatoms_in = k_exude_diatoms , & + k_exude_sp_in = k_exude_sp , & + k_exude_phaeo_in = k_exude_phaeo , & + K_Nit_diatoms_in = K_Nit_diatoms , & + K_Nit_sp_in = K_Nit_sp , & + K_Nit_phaeo_in = K_Nit_phaeo , & + K_Am_diatoms_in = K_Am_diatoms , & + K_Am_sp_in = K_Am_sp , & + K_Am_phaeo_in = K_Am_phaeo , & + K_Sil_diatoms_in = K_Sil_diatoms , & + K_Sil_sp_in = K_Sil_sp , & + K_Sil_phaeo_in = K_Sil_phaeo , & + K_Fe_diatoms_in = K_Fe_diatoms , & + K_Fe_sp_in = K_Fe_sp , & + K_Fe_phaeo_in = K_Fe_phaeo , & + f_doc_s_in = f_doc_s , & + f_doc_l_in = f_doc_l , & + f_don_protein_in = f_don_protein , & + kn_bac_protein_in = kn_bac_protein , & + f_don_Am_protein_in = f_don_Am_protein , & + f_exude_s_in = f_exude_s , & + f_exude_l_in = f_exude_l , & + k_bac_s_in = k_bac_s , & + k_bac_l_in = k_bac_l , & + algaltype_diatoms_in = algaltype_diatoms , & + algaltype_sp_in = algaltype_sp , & + algaltype_phaeo_in = algaltype_phaeo , & + dictype_1_in = dictype_1 , & + doctype_s_in = doctype_s , & + doctype_l_in = doctype_l , & + dontype_protein_in = dontype_protein , & + fedtype_1_in = fedtype_1 , & + feptype_1_in = feptype_1 , & + nitratetype_in = nitratetype , & + ammoniumtype_in = ammoniumtype , & + silicatetype_in = silicatetype , & + dmspptype_in = dmspptype , & + dmspdtype_in = dmspdtype , & + humtype_in = humtype , & + zaerotype_bc1_in = zaerotype_bc1 , & + zaerotype_bc2_in = zaerotype_bc2 , & + zaerotype_dust1_in = zaerotype_dust1 , & + zaerotype_dust2_in = zaerotype_dust2 , & + zaerotype_dust3_in = zaerotype_dust3 , & + zaerotype_dust4_in = zaerotype_dust4) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & file=__FILE__, line=__LINE__) @@ -1219,7 +1324,8 @@ subroutine init_zbgc nlt_bgc_N(:) = 0 nlt_bgc_C(:) = 0 nlt_bgc_chl(:) = 0 - nt_bgc_N(:) = 0 + ! need some valid array indices if unset + nt_bgc_N(:) = max_ntrcr - n_algae*(nblyr+3) nt_bgc_C(:) = 0 nt_bgc_chl(:) = 0 @@ -1244,7 +1350,8 @@ subroutine init_zbgc ! vectors of size icepack_max_aero nlt_zaero(:) = 0 nlt_zaero_sw(:) = 0 - nt_zaero(:) = 0 + ! need some valid array indices if unset + nt_zaero(:) = max_ntrcr - n_zaero*(nblyr+3) nt_zaero_sw(:) = 0 nlt_bgc_Nit = 0 @@ -1269,106 +1376,6 @@ subroutine init_zbgc nt_bgc_hum = 0 nt_zbgc_frac = 0 - !----------------------------------------------------------------- - ! Define array parameters - !----------------------------------------------------------------- - - R_Si2N(1) = ratio_Si2N_diatoms - R_Si2N(2) = ratio_Si2N_sp - R_Si2N(3) = ratio_Si2N_phaeo - - R_S2N(1) = ratio_S2N_diatoms - R_S2N(2) = ratio_S2N_sp - R_S2N(3) = ratio_S2N_phaeo - - R_Fe2C(1) = ratio_Fe2C_diatoms - R_Fe2C(2) = ratio_Fe2C_sp - R_Fe2C(3) = ratio_Fe2C_phaeo - - R_Fe2N(1) = ratio_Fe2N_diatoms - R_Fe2N(2) = ratio_Fe2N_sp - R_Fe2N(3) = ratio_Fe2N_phaeo - - R_C2N(1) = ratio_C2N_diatoms - R_C2N(2) = ratio_C2N_sp - R_C2N(3) = ratio_C2N_phaeo - - R_chl2N(1) = ratio_chl2N_diatoms - R_chl2N(2) = ratio_chl2N_sp - R_chl2N(3) = ratio_chl2N_phaeo - - F_abs_chl(1) = F_abs_chl_diatoms - F_abs_chl(2) = F_abs_chl_sp - F_abs_chl(3) = F_abs_chl_phaeo - - R_Fe2DON(1) = ratio_Fe2DON - R_C2N_DON(1) = ratio_C2N_proteins - - R_Fe2DOC(1) = ratio_Fe2DOC_s - R_Fe2DOC(2) = ratio_Fe2DOC_l - R_Fe2DOC(3) = c0 - - chlabs(1) = chlabs_diatoms - chlabs(2) = chlabs_sp - chlabs(3) = chlabs_phaeo - - alpha2max_low(1) = alpha2max_low_diatoms - alpha2max_low(2) = alpha2max_low_sp - alpha2max_low(3) = alpha2max_low_phaeo - - beta2max(1) = beta2max_diatoms - beta2max(2) = beta2max_sp - beta2max(3) = beta2max_phaeo - - mu_max(1) = mu_max_diatoms - mu_max(2) = mu_max_sp - mu_max(3) = mu_max_phaeo - - grow_Tdep(1) = grow_Tdep_diatoms - grow_Tdep(2) = grow_Tdep_sp - grow_Tdep(3) = grow_Tdep_phaeo - - fr_graze(1) = fr_graze_diatoms - fr_graze(2) = fr_graze_sp - fr_graze(3) = fr_graze_phaeo - - mort_pre(1) = mort_pre_diatoms - mort_pre(2) = mort_pre_sp - mort_pre(3) = mort_pre_phaeo - - mort_Tdep(1) = mort_Tdep_diatoms - mort_Tdep(2) = mort_Tdep_sp - mort_Tdep(3) = mort_Tdep_phaeo - - k_exude(1) = k_exude_diatoms - k_exude(2) = k_exude_sp - k_exude(3) = k_exude_phaeo - - K_Nit(1) = K_Nit_diatoms - K_Nit(2) = K_Nit_sp - K_Nit(3) = K_Nit_phaeo - - K_Am(1) = K_Am_diatoms - K_Am(2) = K_Am_sp - K_Am(3) = K_Am_phaeo - - K_Sil(1) = K_Sil_diatoms - K_Sil(2) = K_Sil_sp - K_Sil(3) = K_Sil_phaeo - - K_Fe(1) = K_Fe_diatoms - K_Fe(2) = K_Fe_sp - K_Fe(3) = K_Fe_phaeo - - f_don(1) = f_don_protein - kn_bac(1) = kn_bac_protein - f_don_Am(1) = f_don_Am_protein - - f_exude(1) = f_exude_s - f_exude(2) = f_exude_l - k_bac(1) = k_bac_s - k_bac(2) = k_bac_l - dictype(:) = -c1 algaltype(1) = algaltype_diatoms @@ -1381,6 +1388,7 @@ subroutine init_zbgc dontype(1) = dontype_protein fedtype(1) = fedtype_1 + feptype(1) = feptype_1 zaerotype(1) = zaerotype_bc1 @@ -1390,31 +1398,6 @@ subroutine init_zbgc zaerotype(5) = zaerotype_dust3 zaerotype(6) = zaerotype_dust4 - call icepack_init_zbgc ( & - R_Si2N_in=R_Si2N, & - R_S2N_in=R_S2N, R_Fe2C_in=R_Fe2C, R_Fe2N_in=R_Fe2N, R_C2N_in=R_C2N, & - R_chl2N_in=R_chl2N, F_abs_chl_in=F_abs_chl, R_Fe2DON_in=R_Fe2DON, & - R_C2N_DON_in=R_C2N_DON, & - R_Fe2DOC_in=R_Fe2DOC, & - chlabs_in=chlabs, alpha2max_low_in=alpha2max_low, beta2max_in=beta2max, & - mu_max_in=mu_max, grow_Tdep_in=grow_Tdep, fr_graze_in=fr_graze, & - mort_pre_in=mort_pre, & - mort_Tdep_in=mort_Tdep, k_exude_in=k_exude, & - K_Nit_in=K_Nit, K_Am_in=K_Am, K_sil_in=K_Sil, K_Fe_in=K_Fe, & - f_don_in=f_don, kn_bac_in=kn_bac, f_don_Am_in=f_don_Am, f_exude_in=f_exude, & - k_bac_in=k_bac, & - fr_resp_in=fr_resp, algal_vel_in=algal_vel, R_dFe2dust_in=R_dFe2dust, & - dustFe_sol_in=dustFe_sol, T_max_in=T_max, fr_mort2min_in=fr_mort2min, & - fr_dFe_in=fr_dFe, op_dep_min_in=op_dep_min, & - fr_graze_s_in=fr_graze_s, fr_graze_e_in=fr_graze_e, & - k_nitrif_in=k_nitrif, t_iron_conv_in=t_iron_conv, & - max_loss_in=max_loss, max_dfe_doc1_in=max_dfe_doc1, & - fr_resp_s_in=fr_resp_s, y_sk_DMS_in=y_sk_DMS, & - t_sk_conv_in=t_sk_conv, t_sk_ox_in=t_sk_ox, fsal_in=fsal) - call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & - file=__FILE__, line=__LINE__) - if (skl_bgc) then nk = 1 @@ -1780,7 +1763,6 @@ subroutine init_zbgc write(nu_diag,1010) ' skl_bgc = ', skl_bgc write(nu_diag,1030) ' bgc_flux_type = ', bgc_flux_type - write(nu_diag,1010) ' restore_bgc = ', restore_bgc write(nu_diag,*) ' bgc_data_type = ', & trim(bgc_data_type) write(nu_diag,1020) ' number of bio tracers = ', nbtrcr @@ -1832,11 +1814,14 @@ subroutine init_zbgc write(nu_diag,1010) ' tr_bgc_DON = ', tr_bgc_DON write(nu_diag,1010) ' tr_bgc_Fe = ', tr_bgc_Fe write(nu_diag,1000) ' grid_o = ', grid_o + write(nu_diag,1000) ' grid_o_t = ', grid_o_t write(nu_diag,1005) ' l_sk = ', l_sk write(nu_diag,1000) ' initbio_frac = ', initbio_frac write(nu_diag,1000) ' frazil_scav = ', frazil_scav - endif ! skl_bgc or solve_bgc + endif ! skl_bgc or z_tracers + + call icedrv_system_flush(nu_diag) 1000 format (a30,2x,f9.2) ! a30 to align formatted, unformatted statements 1005 format (a30,2x,f9.6) ! float diff --git a/configuration/driver/icedrv_restart.F90 b/configuration/driver/icedrv_restart.F90 index 762d1b38..4cedb507 100644 --- a/configuration/driver/icedrv_restart.F90 +++ b/configuration/driver/icedrv_restart.F90 @@ -415,8 +415,7 @@ subroutine restartfile (ice_ic) do i = 1, nx if (tmask(i)) & - call icepack_aggregate (ncat=ncat, & - aicen=aicen(i,:), & + call icepack_aggregate (aicen=aicen(i,:), & trcrn=trcrn(i,:,:), & vicen=vicen(i,:), & vsnon=vsnon(i,:), & @@ -425,7 +424,6 @@ subroutine restartfile (ice_ic) vice=vice (i), & vsno=vsno (i), & aice0=aice0(i), & - ntrcr=max_ntrcr, & trcr_depend=trcr_depend, & trcr_base=trcr_base, & n_trcr_strata=n_trcr_strata, & diff --git a/configuration/driver/icedrv_step.F90 b/configuration/driver/icedrv_step.F90 index 0f25b565..0c4538c4 100644 --- a/configuration/driver/icedrv_step.F90 +++ b/configuration/driver/icedrv_step.F90 @@ -271,7 +271,7 @@ subroutine step_therm1 (dt) enddo endif ! snwgrain - call icepack_step_therm1(dt=dt, ncat=ncat, nilyr=nilyr, nslyr=nslyr, & + call icepack_step_therm1(dt=dt, & aicen_init = aicen_init(i,:), & vicen_init = vicen_init(i,:), & vsnon_init = vsnon_init(i,:), & @@ -431,10 +431,10 @@ subroutine step_therm2 (dt) wavefreq, dwavefreq, & floe_rad_c, floe_binwidth, & d_afsd_latg, d_afsd_newi, d_afsd_latm, d_afsd_weld - use icedrv_arrays_column, only: first_ice, bgrid, cgrid, igrid + use icedrv_arrays_column, only: first_ice use icedrv_calendar, only: yday use icedrv_domain_size, only: ncat, nilyr, nslyr, n_aero, nblyr, & - nltrcr, nx, nfsd + nx, nfsd use icedrv_flux, only: fresh, frain, fpond, frzmlt, frazil, frz_onset use icedrv_flux, only: fsalt, Tf, sss, salinz, fhocn, rside, fside, wlat use icedrv_flux, only: meltl, frazil_diag, flux_bio, faero_ocn, fiso_ocn @@ -482,9 +482,8 @@ subroutine step_therm2 (dt) if (tr_fsd) & wave_sig_ht(i) = c4*SQRT(SUM(wave_spectrum(i,:)*dwavefreq(:))) - call icepack_step_therm2(dt=dt, ncat=ncat, & - nltrcr=nltrcr, nilyr=nilyr, nslyr=nslyr, & - hin_max=hin_max(:), nblyr=nblyr, & + call icepack_step_therm2(dt=dt, & + hin_max=hin_max(:), & aicen=aicen(i,:), & vicen=vicen(i,:), & vsnon=vsnon(i,:), & @@ -505,8 +504,7 @@ subroutine step_therm2 (dt) frain=frain(i), fpond=fpond(i), & fresh=fresh(i), fsalt=fsalt(i), & fhocn=fhocn(i), & - bgrid=bgrid, cgrid=cgrid, & - igrid=igrid, faero_ocn=faero_ocn(i,:), & + faero_ocn=faero_ocn(i,:), & first_ice=first_ice(i,:), & flux_bio=flux_bio(i,1:nbtrcr), & ocean_bio=ocean_bio(i,1:nbtrcr), & @@ -517,7 +515,7 @@ subroutine step_therm2 (dt) HDO_ocn=HDO_ocn(i), & H2_16O_ocn=H2_16O_ocn(i), & H2_18O_ocn=H2_18O_ocn(i), & - nfsd=nfsd, wave_sig_ht=wave_sig_ht(i), & + wave_sig_ht=wave_sig_ht(i), & wave_spectrum=wave_spectrum(i,:), & wavefreq=wavefreq(:), & dwavefreq=dwavefreq(:), & @@ -603,13 +601,12 @@ subroutine update_state (dt, daidt, dvidt, dagedt, offset) !----------------------------------------------------------------- if (tmask(i)) then - call icepack_aggregate (ncat=ncat, & + 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), & - ntrcr=ntrcr, & trcr_depend=trcr_depend (1:ntrcr), & trcr_base=trcr_base (1:ntrcr,:), & n_trcr_strata=n_trcr_strata(1:ntrcr), & @@ -682,7 +679,7 @@ subroutine step_dyn_wave (dt) do i = 1, nx d_afsd_wave(i,:) = c0 call icepack_step_wavefracture (wave_spec_type=wave_spec_type, & - dt=dt, ncat=ncat, nfsd=nfsd, nfreq=nfreq, & + dt=dt, nfreq=nfreq, & aice = aice (i), & vice = vice (i), & aicen = aicen (i,:), & @@ -867,9 +864,7 @@ subroutine step_dyn_ridge (dt, ndtd) if (tmask(i)) then call icepack_step_ridge(dt=dt, ndtd=ndtd, & - nilyr=nilyr, nslyr=nslyr, & - nblyr=nblyr, & - ncat=ncat, hin_max=hin_max(:), & + hin_max=hin_max(:), & rdg_conv=rdg_conv(i), rdg_shear=rdg_shear(i), & aicen=aicen(i,:), & trcrn=trcrn(i,1:ntrcr,:), & @@ -883,7 +878,6 @@ subroutine step_dyn_ridge (dt, ndtd) dvirdgdt=dvirdgdt(i), opening=opening(i), & fpond=fpond(i), & fresh=fresh(i), fhocn=fhocn(i), & - n_aero=n_aero, & faero_ocn=faero_ocn(i,:), fiso_ocn=fiso_ocn(i,:), & aparticn=aparticn(i,:), krdgn=krdgn(i,:), & aredistn=aredistn(i,:), vredistn=vredistn(i,:), & @@ -910,9 +904,7 @@ subroutine step_dyn_ridge (dt, ndtd) if (tmask(i)) then call icepack_step_ridge (dt=dt, ndtd=ndtd, & - nilyr=nilyr, nslyr=nslyr, & - nblyr=nblyr, & - ncat=ncat, hin_max=hin_max(:), & + hin_max=hin_max(:), & rdg_conv=rdg_conv(i), rdg_shear=rdg_shear(i), & aicen=aicen(i,:), & trcrn=trcrn(i,1:ntrcr,:), & @@ -926,7 +918,6 @@ subroutine step_dyn_ridge (dt, ndtd) dvirdgdt=dvirdgdt(i), opening=opening(i), & fpond=fpond(i), & fresh=fresh(i), fhocn=fhocn(i), & - n_aero=n_aero, & faero_ocn=faero_ocn(i,:), fiso_ocn=fiso_ocn(i,:), & aparticn=aparticn(i,:), krdgn=krdgn(i,:), & aredistn=aredistn(i,:), vredistn=vredistn(i,:), & @@ -997,8 +988,7 @@ subroutine step_snow (dt) do i = 1, nx - call icepack_step_snow (dt, nilyr, & - nslyr, ncat, & + call icepack_step_snow (dt, & wind (i), aice (i), & aicen(i,:), vicen (i,:), & vsnon(i,:), trcrn(i,nt_Tsfc,:), & @@ -1031,7 +1021,6 @@ subroutine step_radiation (dt) use icedrv_arrays_column, only: fswthrun, fswthrun_vdr, fswthrun_vdf, fswthrun_idr, fswthrun_idf use icedrv_arrays_column, only: albicen, albsnon, albpndn use icedrv_arrays_column, only: alvdrn, alidrn, alvdfn, alidfn, apeffn, trcrn_sw, snowfracn - use icedrv_arrays_column, only: swgrid, igrid use icedrv_calendar, only: yday, sec use icedrv_domain_size, only: ncat, n_aero, nilyr, nslyr, n_zaero, n_algae, nblyr, nx use icedrv_flux, only: swvdr, swvdf, swidr, swidf, coszen, fsnow @@ -1131,7 +1120,6 @@ subroutine step_radiation (dt) if (tmask(i)) then call icepack_step_radiation(dt=dt, & - swgrid=swgrid(:), igrid=igrid(:), & fbri=fbri(:), & aicen=aicen(i,:), vicen=vicen(i,:), & vsnon=vsnon(i,:), & @@ -1332,13 +1320,12 @@ subroutine biogeochemistry (dt) use icedrv_arrays_column, only: fbio_snoice, fbio_atmice, ocean_bio use icedrv_arrays_column, only: first_ice, fswpenln, bphi, bTiz, ice_bio_net use icedrv_arrays_column, only: snow_bio_net, fswthrun - use icedrv_arrays_column, only: ocean_bio_all, sice_rho - use icedrv_arrays_column, only: bgrid, igrid, icgrid, cgrid + use icedrv_arrays_column, only: ocean_bio_all use icepack_intfc, only: icepack_biogeochemistry, icepack_load_ocean_bio_array use icedrv_domain_size, only: nblyr, nilyr, nslyr, n_algae, n_zaero, ncat use icedrv_domain_size, only: n_doc, n_dic, n_don, n_fed, n_fep, nx use icedrv_flux, only: meltbn, melttn, congeln, snoicen - use icedrv_flux, only: sst, sss, fsnow, meltsn + use icedrv_flux, only: sst, sss, Tf, fsnow, meltsn use icedrv_flux, only: hin_old, flux_bio, flux_bio_atm, faero_atm use icedrv_flux, only: nit, amm, sil, dmsp, dms, algalN, doc, don, dic, fed, fep, zaeros, hum use icedrv_state, only: aicen_init, vicen_init, aicen, vicen, vsnon @@ -1416,10 +1403,7 @@ subroutine biogeochemistry (dt) ! Define ocean concentrations for tracers used in simulation do i = 1, nx - call icepack_load_ocean_bio_array(max_nbtrcr=max_nbtrcr,& - max_algae = max_algae, max_don = max_don, & - max_doc = max_doc, max_dic = max_dic, & - max_aero = max_aero, max_fe = max_fe, & + call icepack_load_ocean_bio_array( & nit = nit(i), amm = amm(i), & sil = sil(i), dmsp = dmsp(i), & dms = dms(i), algalN = algalN(i,:), & @@ -1428,6 +1412,7 @@ subroutine biogeochemistry (dt) fep = fep(i,:), zaeros = zaeros(i,:), & ocean_bio_all=ocean_bio_all(i,:), & hum=hum(i)) +! handled below ! call icepack_warnings_flush(nu_diag) ! if (icepack_warnings_aborted()) call icedrv_system_abort(i, istep1, subname, & ! file=__FILE__,line= __LINE__) @@ -1441,12 +1426,7 @@ subroutine biogeochemistry (dt) enddo ! mm endif - call icepack_biogeochemistry(dt=dt, ntrcr=ntrcr, nbtrcr=nbtrcr, & - ncat=ncat, nblyr=nblyr, nilyr=nilyr, nslyr=nslyr, & - n_algae=n_algae, n_zaero=n_zaero, & - n_doc=n_doc, n_dic=n_dic, n_don=n_don, & - n_fed=n_fed, n_fep=n_fep, & - bgrid=bgrid, igrid=igrid, icgrid=icgrid, cgrid=cgrid, & + call icepack_biogeochemistry(dt=dt, & upNO = upNO(i), & upNH = upNH(i), & iDi = iDi(i,:,:), & @@ -1469,13 +1449,13 @@ subroutine biogeochemistry (dt) ice_bio_net = ice_bio_net(i,1:nbtrcr), & snow_bio_net = snow_bio_net(i,1:nbtrcr), & fswthrun = fswthrun(i,:), & - sice_rho = sice_rho(i,:), & meltbn = meltbn(i,:), & melttn = melttn(i,:), & congeln = congeln(i,:), & snoicen = snoicen(i,:), & sst = sst(i), & sss = sss(i), & + Tf = Tf(i), & fsnow = fsnow(i), & meltsn = meltsn(i,:), & hin_old = hin_old(i,:), & @@ -1488,9 +1468,8 @@ subroutine biogeochemistry (dt) vsnon = vsnon(i,:), & aice0 = aice0(i), & trcrn = trcrn(i,1:ntrcr,:), & - vsnon_init = vsnon_init(i,:), & - skl_bgc = skl_bgc) - + vsnon_init = vsnon_init(i,:)) +! handled below ! call icepack_warnings_flush(nu_diag) ! if (icepack_warnings_aborted()) call icedrv_system_abort(i, istep1, subname, & ! __FILE__, __LINE__) diff --git a/configuration/driver/icedrv_system.F90 b/configuration/driver/icedrv_system.F90 index 46203735..ddd293d0 100644 --- a/configuration/driver/icedrv_system.F90 +++ b/configuration/driver/icedrv_system.F90 @@ -13,7 +13,8 @@ module icedrv_system implicit none private - public :: icedrv_system_abort + public :: icedrv_system_abort, & + icedrv_system_flush !======================================================================= @@ -46,10 +47,29 @@ subroutine icedrv_system_abort(icell, istep, string, file, line) if (present(istep)) write (nu_diag,*) subname,' istep =', istep if (present(icell)) write (nu_diag,*) subname,' i, aice =', icell, aice(icell) if (present(string)) write (nu_diag,*) subname,' string = ',trim(string) + call icedrv_system_flush(nu_diag) stop end subroutine icedrv_system_abort +!======================================================================= +! flushes iunit IO buffer + + subroutine icedrv_system_flush(iunit) + + integer (kind=int_kind), intent(in) :: & + iunit ! unit number to flush + + ! local variables + + character(len=*), parameter :: subname='(icedrv_system_flush)' + +#ifndef NO_F2003 + flush(iunit) +#endif + + end subroutine icedrv_system_flush + !======================================================================= end module icedrv_system diff --git a/configuration/scripts/icepack_in b/configuration/scripts/icepack_in index 4ac97ad8..d831c2d5 100644 --- a/configuration/scripts/icepack_in +++ b/configuration/scripts/icepack_in @@ -156,7 +156,6 @@ dEdd_algae = .false. solve_zbgc = .false. bgc_flux_type = 'Jin2006' - restore_bgc = .false. scale_bgc = .false. solve_zsal = .false. tr_bgc_Nit = .false. @@ -170,11 +169,12 @@ tr_bgc_DON = .false. tr_bgc_Fe = .false. grid_o = 0.006 - l_sk = 0.024 + grid_o_t = 0.006 + l_sk = 2.0 grid_oS = 0.0 l_skS = 0.028 - phi_snow = -0.3 - initbio_frac = 0.8 + phi_snow = -1.0 + initbio_frac = 1.0 frazil_scav = 0.8 ratio_Si2N_diatoms = 1.8 ratio_Si2N_sp = 0.0 @@ -192,29 +192,29 @@ ratio_Fe2DOC_s = 0.1 ratio_Fe2DOC_l = 0.033 fr_resp = 0.05 - tau_min = 5200.0 - tau_max = 173000.0 - algal_vel = 0.0000000111 + tau_min = 3600.0 + tau_max = 604800.0 + algal_vel = 0.0000001 R_dFe2dust = 0.035 dustFe_sol = 0.005 chlabs_diatoms = 0.03 chlabs_sp = 0.01 chlabs_phaeo = 0.05 - alpha2max_low_diatoms = 0.8 - alpha2max_low_sp = 0.67 - alpha2max_low_phaeo = 0.67 - beta2max_diatoms = 0.018 - beta2max_sp = 0.0025 - beta2max_phaeo = 0.01 + alpha2max_low_diatoms = 0.3 + alpha2max_low_sp = 0.2 + alpha2max_low_phaeo = 0.17 + beta2max_diatoms = 0.001 + beta2max_sp = 0.001 + beta2max_phaeo = 0.04 mu_max_diatoms = 1.44 - mu_max_sp = 0.851 - mu_max_phaeo = 0.851 - grow_Tdep_diatoms = 0.06 - grow_Tdep_sp = 0.06 - grow_Tdep_phaeo = 0.06 - fr_graze_diatoms = 0.0 - fr_graze_sp = 0.1 - fr_graze_phaeo = 0.1 + mu_max_sp = 0.41 + mu_max_phaeo = 0.63 + grow_Tdep_diatoms = 0.063 + grow_Tdep_sp = 0.063 + grow_Tdep_phaeo = 0.063 + fr_graze_diatoms = 0.19 + fr_graze_sp = 0.19 + fr_graze_phaeo = 0.19 mort_pre_diatoms = 0.007 mort_pre_sp = 0.007 mort_pre_phaeo = 0.007 @@ -237,10 +237,10 @@ K_Fe_sp = 0.2 K_Fe_phaeo = 0.1 f_don_protein = 0.6 - kn_bac_protein = 0.03 - f_don_Am_protein = 0.25 - f_doc_s = 0.4 - f_doc_l = 0.4 + kn_bac_protein = 0.2 + f_don_Am_protein = 1.0 + f_doc_s = 0.5 + f_doc_l = 0.5 f_exude_s = 1.0 f_exude_l = 1.0 k_bac_s = 0.03 @@ -250,36 +250,36 @@ op_dep_min = 0.1 fr_graze_s = 0.5 fr_graze_e = 0.5 - fr_mort2min = 0.5 - fr_dFe = 0.3 - k_nitrif = 0.0 + fr_mort2min = 0.9 + fr_dFe = 1.0 + k_nitrif = 0.046 t_iron_conv = 3065.0 max_loss = 0.9 max_dfe_doc1 = 0.2 - fr_resp_s = 0.75 - y_sk_DMS = 0.5 - t_sk_conv = 3.0 - t_sk_ox = 10.0 + fr_resp_s = 0.9 + y_sk_DMS = 0.7 + t_sk_conv = 5.0 + t_sk_ox = 12.0 algaltype_diatoms = 0.0 - algaltype_sp = 0.5 - algaltype_phaeo = 0.5 + algaltype_sp = 0.0 + algaltype_phaeo = 0.0 nitratetype = -1.0 - ammoniumtype = 1.0 + ammoniumtype = 0.0 silicatetype = -1.0 dmspptype = 0.5 - dmspdtype = -1.0 - humtype = 1.0 - doctype_s = 0.5 - doctype_l = 0.5 - dontype_protein = 0.5 - fedtype_1 = 0.5 + dmspdtype = 0.0 + humtype = 0.0 + doctype_s = 0.0 + doctype_l = 0.0 + dontype_protein = 0.0 + fedtype_1 = 0.0 feptype_1 = 0.5 - zaerotype_bc1 = 1.0 - zaerotype_bc2 = 1.0 - zaerotype_dust1 = 1.0 - zaerotype_dust2 = 1.0 - zaerotype_dust3 = 1.0 - zaerotype_dust4 = 1.0 + zaerotype_bc1 = -1.0 + zaerotype_bc2 = -1.0 + zaerotype_dust1 = -1.0 + zaerotype_dust2 = -1.0 + zaerotype_dust3 = -1.0 + zaerotype_dust4 = -1.0 ratio_C2N_diatoms = 7.0 ratio_C2N_sp = 7.0 ratio_C2N_phaeo = 7.0 @@ -289,6 +289,6 @@ F_abs_chl_diatoms = 2.0 F_abs_chl_sp = 4.0 F_abs_chl_phaeo = 5.0 - ratio_C2N_proteins = 7.0 + ratio_C2N_proteins = 5.0 / diff --git a/configuration/scripts/options/set_env.bgcispol b/configuration/scripts/options/set_env.bgcispol index c38635a7..1ab2fa2e 100644 --- a/configuration/scripts/options/set_env.bgcispol +++ b/configuration/scripts/options/set_env.bgcispol @@ -1,6 +1,6 @@ ### Layers setenv NICELYR 7 # number of vertical layers in the ice -setenv NSNWLYR 1 # number of vertical layers in the snow +setenv NSNWLYR 5 # number of vertical layers in the snow setenv NICECAT 5 # number of ice thickness categories ### Tracers # match icepack_in tracer_nml to conserve memory @@ -8,7 +8,8 @@ setenv TRAGE 1 # set to 1 for ice age tracer setenv TRFY 1 # set to 1 for first-year ice area tracer setenv TRLVL 1 # set to 1 for level and deformed ice tracers setenv TRPND 1 # set to 1 for melt pond tracers -setenv NTRAERO 0 # number of aerosol tracers +setenv TRSNOW 1 # set to 1 for snow metamorphism tracers +setenv NTRAERO 1 # number of aerosol tracers # (up to max_aero in ice_domain_size.F90) # CESM uses 3 aerosol tracers setenv TRBRI 1 # set to 1 for brine height tracer @@ -23,7 +24,7 @@ setenv TRALG 3 # number of algal tracers # (up to max_algae = 3) setenv TRDOC 2 # number of dissolve organic carbon # (up to max_doc = 3) -setenv TRDIC 0 # number of dissolve inorganic carbon +setenv TRDIC 1 # number of dissolve inorganic carbon # (up to max_dic = 1) setenv TRDON 1 # number of dissolve organic nitrogen # (up to max_don = 1) diff --git a/configuration/scripts/options/set_env.bgcnice b/configuration/scripts/options/set_env.bgcnice index 1d6efc40..8d51abaa 100644 --- a/configuration/scripts/options/set_env.bgcnice +++ b/configuration/scripts/options/set_env.bgcnice @@ -1,6 +1,6 @@ ### Layers setenv NICELYR 7 # number of vertical layers in the ice -setenv NSNWLYR 1 # number of vertical layers in the snow +setenv NSNWLYR 5 # number of vertical layers in the snow setenv NICECAT 5 # number of ice thickness categories ### Tracers # match icepack_in tracer_nml to conserve memory @@ -8,7 +8,7 @@ setenv TRAGE 1 # set to 1 for ice age tracer setenv TRFY 1 # set to 1 for first-year ice area tracer setenv TRLVL 1 # set to 1 for level and deformed ice tracers setenv TRPND 1 # set to 1 for melt pond tracers -setenv NTRAERO 0 # number of aerosol tracers +setenv NTRAERO 1 # number of aerosol tracers # (up to max_aero in ice_domain_size.F90) # CESM uses 3 aerosol tracers setenv TRBRI 1 # set to 1 for brine height tracer @@ -17,13 +17,13 @@ setenv TRBGCS 0 # set to 1 for skeletal layer tracers setenv TRBGCZ 1 # set to 1 for zbgc tracers # (needs TRBGCS = 0 and TRBRI = 1) setenv NBGCLYR 7 # number of zbgc layers -setenv TRZAERO 0 # number of z aerosol tracers +setenv TRZAERO 3 # number of z aerosol tracers # (up to max_aero = 6) setenv TRALG 3 # number of algal tracers # (up to max_algae = 3) setenv TRDOC 2 # number of dissolve organic carbon # (up to max_doc = 3) -setenv TRDIC 0 # number of dissolve inorganic carbon +setenv TRDIC 1 # number of dissolve inorganic carbon # (up to max_dic = 1) setenv TRDON 1 # number of dissolve organic nitrogen # (up to max_don = 1) diff --git a/configuration/scripts/options/set_env.bgcsklnice b/configuration/scripts/options/set_env.bgcsklnice index 985bacbf..f51e75ab 100644 --- a/configuration/scripts/options/set_env.bgcsklnice +++ b/configuration/scripts/options/set_env.bgcsklnice @@ -23,7 +23,7 @@ setenv TRALG 3 # number of algal tracers # (up to max_algae = 3) setenv TRDOC 2 # number of dissolve organic carbon # (up to max_doc = 3) -setenv TRDIC 0 # number of dissolve inorganic carbon +setenv TRDIC 1 # number of dissolve inorganic carbon # (up to max_dic = 1) setenv TRDON 1 # number of dissolve organic nitrogen # (up to max_don = 1) diff --git a/configuration/scripts/options/set_env.zaero b/configuration/scripts/options/set_env.zaero new file mode 100644 index 00000000..d434f092 --- /dev/null +++ b/configuration/scripts/options/set_env.zaero @@ -0,0 +1,6 @@ +### Tracers # match icepack_in tracer_nml to conserve memory +setenv NBGCLYR 7 # number of zbgc layers +setenv NTRAERO 0 # number of aerosol tracers +setenv TRBRI 1 # set to 1 for brine height tracer +setenv TRBGCZ 1 # set to 1 for zbgc tracers +setenv TRZAERO 3 # number of z aerosol tracers diff --git a/configuration/scripts/options/set_nml.bgcispol b/configuration/scripts/options/set_nml.bgcispol index 9f3eab1f..0c1cad4e 100644 --- a/configuration/scripts/options/set_nml.bgcispol +++ b/configuration/scripts/options/set_nml.bgcispol @@ -23,5 +23,13 @@ tr_bgc_PON = .true. tr_bgc_hum = .true. tr_bgc_DON = .true. - tr_bgc_Fe = .false. + tr_bgc_Fe = .true. tfrz_option = 'mushy' + tr_FY = .true. + kcatbound = 0 + tr_snow = .true. + use_smliq_pnd = .true. + snwgrain = .true. + snwredist = 'ITDrdg' + rsnw_fall = 54.526 + rsnw_tmax = 2800.0 diff --git a/configuration/scripts/options/set_nml.bgcnice b/configuration/scripts/options/set_nml.bgcnice index 286b7616..11ca8e1c 100644 --- a/configuration/scripts/options/set_nml.bgcnice +++ b/configuration/scripts/options/set_nml.bgcnice @@ -11,7 +11,7 @@ ocn_data_file = 'oceanmixed_daily_3.txt' bgc_data_file = 'nutrients_daily_ISPOL_WOA_field3.txt' tr_brine = .true. - tr_zaero = .false. + tr_zaero = .true. z_tracers = .true. solve_zbgc = .true. bgc_flux_type = 'Jin2006' @@ -25,3 +25,11 @@ tr_bgc_DON = .true. tr_bgc_Fe = .true. tfrz_option = 'mushy' + tr_FY = .true. + kcatbound = 0 + tr_snow = .true. + use_smliq_pnd = .true. + snwgrain = .true. + snwredist = 'ITDrdg' + rsnw_fall = 54.526 + rsnw_tmax = 2800.0 diff --git a/configuration/scripts/options/set_nml.zaero b/configuration/scripts/options/set_nml.zaero new file mode 100644 index 00000000..6d81ae9b --- /dev/null +++ b/configuration/scripts/options/set_nml.zaero @@ -0,0 +1,3 @@ + tr_brine = .true. + tr_zaero = .true. + z_tracers = .true. diff --git a/configuration/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index 3a68d7dd..9ca13409 100644 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -3,7 +3,8 @@ smoke col 1x1 diag1,run1year smoke col 1x1 debug,run1year smoke col 1x1 debug,bgcispol smoke col 1x1 debug,bgcnice -smoke col 1x1 debug,bgcsklnice +smoke col 1x1 debug,zaero +#smoke col 1x1 debug,bgcsklnice smoke col 1x1 debug,run1year,thermo1 smoke col 1x1 debug,run1year,swredist smoke col 1x1 debug,run1year,swccsm3 @@ -29,6 +30,9 @@ restart col 1x1 diag1 restart col 1x1 pondlvl restart col 1x1 pondtopo restart col 1x1 bgcispol +restart col 1x1 bgcnice +restart col 1x1 zaero,snwitdrdg,snwgrain +#restart col 1x1 bgcsklnice restart col 1x1 thermo1 restart col 1x1 swccsm3 restart col 1x1 isotope diff --git a/configuration/scripts/tests/travis_suite.ts b/configuration/scripts/tests/travis_suite.ts index 8c22ba46..31d74948 100644 --- a/configuration/scripts/tests/travis_suite.ts +++ b/configuration/scripts/tests/travis_suite.ts @@ -3,7 +3,8 @@ smoke col 1x1 diag1,run1year smoke col 1x1 debug,run1year smoke col 1x1 debug,bgcispol smoke col 1x1 debug,bgcnice -smoke col 1x1 debug,bgcsklnice +smoke col 1x1 debug,zaero +#smoke col 1x1 debug,bgcsklnice smoke col 1x1 debug,run1year,thermo1 smoke col 1x1 debug,run1year,swccsm3 smoke col 1x1 debug,run1year,alt01 diff --git a/doc/source/conf.py b/doc/source/conf.py index e9d2e3ef..49c6e2c4 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -38,6 +38,7 @@ 'sphinxcontrib.bibtex', ] +bibtex_bibfiles=['master_list.bib'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -71,7 +72,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/doc/source/master_list.bib b/doc/source/master_list.bib index 445bf758..2296cbd9 100644 --- a/doc/source/master_list.bib +++ b/doc/source/master_list.bib @@ -56,6 +56,8 @@ @string{BGC @string{EFM = {Eng. Fract. Mech.}} @string{ANG = {Ann. Glaciol.}} @string{NOAA = {Natl. Ocn. and Atm. Admin}} +@string{WRR = {Water Resour. Res.}} +@string{LO = {L&O}} % ********************************************** % List of individual sources and their meta data @@ -819,9 +821,28 @@ @article{Plante24 volume = 18, pages = {1685--1708}, doi = {10.5194/tc-18-1685-2024}, -year = {20124} +year = {2024} } +@article{Johnson95, +author = {Johnson, {William P.} and Blue, {Karen A.} and Logan, {Bruce E.} and Arnold, {Robert G.}}, +title = {Modeling Bacterial Detachment During Transport Through Porous Media as a Residence‐Time‐Dependent Process}, +year = {1995}, +doi = {10.1029/95WR02311}, +volume = 31, +pages = {2649--2658}, +journal = {WWR} +} +@article{Edwards2012, +author = {Edwards, Kyle F. and Thomas, Mridul K. and Klausmeier, Christopher A. and Litchman, Elena}, +title = {Allometric scaling and taxonomic variation in nutrient utilization traits and maximum growth rate of phytoplankton}, +journal = {LO}, +volume = {57}, +number = {2}, +pages = {554-566}, +doi = {https://doi.org/10.4319/lo.2012.57.2.0554}, +year = {2012} +} % ********************************************** % For new entries, see example entry in BIB_TEMPLATE.txt % ********************************************** diff --git a/doc/source/science_guide/sg_bgc.rst b/doc/source/science_guide/sg_bgc.rst index 90f93f62..b38b2713 100755 --- a/doc/source/science_guide/sg_bgc.rst +++ b/doc/source/science_guide/sg_bgc.rst @@ -13,7 +13,7 @@ Basic Aerosols Aerosols may be deposited on the ice and gradually work their way through it until the ice melts and they are passed into the ocean. They -are defined as ice and snow volume tracers (Eq. 15 and 16 in CICE.v5 +are defined as ice and snow volume tracers (see CICE "Tracers" documentation), with the snow and ice each having two tracers for each aerosol species, one in the surface scattering layer (delta-Eddington SSL) and one in the snow or ice interior below the SSL. @@ -50,7 +50,7 @@ An alternate scheme for aerosols in sea ice is available using the brine motion based transport scheme of the biogeochemical tracers. All vertically resolved biogeochemical tracers (z-tracers), including aerosols, have the potential to be atmospherically deposited onto the -snow or ice, scavenged during snow melt, and passed into the brine. The +snow or ice, scavenged during snow melt, and passed into the brine. They can also be picked up from the ocean if there is an ocean source. The mobile fraction (discussed in :ref:`mobile-and-stationary`) is then transported via brine drainage processes (Eq. :eq:`mobile-transport`) while a @@ -63,7 +63,7 @@ the scavenging parameter ``kscavz`` for z-tracers defined in **icepack\_zbgc\_shared.F90**. Within the snow, z-tracers are defined as concentrations in the snow -surface layer (:math:`h_{ssl}`) and the snow interior +surface layer (:math:`h_{ssl}`), equal to half the snow layer thickness, and the snow interior (:math:`h_s-h_{ssl}`). The total snow content of z-tracers per ice area per grid cell area, :math:`C_{snow}` is @@ -73,13 +73,13 @@ per grid cell area, :math:`C_{snow}` is One major difference in how the two schemes model snow aerosol transport is that the fraction scavenged from snow melt in the z-tracer scheme is not immediately fluxed into the ocean, but rather, enters the ice as a -source of low salinity but potentially tracer-rich brine. The snow melt +source of potentially tracer-rich brine. The snow melt source is included as a surface flux condition in **icepack\_algae.F90**. All the z-aerosols are nonreactive with the exception of the dust -aerosols. We assume that a small fraction of the dust flux into the ice -has soluble iron (``dustFe_sol`` in **icepack\_in**) and so is -passed to the dissolved iron tracer. The remaining dust passes through +aerosols. If biogeochemistry is active, we assume that a small fraction of the dust flux into the ice +is iron ((``R_dFe2dust`` in **icepack\_in**) and a fraction of that has soluble iron (``dustFe_sol`` in **icepack\_in**). This is +passed to the dissolved iron tracer if active. The remaining dust passes through the ice without reactions. To use z-aerosols, ``tr_zaero`` must be set to true in **icepack\_in**, and the @@ -87,7 +87,7 @@ number of z-aerosol species is set in **icepack.settings**, ``TRZAERO``. Note, t basic tracers ``tr_aero`` must be false and ``NTRAERO`` in **icepack.settings** should be 0. In addition, z-tracers and the brine height tracer must also be active. These are set in **icepack\_in** with ``tr_brine`` and -``z_tracer`` set to true. In addition, to turn on the radiative coupling +``z_tracer`` set to true. To turn on the radiative coupling between the aerosols and the Delta-Eddington radiative scheme, ``shortwave`` must equal ’dEdd’ and ``dEdd_algae`` must be true in **icepack\_in**. @@ -98,7 +98,7 @@ Water Isotope Water isotopes may be deposited on the ice from above or below, and gradually work their way through it until the ice melts and they are passed into the ocean. They -are defined as ice and snow volume tracers (Eq. 15 and 16 in CICE.v5 +are defined as ice and snow volume tracers (see CICE "Tracers" documentation), with the snow and ice each having one tracer for each water isotope species. @@ -264,6 +264,10 @@ where the sums are taken over thickness categories. Sea ice ecosystem ----------------- +**The skeletal layer implementation has been deprecated but not removed as of +September, 2024. If users are interested in this feature, please contact +the CICE Consortium. The documentation below has not yet been removed.** + There are two options for modeling biogeochemistry in sea ice: 1) a skeletal layer or bottom layer model that assumes biology and biological molecules are restricted to a single layer at the base of @@ -299,8 +303,7 @@ There are also environmental variables in **icepack.settings** that, in part, specify the complexity of the ecosystem and are used for both zbgc and the skeletal-layer model. These are 1) ``TRALG``, the number of algal species; 2) ``TRDOC``, the number of dissolved organic carbon groups, 3) ``TRDIC``, the -number of dissolved inorganic carbon groups (this is currently not yet -implemented and should be set to 0); 4) ``TRDON``, the number of dissolved +number of dissolved inorganic carbon groups (this is set to 1 if conservation of carbon is desired); 4) ``TRDON``, the number of dissolved organic nitrogen groups, 5) ``TRFEP``, the number of particulate iron groups; and 6) ``TRFED``, the number of dissolved iron groups. The current version of **algal\_dyn** biochemistry has parameters for up to 3 algal @@ -329,6 +332,10 @@ namelist, ``bgc_data_file``. Skeletal Layer BGC ~~~~~~~~~~~~~~~~~~ +**The skeletal layer implementation has been deprecated but not removed as of +September, 2024. If users are interested in this feature, please contact +the CICE Consortium. The documentation below has not yet been removed.** + In the skeletal layer model, biogeochemical processing is modelled as a single layer of reactive tracers attached to the sea ice bottom. Optional settings are available via the *zbgc\_nml* namelist in @@ -426,7 +433,7 @@ section :ref:`reactions`. .. _zbgc: -Vertical BGC (''zbgc'') +Vertical BGC ("zbgc") ~~~~~~~~~~~~~~~~~~~~~~~ In order to solve for the vertically resolved biogeochemistry, several @@ -439,7 +446,7 @@ flags in **icepack\_in** must be true: a) ``tr_brine``, b) ``z_tracers``, and c) volume\ :math:`\times`\ brine height fraction. - ``z_tracers`` = true indicates use of vertically resolved - biogeochemical and z-aerosol tracers. This flag alone turns on the + biogeochemical tracers, z-aerosol tracers, or both. This flag alone turns on the vertical transport scheme but not the biochemistry. - ``solve_zbgc`` = true turns on the biochemistry for the vertically @@ -455,17 +462,17 @@ flags in **icepack\_in** must be true: a) ``tr_brine``, b) ``z_tracers``, and c) .. the Bitz and Lipscomb thermodynamics ``ktherm`` set to 1 and ``solve_zsal`` .. true (referred to as "zsalinity"). -With the above flags, the default biochemistry is a simple -algal-nitrate system: ``tr_bgc_N`` and ``tr_bgc_Nit`` are true. Options +With the above flags and ``tr_bgc_Nit`` set to true, the default biochemistry is a simple +algal-nitrate system: ``tr_bgc_N`` (turned on by default) and ``tr_bgc_Nit`` (required). Options exist in **icepack\_in** to use a more complicated ecosystem which includes up -to three algal classes, two DOC groups, one DON pool, limitation by -nitrate, silicate and dissolved iron, sulfur chemistry plus refractory +to three algal classes, two DOC groups, one DON pool, one DIC, limitation by +silicate and dissolved iron, sulfur chemistry plus refractory humic material. The **icepack\_in** namelist options are described in the :ref:`tabnamelist`. -Vertically resolved z-tracers are brine- volume conserved and thus depend +Vertically resolved z-tracers are brine volume conserved and thus depend on both the ice volume and the brine height fraction tracer (:math:`v_{in}f_b`). These tracers follow the conservation equations for multiply dependent tracers (see, for example Equation :eq:`transport-apnd-lvl` where :math:`a_{pnd}` is a tracer on :math:`a_{lvl}a_{i}`) @@ -482,12 +489,12 @@ The vertical bio-grid is described in the :ref:`grids` section. Purely mobile tracers are tracers which move with the brine and thus, in the absence of biochemical reactions, evolve like salinity. For vertical tracer transport of purely mobile tracers, the flux conserved quantity -is the bulk tracer concentration multiplied by the ice thickness, i.e. -:math:`C = h\phi -[c]`, where :math:`h` is the ice thickness, :math:`\phi` is the +is the bulk tracer concentration multiplied by the brine thickness, i.e. +:math:`C = h_{b}\phi +[c]`, where :math:`h_{b}` is the brine thickness, :math:`\phi` is the porosity, and :math:`[c]` is the tracer concentration in the brine. :math:`\phi`, :math:`[c]` and :math:`C` are defined on the interface bio -grid (igrid): +grid (igrid) with ``NBGCLYR`` equal to :math:`n_{b}` in what follows: .. math:: \mbox{igrid}(k) = \Delta (k-1) \ \ \ \mbox{for }k = 1:n_b+1 \ \ \mbox{and }\Delta = 1/n_b. @@ -497,13 +504,13 @@ The biogeochemical module solves the following equation: .. math:: \begin{aligned} \frac{\partial C}{\partial t} & =& \frac{\partial }{\partial x}\left\{ - \left( \frac{v}{h} + \frac{w_f}{h\phi} - - \frac{\tilde{D}}{h^2\phi^2}\frac{\partial \phi}{\partial x} \right) C - + \frac{\tilde{D}}{h^2\phi}\frac{\partial C}{\partial x} - \right\} + h\phi R([c])\end{aligned} + \left( \frac{v}{h_{b}} + \frac{w_f}{h_{b}\phi} - + \frac{\tilde{D}}{h_{b}^2\phi^2}\frac{\partial \phi}{\partial x} \right) C + + \frac{\tilde{D}}{h_{b}^2\phi}\frac{\partial C}{\partial x} + \right\} + h_{b}\phi R([c])\end{aligned} :label: mobile-transport -where :math:`D_{in} = \tilde{D}/h^2 = (D + \phi D_m)/h^2` and +where :math:`D_{in} = \tilde{D}/h_{b}^2 = (D + \phi D_m)/h_{b}^2` and :math:`R([c])` is the nonlinear biogeochemical interaction term (see :cite:`Jeffery11`). @@ -516,12 +523,7 @@ otherwise adhere to the ice crystals. These tracers exist in both the mobile and stationary phases. In this case, their total brine concentration is a sum :math:`c_m + c_s` where :math:`c_m` is the mobile fraction transported by equation :eq:`mobile-transport` and :math:`c_s` -is fixed vertically in the ice matrix. The algae are an exception, -however. We assume that algae in the stationary phase resist brine -motion, but rather than being fixed vertically, these tracers maintain -their relative position in the ice. Algae that adhere to the ice -interior (bottom, surface), remain in the ice interior (bottom, surface) -until release to the mobile phase. +is fixed vertically in the ice matrix. Nitrate and Diatoms are special cases discussed below. In order to model the transfer between these fractions, we assume that tracers adhere (are retained) to the crystals with a time-constant of @@ -545,8 +547,8 @@ We use the exponential form of these equations: c_s^{t+dt} & = & c_s^t\exp\left(-\frac{dt}{\tau_{rel}}\right) + c_m^t\left(1-\exp\left[-\frac{dt}{\tau_{ret}}\right]\right) \end{aligned} -The time constants are functions of the ice growth and melt rates -(:math:`dh/dt`). All tracers except algal nitrogen diatoms follow the +The time constants are step-functions of the ice growth and melt rates +(:math:`dh/dt`). All tracers except algal nitrogen diatoms and nitrate follow the simple case: when :math:`dh/dt \geq 0`, then :math:`\tau_{rel} \rightarrow \infty` and :math:`\tau_{ret}` is finite. For :math:`dh/dt < 0`, then :math:`\tau_{ret} \rightarrow \infty` and @@ -554,7 +556,9 @@ For :math:`dh/dt < 0`, then :math:`\tau_{ret} \rightarrow \infty` and transitions to the stationary phase and ice melt enables transitions to the mobile phase. -The exception is the diatom pool. We assume that diatoms, the first +Nitrate is a special case. This tracer is generally treated as purely mobile. However this is not the case if nitrate arises from in situ nitrification (i.e. ammonium to nitrate). In this case, we model the nitrate as associated with a implicit biofilm which adheres to the ice matrix. This ice in situ production is assigned to the stationary phase. + +As with nitrate, diatoms are a special case. We assume that diatoms, the first algal nitrogen group, can actively maintain their relative position within the ice, i.e. bottom (interior, upper) algae remain in the bottom (interior, upper) ice, unless melt rates exceed a threshold. The @@ -562,18 +566,19 @@ namelist parameter ``algal_vel`` sets this threshold. The variable ``bgc_tracer_type`` determines the mobile to stationary transition timescales for each z-tracer. It is multi-dimensional with a -value for each z-tracer. For ``bgc_tracer_type``(k) equal to -1, the kth +value for each z-tracer. For ``bgc_tracer_type`` equal to -1, the tracer remains solely in the mobile phase. For ``bgc_tracer_type`` equal to 1, the tracer has maximal rates in the retention phase and minimal in the release. For ``bgc_tracer_type`` equal to 0, the tracer has maximal rates in the release phase and minimal in the retention. -Finally for ``bgc_tracer_type`` equal to 0.5, minimum timescales are +Finally, for ``bgc_tracer_type`` equal to 0.5, minimum timescales are used for both transitions. Table :ref:`tab-phases` summarizes the -transition types. The tracer types are: ``algaltype_diatoms``, +transition types. The distinct tracer types are specified by the parameters: ``algaltype_diatoms``, ``algaltype_sp`` (small plankton), ``algaltype_phaeo`` (*phaeocystis*), ``nitratetype``, ``ammoniumtype``, ``silicatetype``, ``dmspptype``, ``dmspdtype``, ``humtype``, ``doctype_s`` (saccharids), ``doctype_l`` (lipids), ``dontype_protein``, +``dictype`` ``fedtype_1``, ``feptype_1``, ``zaerotype_bc1`` (black carbon class 1), ``zaerotype_bc2`` (black carbon class 2), and four dust classes, ``zaerotype_dustj``, where j takes values 1 to 4. These may be modified to @@ -606,13 +611,20 @@ dependent on two tracers: brine height fraction (:math:`f_b`) and ice volume (:math:`v_{in}`). The conservation equations are given by .. math:: - {\partial\over\partial t} (f_{b}v_{in}) + \nabla \cdot (f_{b}v_{in} {\bf u}) = 0. + {\partial\over\partial t} (f_{b}v_{in}) + \nabla \cdot (f_{b}v_{in} {\bf u}) = 0 . The tracer, ``zbgc_frac``, is initialized to 1 during new ice formation, because all z-tracers are initially in the purely mobile phase. -Similarly, as the ice melts, z-tracers return to the mobile phase. Very -large release timescales will prevent this transition and could result -in an unphysically large accumulation during the melt season. +Similarly, as the ice melts, z-tracers gradually return to the mobile phase. + +Maximum accumulation of tracers (based on diatoms) on ice crystals (i.e. collectors) is ultimately limited by their saturation concentration based on :cite:`Johnson95`'s model of bacterial detachment in porous media. This is modeled simply using a single saturation concentration for all tracers. This could be modified to be tracer dependent in future versions if warranted. Several local parameters defined in **z\_biogeochemistry** are used in the calculation: 1) mean ice crystal radius :math:`r_c` ; 2) large diatom radius :math:`r_{bac}` ; 3) small diatom radius :math:`r_{alg}` ; 4) two parameters in a conversion from algal nitrogen quota to cell volume :math:`Nquota_{A}` and :math:`Nquota_I` :cite:`Edwards2012` ; 5) fraction of sites available for saturation :math:`f_s` ; 6) fraction of the collector (ice crystal) available for attachment :math:`f_a` ; 6) fraction of algal coverage by area available for attachment :math:`f_v`. These are used to compute the volume and surface area of a diatom cell (assumed to be a prolate spheriod) :math:`V_alg = \frac{\pi}{6} r_{bac}r_{alg}^{2}` and :math:`P_b = \pi r_{bac}^{2}`, respectively; and the volume and surface area of the collector (assumed to be spherical) :math:`V_c = \frac{4 \pi}{3} r_{c}^{3}` and :math:`S_{col} = 4 \pi r_{c}^{2}`, respectively. + +The saturation concentration ``Sat_conc`` is approximated as: + +.. math:: + Sat_{conc} = \frac{f_{s}f_{a}f_{v} S_{col}Nquota_{I}}{V_{c} P_{b}}(c1-phi_{max})V_{alg}^{Nquota_{A}} + +where :math:`phi_{max}` is the maximum porosity in the ice column. .. _tracer-numerics: @@ -997,9 +1009,10 @@ are true). "N (3)", "Nin(3)", "`tr_bgc_N`", "*Phaeocystis sp*", ":math:`mmol` :math:`N/m^3`" "DOC (1)", "DOCin(1)", "`tr_bgc_DOC`", "polysaccharids", ":math:`mmol` :math:`C/m^3`" "DOC (2)", "DOCin(2)", "`tr_bgc_DOC`", "lipids", ":math:`mmol` :math:`C/m^3`" - "DON", "DONin(1)", "`tr_bgc_DON`", "proteins", ":math:`mmol` :math:`C/m^3`" - "fed", "Fedin(1)", "`tr_bgc_Fe`", "dissolved iron", ":math:`\mu` :math:`Fe/m^3`" - "fep", "Fepin(1)", "`tr_bgc_Fe`", "particulate iron", ":math:`\mu` :math:`Fe/m^3`" + "DIC", "DICin(1)", "`tr_bgc_DIC`", "dissolved inorganic carbon", ":math:`mmol` :math:`C/m^3`" + "DON", "DONin(1)", "`tr_bgc_DON`", "proteins", ":math:`mmol` :math:`N/m^3`" + "fed", "Fedin(1)", "`tr_bgc_Fe`", "dissolved iron", ":math:`\mu mol` :math:`Fe/m^3`" + "fep", "Fepin(1)", "`tr_bgc_Fe`", "particulate iron", ":math:`\mu mol` :math:`Fe/m^3`" ":math:`{\mbox{NO$_3$}}`", "Nitin", "`tr_bgc_Nit`", ":math:`{\mbox{NO$_3$}}`", ":math:`mmol` :math:`N/m^3`" ":math:`{\mbox{NH$_4$}}`", "Amin", "`tr_bgc_Am`", ":math:`{\mbox{NH$_4$}}`", ":math:`mmol` :math:`N/m^3`" ":math:`{\mbox{SiO$_3$}}`", "Silin", "`tr_bgc_Sil`", ":math:`{\mbox{SiO$_2$}}`", ":math:`mmol` :math:`Si/m^3`" @@ -1007,7 +1020,7 @@ are true). "DMSPd", "DMSPdin", "`tr_bgc_DMS`", "dissolved DMSP", ":math:`mmol` :math:`S/m^3`" "DMS", "DMSin", "`tr_bgc_DMS`", "DMS", ":math:`mmol` :math:`S/m^3`" "PON", "PON :math:`^a`", "`tr_bgc_PON`", "passive mobile tracer", ":math:`mmol` :math:`N/m^3`" - "hum", "hum :math:`^{ab}`", "`tr_bgc_hum`", "passive sticky tracer", ":math:`mmol` :math:`/m^3`" + "hum", "hum :math:`^{a}`", "`tr_bgc_hum`", "refractory dissolved organic carbon", ":math:`mmol C` :math:`/m^3`" "BC (1)", "zaero(1) :math:`^a`", "`tr_zaero`", "black carbon species 1", ":math:`kg` :math:`/m^3`" "BC (2)", "zaero(2) :math:`^a`", "`tr_zaero`", "black carbon species 2", ":math:`kg` :math:`/m^3`" "dust (1)", "zaero(3) :math:`^a`", "`tr_zaero`", "dust species 1", ":math:`kg` :math:`/m^3`" @@ -1017,33 +1030,31 @@ are true). :math:`^a` not modified in *algal_dyn* -:math:`^b` may be in C or N units depending on the ocean concentration - The biochemical reaction term for each algal species has the form: .. math:: - \Delta {\mbox{N}}/dt = R_{{\mbox{N}}} = \mu (1- f_{graze} - f_{res}) - M_{ort} + \Delta {\mbox{N}}/dt = R_{{\mbox{N}}} = \mu (1 - f_{res}) - M_{ort} - G_{raze} where :math:`\mu` is the algal growth rate, :math:`M_{ort}` is a -mortality loss, :math:`f_{graze}` is the fraction of algal growth that -is lost to predatory grazing, and :math:`f_{res}` is the fraction of -algal growth lost to respiration. Algal mortality is temperature -dependent and limited by a maximum loss rate fraction (:math:`l_{max}`): +mortality loss, :math:`G_{raze}` is a loss term from implicit predatory grazing, and :math:`f_{res}` is the fraction of algal growth lost to respiration. Algal mortality is temperature +dependent. Both are limited by a maximum loss rate fraction (:math:`l_{max}`). For each algal type, we have: .. math:: - M_{ort} = \min( l_{max}[{\mbox{N}}], m_{pre} \exp\{m_{T}(T-T_{max})\}[{\mbox{N}}]) + G_{raze} = \min( l_{max} * {\mbox{N}}/dt, \mu * fr_{graze}(k) * ({\mbox{N}}/graze_{conc})^{graze_{exponent}}) Note, :math:`[\cdot]` denotes brine concentration. +.. math:: + M_{ort} = \min( l_{max}[{\mbox{N}}], m_{pre} \exp\{m_{T}(T-T_{max})\}[{\mbox{N}}]) + Nitrate and ammonium reaction terms are given by .. math:: \begin{aligned} - \Delta{\mbox{NO$_3$}}/dt & = & R_{{\mbox{NO$_3$}}} = [{\mbox{NH$_4$}}] k_{nitr}- U^{tot}_{{\mbox{NO$_3$}}} \nonumber \\ - \Delta{\mbox{NH$_4$}}/dt & = & R_{{\mbox{NH$_4$}}} = -[{\mbox{NH$_4$}}] k_{nitr} -U^{tot}_{{\mbox{NH$_4$}}} + - (f_{ng}f_{graze}(1-f_{gs})+f_{res})\mu^{tot} \nonumber \\ - & + & f_{nm} M_{ort} + \frac{\Delta{\mbox{NO$_3$}}}{dt} = R_{{\mbox{NO$_3$}}} & = & [{\mbox{NH$_4$}}] k_{nitr}- U^{tot}_{{\mbox{NO$_3$}}} \nonumber \\ + \frac{\Delta{\mbox{NH$_4$}}}{dt} = R_{{\mbox{NH$_4$}}} & = & -[{\mbox{NH$_4$}}] k_{nitr} -U^{tot}_{{\mbox{NH$_4$}}} + + (f_{ng}f_{graze}(1-f_{gs})+f_{res})\mu^{tot} + f_{nm} M_{ort} \nonumber \\ & = & -[{\mbox{NH$_4$}}]k_{nitr} -U^{tot}_{{\mbox{NH$_4$}}} + N_{remin}\end{aligned} @@ -1055,15 +1066,19 @@ ammonium and :math:`f_{gs}` is the fraction of grazing spilled or lost. Algal growth and nutrient uptake terms are described in more detail in :ref:`growth-uptake`. -Dissolved organic nitrogen satisfies the equation + +Dissolved organic nitrogen depends on the sum of all grazing :math:`graze^{tot}` and mortality :math:`M_{ort}^{tot}` and satisfies the equation .. math:: \begin{aligned} - \Delta {\mbox{DON}}/dt & = & R_{{\mbox{DON}}} = f_{dg}f_{gs}f_{graze}\mu^{tot} - [{\mbox{DON}}]k_{nb}\end{aligned} + \frac{\Delta {\mbox{DON}}}{dt} & = & R_{{\mbox{DON}}} \nonumber \\ + & = & graze^{tot} - graze^{tot}(1-fr_{graze_s})*fr_{graze_e} + M_{ort}^{tot}(1 - fr_{mort2min}) - [{\mbox{DON}}]k_{nb} \\ + & = & DON_{source} - [{\mbox{DON}}]k_{nb} + \end{aligned} With a loss from bacterial degration (rate :math:`k_{nb}`) and a gain -from spilled grazing that does not enter the :math:`{\mbox{NH$_4$}}` +from spilled grazing and mortality that does not enter the :math:`{\mbox{NH$_4$}}` pool. A term Z\ :math:`_{oo}` closes the nitrogen cycle by summing all the @@ -1077,8 +1092,8 @@ cycle at each timestep. .. math:: \begin{aligned} - \mbox{Z}_{oo} & = & [(1-f_{ng}(1-f_{gs}) - f_{dg}f_{gs}]f_{graze}\mu^{tot}dt + (1-f_{nm})M_{ort}dt + - [{\mbox{DON}}]k_{nb}dt \nonumber\end{aligned} + \mbox{Z}_{oo} & = & (1-fr_{graze_e})(1-fr_{graze_s})graze^{tot} + fr_{graze_s} graze^{tot} + M_{ort}^{tot}(1 - fr_{mort2min}) + \nonumber\end{aligned} Dissolved organic carbon may be divided into polysaccharids and lipids. Parameters are two dimensional (indicated by superscript :math:`i`) with @@ -1088,15 +1103,16 @@ lipids. The :math:`{\mbox{DOC}}^i` equation is: .. math:: \begin{aligned} - \Delta {\mbox{DOC}}^i/dt & = & R_{{\mbox{DOC}}} = f^i_{cg}f_{ng}\mu^{tot} + R^i_{c:n}M_{ort}-[{\mbox{DOC}}]k^i_{cb}\end{aligned} - + \frac{\Delta {\mbox{DOC}}^i}{dt} & = & R_{{\mbox{DOC}}} = f^i_{cg}(graze^{tot} + M_{ort}^{tot} - f_{ng}\mu^{tot} - \frac{DON_{source}}{dt}) R^i_{c:n}-[{\mbox{DOC}}]k^i_{cb} \\ + & = & R_{{\mbox{DOC}}} = f^i_{cg}(graze^{tot} + M_{ort}^{tot} - f_{ng}\mu^{tot} - \frac{DON_{source}}{dt}) R^i_{c:n} - \frac{DOC_{loss}}{dt}\end{aligned} + Silicate has no biochemical source terms within the ice and is lost only through algal uptake: .. math:: \begin{aligned} - \Delta {\mbox{SiO$_3$}}/dt & = & R_{{\mbox{SiO$_3$}}} = -U_{{\mbox{SiO$_3$}}}^{tot}\end{aligned} + \frac{\Delta {\mbox{SiO$_3$}}}{dt} & = & R_{{\mbox{SiO$_3$}}} = -U_{{\mbox{SiO$_3$}}}^{tot}\end{aligned} Dissolved iron has algal uptake and remineralization pathways. In addition, :math:`{\mbox{fed}}` may be converted to or released from the @@ -1109,16 +1125,16 @@ and particulate iron is .. math:: \begin{aligned} - \Delta_{fe}{\mbox{fed}}/dt & = & -[{\mbox{fed}}]/\tau_{fe} \nonumber \\ - \Delta_{fe}{\mbox{fep}}/dt & = & [{\mbox{fed}}]/\tau_{fe}\end{aligned} + \frac{\tilde{\Delta} {\mbox{fed}}}{dt} & = & -\frac{[{\mbox{fed}}]}{\tau_{fe}} \nonumber \\ + \frac{\tilde{\Delta} {\mbox{fep}}}{dt} & = & \frac{[{\mbox{fed}}]}{\tau_{fe}}\end{aligned} -For values less than :math:`r^{max}_{fed:doc}` +for values less than :math:`r^{max}_{fed:doc}`. .. math:: \begin{aligned} - \Delta_{fe}{\mbox{fed}}/dt & = & [{\mbox{fep}}]/\tau_{fe} \nonumber \\ - \Delta_{fe}{\mbox{fep}}/dt & = & -[{\mbox{fep}}]/\tau_{fe}\end{aligned} + \frac{\tilde{\Delta} {\mbox{fed}}}{dt} & = & \frac{[{\mbox{fep}}]}{\tau_{fe}} \nonumber \\ + \frac{\tilde{\Delta} {\mbox{fep}}}{dt} & = & -\frac{[{\mbox{fep}}]}{\tau_{fe}}\end{aligned} Very long timescales :math:`\tau_{fe}` will remove this source/sink term. The default value is currently set at 3065 days to turn off this @@ -1131,8 +1147,8 @@ remineralization is .. math:: \begin{aligned} - \Delta {\mbox{fed}}/dt & = & R_{{\mbox{fed}}} = -U^{tot}_{{\mbox{fed}}} + f_{fa}R_{fe:n}N_{remin} - + \Delta_{fe}{\mbox{fed}}/dt\end{aligned} + \frac{\Delta {\mbox{fed}}}{dt} & = & R_{{\mbox{fed}}} = -U^{tot}_{{\mbox{fed}}} + f_{fa}R_{fe:n}N_{remin} + + \frac{\tilde{\Delta}{\mbox{fed}}}{dt}\end{aligned} Particulate iron also includes a source term from algal mortality and grazing that is not immediately bioavailable. The full equation for @@ -1141,8 +1157,8 @@ grazing that is not immediately bioavailable. The full equation for .. math:: \begin{aligned} - \Delta {\mbox{fep}}/dt & = & R_{{\mbox{fep}}} = R_{fe:n}[\mbox{Z}_{oo}/dt + (1-f_{fa})]N_{remin} - + \Delta_{fe}{\mbox{fep}}/dt\end{aligned} + \frac{\Delta {\mbox{fep}}}{dt} & = & R_{{\mbox{fep}}} = R_{fe:n}[\frac{\mbox{Z}_{oo}}{dt} + (1-f_{fa})]N_{remin} + + \frac{\tilde{\Delta}{\mbox{fep}}}{dt}\end{aligned} The sulfur cycle includes :math:`{\mbox{DMS}}` and dissolved DMSP (:math:`{\mbox{DMSPd}}`). Particulate DMSP is assumed to be proportional @@ -1153,9 +1169,21 @@ to the algal concentration, i.e. .. math:: \begin{aligned} - \Delta {\mbox{DMSPd}}/dt & = & R_{{\mbox{DMSPd}}} = R_{s:n}[ f_{sr}f_{res}\mu^{tot} - +f_{nm}M_{ort} ] - [{\mbox{DMSPd}}]/\tau_{dmsp} \nonumber \\ - \Delta {\mbox{DMS}}/dt & = & R_{{\mbox{DMS}}} = y_{dms}[{\mbox{DMSPd}}]/\tau_{dmsp} - [{\mbox{DMS}}]/\tau_{dms}\end{aligned} + \frac{\Delta {\mbox{DMSPd}}}{dt} & = & R_{{\mbox{DMSPd}}} = R_{s:n}[ f_{sr}f_{res}\mu^{tot} + +f_{nm}M_{ort} ] - \frac{[{\mbox{DMSPd}}]}{\tau_{dmsp}} \nonumber \\ + \frac{\Delta {\mbox{DMS}}}{dt} & = & R_{{\mbox{DMS}}} = y_{dms}\frac{[{\mbox{DMSPd}}]}{\tau_{dmsp}} - \frac{[{\mbox{DMS}}]}{\tau_{dms}}\end{aligned} + +The dissolved inorganic carbon tracer, :math:`{\mbox{DIC}}`, currently serves to conserve carbon in sea ice. There is no alkalinity tracer nor precipitated forms of carbonate that would be needed for solving the carbonate chemistry. In addition, :math:`{\mbox{DIC}}` never limits photosynthesis in this formulation and carbon to nitrogen ratios for each algal species are fixed at run-time. In the event that :math:`{\mbox{DIC}}` algal requirements exceed the available in situ concentration at a given timestep, the demand is met by an assumed ocean flux into the sea ice. :math:`{\mbox{DIC}}` reactive sources are equivalent to the remineralized losses of :math:`{\mbox{DON}}_{loss} = [{\mbox{DON}}] k_{nb}` and :math:`{\mbox{DOC}}^{tot}_{loss} = \sum^{i} [{\mbox{DOC}}]_i (k_{bac})_i` + +The :math:`{\mbox{DIC}}` reaction equation is + +.. math:: + + \begin{aligned} + \frac{\Delta {\mbox{DIC}}}{dt} & = & R_{{\mbox{DIC}}} = {\mbox{DON}}_{loss} * R_{C2N:DON} + {\mbox{DOC}}^{tot}_{loss}-\sum^{algae} [(1-fr_{resp})*grow_{N} * R_{C:N}]\end{aligned} + +where the summation is over all algal groups, :math:`R_{C:N}` is the carbon to nitrogen ratio of each algal group :math:`{\mbox{N}}`, and :math:`R_{C2N:DON}` is the carbon to nitrogen ratio of :math:`{\mbox{DON}}`. + See :ref:`tuning` for a more complete list and description of biogeochemical parameters. @@ -1180,13 +1208,12 @@ limitation terms may also be found for :math:`{\mbox{NH$_4$}}`, Light limitation :math:`L_{lim}` is defined in the following way: :math:`I _{sw}(z)` (in :math:`W/m^2`) is the shortwave radiation at the ice level -and the optical depth is proportional to the chlorophyll concentration, -:math:`op_{dep} =` ``chlabs`` [Chl*a*]. If ( :math:`op_{dep} > op_{min}`) then +and the optical depth :math:`op_{dep}` is proportional to the chlorophyll concentration. If ( :math:`op_{dep} > op_{min}`) then .. math:: - I_{avg} = I_{sw}(1- \exp(-op_{dep}))/op_{dep} + I_{avg} = I_{sw}\frac{(1- \exp(-op_{dep}))}{op_{dep}} -otherwise :math:`I_{avg} = I_{sw}`. +otherwise :math:`I_{avg} = I_{sw}`. Then, .. math:: L_{lim} = (1 - \exp(-\alpha I_{avg}))\exp(-\beta I_{avg}) @@ -1196,7 +1223,7 @@ The maximal algal growth rate before limitation is .. math:: \begin{aligned} \mu_o & = & \mu_{max}\exp(\mu_T\Delta T)f_{sal}[{\mbox{N}}] \\ - \mu' & = & min(L_{lim},N_{lim},{\mbox{SiO$_3$}}_{lim},{\mbox{fed}}_{lim}) \mu_o\end{aligned} + \mu' & = & min(L_{lim},\ N_{lim},\ {\mbox{SiO$_3$}}_{lim},\ {\mbox{fed}}_{lim}) \mu_o\end{aligned} where :math:`\mu'` is the initial estimate of algal growth rate for a given algal species and :math:`\Delta T` is the difference between the @@ -1241,8 +1268,13 @@ uptake is .. math:: \begin{aligned} - fU^i_{{\mbox{NO$_3$}}} & = & \frac{\tilde{U}^i_{{\mbox{NO$_3$}}}}{\tilde{U}^{tot}_{{\mbox{NO$_3$}}}} \nonumber \\ - U^{tot}_{{\mbox{NO$_3$}}} & = & \min(\tilde{U}^{tot}_{{\mbox{NO$_3$}}}, l_{max}[{\mbox{NO$_3$}}]/dt)\end{aligned} + fU^i_{{\mbox{NO$_3$}}} & = & \frac{\tilde{U}^i_{{\mbox{NO$_3$}}}}{\tilde{U}^{tot}_{{\mbox{NO$_3$}}}},\end{aligned} + +and the true total update is + +.. math:: + \begin{aligned} + U^{tot}_{{\mbox{NO$_3$}}} & = & \min(\tilde{U}^{tot}_{{\mbox{NO$_3$}}}, l_{max}[{\mbox{NO$_3$}}]/dt) .\end{aligned} Now, for each algal species the nitrate uptake is @@ -1254,7 +1286,7 @@ Then the true growth rate for each algal species :math:`i` is .. math:: \begin{aligned} - \mu^i & = & \min(U^i_{{\mbox{SiO$_3$}}}/R_{si:n}, U^i_{{\mbox{NO$_3$}}} + U^i_{{\mbox{NH$_4$}}}, U^i_{{\mbox{fed}}}/R_{fe:n})\end{aligned} + \mu^i & = & \min(R_{si:n}^{-1}U^i_{{\mbox{SiO$_3$}}}, U^i_{{\mbox{NO$_3$}}} + U^i_{{\mbox{NH$_4$}}}, R_{fe:n}^{-1}U^i_{{\mbox{fed}}})\end{aligned} Preferential ammonium uptake is assumed once again and the remaining nitrogen is taken from the nitrate pool. diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index cb5e5cb6..3dea32fb 100644 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -103,11 +103,11 @@ can be modified as needed. "NBGCLYR", "integer", "number of zbgc layers", "1" "TRZAERO", "0-6", "number of z aerosol tracers", "0" "TRALG", "0,1,2,3", "number of algal tracers", "0" - "TRDOC", "0,1,2,3", "number of dissolved organic carbon", "0" + "TRDOC", "0,1,2", "number of dissolved organic carbon", "0" "TRDIC", "0,1", "number of dissolved inorganic carbon", "0" "TRDON", "0,1", "number of dissolved organic nitrogen", "0" - "TRFEP", "0,1,2", "number of particulate iron tracers", "0" - "TRFED", "0,1,2", "number of dissolved iron tracers", "0" + "TRFEP", "0,1", "number of particulate iron tracers", "0" + "TRFED", "0,1", "number of dissolved iron tracers", "0" "ICE_SNICARHC", "true,false", "include hardcoded (HC) snicar tables", "false" "ICE_BLDDEBUG", "true,false", "turn on compile debug flags", "false" "ICE_COVERAGE", "true,false", "turn on code coverage flags", "false" @@ -265,7 +265,7 @@ shortwave_nml "``shortwave``", "``ccsm3``", "NCAR CCSM3 shortwave distribution method", "``dEdd``" "", "``dEdd``", "Delta-Eddington method (3-band)", "" "", "``dEdd_snicar_ad``", "Delta-Eddington method with 5-band snow", "" - "``snw_ssp_table``", "``snicar``", "lookup table for `dEdd_snicar_ad`", "" + "``snw_ssp_table``", "``snicar``", "lookup table for `dEdd_snicar_ad`", "test" "", "``test``", "reduced lookup table for `dEdd_snicar_ad` testing", "" "``sw_dtemp``", "real", "temperature from melt for sw_redist", "0.02" "``sw_frac``", "real", "fraction of shortwave redistribution", "0.9" @@ -284,7 +284,7 @@ ponds_nml "``frzpnd``", "``cesm``", "CESM pond refreezing forumulation", "``cesm``" "", "``hlid``", "Stefan refreezing with pond ice thickness", "" "``hp1``", "real", "critical ice lid thickness for topo ponds in m", "0.01" - "``hs0``", "real", "snow depth of transition to bare sea ice in m", "" + "``hs0``", "real", "snow depth of transition to bare sea ice in m", "0.03" "``hs1``", "real", "snow depth of transition to pond ice in m", "0.03" "``pndaspect``", "real", "aspect ratio of pond changes (depth:area)", "0.8" "``rfracmax``", ":math:`0 \le r_{max} \le 1`", "maximum melt water added to ponds", "0.85" @@ -307,12 +307,12 @@ snow_nml "``rsnw_tmax``", "real", "maximum snow radius (um)", "1500.0" "``snw_aging_table``", "test", "snow aging lookup table", "test" "", "snicar", "(not available in Icepack)", "" - "``snwgrain``", "logical", "snow grain metamorphosis", ".true." + "``snwgrain``", "logical", "snow grain metamorphosis", ".false." "``snwlvlfac``", "real", "fraction increase in bulk snow redistribution", "0.3" - "``snwredist``", "``snwITDrdg``", "snow redistribution using ITD/ridges", "snwITDrdg" + "``snwredist``", "``snwITDrdg``", "snow redistribution using ITD/ridges", "none" "", "``bulk``", "bulk snow redistribution", "" "", "``none``", "no snow redistribution", "" - "``use_smliq_pnd``", "logical", "use liquid in snow for ponds", ".true." + "``use_smliq_pnd``", "logical", "use liquid in snow for ponds", ".false." "``windmin``", "real", "minimum wind speed to compact snow", "10.0" "", "", "", "" @@ -392,69 +392,70 @@ forcing_nml "", "``random``", "wave data file is provided, sea surface height generated using random number (multiple iterations of wave fracture)", "" "``ycycle``", "integer", "number of years in forcing data cycle", "1" "", "", "", "" + +* = If Icepack is run stand-alone and wave_spec_type is not set to none, then a fixed wave spectrum is defined in the code to use for testing. As with other input data, this spectrum should not be used for production runs or publications. zbgc_nml ~~~~~~~~~~~~~~~~~~~~~~~~~ +.. _tab-bio-tracers-namelist2: + .. csv-table:: **zbgc_nml namelist options** :header: "variable", "options/format", "description", "default value" - :widths: 15, 15, 30, 15 + :widths: 15, 15, 30, 15 "", "", "", "" "``algaltype_diatoms``", "real", "mobility type between stationary and mobile algal diatoms", "0.0" - "``algaltype_phaeo``", "real", "mobility type between stationary and mobile algal phaeocystis", "0.5" - "``algaltype_sp``", "real", "mobility type between stationary and mobile small plankton", "0.5" - "``algal_vel``", "real", ":cite:`Lavoie05`", "1.11e-8" - "``alpha2max_low_diatoms``", "real", "light limitation diatoms 1/(W/m^2)", "0.8" - "``alpha2max_low_phaeo``", "real", "light limitation phaeocystis 1/(W/m^2)", "0.67" - "``alpha2max_low_sp``", "real", "light limitation small plankton 1/(W/m^2)", "0.67" - "``ammoniumtype``", "real", "mobility type between stationary and mobile ammonium", "1.0" - "``beta2max_diatoms``", "real", "light inhibition diatoms 1/(W/m^2)", "0.18" - "``beta2max_phaeo``", "real", "light inhibition phaeocystis 1/(W/m^2)", "0.01" - "``beta2max_sp``", "real", "light inhibition small plankton 1/(W/m^2)", "0.0025" - "``bgc_data_type``", "``clim``", "bgc climatological data", "``default``" - "", "``default``", "constant values defined in the code", "" - "", "``ncar``", "POP ocean forcing data", "" + "``algaltype_phaeo``", "real", "mobility type between stationary and mobile algal phaeocystis", "0.0" + "``algaltype_sp``", "real", "mobility type between stationary and mobile small plankton", "0.0" + "``algal_vel``", "real", "maximum speed of algae (m/s) :cite:`Lavoie05`", "1.0e-7" + "``alpha2max_low_diatoms``", "real", "light limitation diatoms 1/(W/m^2)", "0.3" + "``alpha2max_low_phaeo``", "real", "light limitation phaeocystis 1/(W/m^2)", "0.17" + "``alpha2max_low_sp``", "real", "light limitation small plankton 1/(W/m^2)", "0.2" + "``ammoniumtype``", "real", "mobility type between stationary and mobile ammonium", "0.0" + "``beta2max_diatoms``", "real", "light inhibition diatoms 1/(W/m^2)", "0.001" + "``beta2max_phaeo``", "real", "light inhibition phaeocystis 1/(W/m^2)", "0.04" + "``beta2max_sp``", "real", "light inhibition small plankton 1/(W/m^2)", "0.001" "``bgc_flux_type``", "``constant``", "constant ice–ocean flux velocity", "``Jin2006``" "", "``Jin2006``", "ice–ocean flux velocity of :cite:`Jin06`", "" "``chlabs_diatoms``", "real", "chl absorbtion diatoms 1/m/(mg/m^3)", "0.03" "``chlabs_phaeo``", "real", "chl absorbtion phaeocystis 1/m/(mg/m^3)", "0.05" "``chlabs_sp``", "real", "chl absorbtion small plankton 1/m/(mg/m^3)", "0.01" - "``dEdd_algae``", "logical", "", "``.false.``" - "``dmspdtype``", "real", "mobility type between stationary and mobile dmspd", "-1.0" + "``dEdd_algae``", "logical", "include ice bgc and/or aerosols in radiative transfer", "``.false.``" + "``dmspdtype``", "real", "mobility type between stationary and mobile dmspd", "0.0" "``dmspptype``", "real", "mobility type between stationary and mobile dmspp", "0.5" - "``doctype_l``", "real", "mobility type between stationary and mobile doc lipids", "0.5" - "``doctype_s``", "real", "mobility type between stationary and mobile doc saccharids", "0.5" - "``dontype_protein``", "real", "mobility type between stationary and mobile don proteins", "0.5" + "``doctype_l``", "real", "mobility type between stationary and mobile doc lipids", "0.0" + "``doctype_s``", "real", "mobility type between stationary and mobile doc saccharids", "0.0" + "``dontype_protein``", "real", "mobility type between stationary and mobile don proteins", "0.0" "``dustFe_sol``", "real", "solubility fraction", "0.005" - "``fedtype_1``", "real", "mobility type between stationary and mobile fed lipids", "0.5" + "``fedtype_1``", "real", "mobility type between stationary and mobile fed lipids", "0.0" "``feptype_1``", "real", "mobility type between stationary and mobile fep lipids", "0.5" - "``frazil_scav``", "real", "increase in initial bio bracer from ocean scavenging", "1.0" - "``fr_dFe``", "real", "fraction of remineralized nitrogen in units of algal iron", "0.3" - "``fr_graze_diatoms``", "real", "fraction grazed diatoms", "0.01" + "``frazil_scav``", "real", "increase in initial bio bracer from ocean scavenging", "0.8" + "``fr_dFe``", "real", "fraction of remineralized iron from algae", "1.0" + "``fr_graze_diatoms``", "real", "fraction grazed diatoms", "0.19" "``fr_graze_e``", "real", "fraction of assimilation excreted", "0.5" - "``fr_graze_phaeo``", "real", "fraction grazed phaeocystis", "0.1" + "``fr_graze_phaeo``", "real", "fraction grazed phaeocystis", "0.19" "``fr_graze_s``", "real", "fraction of grazing spilled or slopped", "0.5" - "``fr_graze_sp``", "real", "fraction grazed small plankton", "0.1" - "``fr_mort2min``", "real", "fractionation of mortality to Am", "0.5" - "``fr_resp``", "real", "frac of algal growth lost due to respiration", "0.05" - "``fr_resp_s``", "real", "DMSPd fraction of respiration loss as DMSPd", "0.75" + "``fr_graze_sp``", "real", "fraction grazed small plankton", "0.19" + "``fr_mort2min``", "real", "fractionation of mortality to Am", "0.9" + "``fr_resp``", "real", "fraction of algal growth lost due to respiration", "0.05" + "``fr_resp_s``", "real", "DMSPd fraction of respiration loss as DMSPd", "0.9" "``fsal``", "real", "salinity limitation ppt", "1.0" "``F_abs_chl_diatoms``", "real", "scales absorbed radiation for dEdd chl diatoms", "2.0" "``F_abs_chl_phaeo``", "real", "scales absorbed radiation for dEdd chl phaeocystis", "5.0" "``F_abs_chl_sp``", "real", "scales absorbed radiation for dEdd small plankton", "4.0" - "``f_doc_l``", "real", "fraction of mortality to DOC lipids", "0.4" - "``f_doc_s``", "real", "fraction of mortality to DOC saccharides", "0.4" - "``f_don_Am_protein``", "real", "fraction of remineralized DON to ammonium", "0.25" + "``f_doc_l``", "real", "fraction of mortality to DOC lipids", "0.5" + "``f_doc_s``", "real", "fraction of mortality to DOC saccharides", "0.5" + "``f_don_Am_protein``", "real", "fraction of remineralized DON to ammonium", "1.0" "``f_don_protein``", "real", "fraction of spilled grazing to proteins", "0.6" "``f_exude_l``", "real", "fraction of exudation to DOC lipids", "1.0" "``f_exude_s``", "real", "fraction of exudation to DOC saccharids", "1.0" - "``grid_o``", "real", "z biology for bottom flux", "5.0" + "``grid_o``", "real", "z biology length scale for bottom flux (m)", "0.006" "``grid_oS``", "real", "DEPRECATED", "" - "``grow_Tdep_diatoms``", "real", "temperature dependence growth diatoms per degC", "0.06" - "``grow_Tdep_phaeo``", "real", "temperature dependence growth phaeocystis per degC", "0.06" - "``grow_Tdep_sp``", "real", "temperature dependence growth small plankton per degC", "0.06" - "``humtype``", "real", "mobility type between stationary and mobile hum", "1.0" + "``grow_Tdep_diatoms``", "real", "temperature dependence growth diatoms per degC", "0.063" + "``grow_Tdep_phaeo``", "real", "temperature dependence growth phaeocystis per degC", "0.063" + "``grow_Tdep_sp``", "real", "temperature dependence growth small plankton per degC", "0.063" + "``humtype``", "real", "mobility type between stationary and mobile hum", "0.0" "``initbio_frac``", "real", "fraction of ocean trcr concentration in bio tracers", "1.0" "``K_Am_diatoms``", "real", "ammonium half saturation diatoms mmol/m^3", "0.3" "``K_Am_phaeo``", "real", "ammonium half saturation phaeocystis mmol/m^3", "0.3" @@ -467,45 +468,45 @@ zbgc_nml "``K_Fe_diatoms``", "real", "iron half saturation diatoms nM", "1.0" "``K_Fe_phaeo``", "real", "iron half saturation phaeocystis nM", "0.1" "``K_Fe_sp``", "real", "iron half saturation small plankton nM", "0.2" - "``k_nitrif``", "real", "nitrification rate per day", "0.0" + "``k_nitrif``", "real", "nitrification rate per day", "0.046" "``K_Nit_diatoms``", "real", "nitrate half saturation diatoms mmol/m^3", "1.0" "``K_Nit_phaeo``", "real", "nitrate half saturation phaeocystis mmol/m^3", "1.0" "``K_Nit_sp``", "real", "nitrate half saturation small plankton mmol/m^3", "1.0" "``K_Sil_diatoms``", "real", "silicate half saturation diatoms mmol/m^3", "4.0" "``K_Sil_phaeo``", "real", "silicate half saturation phaeocystis mmol/m^3", "0.0" "``K_Sil_sp``", "real", "silicate half saturation small plankton mmol/m^3", "0.0" - "``kn_bac_protein``", "real", "bacterial degradation of DON per day", "0.03" - "``l_sk``", "real", "characteristic diffusive scale in m", "7.0" + "``kn_bac_protein``", "real", "bacterial degradation of DON per day", "0.2" + "``l_sk``", "real", "characteristic diffusive scale in m", "2.0" "``l_skS``", "real", "DEPRECATED", "" "``max_dfe_doc1``", "real", "max ratio of dFe to saccharides in the ice in nm Fe / muM C", "0.2" "``max_loss``", "real", "restrict uptake to percent of remaining value", "0.9" - "``modal_aero``", "logical", "modal aersols", "``.false.``" - "``mort_pre_diatoms``", "real", "mortality diatoms", "0.007" - "``mort_pre_phaeo``", "real", "mortality phaeocystis", "0.007" - "``mort_pre_sp``", "real", "mortality small plankton", "0.007" + "``modal_aero``", "logical", "modal aerosols", "``.false.``" + "``mort_pre_diatoms``", "real", "mortality diatoms per day", "0.007" + "``mort_pre_phaeo``", "real", "mortality phaeocystis per day", "0.007" + "``mort_pre_sp``", "real", "mortality small plankton per day", "0.007" "``mort_Tdep_diatoms``", "real", "temperature dependence of mortality diatoms per degC", "0.03" "``mort_Tdep_phaeo``", "real", "temperature dependence of mortality phaeocystis per degC", "0.03" "``mort_Tdep_sp``", "real", "temperature dependence of mortality small plankton per degC", "0.03" - "``mu_max_diatoms``", "real", "maximum growth rate diatoms per day", "1.2" - "``mu_max_phaeo``", "real", "maximum growth rate phaeocystis per day", "0.851" - "``mu_max_sp``", "real", "maximum growth rate small plankton per day", "0.851" + "``mu_max_diatoms``", "real", "maximum growth rate diatoms per day", "1.44" + "``mu_max_phaeo``", "real", "maximum growth rate phaeocystis per day", "0.63" + "``mu_max_sp``", "real", "maximum growth rate small plankton per day", "0.41" "``nitratetype``", "real", "mobility type between stationary and mobile nitrate", "-1.0" "``op_dep_min``", "real", "light attenuates for optical depths exceeding min", "0.1" - "``phi_snow``", "real", "snow porosity for brine height tracer", "0.5" + "``phi_snow``", "real", "snow porosity for brine height tracer (compute from snow density if negative)", "-1.0" "``ratio_chl2N_diatoms``", "real", "algal chl to N in mg/mmol diatoms", "2.1" "``ratio_chl2N_phaeo``", "real", "algal chl to N in mg/mmol phaeocystis", "0.84" "``ratio_chl2N_sp``", "real", "algal chl to N in mg/mmol small plankton", "1.1" "``ratio_C2N_diatoms``", "real", "algal C to N in mol/mol diatoms", "7.0" "``ratio_C2N_phaeo``", "real", "algal C to N in mol/mol phaeocystis", "7.0" - "``ratio_C2N_proteins``", "real", "algal C to N in mol/mol proteins", "7.0" + "``ratio_C2N_proteins``", "real", "algal C to N in mol/mol proteins", "5.0" "``ratio_C2N_sp``", "real", "algal C to N in mol/mol small plankton", "7.0" - "``ratio_Fe2C_diatoms``", "real", "algal Fe to C in umol/mol diatoms", "0.0033" - "``ratio_Fe2C_phaeo``", "real", "algal Fe to C in umol/mol phaeocystis", "1.0" - "``ratio_Fe2C_sp``", "real", "algal Fe to C in umol/mol small plankton", "0.0033" - "``ratio_Fe2N_diatoms``", "real", "algal Fe to N in umol/mol diatoms", "0.23" - "``ratio_Fe2N_phaeo``", "real", "algal Fe to N in umol/mol phaeocystis", "0.7" - "``ratio_Fe2N_sp``", "real", "algal Fe to N in umol/mol small plankton", "0.23" - "``ratio_Fe2DOC_s``", "real", "Fe to C of DON saccharids nmol/umol", "1.0" + "``ratio_Fe2C_diatoms``", "real", "algal Fe to C in mmol/mol diatoms", "0.0033" + "``ratio_Fe2C_phaeo``", "real", "algal Fe to C in mmol/mol phaeocystis", "0.1" + "``ratio_Fe2C_sp``", "real", "algal Fe to C in mmol/mol small plankton", "0.0033" + "``ratio_Fe2N_diatoms``", "real", "algal Fe to N in mmol/mol diatoms", "0.023" + "``ratio_Fe2N_phaeo``", "real", "algal Fe to N in mmol/mol phaeocystis", "0.7" + "``ratio_Fe2N_sp``", "real", "algal Fe to N in mmol/mol small plankton", "0.023" + "``ratio_Fe2DOC_s``", "real", "Fe to C of DON saccharids nmol/umol", "0.1" "``ratio_Fe2DOC_l``", "real", "Fe to C of DOC lipids nmol/umol", "0.033" "``ratio_Fe2DON``", "real", "Fe to C of DON nmol/umol", "0.023" "``ratio_Si2N_diatoms``", "real", "algal Si to N in mol/mol diatoms", "1.8" @@ -514,39 +515,39 @@ zbgc_nml "``ratio_S2N_diatoms``", "real", "algal S to N in mol/mol diatoms", "0.03" "``ratio_S2N_phaeo``", "real", "algal S to N in mol/mol phaeocystis", "0.03" "``ratio_S2N_sp``", "real", "algal S to N in mol/mol small plankton", "0.03" - "``restore_bgc``", "logical", "restore bgc to data", "``.false.``" + "``restore_bgc``", "logical", "DEPRECATED", "``.false.``" "``R_dFe2dust``", "real", "g/g :cite:`Tagliabue09`", "0.035" - "``scale_bgc``", "logical", "", "``.false.``" + "``scale_bgc``", "logical", "initialize bgc by scaling with salinity", "``.false.``" "``silicatetype``", "real", "mobility type between stationary and mobile silicate", "-1.0" - "``skl_bgc``", "logical", "biogeochemistry", "``.false.``" - "``solve_zbgc``", "logical", "", "``.false.``" + "``skl_bgc``", "logical", "DEPRECATED: skeletal layer biogeochemistry", "``.false.``" + "``solve_zbgc``", "logical", "solve z-biogeochemistry reactions", "``.false.``" "``solve_zsal``", "logical", "DEPRECATED", "``.false.``" - "``tau_max``", "real", "long time mobile to stationary exchanges", "1.73e-5" - "``tau_min``", "real", "rapid module to stationary exchanges", "5200." + "``tau_max``", "real", "long time mobile to stationary exchanges (s)", "604800.0" + "``tau_min``", "real", "rapid module to stationary exchanges (s)", "3600.0" "``tr_bgc_Am``", "logical", "ammonium tracer", "``.false.``" "``tr_bgc_C``", "logical", "algal carbon tracer", "``.false.``" "``tr_bgc_chl``", "logical", "algal chlorophyll tracer", "``.false.``" "``tr_bgc_DMS``", "logical", "DMS tracer", "``.false.``" "``tr_bgc_DON``", "logical", "DON tracer", "``.false.``" "``tr_bgc_Fe``", "logical", "iron tracer", "``.false.``" - "``tr_bgc_hum``", "logical", "", "``.false.``" - "``tr_bgc_Nit``", "logical", "", "``.false.``" - "``tr_bgc_PON``", "logical", "PON tracer", "``.false.``" + "``tr_bgc_hum``", "logical", "refractory DOC", "``.false.``" + "``tr_bgc_Nit``", "logical", "nitrate tracer", "``.false.``" + "``tr_bgc_PON``", "logical", "Non-reactive nitrate tracer", "``.false.``" "``tr_bgc_Sil``", "logical", "silicate tracer", "``.false.``" "``tr_brine``", "logical", "brine height tracer", "``.false.``" "``tr_zaero``", "logical", "vertical aerosol tracers", "``.false.``" "``t_iron_conv``", "real", "desorption loss pFe to dFe in days", "3065." - "``t_sk_conv``", "real", "Stefels conversion time in days", "3.0" - "``t_sk_ox``", "real", "DMS oxidation time in days", "10.0" - "``T_max``", "real", "maximum temperature degC", "0.0" - "``y_sk_DMS``", "real", "fraction conversion given high yield", "0.5" - "``zaerotype_bc1``", "real", "mobility type between stationary and mobile zaero bc1", "1.0" - "``zaerotype_bc2``", "real", "mobility type between stationary and mobile zaero bc2", "1.0" - "``zaerotype_dust1``", "real", "mobility type between stationary and mobile zaero dust1", "1.0" - "``zaerotype_dust2``", "real", "mobility type between stationary and mobile zaero dust2", "1.0" - "``zaerotype_dust3``", "real", "mobility type between stationary and mobile zaero dust3", "1.0" - "``zaerotype_dust4``", "real", "mobility type between stationary and mobile zaero dust4", "1.0" - "``z_tracers``", "logical", "", "``.false.``" + "``t_sk_conv``", "real", "Stefels conversion time in days", "5.0" + "``t_sk_ox``", "real", "DMS oxidation time in days", "12.0" + "``T_max``", "real", "maximum brine temperature degC", "0.0" + "``y_sk_DMS``", "real", "fraction conversion given high yield", "0.7" + "``zaerotype_bc1``", "real", "mobility type between stationary and mobile zaero bc1", "-1.0" + "``zaerotype_bc2``", "real", "mobility type between stationary and mobile zaero bc2", "-1.0" + "``zaerotype_dust1``", "real", "mobility type between stationary and mobile zaero dust1", "-1.0" + "``zaerotype_dust2``", "real", "mobility type between stationary and mobile zaero dust2", "-1.0" + "``zaerotype_dust3``", "real", "mobility type between stationary and mobile zaero dust3", "-1.0" + "``zaerotype_dust4``", "real", "mobility type between stationary and mobile zaero dust4", "-1.0" + "``z_tracers``", "logical", "allows vertically resolved bgc and/or z-aerosol tracers", "``.false.``" "", "", "", "" @@ -562,19 +563,18 @@ zbgc_nml .. "``restart_hbrine``", "logical", "", "``.false.``" .. "``solve_zsal``", "logical", "update salinity tracer profile", "``.false.``" .. "TRZS", "0,1", "zsalinity tracer, needs TRBRI=1", "0" - -* = If Icepack is run stand-alone and wave_spec_type is not set to none, then a fixed wave spectrum is defined in the code to use for testing. As with other input data, this spectrum should not be used for production runs or publications. .. _tuning: -BGC Tuning Parameters +BGC Parameter Arrays ------------------------ -Biogeochemical tuning parameters are specified as namelist options in -**icepack\_in**. Table :ref:`tab-bio-tracers2` provides a list of parameters + +Biogeochemical parameter arrays are specified in the code from namelist options in +**icepack\_in**. Table :ref:`tab-bio-tracers2` provides a list of parameter arrays used in the reaction equations, their representation in the code, a -short description of each and the default values. Please keep in mind -that there has only been minimal tuning of the model. +short description of each and the namelist parameters (Table :ref:`tab-bio-tracers-namelist2`) +used in their definition. .. _tab-bio-tracers2: @@ -582,41 +582,22 @@ that there has only been minimal tuning of the model. :header: "Text Variable", "Variable in code", "Description", "Value", "units" :widths: 7, 20, 15, 15, 15 - ":math:`f_{graze}`", "fr\_graze(1:3)", "fraction of growth grazed", "0, 0.1, 0.1", "1" - ":math:`f_{res}`", "fr\_resp", "fraction of growth respired", "0.05", "1" - ":math:`l_{max}`", "max\_loss", "maximum tracer loss fraction", "0.9", "1" - ":math:`m_{pre}`", "mort\_pre(1:3)", "maximum mortality rate", "0.007, 0.007, 0.007", "day\ :math:`^{-1}`" - ":math:`m_{T}`", "mort\_Tdep(1:3)", "mortality temperature decay", "0.03, 0.03, 0.03", ":math:`^o`\ C\ :math:`^{-1}`" - ":math:`T_{max}`", "T\_max", "maximum brine temperature", "0", ":math:`^o`\ C" - ":math:`k_{nitr}`", "k\_nitrif", "nitrification rate", "0", "day\ :math:`^{-1}`" - ":math:`f_{ng}`", "fr\_graze\_e", "fraction of grazing excreted", "0.5", "1" - ":math:`f_{gs}`", "fr\_graze\_s", "fraction of grazing spilled", "0.5", "1" - ":math:`f_{nm}`", "fr\_mort2min", "fraction of mortality to :math:`{\mbox{NH$_4$}}`", "0.5", "1" - ":math:`f_{dg}`", "f\_don", "frac. spilled grazing to :math:`{\mbox{DON}}`", "0.6", "1" - ":math:`k_{nb}`", "kn\_bac :math:`^a`", "bacterial degradation of :math:`{\mbox{DON}}`", "0.03", "day\ :math:`^{-1}`" - ":math:`f_{cg}`", "f\_doc(1:3)", "fraction of mortality to :math:`{\mbox{DOC}}`", "0.4, 0.4, 0.2 ", "1" - ":math:`R_{c:n}^c`", "R\_C2N(1:3)", "algal carbon to nitrogen ratio", "7.0, 7.0, 7.0", "mol/mol" - ":math:`k_{cb}`", "k\_bac1:3\ :math:`^a`", "bacterial degradation of DOC", "0.03, 0.03, 0.03", "day\ :math:`^{-1}`" - ":math:`\tau_{fe}`", "t\_iron\_conv", "conversion time pFe :math:`\leftrightarrow` dFe", "3065.0 ", "day" - ":math:`r^{max}_{fed:doc}`", "max\_dfe\_doc1", "max ratio of dFe to saccharids", "0.1852", "nM Fe\ :math:`/\mu`\ M C" - ":math:`f_{fa}`", "fr\_dFe ", "fraction of remin. N to dFe", "0.3", "1" - ":math:`R_{fe:n}`", "R\_Fe2N(1:3)", "algal Fe to N ratio", "0.023, 0.023, 0.7", "mmol/mol" - ":math:`R_{s:n}`", "R\_S2N(1:3)", "algal S to N ratio", "0.03, 0.03, 0.03", "mol/mol" - ":math:`f_{sr}`", "fr\_resp\_s", "resp. loss as DMSPd", "0.75", "1" - ":math:`\tau_{dmsp}`", "t\_sk\_conv", "Stefels rate", "3.0", "day" - ":math:`\tau_{dms}`", "t\_sk\_ox", "DMS oxidation rate", "10.0", "day" - ":math:`y_{dms}`", "y\_sk\_DMS", "yield for DMS conversion", "0.5", "1" - ":math:`K_{{\mbox{NO$_3$}}}`", "K\_Nit(1:3)", ":math:`{\mbox{NO$_3$}}` half saturation constant", "1,1,1", "mmol/m\ :math:`^{3}`" - ":math:`K_{{\mbox{NH$_4$}}}`", "K\_Am(1:3)", ":math:`{\mbox{NH$_4$}}` half saturation constant", "0.3, 0.3, 0.3", "mmol/m\ :math:`^{-3}`" - ":math:`K_{{\mbox{SiO$_3$}}}`", "K\_Sil(1:3)", "silicate half saturation constant", "4.0, 0, 0", "mmol/m\ :math:`^{-3}`" - ":math:`K_{{\mbox{fed}}}`", "K\_Fe(1:3)", "iron half saturation constant", "1.0, 0.2, 0.1", ":math:`\mu`\ mol/m\ :math:`^{-3}`" - ":math:`op_{min}`", "op\_dep\_min", "boundary for light attenuation", "0.1", "1" - ":math:`chlabs`", "chlabs(1:3)", "light absorption length per chla conc.", "0.03, 0.01, 0.05", "1\ :math:`/`\ m\ :math:`/`\ (mg\ :math:`/`\ m\ :math:`^{3}`)" - ":math:`\alpha`", "alpha2max\_low(1:3)", "light limitation factor", "0.25, 0.25, 0.25", "m\ :math:`^2`/W" - ":math:`\beta`", "beta2max(1:3)", "light inhibition factor", "0.018, 0.0025, 0.01", "m\ :math:`^2`/W" - ":math:`\mu_{max}`", "mu\_max(1:3)", "maximum algal growth rate", "1.44, 0.851, 0.851", "day\ :math:`^{-1}`" - ":math:`\mu_T`", "grow\_Tdep(1:3)", "temperature growth factor", "0.06, 0.06, 0.06", "day\ :math:`^{-1}`" - ":math:`f_{sal}`", "fsal", "salinity growth factor", "1", "1" - ":math:`R_{si:n}`", "R\_Si2N(1:3)", "algal silicate to nitrogen", "1.8, 0, 0", "mol/mol" - -:math:`^a` only (1:2) of DOC and DOC parameters have physical meaning + ":math:`f_{graze}`", "fr\_graze(1:3)", "fraction of growth grazed", "(``fr_graze_diatoms``, ``fr_graze_sp``, ``fr_graze_phaeo``)", "1" + ":math:`m_{pre}`", "mort\_pre(1:3)", "maximum mortality rate", "(``mort_pre_diatoms``, ``mort_pre_sp``, ``mort_pre_phaeo``)", "day\ :math:`^{-1}`" + ":math:`m_{T}`", "mort\_Tdep(1:3)", "mortality temperature decay", "(``mort_Tdep_diatoms``, ``mort_Tdep_sp``, ``mort_Tdep_phaeo``)", ":math:`^o`\ C\ :math:`^{-1}`" + ":math:`f_{cg}`", "f\_doc(1:2)", "fraction of mortality to :math:`{\mbox{DOC}}`", "(``f_doc_s``, ``f_doc_l``)", "1" + ":math:`R_{c:n}`", "R\_C2N(1:3)", "algal carbon to nitrogen ratio", "(``ratio_C2N_diatoms``, ``ratio_C2N_sp``, ``ratio_C2N_phaeo``)", "mol/mol" + ":math:`k_{cb}`", "k\_bac(1:2)", "bacterial degradation of DOC", "(``k_bac_s``, ``k_bac_l``)", "day\ :math:`^{-1}`" + ":math:`R_{fe:n}`", "R\_Fe2N(1:3)", "algal Fe to N ratio", "(``ratio_Fe2N_diatoms``, ``ratio_Fe2N_sp``, ``ratio_Fe2N_phaeo``)", "mmol/mol" + ":math:`R_{s:n}`", "R\_S2N(1:3)", "algal S to N ratio", "(``ratio_S2N_diatoms``, ``ratio_S2N_sp``, ``ratio_S2N_phaeo``)", "mol/mol" + ":math:`K_{{\mbox{NO$_3$}}}`", "K\_Nit(1:3)", ":math:`{\mbox{NO$_3$}}` half saturation constant", "(``K_Nit_diatoms``, ``K_Nit_sp``, ``K_Nit_phaeo``)", "mmol/m\ :math:`^{3}`" + ":math:`K_{{\mbox{NH$_4$}}}`", "K\_Am(1:3)", ":math:`{\mbox{NH$_4$}}` half saturation constant", "(``K_Am_diatoms``, ``K_Am_sp``, ``K_Am_phaeo``)", "mmol/m\ :math:`^{-3}`" + ":math:`K_{{\mbox{SiO$_3$}}}`", "K\_Sil(1:3)", "silicate half saturation constant", "(``K_Sil_diatoms``, ``K_Sil_sp``, ``K_Sil_phaeo``)", "mmol/m\ :math:`^{-3}`" + ":math:`K_{{\mbox{fed}}}`", "K\_Fe(1:3)", "iron half saturation constant", "(``K_Fe_diatoms``, ``K_Fe_sp``, ``K_Fe_phaeo``)", ":math:`\mu`\ mol/m\ :math:`^{-3}`" + ":math:`chlabs`", "chlabs(1:3)", "light absorption length per chla conc.", "(``chlabs_diatoms``, ``chlabs_sp``, ``chlabs_phaeo``)", "1\ :math:`/`\ m\ :math:`/`\ (mg\ :math:`/`\ m\ :math:`^{3}`)" + + ":math:`\alpha`", "alpha2max\_low(1:3)", "light limitation factor", "(``alpha2max_low_diatoms``, ``alpha2max_low_sp``, ``alpha2max_low_phaeo``)", "m\ :math:`^2`/W" + ":math:`\beta`", "beta2max(1:3)", "light inhibition factor", "(``beta2max_diatoms``, ``beta2max_sp``, ``beta2max_phaeo``)", "m\ :math:`^2`/W" + ":math:`\mu_{max}`", "mu\_max(1:3)", "maximum algal growth rate", "(``mu_max_diatoms``, ``mu_max_sp``, ``mu_max_phaeo``)", "day\ :math:`^{-1}`" + ":math:`\mu_T`", "grow\_Tdep(1:3)", "temperature growth factor", "(``grow_Tdep_diatoms``, ``grow_Tdep_sp``, ``grow_Tdep_phaeo``)", "day\ :math:`^{-1}`" + ":math:`R_{si:n}`", "R\_Si2N(1:3)", "algal silicate to nitrogen", "(``ratio_Si2N_diatoms``, ``ratio_Si2N_sp``, ``ratio_Si2N_phaeo``)", "mol/mol"