From c1099ac010285915bc6a8decd9d3749be3ed2aeb Mon Sep 17 00:00:00 2001 From: apcraig Date: Thu, 18 Apr 2024 09:43:02 -0600 Subject: [PATCH] Update icepack for new bgc - Refactor icepack_init_zbgc, leverage icepack_parameters for most arguments instead - Update standalone icepack driver to be consistent with latest bgc changes --- columnphysics/icepack_algae.F90 | 28 +- columnphysics/icepack_parameters.F90 | 4 +- columnphysics/icepack_zbgc.F90 | 619 +++------------ columnphysics/icepack_zbgc_shared.F90 | 17 +- configuration/driver/icedrv_arrays_column.F90 | 4 - configuration/driver/icedrv_domain_size.F90 | 1 - configuration/driver/icedrv_init_column.F90 | 747 +++--------------- configuration/driver/icedrv_step.F90 | 26 +- 8 files changed, 267 insertions(+), 1179 deletions(-) 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..3295e7a84 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,12 +564,14 @@ 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 @@ -576,78 +579,7 @@ end subroutine icepack_init_bgc !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 +597,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 +612,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 +855,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 +866,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 +895,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 +906,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 +920,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 +933,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 +944,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 +955,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 +965,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 +975,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 +986,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 +1000,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 +1014,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 +1026,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 +1037,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 +1066,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 +1111,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 @@ -1715,7 +1343,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 +1352,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 +1375,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 +1439,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 +1459,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) & @@ -1943,7 +1576,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 +1595,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 +1627,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..687a27c79 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__) @@ -663,6 +660,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 +813,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 +941,7 @@ subroutine init_zbgc dmspptype = p5 ! dmspdtype = -c1 ! humtype = c1 ! + dictype_1 = -c1 ! doctype_s = p5 ! doctype_l = p5 ! dontype_protein = p5 ! @@ -1187,657 +1187,108 @@ subroutine init_zbgc if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & file=__FILE__, line=__LINE__) - !----------------------------------------------------------------- - ! initialize zbgc tracer indices - !----------------------------------------------------------------- - - ntrcr_o = ntrcr - nt_fbri = 0 - if (tr_brine) then - nt_fbri = ntrcr + 1 ! ice volume fraction with salt - ntrcr = ntrcr + 1 - trcr_depend(nt_fbri) = 1 ! volume-weighted - trcr_base (nt_fbri,1) = c0 ! volume-weighted - trcr_base (nt_fbri,2) = c1 ! volume-weighted - trcr_base (nt_fbri,3) = c0 ! volume-weighted - n_trcr_strata(nt_fbri) = 0 - nt_strata (nt_fbri,1) = 0 - nt_strata (nt_fbri,2) = 0 - endif - - ntd = 0 ! if nt_fbri /= 0 then use fbri dependency - if (nt_fbri == 0) ntd = -1 ! otherwise make tracers depend on ice volume - - !----------------------------------------------------------------- - ! biogeochemistry - !----------------------------------------------------------------- - - nbtrcr = 0 - nbtrcr_sw = 0 - - ! vectors of size icepack_max_algae - nlt_bgc_N(:) = 0 - nlt_bgc_C(:) = 0 - nlt_bgc_chl(:) = 0 - nt_bgc_N(:) = 0 - nt_bgc_C(:) = 0 - nt_bgc_chl(:) = 0 - - ! vectors of size icepack_max_dic - nlt_bgc_DIC(:) = 0 - nt_bgc_DIC(:) = 0 - - ! vectors of size icepack_max_doc - nlt_bgc_DOC(:) = 0 - nt_bgc_DOC(:) = 0 - - ! vectors of size icepack_max_don - nlt_bgc_DON(:) = 0 - nt_bgc_DON(:) = 0 - - ! vectors of size icepack_max_fe - nlt_bgc_Fed(:) = 0 - nlt_bgc_Fep(:) = 0 - nt_bgc_Fed(:) = 0 - nt_bgc_Fep(:) = 0 - - ! vectors of size icepack_max_aero - nlt_zaero(:) = 0 - nlt_zaero_sw(:) = 0 - nt_zaero(:) = 0 - nt_zaero_sw(:) = 0 - - nlt_bgc_Nit = 0 - nlt_bgc_Am = 0 - nlt_bgc_Sil = 0 - nlt_bgc_DMSPp = 0 - nlt_bgc_DMSPd = 0 - nlt_bgc_DMS = 0 - nlt_bgc_PON = 0 - nlt_bgc_hum = 0 - nlt_chl_sw = 0 - bio_index(:) = 0 - bio_index_o(:) = 0 - - nt_bgc_Nit = 0 - nt_bgc_Am = 0 - nt_bgc_Sil = 0 - nt_bgc_DMSPp = 0 - nt_bgc_DMSPd = 0 - nt_bgc_DMS = 0 - nt_bgc_PON = 0 - nt_bgc_hum = 0 - nt_zbgc_frac = 0 - - !----------------------------------------------------------------- - ! Define array parameters - !----------------------------------------------------------------- - - R_Si2N(1) = ratio_Si2N_diatoms - R_Si2N(2) = ratio_Si2N_sp - R_Si2N(3) = ratio_Si2N_phaeo - - R_S2N(1) = ratio_S2N_diatoms - R_S2N(2) = ratio_S2N_sp - R_S2N(3) = ratio_S2N_phaeo - - R_Fe2C(1) = ratio_Fe2C_diatoms - R_Fe2C(2) = ratio_Fe2C_sp - R_Fe2C(3) = ratio_Fe2C_phaeo - - R_Fe2N(1) = ratio_Fe2N_diatoms - R_Fe2N(2) = ratio_Fe2N_sp - R_Fe2N(3) = ratio_Fe2N_phaeo - - R_C2N(1) = ratio_C2N_diatoms - R_C2N(2) = ratio_C2N_sp - R_C2N(3) = ratio_C2N_phaeo - - R_chl2N(1) = ratio_chl2N_diatoms - R_chl2N(2) = ratio_chl2N_sp - R_chl2N(3) = ratio_chl2N_phaeo - - F_abs_chl(1) = F_abs_chl_diatoms - F_abs_chl(2) = F_abs_chl_sp - F_abs_chl(3) = F_abs_chl_phaeo - - R_Fe2DON(1) = ratio_Fe2DON - R_C2N_DON(1) = ratio_C2N_proteins - - R_Fe2DOC(1) = ratio_Fe2DOC_s - R_Fe2DOC(2) = ratio_Fe2DOC_l - R_Fe2DOC(3) = c0 - - chlabs(1) = chlabs_diatoms - chlabs(2) = chlabs_sp - chlabs(3) = chlabs_phaeo - - alpha2max_low(1) = alpha2max_low_diatoms - alpha2max_low(2) = alpha2max_low_sp - alpha2max_low(3) = alpha2max_low_phaeo - - beta2max(1) = beta2max_diatoms - beta2max(2) = beta2max_sp - beta2max(3) = beta2max_phaeo - - mu_max(1) = mu_max_diatoms - mu_max(2) = mu_max_sp - mu_max(3) = mu_max_phaeo - - grow_Tdep(1) = grow_Tdep_diatoms - grow_Tdep(2) = grow_Tdep_sp - grow_Tdep(3) = grow_Tdep_phaeo - - fr_graze(1) = fr_graze_diatoms - fr_graze(2) = fr_graze_sp - fr_graze(3) = fr_graze_phaeo - - mort_pre(1) = mort_pre_diatoms - mort_pre(2) = mort_pre_sp - mort_pre(3) = mort_pre_phaeo - - mort_Tdep(1) = mort_Tdep_diatoms - mort_Tdep(2) = mort_Tdep_sp - mort_Tdep(3) = mort_Tdep_phaeo - - k_exude(1) = k_exude_diatoms - k_exude(2) = k_exude_sp - k_exude(3) = k_exude_phaeo - - K_Nit(1) = K_Nit_diatoms - K_Nit(2) = K_Nit_sp - K_Nit(3) = K_Nit_phaeo - - K_Am(1) = K_Am_diatoms - K_Am(2) = K_Am_sp - K_Am(3) = K_Am_phaeo - - K_Sil(1) = K_Sil_diatoms - K_Sil(2) = K_Sil_sp - K_Sil(3) = K_Sil_phaeo - - K_Fe(1) = K_Fe_diatoms - K_Fe(2) = K_Fe_sp - K_Fe(3) = K_Fe_phaeo - - f_don(1) = f_don_protein - kn_bac(1) = kn_bac_protein - f_don_Am(1) = f_don_Am_protein - - f_exude(1) = f_exude_s - f_exude(2) = f_exude_l - k_bac(1) = k_bac_s - k_bac(2) = k_bac_l - - dictype(:) = -c1 - - algaltype(1) = algaltype_diatoms - algaltype(2) = algaltype_sp - algaltype(3) = algaltype_phaeo - - doctype(1) = doctype_s - doctype(2) = doctype_l - - dontype(1) = dontype_protein - - fedtype(1) = fedtype_1 - feptype(1) = feptype_1 - - zaerotype(1) = zaerotype_bc1 - zaerotype(2) = zaerotype_bc2 - zaerotype(3) = zaerotype_dust1 - zaerotype(4) = zaerotype_dust2 - zaerotype(5) = zaerotype_dust3 - zaerotype(6) = zaerotype_dust4 - - call icepack_init_zbgc ( & - R_Si2N_in=R_Si2N, & - R_S2N_in=R_S2N, R_Fe2C_in=R_Fe2C, R_Fe2N_in=R_Fe2N, R_C2N_in=R_C2N, & - R_chl2N_in=R_chl2N, F_abs_chl_in=F_abs_chl, R_Fe2DON_in=R_Fe2DON, & - R_C2N_DON_in=R_C2N_DON, & - R_Fe2DOC_in=R_Fe2DOC, & - chlabs_in=chlabs, alpha2max_low_in=alpha2max_low, beta2max_in=beta2max, & - mu_max_in=mu_max, grow_Tdep_in=grow_Tdep, fr_graze_in=fr_graze, & - mort_pre_in=mort_pre, & - mort_Tdep_in=mort_Tdep, k_exude_in=k_exude, & - K_Nit_in=K_Nit, K_Am_in=K_Am, K_sil_in=K_Sil, K_Fe_in=K_Fe, & - f_don_in=f_don, kn_bac_in=kn_bac, f_don_Am_in=f_don_Am, f_exude_in=f_exude, & - k_bac_in=k_bac, & - fr_resp_in=fr_resp, algal_vel_in=algal_vel, R_dFe2dust_in=R_dFe2dust, & - dustFe_sol_in=dustFe_sol, T_max_in=T_max, fr_mort2min_in=fr_mort2min, & - fr_dFe_in=fr_dFe, op_dep_min_in=op_dep_min, & - fr_graze_s_in=fr_graze_s, fr_graze_e_in=fr_graze_e, & - k_nitrif_in=k_nitrif, t_iron_conv_in=t_iron_conv, & - max_loss_in=max_loss, max_dfe_doc1_in=max_dfe_doc1, & - fr_resp_s_in=fr_resp_s, y_sk_DMS_in=y_sk_DMS, & - t_sk_conv_in=t_sk_conv, t_sk_ox_in=t_sk_ox, fsal_in=fsal) + call icepack_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__) - if (skl_bgc) then - - nk = 1 - nt_depend = 0 - - if (dEdd_algae) then - nlt_chl_sw = 1 - nbtrcr_sw = nilyr+nslyr+2 ! only the bottom layer will be nonzero - endif - - elseif (z_tracers) then ! defined on nblyr+1 in ice - ! and 2 snow layers (snow surface + interior) - - nk = nblyr + 1 - nt_depend = 2 + nt_fbri + ntd - - if (tr_bgc_N) then - if (dEdd_algae) then - nlt_chl_sw = 1 - nbtrcr_sw = nilyr+nslyr+2 - endif - endif ! tr_bgc_N - - endif ! skl_bgc or z_tracers - - if (skl_bgc .or. z_tracers) then - - !----------------------------------------------------------------- - ! assign tracer indices and dependencies - ! bgc_tracer_type: < 0 purely mobile , >= 0 stationary - !------------------------------------------------------------------ - - if (tr_bgc_N) then - do mm = 1, n_algae - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_N(mm), nlt_bgc_N(mm), & - algaltype(mm), nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_N(mm)) = mm - enddo ! mm - endif ! tr_bgc_N - - if (tr_bgc_Nit) then - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_Nit, nlt_bgc_Nit, & - nitratetype, nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_Nit) = icepack_max_algae + 1 - endif ! tr_bgc_Nit - - if (tr_bgc_C) then - ! - ! Algal C is not yet distinct from algal N - ! * Reqires exudation and/or changing C:N ratios - ! for implementation - ! - ! do mm = 1,n_algae - ! call init_bgc_trcr(nk, nt_fbri, & - ! nt_bgc_C(mm), nlt_bgc_C(mm), & - ! algaltype(mm), nt_depend, & - ! ntrcr, nbtrcr, & - ! bgc_tracer_type, trcr_depend, & - ! trcr_base, n_trcr_strata, & - ! nt_strata, bio_index) - ! bio_index_o(nlt_bgc_C(mm)) = icepack_max_algae + 1 + mm - ! enddo ! mm - - do mm = 1, n_doc - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_DOC(mm), nlt_bgc_DOC(mm), & - doctype(mm), nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_DOC(mm)) = icepack_max_algae + 1 + mm - enddo ! mm - do mm = 1, n_dic - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_DIC(mm), nlt_bgc_DIC(mm), & - dictype(mm), nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_DIC(mm)) = icepack_max_algae + icepack_max_doc + 1 + mm - enddo ! mm - endif ! tr_bgc_C - - if (tr_bgc_chl) then - do mm = 1, n_algae - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_chl(mm), nlt_bgc_chl(mm), & - algaltype(mm), nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_chl(mm)) = icepack_max_algae + 1 + icepack_max_doc + icepack_max_dic + mm - enddo ! mm - endif ! tr_bgc_chl - - if (tr_bgc_Am) then - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_Am, nlt_bgc_Am, & - ammoniumtype, nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_Am) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic + 2 - endif - if (tr_bgc_Sil) then - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_Sil, nlt_bgc_Sil, & - silicatetype, nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_Sil) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic + 3 - endif - if (tr_bgc_DMS) then ! all together - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_DMSPp, nlt_bgc_DMSPp, & - dmspptype, nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_DMSPp) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic + 4 - - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_DMSPd, nlt_bgc_DMSPd, & - dmspdtype, nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_DMSPd) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic + 5 - - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_DMS, nlt_bgc_DMS, & - dmspdtype, nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_DMS) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic + 6 - endif - if (tr_bgc_PON) then - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_PON, nlt_bgc_PON, & - nitratetype, nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_PON) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic + 7 - endif - if (tr_bgc_DON) then - do mm = 1, n_don - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_DON(mm), nlt_bgc_DON(mm), & - dontype(mm), nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_DON(mm)) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic + 7 + mm - enddo ! mm - endif ! tr_bgc_DON - if (tr_bgc_Fe) then - do mm = 1, n_fed - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_Fed(mm), nlt_bgc_Fed(mm), & - fedtype(mm), nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_Fed(mm)) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic & - + icepack_max_don + 7 + mm - enddo ! mm - do mm = 1, n_fep - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_Fep(mm), nlt_bgc_Fep(mm), & - feptype(mm), nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_Fep(mm)) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic & - + icepack_max_don + icepack_max_fe + 7 + mm - enddo ! mm - endif ! tr_bgc_Fe - - if (tr_bgc_hum) then - call init_bgc_trcr(nk, nt_fbri, & - nt_bgc_hum, nlt_bgc_hum, & - humtype, nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_bgc_hum) = 2*icepack_max_algae + icepack_max_doc + 8 + icepack_max_dic & - + icepack_max_don + 2*icepack_max_fe + icepack_max_aero - endif - endif ! skl_bgc or z_tracers - - if (z_tracers) then ! defined on nblyr+1 in ice - ! and 2 snow layers (snow surface + interior) - - nk = nblyr + 1 - nt_depend = 2 + nt_fbri + ntd - - ! z layer aerosols - if (tr_zaero) then - do mm = 1, n_zaero - if (dEdd_algae) then - nlt_zaero_sw(mm) = nbtrcr_sw + 1 - nbtrcr_sw = nbtrcr_sw + nilyr + nslyr+2 - endif - call init_bgc_trcr(nk, nt_fbri, & - nt_zaero(mm), nlt_zaero(mm), & - zaerotype(mm), nt_depend, & - ntrcr, nbtrcr, & - bgc_tracer_type, trcr_depend, & - trcr_base, n_trcr_strata, & - nt_strata, bio_index) - bio_index_o(nlt_zaero(mm)) = 2*icepack_max_algae + icepack_max_doc + icepack_max_dic & - + icepack_max_don + 2*icepack_max_fe + 7 + mm - enddo ! mm - endif ! tr_zaero - -!echmod keep trcr indices etc here but move zbgc_frac_init, zbgc_init_frac, tau_ret, tau_rel to icepack - if (nbtrcr > 0) then - nt_zbgc_frac = ntrcr + 1 - ntrcr = ntrcr + nbtrcr - do k = 1,nbtrcr - zbgc_frac_init(k) = c1 - trcr_depend(nt_zbgc_frac+k-1) = 2+nt_fbri - trcr_base(nt_zbgc_frac+ k - 1,1) = c0 - trcr_base(nt_zbgc_frac+ k - 1,2) = c1 - trcr_base(nt_zbgc_frac+ k - 1,3) = c0 - n_trcr_strata(nt_zbgc_frac+ k - 1)= 1 - nt_strata(nt_zbgc_frac+ k - 1,1) = nt_fbri - nt_strata(nt_zbgc_frac+ k - 1,2) = 0 - tau_ret(k) = c1 - tau_rel(k) = c1 - if (bgc_tracer_type(k) >= c0 .and. bgc_tracer_type(k) < p5) then - tau_ret(k) = tau_min - tau_rel(k) = tau_max - zbgc_frac_init(k) = c1 - elseif (bgc_tracer_type(k) >= p5 .and. bgc_tracer_type(k) < c1) then - tau_ret(k) = tau_min - tau_rel(k) = tau_min - zbgc_frac_init(k) = c1 - elseif (bgc_tracer_type(k) >= c1 .and. bgc_tracer_type(k) < c2) then - tau_ret(k) = tau_max - tau_rel(k) = tau_min - zbgc_frac_init(k) = c1 - elseif (bgc_tracer_type(k) >= c2 ) then - tau_ret(k) = tau_max - tau_rel(k) = tau_max - zbgc_frac_init(k) = c1 - endif - enddo - endif - - endif ! z_tracers - - do k = 1, nbtrcr - zbgc_init_frac(k) = frazil_scav - if (bgc_tracer_type(k) < c0) zbgc_init_frac(k) = initbio_frac - enddo - !----------------------------------------------------------------- ! set values in icepack !----------------------------------------------------------------- - call icepack_init_zbgc( & - zbgc_init_frac_in=zbgc_init_frac, tau_ret_in=tau_ret, tau_rel_in=tau_rel, & - zbgc_frac_init_in=zbgc_frac_init, bgc_tracer_type_in=bgc_tracer_type) - call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & - file=__FILE__, line=__LINE__) - - call icepack_init_tracer_sizes( & - n_algae_in=n_algae, & - n_DOC_in=n_DOC, n_DON_in=n_DON, n_DIC_in=n_DIC, & - n_fed_in=n_fed, n_fep_in=n_fep, n_zaero_in=n_zaero, & - ntrcr_in=ntrcr, ntrcr_o_in=ntrcr_o, nbtrcr_in=nbtrcr, nbtrcr_sw_in=nbtrcr_sw) - call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & - file=__FILE__, line=__LINE__) - - call icepack_init_tracer_flags( & - tr_brine_in =tr_brine, & - tr_bgc_Nit_in=tr_bgc_Nit, tr_bgc_Am_in =tr_bgc_Am, tr_bgc_Sil_in=tr_bgc_Sil, & - tr_bgc_DMS_in=tr_bgc_DMS, tr_bgc_PON_in=tr_bgc_PON, & - tr_bgc_N_in =tr_bgc_N, tr_bgc_C_in =tr_bgc_C, tr_bgc_chl_in=tr_bgc_chl, & - tr_bgc_DON_in=tr_bgc_DON, tr_bgc_Fe_in =tr_bgc_Fe, tr_zaero_in =tr_zaero, & - tr_bgc_hum_in=tr_bgc_hum) - call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & - file=__FILE__, line=__LINE__) - - call icepack_init_tracer_indices( & - nt_fbri_in=nt_fbri, & - nt_bgc_Nit_in=nt_bgc_Nit, nt_bgc_Am_in=nt_bgc_Am, nt_bgc_Sil_in=nt_bgc_Sil, & - nt_bgc_DMS_in=nt_bgc_DMS, nt_bgc_PON_in=nt_bgc_PON, & - nt_bgc_N_in=nt_bgc_N, nt_bgc_chl_in=nt_bgc_chl, nt_bgc_hum_in=nt_bgc_hum, & - nt_bgc_DOC_in=nt_bgc_DOC, nt_bgc_DON_in=nt_bgc_DON, nt_bgc_DIC_in=nt_bgc_DIC, & - nt_zaero_in=nt_zaero, nt_bgc_DMSPp_in=nt_bgc_DMSPp, nt_bgc_DMSPd_in=nt_bgc_DMSPd, & - nt_bgc_Fed_in=nt_bgc_Fed, nt_bgc_Fep_in=nt_bgc_Fep, nt_zbgc_frac_in=nt_zbgc_frac, & - nlt_chl_sw_in=nlt_chl_sw, nlt_bgc_Sil_in=nlt_bgc_Sil, nlt_zaero_sw_in=nlt_zaero_sw, & - nlt_bgc_N_in=nlt_bgc_N, nlt_bgc_Nit_in=nlt_bgc_Nit, nlt_bgc_Am_in=nlt_bgc_Am, & - nlt_bgc_DMS_in=nlt_bgc_DMS, nlt_bgc_DMSPp_in=nlt_bgc_DMSPp, & - nlt_bgc_DMSPd_in=nlt_bgc_DMSPd, & - nlt_bgc_DIC_in=nlt_bgc_DIC, nlt_bgc_DOC_in=nlt_bgc_DOC, nlt_bgc_PON_in=nlt_bgc_PON, & - nlt_bgc_DON_in=nlt_bgc_DON, nlt_bgc_Fed_in=nlt_bgc_Fed, nlt_bgc_Fep_in=nlt_bgc_Fep, & - nlt_bgc_chl_in=nlt_bgc_chl, nlt_bgc_hum_in=nlt_bgc_hum, nlt_zaero_in=nlt_zaero, & - bio_index_o_in=bio_index_o, bio_index_in=bio_index) + 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__) - !----------------------------------------------------------------- - ! final consistency checks - !----------------------------------------------------------------- - if (nbtrcr > icepack_max_nbtrcr) then - write (nu_diag,*) ' ' - write (nu_diag,*) 'nbtrcr > icepack_max_nbtrcr' - write (nu_diag,*) 'nbtrcr, icepack_max_nbtrcr:',nbtrcr, icepack_max_nbtrcr - call icedrv_system_abort(file=__FILE__,line=__LINE__) - endif - if (.NOT. dEdd_algae) nbtrcr_sw = 1 - - if (nbtrcr_sw > max_nsw) then - write (nu_diag,*) ' ' - write (nu_diag,*) 'nbtrcr_sw > max_nsw' - write (nu_diag,*) 'nbtrcr_sw, max_nsw:',nbtrcr_sw, max_nsw - call icedrv_system_abort(file=__FILE__,line=__LINE__) - endif - - if (ntrcr > max_ntrcr) then - write(nu_diag,*) 'max_ntrcr < number of namelist tracers' - write(nu_diag,*) 'max_ntrcr = ',max_ntrcr,' ntrcr = ',ntrcr - call icedrv_system_abort(file=__FILE__,line=__LINE__) - endif - - !----------------------------------------------------------------- - ! spew - !----------------------------------------------------------------- - if (skl_bgc) then - - write(nu_diag,1010) ' skl_bgc = ', skl_bgc - write(nu_diag,1030) ' bgc_flux_type = ', bgc_flux_type - write(nu_diag,1010) ' restore_bgc = ', restore_bgc - write(nu_diag,*) ' bgc_data_type = ', & - trim(bgc_data_type) - write(nu_diag,1020) ' number of bio tracers = ', nbtrcr - write(nu_diag,1020) ' number of Isw tracers = ', nbtrcr_sw - write(nu_diag,1020) ' number of autotrophs = ', n_algae - write(nu_diag,1020) ' number of doc = ', n_doc - write(nu_diag,1020) ' number of dic = ', n_dic - write(nu_diag,1020) ' number of don = ', n_don - write(nu_diag,1020) ' number of fed = ', n_fed - write(nu_diag,1020) ' number of fep = ', n_fep - write(nu_diag,1010) ' tr_bgc_N = ', tr_bgc_N - write(nu_diag,1010) ' tr_bgc_C = ', tr_bgc_C - write(nu_diag,1010) ' tr_bgc_chl = ', tr_bgc_chl - write(nu_diag,1010) ' tr_bgc_Nit = ', tr_bgc_Nit - write(nu_diag,1010) ' tr_bgc_Am = ', tr_bgc_Am - write(nu_diag,1010) ' tr_bgc_Sil = ', tr_bgc_Sil - write(nu_diag,1010) ' tr_bgc_hum = ', tr_bgc_hum - write(nu_diag,1010) ' tr_bgc_DMS = ', tr_bgc_DMS - write(nu_diag,1010) ' tr_bgc_PON = ', tr_bgc_PON - write(nu_diag,1010) ' tr_bgc_DON = ', tr_bgc_DON - write(nu_diag,1010) ' tr_bgc_Fe = ', tr_bgc_Fe - - elseif (z_tracers) then - - write(nu_diag,*) ' bgc_data_type = ', & - trim(bgc_data_type) - write(nu_diag,1010) ' dEdd_algae = ', dEdd_algae - write(nu_diag,1010) ' modal_aero = ', modal_aero - write(nu_diag,1010) ' scale_bgc = ', scale_bgc - write(nu_diag,1010) ' solve_zbgc = ', solve_zbgc - write(nu_diag,1020) ' number of ztracers = ', nbtrcr - write(nu_diag,1020) ' number of Isw tracers = ', nbtrcr_sw - write(nu_diag,1020) ' number of autotrophs = ', n_algae - write(nu_diag,1020) ' number of doc = ', n_doc - write(nu_diag,1020) ' number of dic = ', n_dic - write(nu_diag,1020) ' number of fed = ', n_fed - write(nu_diag,1020) ' number of fep = ', n_fep - write(nu_diag,1020) ' number of aerosols = ', n_zaero - write(nu_diag,1010) ' tr_zaero = ', tr_zaero - write(nu_diag,1010) ' tr_bgc_Nit = ', tr_bgc_Nit - write(nu_diag,1010) ' tr_bgc_N = ', tr_bgc_N - write(nu_diag,1010) ' tr_bgc_Am = ', tr_bgc_Am - write(nu_diag,1010) ' tr_bgc_C = ', tr_bgc_C - write(nu_diag,1010) ' tr_bgc_Sil = ', tr_bgc_Sil - write(nu_diag,1010) ' tr_bgc_hum = ', tr_bgc_hum - write(nu_diag,1010) ' tr_bgc_chl = ', tr_bgc_chl - write(nu_diag,1010) ' tr_bgc_DMS = ', tr_bgc_DMS - write(nu_diag,1010) ' tr_bgc_PON = ', tr_bgc_PON - write(nu_diag,1010) ' tr_bgc_DON = ', tr_bgc_DON - write(nu_diag,1010) ' tr_bgc_Fe = ', tr_bgc_Fe - write(nu_diag,1000) ' grid_o = ', grid_o - write(nu_diag,1005) ' l_sk = ', l_sk - write(nu_diag,1000) ' initbio_frac = ', initbio_frac - write(nu_diag,1000) ' frazil_scav = ', frazil_scav - - endif ! skl_bgc or solve_bgc - 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 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__)