diff --git a/columnphysics/icepack_algae.F90 b/columnphysics/icepack_algae.F90 index 6163c52f1..4a7171653 100644 --- a/columnphysics/icepack_algae.F90 +++ b/columnphysics/icepack_algae.F90 @@ -197,7 +197,7 @@ subroutine zbio (dt, nblyr, & !change to inout when updating ocean fields ocean_bio ! ocean concentrations (mmol/m^3) - real (kind=dbl_kind), dimension (nbtrcr), intent(out) :: & + 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) @@ -208,13 +208,15 @@ subroutine zbio (dt, nblyr, & PP_net , & ! net PP (mg C/m^2/d) times aice grow_net , & ! net specific growth (m/d) times vice upNO , & ! tot nitrate uptake rate (mmol/m^2/d) times aice - upNH , & ! tot ammonium 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), dimension (nblyr+1), intent(inout):: & ! diagnostics - bioPorosityIceCell , & ! porosity on vertical interface points - bioSalinityIceCell , & ! salinity on vertical interface points (ppt) - bioTemperatureIceCell ! temperature on vertical interface points (oC) + real (kind=dbl_kind), optional, dimension (nblyr+1), intent(inout):: & ! diagnostics + 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 @@ -265,6 +267,7 @@ subroutine zbio (dt, nblyr, & write_flux_diag = .false. call bgc_carbon_sum(nblyr, hbri_old, trcrn(:), carbonInitial,n_doc,n_dic,n_algae,n_don) + if (icepack_warnings_aborted(subname)) return if (aice_old > puny) then hsnow_i = vsno_old/aice_old @@ -324,7 +327,9 @@ subroutine zbio (dt, nblyr, & enddo call bgc_carbon_sum(nblyr, hbri, trcrn(:), carbonFinal,n_doc,n_dic,n_algae,n_don) + if (icepack_warnings_aborted(subname)) return call bgc_carbon_flux(flux_bio_atm,flux_bion,n_doc,n_dic,n_algae,n_don,carbonFlux) + if (icepack_warnings_aborted(subname)) return carbonError = carbonInitial-carbonFlux*dt-carbonFinal @@ -379,7 +384,6 @@ subroutine zbio (dt, nblyr, & !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 @@ -408,7 +412,6 @@ subroutine zbio (dt, nblyr, & enddo endif endif - if (icepack_warnings_aborted(subname)) return call merge_bgc_fluxes (dt, nblyr, & @@ -450,6 +453,7 @@ subroutine zbio (dt, nblyr, & enddo endif endif + if (icepack_warnings_aborted(subname)) return end subroutine zbio @@ -645,6 +649,7 @@ subroutine skl_biogeochemistry (dt, & rphi_sk = c1/phi_sk PVt = c0 iTin = Tf + ice_growth = (congel-meltb)/dt do nn = 1, nbtrcr cinit (nn) = c0 @@ -666,7 +671,6 @@ subroutine skl_biogeochemistry (dt, & cling (nn) = c1 endif - ice_growth = (congel-meltb)/dt cinit (nn) = trcrn(bio_index(nn)) * sk_l * rphi_sk cinit_v(nn) = cinit(nn)/sk_l if (cinit(nn) < c0) then @@ -908,7 +912,7 @@ subroutine z_biogeochemistry (n_cat, dt, & ocean_bio , & ! ocean concentrations (mmol/m^3) bphin ! Porosity on the bgrid - real (kind=dbl_kind), dimension (:), intent(out) :: & + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & ocean_bio_dh ! ocean concentrations * hbrine * phi (mmol/m^2) real (kind=dbl_kind), intent(in) :: & @@ -1053,7 +1057,7 @@ subroutine z_biogeochemistry (n_cat, dt, & darcyV = c0 C_top(:) = c0 C_bot(:) = c0 - ocean_bio_dh(:) = c0 + if (present(ocean_bio_dh)) ocean_bio_dh(:) = c0 mobile(:) = c0 conserve_C(:) = .true. nitrification(:) = c0 @@ -1177,7 +1181,7 @@ subroutine z_biogeochemistry (n_cat, dt, & endif C_bot(m) = ocean_bio(m)*hbri_old*iphin_N(nblyr+1) - ocean_bio_dh(m) = C_bot(m) + if (present(ocean_bio_dh)) ocean_bio_dh(m) = C_bot(m) enddo ! m diff --git a/columnphysics/icepack_parameters.F90 b/columnphysics/icepack_parameters.F90 index b5e9a622f..7f2a04e08 100644 --- a/columnphysics/icepack_parameters.F90 +++ b/columnphysics/icepack_parameters.F90 @@ -572,7 +572,7 @@ subroutine icepack_init_parameters( & bgc_flux_type_in, z_tracers_in, scale_bgc_in, solve_zbgc_in, & modal_aero_in, use_macromolecules_in, restartbgc_in, skl_bgc_in, & solve_zsal_in, grid_o_in, l_sk_in, & - grid_oS_in, l_skS_in, dEdd_algae_in, & + initbio_frac_in, grid_oS_in, l_skS_in, dEdd_algae_in, & phi_snow_in, T_max_in, fsal_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, & @@ -882,6 +882,7 @@ subroutine icepack_init_parameters( & 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 :: & @@ -1359,6 +1360,7 @@ subroutine icepack_init_parameters( & 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 diff --git a/columnphysics/icepack_zbgc.F90 b/columnphysics/icepack_zbgc.F90 index a327778bd..3a73fcc7a 100644 --- a/columnphysics/icepack_zbgc.F90 +++ b/columnphysics/icepack_zbgc.F90 @@ -20,6 +20,7 @@ module icepack_zbgc !use icepack_parameters, only: scale_bgc, ktherm, skl_bgc !use icepack_parameters, only: z_tracers, fsal, conserv_check + use icepack_tracers, only: nilyr, nslyr, nblyr 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: nt_sice, bio_index, bio_index_o @@ -482,7 +483,7 @@ subroutine icepack_init_bgc(ncat, nblyr, nilyr, & real (kind=dbl_kind), dimension (:), intent(in) :: & ocean_bio_all ! fixed order, all values even for tracers false - real (kind=dbl_kind), dimension (:), intent(out) :: & + real (kind=dbl_kind), dimension (:), optional, intent(out) :: & DOCPoolFractions ! Fraction of DOC in polysacharids, lipids, and proteins !autodocument_end @@ -563,91 +564,23 @@ subroutine icepack_init_bgc(ncat, nblyr, nilyr, & endif ! skl_bgc endif ! restart - DOCPoolFractions(:) = c1 - if (.not. use_macromolecules) then - do mm = 1,max_doc - DOCPoolFractions(mm) = doc_pool_fractions(mm) - end do - end if + 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 !======================================================================= +#ifdef NEWINITZBGC !autodocument_start icepack_init_zbgc ! - subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & - n_algae_in, n_zaero_in, n_doc_in, n_dic_in, n_don_in, n_fed_in, n_fep_in, & - trcr_base, trcr_depend, n_trcr_strata, nt_strata, nbtrcr_sw_out, tr_brine_in,& - nt_fbri_out, ntrcr_out,ntrcr_o_out, nbtrcr_out, nt_bgc_Nit_out, nt_bgc_Am_out, & - nt_bgc_Sil_out, nt_bgc_DMS_out, nt_bgc_PON_out, nt_bgc_N_out, & - nt_bgc_C_out, nt_bgc_chl_out, nt_bgc_DOC_out, nt_bgc_DON_out, nt_bgc_DIC_out, & - nt_zaero_out, nt_bgc_DMSPp_out, nt_bgc_DMSPd_out, nt_bgc_Fed_out, nt_bgc_Fep_out, & - nt_zbgc_frac_out, tr_bgc_Nit_in, tr_bgc_Am_in, tr_bgc_Sil_in, tr_bgc_DMS_in, & - tr_bgc_PON_in, tr_bgc_N_in, tr_bgc_C_in, tr_bgc_chl_in, & - tr_bgc_DON_in, tr_bgc_Fe_in, tr_zaero_in, nlt_zaero_sw_out, nlt_chl_sw_out, & - nlt_bgc_N_out, nlt_bgc_Nit_out, nlt_bgc_Am_out, nlt_bgc_Sil_out, & - nlt_bgc_DMS_out, nlt_bgc_DMSPp_out, nlt_bgc_DMSPd_out, & - nlt_bgc_C_out, nlt_bgc_chl_out, nlt_bgc_DIC_out, nlt_bgc_DOC_out, & - nlt_bgc_PON_out, nlt_bgc_DON_out, nlt_bgc_Fed_out, nlt_bgc_Fep_out, & - nlt_zaero_out, & - nt_bgc_hum_out, nlt_bgc_hum_out, tr_bgc_hum_in, & - skl_bgc_in, z_tracers_in, dEdd_algae_in, solve_zbgc_in, & - bio_index_o_out, bio_index_out, & - frazil_scav_in, initbio_frac_in, & - max_algae_in, max_doc_in, max_dic_in, max_don_in, max_fe_in, max_aero_in, & !optional - 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_don_protein_in, kn_bac_protein_in, & - f_don_Am_protein_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, & - 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, & - nitratetype_in, ammoniumtype_in, dmspptype_in, dmspdtype_in, & - silicatetype_in, humtype_in, tau_min_in, tau_max_in) - - integer (kind=int_kind), intent(in) :: & - nblyr , & ! number of bio/brine layers per category - nilyr , & ! number of ice layers per category - nslyr ! number of snow layers per category - - integer (kind=int_kind), optional, intent(in) ::& - n_zaero_in , & ! number of z aerosols in use - n_algae_in , & ! number of algae in use - n_doc_in , & ! number of DOC pools in use - n_dic_in , & ! number of DIC pools in use - n_don_in , & ! number of DON pools in use - n_fed_in , & ! number of Fe pools in use dissolved Fe - n_fep_in ! number of Fe pools in use particulate Fe - - integer (kind=int_kind), optional, intent(inout) :: & - ntrcr_out, & ! number of tracers - ntrcr_o_out, & ! number of non-bio tracers in use - nbtrcr_out, & ! number of bgc tracers in use - nbtrcr_sw_out ! size of shorwave tracer vector + subroutine icepack_init_zbgc(trcr_base, trcr_depend, n_trcr_strata, nt_strata, printdiags ) integer (kind=int_kind), dimension (:), intent(inout) :: & trcr_depend ! = 0 for ice area tracers @@ -665,190 +598,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & ! argument 2: (1) aice, (2) vice, (3) vsno logical (kind=log_kind), optional, intent(in) :: & - tr_brine_in, & ! if .true., brine height differs from ice thickness - tr_zaero_in, & ! if .true., black carbon is tracers (n_zaero) - tr_bgc_Nit_in, & ! if .true. Nitrate tracer in ice - tr_bgc_N_in, & ! if .true., algal nitrogen tracers (n_algae) - tr_bgc_DON_in, & ! if .true., DON pools are tracers (n_don) - tr_bgc_C_in, & ! if .true., algal carbon tracers + DOC and DIC - tr_bgc_chl_in, & ! if .true., algal chlorophyll tracers - tr_bgc_Am_in, & ! if .true., ammonia/um as nutrient tracer - tr_bgc_Sil_in, & ! if .true., silicon as nutrient tracer - tr_bgc_DMS_in, & ! if .true., DMS as tracer - tr_bgc_Fe_in, & ! if .true., Fe as tracer - tr_bgc_PON_in, & ! if .true., PON as tracer - tr_bgc_hum_in, & ! if .true., humic material as tracer - z_tracers_in, & ! if .true., bgc or aerosol tracers are vertically resolved - solve_zbgc_in, & ! if .true., solve vertical biochemistry portion of code - dEdd_algae_in, & ! if .true., algal absorption of Shortwave is computed in the - skl_bgc_in ! if true, solve skeletal biochemistry - - integer (kind=int_kind), optional, intent(in) ::& - max_algae_in , & - max_doc_in , & - max_dic_in , & - max_don_in , & - max_fe_in , & - max_aero_in - - real (kind=dbl_kind), optional, intent(in) :: & - initbio_frac_in, & ! fraction of ocean tracer concentration used to initialize tracer - frazil_scav_in ! multiple of ocean tracer concentration due to frazil scavenging - - real (kind=dbl_kind), optional, intent(in) :: & - 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) - - integer (kind=int_kind), optional, intent(out) :: & - nt_fbri_out, & ! volume fraction of ice with dynamic salt (hinS/vicen*aicen) - nt_bgc_Nit_out, & ! nutrients - nt_bgc_Am_out, & ! - nt_bgc_Sil_out, & ! - nt_bgc_DMSPp_out, & ! trace gases (skeletal layer) - nt_bgc_DMSPd_out, & ! - nt_bgc_DMS_out, & ! - nt_bgc_PON_out, & ! zooplankton and detritus - nt_bgc_hum_out, & ! humic material - ! bio layer indicess - nlt_bgc_Nit_out, & ! nutrients - nlt_bgc_Am_out, & ! - nlt_bgc_Sil_out, & ! - nlt_bgc_DMSPp_out,& ! trace gases (skeletal layer) - nlt_bgc_DMSPd_out,& ! - nlt_bgc_DMS_out, & ! - nlt_bgc_PON_out, & ! zooplankton and detritus - nlt_bgc_hum_out, & ! humic material - nlt_chl_sw_out, & ! points to total chla in trcrn_sw - nt_zbgc_frac_out ! fraction of tracer in the mobile phase - - integer (kind=int_kind), dimension(:), optional, intent(out) :: & - nt_bgc_N_out , & ! diatoms, phaeocystis, pico/small - nt_bgc_C_out , & ! diatoms, phaeocystis, pico/small - nt_bgc_chl_out,& ! diatoms, phaeocystis, pico/small - nlt_bgc_N_out ,& ! diatoms, phaeocystis, pico/small - nlt_bgc_C_out ,& ! diatoms, phaeocystis, pico/small - nlt_bgc_chl_out ! diatoms, phaeocystis, pico/small - - integer (kind=int_kind), dimension(:), optional, intent(out) :: & - nt_bgc_DOC_out, & ! dissolved organic carbon - nlt_bgc_DOC_out ! dissolved organic carbon - - integer (kind=int_kind), dimension(:), optional, intent(out) :: & - nt_bgc_DON_out, & ! dissolved organic nitrogen - nlt_bgc_DON_out ! dissolved organic nitrogen - - integer (kind=int_kind), dimension(:), optional, intent(out) :: & - nt_bgc_DIC_out, & ! dissolved inorganic carbon - nlt_bgc_DIC_out ! dissolved inorganic carbon - - integer (kind=int_kind), dimension(:), optional, intent(out) :: & - nt_bgc_Fed_out, & ! dissolved iron - nt_bgc_Fep_out, & ! particulate iron - nlt_bgc_Fed_out, & ! dissolved iron - nlt_bgc_Fep_out ! particulate iron - - integer (kind=int_kind), dimension(:), optional, intent(out) :: & - nt_zaero_out, & ! black carbon and other aerosols - nlt_zaero_out, & ! black carbon and other aerosols - nlt_zaero_sw_out - - integer (kind=int_kind), dimension(:), optional, intent(out) :: & - bio_index_o_out , & ! nlt to appropriate value in ocean data array - bio_index_out ! nlt to nt + printdiags ! print diagnostics to warning package !autodocument_end @@ -863,175 +613,6 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & character(len=*),parameter :: subname='(icepack_init_zbgc)' !------------ - ! BGC Maximum Dimensions - if (present(max_algae_in) ) then - if (max_algae .ne. max_algae_in) then - call icepack_warnings_add(subname//' incorrect dimension max_algae_in') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - endif - endif - if (present(max_doc_in) ) then - if (max_doc .ne. max_doc_in) then - call icepack_warnings_add(subname//' incorrect dimension max_doc_in') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - endif - endif - if (present(max_dic_in) ) then - if (max_dic .ne. max_dic_in) then - call icepack_warnings_add(subname//' incorrect dimension max_dic_in') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - endif - endif - if (present(max_don_in) ) then - if (max_don .ne. max_don_in) then - call icepack_warnings_add(subname//' incorrect dimension max_don_in') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - endif - endif - if (present(max_fe_in) ) then - if (max_fe .ne. max_fe_in) then - call icepack_warnings_add(subname//' incorrect dimension max_fe_in') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - endif - endif - if (present(max_aero_in) ) then - if (max_aero .ne. max_aero_in) then - call icepack_warnings_add(subname//' incorrect dimension max_aero_in') - call icepack_warnings_setabort(.true.,__FILE__,__LINE__) - endif - endif - - ! BGC Tracer Dimensions - if (present(n_algae_in) ) n_algae = n_algae_in - if (present(n_zaero_in) ) n_zaero = n_zaero_in - if (present(n_doc_in) ) n_doc = n_doc_in - if (present(n_dic_in) ) n_dic = n_dic_in - if (present(n_don_in) ) n_don = n_don_in - if (present(n_fed_in) ) n_fed = n_fed_in - if (present(n_fep_in) ) n_fep = n_fep_in - - ! BGC Tracer Flags - if (present(tr_brine_in) ) tr_brine = tr_brine_in - if (present(tr_zaero_in) ) tr_zaero = tr_zaero_in - if (present(tr_bgc_Nit_in)) tr_bgc_Nit = tr_bgc_Nit_in - if (present(tr_bgc_N_in) ) tr_bgc_N = tr_bgc_N_in - if (present(tr_bgc_DON_in)) tr_bgc_DON = tr_bgc_DON_in - if (present(tr_bgc_C_in) ) tr_bgc_C = tr_bgc_C_in - if (present(tr_bgc_chl_in)) tr_bgc_chl = tr_bgc_chl_in - if (present(tr_bgc_Am_in) ) tr_bgc_Am = tr_bgc_Am_in - if (present(tr_bgc_Sil_in)) tr_bgc_Sil = tr_bgc_Sil_in - if (present(tr_bgc_DMS_in)) tr_bgc_DMS = tr_bgc_DMS_in - if (present(tr_bgc_Fe_in )) tr_bgc_Fe = tr_bgc_Fe_in - if (present(tr_bgc_hum_in)) tr_bgc_hum = tr_bgc_hum_in - if (present(tr_bgc_PON_in)) tr_bgc_PON = tr_bgc_PON_in - - !BGC Config Flags - if (present(z_tracers_in) ) z_tracers = z_tracers_in - if (present(solve_zbgc_in) ) solve_zbgc = solve_zbgc_in - if (present(dEdd_algae_in) ) dEdd_algae = dEdd_algae_in - if (present(skl_bgc_in) ) skl_bgc = skl_bgc_in - - !BGC Config Parameters - if (present(f_doc_l_in) ) f_doc_l = f_doc_l_in - if (present(f_doc_s_in) ) f_doc_s = f_doc_s_in - if (present(f_exude_l_in) ) f_exude_l = f_exude_l_in - if (present(f_exude_s_in) ) f_exude_s = f_exude_s_in - if (present(k_bac_l_in) ) k_bac_l = k_bac_l_in - if (present(k_bac_s_in) ) k_bac_s = k_bac_s_in - if (present(frazil_scav_in) ) frazil_scav = frazil_scav_in - if (present(initbio_frac_in) ) initbio_frac = initbio_frac_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 (present(ratio_Fe2N_sp_in) ) ratio_Fe2N_sp = ratio_Fe2N_sp_in - if (present(ratio_Fe2N_phaeo_in) ) ratio_Fe2N_phaeo = ratio_Fe2N_phaeo_in - 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 (present(K_Nit_sp_in) ) K_Nit_sp = K_Nit_sp_in - if (present(K_Nit_phaeo_in) ) K_Nit_phaeo = K_Nit_phaeo_in - if (present(K_Am_diatoms_in) ) K_Am_diatoms = K_Am_diatoms_in - if (present(K_Am_sp_in) ) K_Am_sp = K_Am_sp_in - if (present(K_Am_phaeo_in) ) K_Am_phaeo = K_Am_phaeo_in - 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(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(silicatetype_in) ) silicatetype = silicatetype_in - if (present(humtype_in) ) humtype = humtype_in - if (present(dontype_protein_in) ) dontype_protein = dontype_protein_in - if (present(dmspptype_in) ) dmspptype = dmspptype_in - if (present(dmspdtype_in) ) dmspdtype = dmspdtype_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(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 - - ! Total tracer counts. Initialize first - if (present(ntrcr_out) ) ntrcr = ntrcr_out - if (present(ntrcr_o_out) ) ntrcr_o = ntrcr_o_out - if (present(nbtrcr_out) ) nbtrcr = nbtrcr_out - if (present(nbtrcr_sw_out) ) nbtrcr_sw = nbtrcr_sw_out ntrcr_o = ntrcr nt_fbri = 0 @@ -1275,6 +856,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & nt_strata, bio_index) bio_index_o(nlt_bgc_N(mm)) = mm enddo ! mm + if (icepack_warnings_aborted(subname)) return endif ! tr_bgc_N if (tr_bgc_Nit) then @@ -1285,6 +867,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_Nit) = max_algae + 1 endif ! tr_bgc_Nit @@ -1313,6 +896,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_DOC(mm)) = max_algae + 1 + mm enddo ! mm do mm = 1, n_dic @@ -1323,6 +907,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_DIC(mm)) = max_algae + max_doc + 1 + mm enddo ! mm endif ! tr_bgc_C @@ -1336,6 +921,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_chl(mm)) = max_algae + 1 + max_doc + max_dic + mm enddo ! mm endif ! tr_bgc_chl @@ -1348,6 +934,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_Am) = 2*max_algae + max_doc + max_dic + 2 endif if (tr_bgc_Sil) then @@ -1358,6 +945,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_Sil) = 2*max_algae + max_doc + max_dic + 3 endif if (tr_bgc_DMS) then ! all together @@ -1368,6 +956,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_DMSPp) = 2*max_algae + max_doc + max_dic + 4 call icepack_init_bgc_trcr(nk, nt_fbri, & @@ -1377,6 +966,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_DMSPd) = 2*max_algae + max_doc + max_dic + 5 call icepack_init_bgc_trcr(nk, nt_fbri, & @@ -1386,6 +976,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_DMS) = 2*max_algae + max_doc + max_dic + 6 endif if (tr_bgc_PON) then @@ -1396,6 +987,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_PON) = 2*max_algae + max_doc + max_dic + 7 endif if (tr_bgc_DON) then @@ -1409,6 +1001,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & nt_strata, bio_index) bio_index_o(nlt_bgc_DON(mm)) = 2*max_algae + max_doc + max_dic + 7 + mm enddo ! mm + if (icepack_warnings_aborted(subname)) return endif ! tr_bgc_DON if (tr_bgc_Fe) then do mm = 1, n_fed @@ -1422,6 +1015,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bio_index_o(nlt_bgc_Fed(mm)) = 2*max_algae + max_doc + max_dic & + max_don + 7 + mm enddo ! mm + if (icepack_warnings_aborted(subname)) return do mm = 1, n_fep call icepack_init_bgc_trcr(nk, nt_fbri, & nt_bgc_Fep(mm), nlt_bgc_Fep(mm), & @@ -1433,6 +1027,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bio_index_o(nlt_bgc_Fep(mm)) = 2*max_algae + max_doc + max_dic & + max_don + max_fe + 7 + mm enddo ! mm + if (icepack_warnings_aborted(subname)) return endif ! tr_bgc_Fe if (tr_bgc_hum) then @@ -1443,6 +1038,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bgc_tracer_type, trcr_depend, & trcr_base, n_trcr_strata, & nt_strata, bio_index) + if (icepack_warnings_aborted(subname)) return bio_index_o(nlt_bgc_hum) = 2*max_algae + max_doc + 8 + max_dic & + max_don + 2*max_fe + max_aero endif @@ -1471,6 +1067,7 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & bio_index_o(nlt_zaero(mm)) = 2*max_algae + max_doc + max_dic & + max_don + 2*max_fe + 7 + mm enddo ! mm + if (icepack_warnings_aborted(subname)) return endif ! tr_zaero nt_zbgc_frac = 0 @@ -1515,52 +1112,84 @@ subroutine icepack_init_zbgc ( nblyr, nilyr, nslyr, & if (bgc_tracer_type(k) < c0) zbgc_init_frac(k) = initbio_frac enddo - ! BGC Indices - if (present(bio_index_out) ) bio_index_out = bio_index - if (present(bio_index_o_out) ) bio_index_o_out = bio_index_o - if (present(nt_fbri_out) ) nt_fbri_out = nt_fbri - if (present(nt_bgc_Nit_out) ) nt_bgc_Nit_out = nt_bgc_Nit - if (present(nlt_bgc_Nit_out) ) nlt_bgc_Nit_out = nlt_bgc_Nit - if (present(nt_bgc_Am_out) ) nt_bgc_Am_out = nt_bgc_Am - if (present(nlt_bgc_Am_out) ) nlt_bgc_Am_out = nlt_bgc_Am - if (present(nt_bgc_Sil_out) ) nt_bgc_Sil_out = nt_bgc_Sil - if (present(nlt_bgc_Sil_out) ) nlt_bgc_Sil_out = nlt_bgc_Sil - if (present(nt_bgc_DMSPp_out) ) nt_bgc_DMSPp_out = nt_bgc_DMSPp - if (present(nlt_bgc_DMSPp_out)) nlt_bgc_DMSPp_out= nlt_bgc_DMSPp - if (present(nt_bgc_DMSPd_out) ) nt_bgc_DMSPd_out = nt_bgc_DMSPd - if (present(nlt_bgc_DMSPd_out)) nlt_bgc_DMSPd_out= nlt_bgc_DMSPd - if (present(nt_bgc_DMS_out) ) nt_bgc_DMS_out = nt_bgc_DMS - if (present(nlt_bgc_DMS_out) ) nlt_bgc_DMS_out = nlt_bgc_DMS - if (present(nt_bgc_hum_out) ) nt_bgc_hum_out = nt_bgc_hum - if (present(nlt_bgc_hum_out) ) nlt_bgc_hum_out = nlt_bgc_hum - if (present(nt_bgc_PON_out) ) nt_bgc_PON_out = nt_bgc_PON - if (present(nlt_bgc_PON_out) ) nlt_bgc_PON_out = nlt_bgc_PON - if (present(nt_bgc_N_out) ) nt_bgc_N_out = nt_bgc_N - if (present(nlt_bgc_N_out) ) nlt_bgc_N_out = nlt_bgc_N - if (present(nt_bgc_C_out) ) nt_bgc_C_out = nt_bgc_C - if (present(nlt_bgc_C_out) ) nlt_bgc_C_out = nlt_bgc_C - if (present(nt_bgc_chl_out) ) nt_bgc_chl_out = nt_bgc_chl - if (present(nlt_bgc_chl_out) ) nlt_bgc_chl_out = nlt_bgc_chl - if (present(nt_bgc_DOC_out) ) nt_bgc_DOC_out = nt_bgc_DOC - if (present(nlt_bgc_DOC_out) ) nlt_bgc_DOC_out = nlt_bgc_DOC - if (present(nt_bgc_DON_out) ) nt_bgc_DON_out = nt_bgc_DON - if (present(nlt_bgc_DON_out) ) nlt_bgc_DON_out = nlt_bgc_DON - if (present(nt_bgc_DIC_out) ) nt_bgc_DIC_out = nt_bgc_DIC - if (present(nlt_bgc_DIC_out) ) nlt_bgc_DIC_out = nlt_bgc_DIC - if (present(nt_bgc_Fed_out) ) nt_bgc_Fed_out = nt_bgc_Fed - if (present(nlt_bgc_Fed_out) ) nlt_bgc_Fed_out = nlt_bgc_Fed - if (present(nt_bgc_Fep_out) ) nt_bgc_Fep_out = nt_bgc_Fep - if (present(nlt_bgc_Fep_out) ) nlt_bgc_Fep_out = nlt_bgc_Fep - if (present(nt_zaero_out) ) nt_zaero_out = nt_zaero - if (present(nlt_zaero_out) ) nlt_zaero_out = nlt_zaero - if (present(nlt_zaero_sw_out) ) nlt_zaero_sw_out = nlt_zaero_sw - if (present(nlt_chl_sw_out) ) nlt_chl_sw_out = nlt_chl_sw - if (present(nt_zbgc_frac_out) ) nt_zbgc_frac_out = nt_zbgc_frac - - if (present(ntrcr_out) ) ntrcr_out = ntrcr - if (present(ntrcr_o_out) ) ntrcr_o_out = ntrcr_o - if (present(nbtrcr_out) ) nbtrcr_out = nbtrcr - if (present(nbtrcr_sw_out)) nbtrcr_sw_out = nbtrcr_sw + !----------------------------------------------------------------- + ! final consistency checks + !----------------------------------------------------------------- + + if (nbtrcr > max_nbtrcr) then + write (warnstr,'(a,2i6)') subname//'ERROR: nbtrcr > max_nbtrcr:',nbtrcr, max_nbtrcr + call icepack_warnings_add(warnstr) + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + endif + if (.NOT. dEdd_algae) nbtrcr_sw = 1 + + !----------------------------------------------------------------- + ! spew + !----------------------------------------------------------------- + + if (present(printdiags)) then + if (printdiags) then + write(warnstr,1030) subname//' output:' + if (skl_bgc) then + write(warnstr,1010) ' skl_bgc = ', skl_bgc + write(warnstr,1030) ' bgc_flux_type = ', bgc_flux_type + write(warnstr,1020) ' number of bio tracers = ', nbtrcr + write(warnstr,1020) ' number of Isw tracers = ', nbtrcr_sw + write(warnstr,1020) ' number of autotrophs = ', n_algae + write(warnstr,1020) ' number of doc = ', n_doc + write(warnstr,1020) ' number of dic = ', n_dic + write(warnstr,1020) ' number of don = ', n_don + write(warnstr,1020) ' number of fed = ', n_fed + write(warnstr,1020) ' number of fep = ', n_fep + write(warnstr,1010) ' tr_bgc_N = ', tr_bgc_N + write(warnstr,1010) ' tr_bgc_C = ', tr_bgc_C + write(warnstr,1010) ' tr_bgc_chl = ', tr_bgc_chl + write(warnstr,1010) ' tr_bgc_Nit = ', tr_bgc_Nit + write(warnstr,1010) ' tr_bgc_Am = ', tr_bgc_Am + write(warnstr,1010) ' tr_bgc_Sil = ', tr_bgc_Sil + write(warnstr,1010) ' tr_bgc_hum = ', tr_bgc_hum + write(warnstr,1010) ' tr_bgc_DMS = ', tr_bgc_DMS + write(warnstr,1010) ' tr_bgc_PON = ', tr_bgc_PON + write(warnstr,1010) ' tr_bgc_DON = ', tr_bgc_DON + write(warnstr,1010) ' tr_bgc_Fe = ', tr_bgc_Fe + elseif (z_tracers) then + write(warnstr,1010) ' dEdd_algae = ', dEdd_algae + write(warnstr,1010) ' modal_aero = ', modal_aero + write(warnstr,1010) ' scale_bgc = ', scale_bgc + write(warnstr,1010) ' solve_zbgc = ', solve_zbgc + write(warnstr,1020) ' number of ztracers = ', nbtrcr + write(warnstr,1020) ' number of Isw tracers = ', nbtrcr_sw + write(warnstr,1020) ' number of autotrophs = ', n_algae + write(warnstr,1020) ' number of doc = ', n_doc + write(warnstr,1020) ' number of dic = ', n_dic + write(warnstr,1020) ' number of fed = ', n_fed + write(warnstr,1020) ' number of fep = ', n_fep + write(warnstr,1020) ' number of aerosols = ', n_zaero + write(warnstr,1010) ' tr_zaero = ', tr_zaero + write(warnstr,1010) ' tr_bgc_Nit = ', tr_bgc_Nit + write(warnstr,1010) ' tr_bgc_N = ', tr_bgc_N + write(warnstr,1010) ' tr_bgc_Am = ', tr_bgc_Am + write(warnstr,1010) ' tr_bgc_C = ', tr_bgc_C + write(warnstr,1010) ' tr_bgc_Sil = ', tr_bgc_Sil + write(warnstr,1010) ' tr_bgc_hum = ', tr_bgc_hum + write(warnstr,1010) ' tr_bgc_chl = ', tr_bgc_chl + write(warnstr,1010) ' tr_bgc_DMS = ', tr_bgc_DMS + write(warnstr,1010) ' tr_bgc_PON = ', tr_bgc_PON + write(warnstr,1010) ' tr_bgc_DON = ', tr_bgc_DON + write(warnstr,1010) ' tr_bgc_Fe = ', tr_bgc_Fe + write(warnstr,1000) ' grid_o = ', grid_o + write(warnstr,1005) ' l_sk = ', l_sk + write(warnstr,1000) ' initbio_frac = ', initbio_frac + write(warnstr,1000) ' frazil_scav = ', frazil_scav + endif + endif + endif + + 1000 format (a,2x,f9.2) ! float + 1005 format (a,2x,f9.6) ! float + 1010 format (a,2x,l6) ! logical + 1020 format (a,2x,i6) ! integer + 1030 format (a, a8) ! character end subroutine icepack_init_zbgc @@ -1666,6 +1295,149 @@ subroutine icepack_init_bgc_trcr(nk, nt_fbri, & bio_index (nlt_bgc) = nt_bgc end subroutine icepack_init_bgc_trcr +#else +!======================================================================= +!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 + +!autodocument_end + + character(len=*),parameter :: subname='(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(:) + + + end subroutine icepack_init_zbgc + +#endif !======================================================================= !autodocument_start icepack_biogeochemistry @@ -1715,7 +1487,7 @@ subroutine icepack_biogeochemistry(dt, & real (kind=dbl_kind), dimension (:), intent(in) :: & ocean_bio ! contains the ocean bgc tracer concentrations in use (mmol/m^3) - real (kind=dbl_kind), dimension (:), intent(out) :: & + 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) :: & @@ -1724,10 +1496,10 @@ 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), dimension (:,:), intent(out) :: & + real (kind=dbl_kind), optional, dimension (:,:), intent(out) :: & flux_bion ! per categeory ice to ocean biogeochemistry flux (mmol/m2/s) - real (kind=dbl_kind), dimension (:), intent(inout) :: & + 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 @@ -1747,7 +1519,9 @@ subroutine icepack_biogeochemistry(dt, & PP_net , & ! Total production (mg C/m^2/s) per grid cell hbri , & ! brine height, area-averaged for comparison with hi (m) upNO , & ! nitrate uptake rate (mmol/m^2/d) times aice - upNH , & ! ammonium uptake rate (mmol/m^2/d) times aice + upNH ! ammonium uptake rate (mmol/m^2/d) times aice + + 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) :: & @@ -1809,7 +1583,10 @@ subroutine icepack_biogeochemistry(dt, & 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) :: & @@ -1826,16 +1603,16 @@ subroutine icepack_biogeochemistry(dt, & zspace(1) = p5*zspace(2) zspace(nblyr+1) = zspace(1) - bioPorosityIceCell(:) = c0 - bioSalinityIceCell(:) = c0 - bioTemperatureIceCell(:) = c0 + if (present(bioPorosityIceCell)) bioPorosityIceCell(:) = c0 + if (present(bioSalinityIceCell)) bioSalinityIceCell(:) = c0 + if (present(bioTemperatureIceCell)) bioTemperatureIceCell(:) = c0 do n = 1, ncat !----------------------------------------------------------------- ! initialize !----------------------------------------------------------------- - flux_bion(:,n) = c0 + flux_bion_n(:) = c0 hin_old(n) = c0 if (aicen_init(n) > puny) then hin_old(n) = vicen_init(n) & @@ -1847,6 +1624,7 @@ subroutine icepack_biogeochemistry(dt, & do mm = 1,nbtrcr trcrn(nt_zbgc_frac-1+mm,n) = zbgc_frac_init(mm) enddo + !endif endif if (aicen(n) > puny) then @@ -1943,7 +1721,7 @@ subroutine icepack_biogeochemistry(dt, & n_fed, n_fep, & n_zaero, first_ice(n), & hin_old(n), ocean_bio(1:nbtrcr), & - ocean_bio_dh(1:nbtrcr), & + ocean_bio_dh, & bphi(:,n), iphin, & iDi(:,n), & fswpenln(:,n), & @@ -1962,12 +1740,14 @@ subroutine icepack_biogeochemistry(dt, & PP_net, ice_bio_net (1:nbtrcr), & snow_bio_net(1:nbtrcr),grow_net, & totalChla, & - flux_bion(:,n), iSin, & + flux_bion_n, iSin, & bioPorosityIceCell(:), bioSalinityIceCell(:), & bioTemperatureIceCell(:) ) if (icepack_warnings_aborted(subname)) return + if (present(flux_bion)) flux_bion(:,n) = flux_bion_n(:) + elseif (skl_bgc) then call sklbio (dt, Tf, & @@ -1992,8 +1772,10 @@ subroutine icepack_biogeochemistry(dt, & else do mm = 1, nbtrcr do k = 1, nblyr+1 - 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) + 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 diff --git a/columnphysics/icepack_zbgc_shared.F90 b/columnphysics/icepack_zbgc_shared.F90 index e6099694e..5cd5f3299 100644 --- a/columnphysics/icepack_zbgc_shared.F90 +++ b/columnphysics/icepack_zbgc_shared.F90 @@ -641,7 +641,9 @@ subroutine merge_bgc_fluxes (dt, nblyr, & zbgc_snow , & ! bio flux from snow to ice per cat (mmol/m^2/s) zbgc_atm , & ! bio flux from atm to ice per cat (mmol/m^2/s) ice_bio_net, & ! integrated ice tracers mmol or mg/m^2) - snow_bio_net, &! integrated snow 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) @@ -651,7 +653,10 @@ subroutine merge_bgc_fluxes (dt, nblyr, & PP_net , & ! net PP (mg C/m^2/d) times aice grow_net , & ! net specific growth (m/d) times vice upNO , & ! tot nitrate uptake rate (mmol/m^2/d) times aice - upNH , & ! tot ammonium 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 @@ -699,13 +704,13 @@ subroutine merge_bgc_fluxes (dt, nblyr, & enddo ! mm ! diagnostics : mean cell bio interface grid profiles do k = 1, nblyr+1 - bioPorosityIceCell(k) = bioPorosityIceCell(k) + iphin(k)*vicen - bioSalinityIceCell(k) = bioSalinityIceCell(k) + iSin(k)*vicen - bioTemperatureIceCell(k) = bioTemperatureIceCell(k) + iTin(k)*vicen + 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 - totalChla = totalChla + ice_bio_net(nlt_bgc_N(mm))*R_chl2N(mm) + 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 & diff --git a/configuration/driver/icedrv_arrays_column.F90 b/configuration/driver/icedrv_arrays_column.F90 index 61017c6b8..e0a5c42bf 100644 --- a/configuration/driver/icedrv_arrays_column.F90 +++ b/configuration/driver/icedrv_arrays_column.F90 @@ -209,10 +209,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_domain_size.F90 b/configuration/driver/icedrv_domain_size.F90 index 75bb4d28e..514045558 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_column.F90 b/configuration/driver/icedrv_init_column.F90 index 15a795bcc..4c0b925cf 100644 --- a/configuration/driver/icedrv_init_column.F90 +++ b/configuration/driver/icedrv_init_column.F90 @@ -439,9 +439,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 +449,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 +472,11 @@ 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(ncat=ncat, nblyr=nblyr, nilyr=nilyr, & + cgrid=cgrid, igrid=igrid, & + 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__) @@ -531,6 +528,7 @@ subroutine init_hbrine() end subroutine init_hbrine +#ifdef NEWINITZBGC !======================================================================= ! Namelist variables, set to default values; may be altered at run time @@ -663,6 +661,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 , & @@ -815,6 +814,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 , & @@ -942,6 +942,7 @@ subroutine init_zbgc dmspptype = p5 ! dmspdtype = -c1 ! humtype = c1 ! + dictype_1 = -c1 ! doctype_s = p5 ! doctype_l = p5 ! dontype_protein = p5 ! @@ -1169,6 +1170,877 @@ subroutine init_zbgc ! set Icepack values !----------------------------------------------------------------- + call icepack_init_parameters(ktherm_in=ktherm, shortwave_in=shortwave, & + 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, & + 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, & + algal_vel_in=algal_vel, R_dFe2dust_in=R_dFe2dust, & + dustFe_sol_in=dustFe_sol, T_max_in=T_max, fsal_in=fsal, & + op_dep_min_in=op_dep_min, fr_graze_s_in=fr_graze_s, & + fr_graze_e_in=fr_graze_e, fr_mort2min_in=fr_mort2min, & + 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) + 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_chl2N_diatoms_in = ratio_chl2N_diatoms, & + ratio_chl2N_sp_in = ratio_chl2N_sp, & + ratio_chl2N_phaeo_in = ratio_chl2N_phaeo, & + 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, & + ratio_Fe2DON_in = ratio_Fe2DON, & + ratio_C2N_proteins_in = ratio_C2N_proteins, & + ratio_Fe2DOC_s_in = ratio_Fe2DOC_s, & + ratio_Fe2DOC_l_in = ratio_Fe2DOC_l, & + 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, & + doctype_s_in = doctype_s, & + doctype_l_in = doctype_l, & + dictype_1_in = dictype_1, & + dontype_protein_in = dontype_protein, & + fedtype_1_in = fedtype_1, & + feptype_1_in = feptype_1, & + 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__) + + !----------------------------------------------------------------- + ! set values in icepack + !----------------------------------------------------------------- + + call icepack_init_zbgc(trcr_base, trcr_depend, n_trcr_strata, nt_strata, printdiags=.true.) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & + file=__FILE__, line=__LINE__) + + 1000 format (a30,2x,f9.2) ! a30 to align formatted, unformatted statements + 1005 format (a30,2x,f9.6) ! float + 1010 format (a30,2x,l6) ! logical + 1020 format (a30,2x,i6) ! integer + 1030 format (a30, a8) ! character + + end subroutine init_zbgc + +!======================================================================= + + subroutine init_bgc_trcr(nk, nt_fbri, & + nt_bgc, nlt_bgc, & + bgctype, nt_depend, & + ntrcr, nbtrcr, & + bgc_tracer_type, trcr_depend, & + trcr_base, n_trcr_strata, & + nt_strata, bio_index) + + integer (kind=int_kind), intent(in) :: & + nk , & ! counter + nt_depend , & ! tracer dependency index + nt_fbri + + integer (kind=int_kind), intent(inout) :: & + ntrcr , & ! number of tracers + nbtrcr , & ! number of bio tracers + nt_bgc , & ! tracer index + nlt_bgc ! bio tracer index + + integer (kind=int_kind), dimension(:), intent(inout) :: & + trcr_depend , & ! tracer dependencies + n_trcr_strata, & ! number of underlying tracer layers + bio_index ! + + integer (kind=int_kind), dimension(:,:), intent(inout) :: & + nt_strata ! indices of underlying tracer layers + + real (kind=dbl_kind), dimension(:,:), intent(inout) :: & + trcr_base ! = 0 or 1 depending on tracer dependency + ! argument 2: (1) aice, (2) vice, (3) vsno + + real (kind=dbl_kind), intent(in) :: & + bgctype ! bio tracer transport type (mobile vs stationary) + + real (kind=dbl_kind), dimension(:), intent(inout) :: & + bgc_tracer_type ! bio tracer transport type array + + ! local variables + + integer (kind=int_kind) :: & + k , & ! loop index + n_strata , & ! temporary values + nt_strata1, & ! + nt_strata2 + + real (kind=dbl_kind) :: & + trcr_base1, & ! temporary values + trcr_base2, & + trcr_base3 + + character(len=*), parameter :: subname='(init_bgc_trcr)' + + !-------- + + nt_bgc = ntrcr + 1 + nbtrcr = nbtrcr + 1 + nlt_bgc = nbtrcr + bgc_tracer_type(nbtrcr) = bgctype + + if (nk > 1) then + ! include vertical bgc in snow + do k = nk, nk+1 + ntrcr = ntrcr + 1 + trcr_depend (nt_bgc + k ) = 2 ! snow volume + trcr_base (nt_bgc + k,1) = c0 + trcr_base (nt_bgc + k,2) = c0 + trcr_base (nt_bgc + k,3) = c1 + n_trcr_strata(nt_bgc + k ) = 0 + nt_strata (nt_bgc + k,1) = 0 + nt_strata (nt_bgc + k,2) = 0 + enddo + + trcr_base1 = c0 + trcr_base2 = c1 + trcr_base3 = c0 + n_strata = 1 + nt_strata1 = nt_fbri + nt_strata2 = 0 + else ! nk = 1 + trcr_base1 = c1 + trcr_base2 = c0 + trcr_base3 = c0 + n_strata = 0 + nt_strata1 = 0 + nt_strata2 = 0 + endif ! nk + + do k = 1, nk !in ice + ntrcr = ntrcr + 1 + trcr_depend (nt_bgc + k - 1 ) = nt_depend + trcr_base (nt_bgc + k - 1,1) = trcr_base1 + trcr_base (nt_bgc + k - 1,2) = trcr_base2 + trcr_base (nt_bgc + k - 1,3) = trcr_base3 + n_trcr_strata(nt_bgc + k - 1 ) = n_strata + nt_strata (nt_bgc + k - 1,1) = nt_strata1 + nt_strata (nt_bgc + k - 1,2) = nt_strata2 + enddo + + bio_index (nlt_bgc) = nt_bgc + + end subroutine init_bgc_trcr +#else + +!======================================================================= + +! Namelist variables, set to default values; may be altered at run time +! +! author Elizabeth C. Hunke, LANL +! Nicole Jeffery, LANL + + subroutine init_zbgc + + use icedrv_state, only: trcr_base, trcr_depend, n_trcr_strata + use icedrv_state, only: nt_strata + use icedrv_forcing, only: bgc_data_type + + character (len=char_len) :: & + shortwave ! from icepack + + integer (kind=int_kind) :: & + ntrcr, nbtrcr, nbtrcr_sw, & + ntrcr_o, nt_fbri, & + nt_bgc_Nit, nt_bgc_Am, nt_bgc_Sil, & + nt_bgc_DMS, nt_bgc_PON, & + nt_bgc_DMSPp, nt_bgc_DMSPd, & + nt_zbgc_frac, nlt_chl_sw, & + nlt_bgc_Nit, nlt_bgc_Am, nlt_bgc_Sil, & + nlt_bgc_DMS, nlt_bgc_DMSPp,nlt_bgc_DMSPd,& + nlt_bgc_PON, nt_bgc_hum, nlt_bgc_hum + + integer (kind=int_kind), dimension(icepack_max_aero) :: & + nlt_zaero_sw ! points to aerosol in trcrn_sw + + integer (kind=int_kind), dimension(icepack_max_algae) :: & + nlt_bgc_N , & ! algae + nlt_bgc_C , & ! + nlt_bgc_chl + + integer (kind=int_kind), dimension(icepack_max_doc) :: & + nlt_bgc_DOC ! disolved organic carbon + + integer (kind=int_kind), dimension(icepack_max_don) :: & + nlt_bgc_DON ! + + integer (kind=int_kind), dimension(icepack_max_dic) :: & + nlt_bgc_DIC ! disolved inorganic carbon + + integer (kind=int_kind), dimension(icepack_max_fe) :: & + nlt_bgc_Fed , & ! + nlt_bgc_Fep ! + + integer (kind=int_kind), dimension(icepack_max_aero) :: & + nlt_zaero ! non-reacting layer aerosols + + integer (kind=int_kind), dimension(icepack_max_algae) :: & + nt_bgc_N , & ! diatoms, phaeocystis, pico/small + nt_bgc_C , & ! diatoms, phaeocystis, pico/small + nt_bgc_chl ! diatoms, phaeocystis, pico/small + + integer (kind=int_kind), dimension(icepack_max_doc) :: & + nt_bgc_DOC ! dissolved organic carbon + + integer (kind=int_kind), dimension(icepack_max_don) :: & + nt_bgc_DON ! dissolved organic nitrogen + + integer (kind=int_kind), dimension(icepack_max_dic) :: & + nt_bgc_DIC ! dissolved inorganic carbon + + integer (kind=int_kind), dimension(icepack_max_fe) :: & + nt_bgc_Fed , & ! dissolved iron + nt_bgc_Fep ! particulate iron + + integer (kind=int_kind), dimension(icepack_max_aero) :: & + nt_zaero , & ! black carbon and other aerosols + nt_zaero_sw ! for shortwave calculation + + integer (kind=int_kind), dimension(icepack_max_nbtrcr) :: & + bio_index_o ! relates nlt_bgc_NO to ocean concentration index + + integer (kind=int_kind), dimension(icepack_max_nbtrcr) :: & + bio_index ! relates bio indices nlt_bgc_N to nt_bgc_N + + logical (kind=log_kind) :: & + tr_brine, & + tr_bgc_Nit, tr_bgc_Am, tr_bgc_Sil, & + tr_bgc_DMS, tr_bgc_PON, & + tr_bgc_N, tr_bgc_C, tr_bgc_chl, & + 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 + + character (char_len) :: & + bgc_flux_type + + real (kind=dbl_kind) :: & + grid_o, l_sk, initbio_frac, & + frazil_scav, grid_oS, l_skS, & + phi_snow, & + ratio_Si2N_diatoms , ratio_Si2N_sp , ratio_Si2N_phaeo , & + ratio_S2N_diatoms , ratio_S2N_sp , ratio_S2N_phaeo , & + ratio_Fe2C_diatoms , ratio_Fe2C_sp , ratio_Fe2C_phaeo , & + ratio_Fe2N_diatoms , ratio_Fe2N_sp , ratio_Fe2N_phaeo , & + ratio_Fe2DON , ratio_Fe2DOC_s , ratio_Fe2DOC_l , & + fr_resp , tau_min , tau_max , & + algal_vel , R_dFe2dust , dustFe_sol , & + chlabs_diatoms , chlabs_sp , chlabs_phaeo , & + alpha2max_low_diatoms,alpha2max_low_sp , alpha2max_low_phaeo, & + beta2max_diatoms , beta2max_sp , beta2max_phaeo , & + mu_max_diatoms , mu_max_sp , mu_max_phaeo , & + grow_Tdep_diatoms , grow_Tdep_sp , grow_Tdep_phaeo , & + fr_graze_diatoms , fr_graze_sp , fr_graze_phaeo , & + mort_pre_diatoms , mort_pre_sp , mort_pre_phaeo , & + mort_Tdep_diatoms , mort_Tdep_sp , mort_Tdep_phaeo , & + k_exude_diatoms , k_exude_sp , k_exude_phaeo , & + K_Nit_diatoms , K_Nit_sp , K_Nit_phaeo , & + K_Am_diatoms , K_Am_sp , K_Am_phaeo , & + K_Sil_diatoms , K_Sil_sp , K_Sil_phaeo , & + K_Fe_diatoms , K_Fe_sp , K_Fe_phaeo , & + f_don_protein , kn_bac_protein , f_don_Am_protein , & + f_doc_s , f_doc_l , f_exude_s , & + f_exude_l , k_bac_s , k_bac_l , & + T_max , fsal , op_dep_min , & + fr_graze_s , fr_graze_e , fr_mort2min , & + fr_dFe , k_nitrif , t_iron_conv , & + max_loss , max_dfe_doc1 , fr_resp_s , & + y_sk_DMS , t_sk_conv , t_sk_ox , & + algaltype_diatoms , algaltype_sp , algaltype_phaeo , & + nitratetype , ammoniumtype , silicatetype , & + dmspptype , dmspdtype , humtype , & + doctype_s , doctype_l , dontype_protein , & + fedtype_1 , feptype_1 , zaerotype_bc1 , & + zaerotype_bc2 , zaerotype_dust1 , zaerotype_dust2 , & + zaerotype_dust3 , zaerotype_dust4 , ratio_C2N_diatoms , & + ratio_C2N_sp , ratio_C2N_phaeo , ratio_chl2N_diatoms, & + ratio_chl2N_sp , ratio_chl2N_phaeo , F_abs_chl_diatoms , & + F_abs_chl_sp , F_abs_chl_phaeo , ratio_C2N_proteins + + real (kind=dbl_kind), dimension(icepack_max_dic) :: & + dictype + + real (kind=dbl_kind), dimension(icepack_max_algae) :: & + algaltype ! tau_min for both retention and release + + real (kind=dbl_kind), dimension(icepack_max_doc) :: & + doctype + + real (kind=dbl_kind), dimension(icepack_max_don) :: & + dontype + + real (kind=dbl_kind), dimension(icepack_max_fe) :: & + fedtype + + real (kind=dbl_kind), dimension(icepack_max_fe) :: & + feptype + + real (kind=dbl_kind), dimension(icepack_max_aero) :: & + zaerotype + + real (kind=dbl_kind), dimension(icepack_max_algae) :: & + R_C2N , & ! algal C to N (mole/mole) + R_chl2N , & ! 3 algal chlorophyll to N (mg/mmol) + F_abs_chl ! to scale absorption in Dedd + + real (kind=dbl_kind), dimension(icepack_max_don) :: & ! increase compare to algal R_Fe2C + R_C2N_DON + + real (kind=dbl_kind), dimension(icepack_max_algae) :: & + 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 + R_Fe2C , & ! algal Fe to carbon (umol/mmol) + R_Fe2N ! algal Fe to N (umol/mmol) + + real (kind=dbl_kind), dimension(icepack_max_don) :: & + R_Fe2DON ! Fe to N of DON (nmol/umol) + + real (kind=dbl_kind), dimension(icepack_max_doc) :: & + R_Fe2DOC ! Fe to C of DOC (nmol/umol) + + real (kind=dbl_kind), dimension(icepack_max_algae) :: & + chlabs , & ! chla absorption 1/m/(mg/m^3) + alpha2max_low , & ! light limitation (1/(W/m^2)) + beta2max , & ! light inhibition (1/(W/m^2)) + mu_max , & ! maximum growth rate (1/d) + grow_Tdep , & ! T dependence of growth (1/C) + fr_graze , & ! fraction of algae grazed + mort_pre , & ! mortality (1/day) + mort_Tdep , & ! T dependence of mortality (1/C) + k_exude , & ! algal carbon exudation rate (1/d) + K_Nit , & ! nitrate half saturation (mmol/m^3) + K_Am , & ! ammonium half saturation (mmol/m^3) + K_Sil , & ! silicon half saturation (mmol/m^3) + K_Fe ! iron half saturation or micromol/m^3 + + real (kind=dbl_kind), dimension(icepack_max_DON) :: & + f_don , & ! fraction of spilled grazing to DON + kn_bac , & ! Bacterial degredation of DON (1/d) + f_don_Am ! fraction of remineralized DON to Am + + real (kind=dbl_kind), dimension(icepack_max_DOC) :: & + f_exude , & ! fraction of exuded carbon to each DOC pool + k_bac ! Bacterial degredation of DOC (1/d) + + real (kind=dbl_kind), dimension(icepack_max_nbtrcr) :: & + zbgc_frac_init,&! initializes mobile fraction + bgc_tracer_type ! described tracer in mobile or stationary phases + ! < 0 is purely mobile (eg. nitrate) + ! > 0 has timescales for transitions between + ! phases based on whether the ice is melting or growing + + real (kind=dbl_kind), dimension(icepack_max_nbtrcr) :: & + zbgc_init_frac, & ! fraction of ocean tracer concentration in new ice + tau_ret, & ! retention timescale (s), mobile to stationary phase + tau_rel ! release timescale (s), stationary to mobile phase + + character (32) :: & + nml_filename = 'icepack_in' ! namelist input file name + + integer (kind=int_kind) :: & + nml_error, & ! namelist i/o error flag + k, mm , & ! loop index + ntd , & ! for tracer dependency calculation + nk , & ! + nt_depend + + character(len=*), parameter :: subname='(init_zbgc)' + + !------------------------------------------------------------ + ! Tracers have mobile and stationary phases. + ! ice growth allows for retention, ice melt facilitates mobility + ! bgc_tracer_type defines the exchange timescales between these phases + ! -1 : entirely in the mobile phase, no exchange (this is the default) + ! 0 : retention time scale is tau_min, release time scale is tau_max + ! 1 : retention time scale is tau_max, release time scale is tau_min + ! 0.5: retention time scale is tau_min, release time scale is tau_min + ! 2 : retention time scale is tau_max, release time scale is tau_max + !------------------------------------------------------------ + + !----------------------------------------------------------------- + ! namelist variables + !----------------------------------------------------------------- + + 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, & + 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, & + 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 , & + ratio_Fe2C_diatoms , ratio_Fe2C_sp , ratio_Fe2C_phaeo , & + ratio_Fe2N_diatoms , ratio_Fe2N_sp , ratio_Fe2N_phaeo , & + ratio_Fe2DON , ratio_Fe2DOC_s , ratio_Fe2DOC_l , & + fr_resp , tau_min , tau_max , & + algal_vel , R_dFe2dust , dustFe_sol , & + chlabs_diatoms , chlabs_sp , chlabs_phaeo , & + alpha2max_low_diatoms,alpha2max_low_sp , alpha2max_low_phaeo, & + beta2max_diatoms , beta2max_sp , beta2max_phaeo , & + mu_max_diatoms , mu_max_sp , mu_max_phaeo , & + grow_Tdep_diatoms , grow_Tdep_sp , grow_Tdep_phaeo , & + fr_graze_diatoms , fr_graze_sp , fr_graze_phaeo , & + mort_pre_diatoms , mort_pre_sp , mort_pre_phaeo , & + mort_Tdep_diatoms , mort_Tdep_sp , mort_Tdep_phaeo , & + k_exude_diatoms , k_exude_sp , k_exude_phaeo , & + K_Nit_diatoms , K_Nit_sp , K_Nit_phaeo , & + K_Am_diatoms , K_Am_sp , K_Am_phaeo , & + K_Sil_diatoms , K_Sil_sp , K_Sil_phaeo , & + K_Fe_diatoms , K_Fe_sp , K_Fe_phaeo , & + f_don_protein , kn_bac_protein , f_don_Am_protein , & + f_doc_s , f_doc_l , f_exude_s , & + f_exude_l , k_bac_s , k_bac_l , & + T_max , fsal , op_dep_min , & + fr_graze_s , fr_graze_e , fr_mort2min , & + fr_dFe , k_nitrif , t_iron_conv , & + max_loss , max_dfe_doc1 , fr_resp_s , & + y_sk_DMS , t_sk_conv , t_sk_ox , & + algaltype_diatoms , algaltype_sp , algaltype_phaeo , & + nitratetype , ammoniumtype , silicatetype , & + dmspptype , dmspdtype , humtype , & + doctype_s , doctype_l , dontype_protein , & + fedtype_1 , feptype_1 , zaerotype_bc1 , & + zaerotype_bc2 , zaerotype_dust1 , zaerotype_dust2 , & + zaerotype_dust3 , zaerotype_dust4 , ratio_C2N_diatoms , & + ratio_C2N_sp , ratio_C2N_phaeo , ratio_chl2N_diatoms, & + ratio_chl2N_sp , ratio_chl2N_phaeo , F_abs_chl_diatoms , & + F_abs_chl_sp , F_abs_chl_phaeo , ratio_C2N_proteins + + !----------------------------------------------------------------- + ! query Icepack values + !----------------------------------------------------------------- + + 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, & + 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, & + 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, & + 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, & + 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) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & + file=__FILE__, line=__LINE__) + + !----------------------------------------------------------------- + ! 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) + + !----------------------------------------------------------------- + ! read from input file + !----------------------------------------------------------------- + + write(nu_diag,*) subname,' Reading zbgc_nml' + + open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error) + if (nml_error /= 0) then + call icedrv_system_abort(string=subname//'ERROR: zbgc_nml open file '// & + trim(nml_filename), & + file=__FILE__, line=__LINE__) + endif + + nml_error = 1 + do while (nml_error > 0) + read(nu_nml, nml=zbgc_nml,iostat=nml_error) + end do + if (nml_error /= 0) then + call icedrv_system_abort(string=subname//'ERROR: zbgc_nml reading ', & + file=__FILE__, line=__LINE__) + endif + close(nu_nml) + + !----------------------------------------------------------------- + ! resolve conflicts + !----------------------------------------------------------------- + + !----------------------------------------------------------------- + ! zsalinity and brine + !----------------------------------------------------------------- + if (solve_zsal) then + call icedrv_system_abort(string=subname//'ERROR: zsalinity is deprecated ', & + file=__FILE__, line=__LINE__) + endif + + if (tr_brine .and. TRBRI == 0 ) then + write(nu_diag,*) & + 'WARNING: tr_brine=T but no brine height compiled' + write(nu_diag,*) & + 'WARNING: setting tr_brine = F' + tr_brine = .false. + elseif (tr_brine .and. nblyr < 1 ) then + write(nu_diag,*) & + 'WARNING: tr_brine=T but no biology layers compiled' + write(nu_diag,*) & + 'WARNING: setting tr_brine = F' + tr_brine = .false. + endif + + write(nu_diag,1010) ' tr_brine = ', tr_brine + if (tr_brine) then + write(nu_diag,1005) ' phi_snow = ', phi_snow + endif + + !----------------------------------------------------------------- + ! biogeochemistry + !----------------------------------------------------------------- + + if (.not. tr_brine) then + if (solve_zbgc) then + write(nu_diag,*) 'WARNING: tr_brine = F and solve_zbgc = T' + write(nu_diag,*) 'WARNING: setting solve_zbgc = F' + solve_zbgc = .false. + endif + if (skl_bgc) then + write(nu_diag,*) 'WARNING: tr_brine = F and skl_bgc = T' + write(nu_diag,*) 'WARNING: setting skl_bgc = F' + skl_bgc = .false. + endif + if (tr_zaero) then + write(nu_diag,*) 'WARNING: tr_brine = F and tr_zaero = T' + write(nu_diag,*) 'WARNING: setting tr_zaero = F' + tr_zaero = .false. + endif + 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' + call icedrv_system_abort(file=__FILE__,line=__LINE__) + endif + + if (skl_bgc .AND. tr_zaero) then + write(nu_diag,*) 'WARNING: skl bgc does not use vertical tracers' + write(nu_diag,*) 'WARNING: setting tr_zaero = F' + tr_zaero = .false. + endif + + if (dEdd_algae .AND. trim(shortwave(1:4)) /= 'dEdd') then + write(nu_diag,*) 'WARNING: dEdd_algae = T but shortwave /= dEdd' + write(nu_diag,*) 'WARNING: setting dEdd_algae = F' + dEdd_algae = .false. + endif + + if (dEdd_algae .AND. (.NOT. tr_bgc_N) .AND. (.NOT. tr_zaero)) then + write(nu_diag,*) 'WARNING: need tr_bgc_N or tr_zaero for dEdd_algae' + write(nu_diag,*) 'WARNING: setting dEdd_algae = F' + dEdd_algae = .false. + endif + + if (modal_aero .AND. (.NOT. tr_zaero) .AND. (.NOT. tr_aero)) then + modal_aero = .false. + endif + + if (modal_aero .AND. trim(shortwave(1:4)) /= 'dEdd') then + write(nu_diag,*) 'WARNING: modal_aero = T but shortwave /= dEdd' + write(nu_diag,*) 'WARNING: setting modal_aero = F' + modal_aero = .false. + endif + if (n_algae > icepack_max_algae) then + print*, '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' + 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' + 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' + 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' + 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' + call icedrv_system_abort(file=__FILE__,line=__LINE__) + endif + + if ((TRBGCS == 0 .and. skl_bgc) .or. (TRALG == 0 .and. skl_bgc)) then + write(nu_diag,*) & + 'WARNING: skl_bgc=T but 0 bgc or algal tracers compiled' + write(nu_diag,*) & + 'WARNING: setting skl_bgc = F' + skl_bgc = .false. + endif + + if ((TRBGCZ == 0 .and. solve_zbgc) .or. (TRALG == 0 .and. solve_zbgc)) then + write(nu_diag,*) & + 'WARNING: solve_zbgc=T but 0 zbgc or algal tracers compiled' + write(nu_diag,*) & + 'WARNING: setting solve_zbgc = F' + solve_zbgc = .false. + endif + + if (solve_zbgc .and. .not. z_tracers) z_tracers = .true. + if (skl_bgc .or. solve_zbgc) then + tr_bgc_N = .true. ! minimum NP biogeochemistry + tr_bgc_Nit = .true. + else + tr_bgc_N = .false. + tr_bgc_C = .false. + tr_bgc_chl = .false. + tr_bgc_Nit = .false. + tr_bgc_Am = .false. + tr_bgc_Sil = .false. + tr_bgc_hum = .false. + tr_bgc_DMS = .false. + tr_bgc_PON = .false. + tr_bgc_DON = .false. + tr_bgc_Fe = .false. + endif + + !----------------------------------------------------------------- + ! z layer aerosols + !----------------------------------------------------------------- + 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' + call icedrv_system_abort(file=__FILE__,line=__LINE__) + endif + + if (skl_bgc .and. n_bgc < 2) then + write (nu_diag,*) ' ' + write (nu_diag,*) 'comp_ice must have number of bgc tracers >= 2' + write (nu_diag,*) 'number of bgc tracers compiled:',n_bgc + call icedrv_system_abort(file=__FILE__,line=__LINE__) + endif + + if (solve_zbgc .and. n_bgc < 2) then + write (nu_diag,*) ' ' + write (nu_diag,*) 'comp_ice must have number of zbgc tracers >= 2' + write (nu_diag,*) 'number of bgc tracers compiled:',n_bgc + call icedrv_system_abort(file=__FILE__,line=__LINE__) + endif + + if (tr_zaero .and. TRZAERO < 1) then + write (nu_diag,*) ' ' + write (nu_diag,*) 'comp_ice must have number of TRZAERO > 0' + write (nu_diag,*) 'in order to solve z aerosols:',TRZAERO + call icedrv_system_abort(file=__FILE__,line=__LINE__) + endif + + !----------------------------------------------------------------- + ! end conflict resolution + !----------------------------------------------------------------- + !----------------------------------------------------------------- + ! set Icepack values + !----------------------------------------------------------------- + call icepack_init_parameters(ktherm_in=ktherm, shortwave_in=shortwave, & 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, & @@ -1949,7 +2821,7 @@ subroutine init_bgc_trcr(nk, nt_fbri, & bio_index (nlt_bgc) = nt_bgc end subroutine init_bgc_trcr - +#endif !======================================================================= end module icedrv_init_column diff --git a/configuration/driver/icedrv_step.F90 b/configuration/driver/icedrv_step.F90 index dc86ac398..3ba09e7e1 100644 --- a/configuration/driver/icedrv_step.F90 +++ b/configuration/driver/icedrv_step.F90 @@ -435,7 +435,7 @@ subroutine step_therm2 (dt) use icedrv_arrays_column, only: first_ice, bgrid, cgrid, igrid 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 @@ -484,7 +484,7 @@ subroutine step_therm2 (dt) 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, & + nilyr=nilyr, nslyr=nslyr, nbtrcr=nbtrcr, & hin_max=hin_max(:), nblyr=nblyr, & aicen=aicen(i,:), & vicen=vicen(i,:), & @@ -1333,13 +1333,13 @@ 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: ocean_bio_all use icedrv_arrays_column, only: bgrid, igrid, icgrid, cgrid 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 @@ -1417,10 +1417,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,:), & @@ -1429,6 +1426,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__) @@ -1442,11 +1440,8 @@ subroutine biogeochemistry (dt) enddo ! mm endif - call icepack_biogeochemistry(dt=dt, ntrcr=ntrcr, nbtrcr=nbtrcr, & + call icepack_biogeochemistry(dt=dt, & 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, & upNO = upNO(i), & upNH = upNH(i), & @@ -1470,13 +1465,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,:), & @@ -1489,9 +1484,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/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index ce98270fd..d22c1852f 100644 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -26,6 +26,8 @@ restart col 1x1 diag1 restart col 1x1 pondlvl restart col 1x1 pondtopo restart col 1x1 bgcispol +restart col 1x1 bgcnice +restart col 1x1 bgcsklnice restart col 1x1 thermo1 restart col 1x1 swccsm3 restart col 1x1 isotope