From b3aa664445dec9ea8eaf2e425014bd806a7880c6 Mon Sep 17 00:00:00 2001 From: apcraig Date: Mon, 17 Jun 2024 15:25:38 -0600 Subject: [PATCH] Migrate bgrid, cgrid, igrid, icgrid, swgrid to Icepack variables, remove them from the driver and interfaces. --- columnphysics/icepack_algae.F90 | 32 ++--- columnphysics/icepack_brine.F90 | 109 +++++++++--------- columnphysics/icepack_shortwave.F90 | 9 +- columnphysics/icepack_therm_itd.F90 | 27 +---- columnphysics/icepack_zbgc.F90 | 28 +---- columnphysics/icepack_zbgc_shared.F90 | 8 ++ configuration/driver/icedrv_arrays_column.F90 | 11 -- configuration/driver/icedrv_init_column.F90 | 12 +- configuration/driver/icedrv_step.F90 | 9 +- 9 files changed, 81 insertions(+), 164 deletions(-) diff --git a/columnphysics/icepack_algae.F90 b/columnphysics/icepack_algae.F90 index 936dc3551..3e4c13ded 100644 --- a/columnphysics/icepack_algae.F90 +++ b/columnphysics/icepack_algae.F90 @@ -47,6 +47,7 @@ module icepack_algae use icepack_zbgc_shared, only: remap_zbgc, regrid_stationary use icepack_zbgc_shared, only: merge_bgc_fluxes use icepack_zbgc_shared, only: merge_bgc_fluxes_skl + use icepack_zbgc_shared, only: bgrid, cgrid, igrid, icgrid use icepack_zbgc_shared, only: phi_sk, bgc_tracer_type use icepack_zbgc_shared, only: zbgc_init_frac use icepack_zbgc_shared, only: zbgc_frac_init @@ -97,8 +98,6 @@ subroutine zbio (dt, & zfswin, & hbri, hbri_old, & darcy_V, & - bgrid, & - igrid, icgrid, & bphi_min, & iTin, & Zoo, & @@ -154,18 +153,13 @@ subroutine zbio (dt, & real (kind=dbl_kind), intent(in) :: & hbri_old ! brine height (m) - real (kind=dbl_kind), dimension (nblyr+2), intent(inout) :: & - bgrid ! biology nondimensional vertical grid points - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - igrid , & ! biology vertical interface points iTin , & ! salinity vertical interface points iphin , & ! Porosity on the igrid iDin , & ! Diffusivity/h on the igrid (1/s) iSin ! Salinity on vertical interface points (ppt) real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: & - icgrid , & ! CICE interface coordinate fswthrul ! visible short wave radiation on icgrid (W/m^2) real (kind=dbl_kind), dimension(nbtrcr), intent(in) :: & @@ -297,8 +291,6 @@ subroutine zbio (dt, & dh_top, dh_bot, & zfswin, hbri, & hbri_old, darcy_V, & - bgrid, & - igrid, icgrid, & bphi_min, zbgc_snown,& zbgc_atmn, & iTin, dh_direct, & @@ -811,8 +803,6 @@ subroutine z_biogeochemistry (n_cat, dt, & dh_top, dh_bot, & zfswin, hbri, & hbri_old, darcy_V, & - bgrid, & - i_grid, ic_grid, & bphi_min, zbgc_snow, & zbgc_atm, & iTin, dh_direct, & @@ -840,7 +830,6 @@ subroutine z_biogeochemistry (n_cat, dt, & dh_direct ! surface flooding or runoff (m) real (kind=dbl_kind), dimension (:), intent(inout) :: & - bgrid , & ! biology nondimensional vertical grid points flux_bio , & ! total ocean tracer flux (mmol/m^2/s) zfswin , & ! visible Short wave flux on igrid (W/m^2) Zoo , & ! N losses to the system from reaction terms @@ -848,11 +837,9 @@ subroutine z_biogeochemistry (n_cat, dt, & trcrn ! bulk tracer concentration (mmol/m^3) real (kind=dbl_kind), dimension (:), intent(in) :: & - i_grid , & ! biology vertical interface points iTin , & ! salinity vertical interface points iphin , & ! Porosity on the igrid iDin , & ! Diffusivity/h on the igrid (1/s) - ic_grid , & ! CICE interface coordinate fswthrul , & ! visible short wave radiation on icgrid (W/m^2) zbgc_snow , & ! tracer input from snow (mmol/m^3*m) zbgc_atm , & ! tracer input from atm (mmol/m^3 *m) @@ -1158,8 +1145,8 @@ subroutine z_biogeochemistry (n_cat, dt, & trtmp0(1:ntrcr), trtmp(1:ntrcr+2), & 0, nblyr+1, & hin, hbri, & - ic_grid(1:nilyr+1), & - i_grid(1:nblyr+1),ice_conc ) + icgrid(1:nilyr+1), & + igrid(1:nblyr+1),ice_conc ) if (icepack_warnings_aborted(subname)) return @@ -1208,7 +1195,7 @@ subroutine z_biogeochemistry (n_cat, dt, & call compute_FCT_matrix & (initcons,sbdiagz, dt, & - diagz, spdiagz, rhsz, bgrid, & + diagz, spdiagz, rhsz, & darcyV, dhtop, & dhbot, iphin_N, & Diff, hbri_old, & @@ -1252,7 +1239,7 @@ subroutine z_biogeochemistry (n_cat, dt, & (initcons_stationary, hbri_old, & hbri, dt, & top_conc, & - i_grid, flux_bio(mm),& + igrid, flux_bio(mm),& meltb, congel) if (icepack_warnings_aborted(subname)) return @@ -1263,7 +1250,7 @@ subroutine z_biogeochemistry (n_cat, dt, & (initcons_stationary, hbri_old, & hbri, dt, & top_conc, & - i_grid, flux_bio(mm),& + igrid, flux_bio(mm),& meltb, congel) if (icepack_warnings_aborted(subname)) return @@ -2297,7 +2284,7 @@ end subroutine thin_ice_flux ! July, 2014 by N. Jeffery ! subroutine compute_FCT_matrix (C_in, sbdiag, dt, & - diag, spdiag, rhs, bgrid, & + diag, spdiag, rhs, & darcyV, dhtop, dhbot, & iphin_N, iDin, hbri_old, & atm_add, bphin_N, & @@ -2307,7 +2294,7 @@ subroutine compute_FCT_matrix (C_in, sbdiag, dt, & real (kind=dbl_kind), dimension(nblyr+1), intent(in) :: & C_in ! Initial (bulk) concentration*hbri_old (mmol/m^2) - ! conserved quantity on i_grid + ! conserved quantity on igrid real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -2319,8 +2306,7 @@ subroutine compute_FCT_matrix (C_in, sbdiag, dt, & iphin_N ! Porosity with min condition on igrid real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - bphin_N, & ! Porosity with min condition on igrid - bgrid + bphin_N ! Porosity with min condition on igrid real (kind=dbl_kind), dimension (nblyr+1), intent(out) :: & sbdiag , & ! sub-diagonal matrix elements diff --git a/columnphysics/icepack_brine.F90 b/columnphysics/icepack_brine.F90 index 9caef7bf5..f4738a4d8 100644 --- a/columnphysics/icepack_brine.F90 +++ b/columnphysics/icepack_brine.F90 @@ -14,6 +14,7 @@ module icepack_brine use icepack_tracers, only: nilyr, nblyr, ntrcr, nt_qice, nt_sice use icepack_tracers, only: nt_Tsfc use icepack_zbgc_shared, only: k_o, exp_h, Dm, Ra_c, viscos_dynamic, thinS + use icepack_zbgc_shared, only: bgrid, cgrid, igrid, swgrid, icgrid use icepack_zbgc_shared, only: remap_zbgc use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -123,8 +124,7 @@ end subroutine preflushing_changes ! NOTE: This subroutine uses thermosaline_vertical output to compute ! average ice permeability and the surface ice porosity - subroutine compute_microS_mushy (bgrid, cgrid, igrid, & - trcrn, hice_old, hbr_old, & + subroutine compute_microS_mushy (trcrn, hice_old, hbr_old, & sss, sst, bTin, & iTin, bphin, & kperm, bphi_min, & @@ -132,15 +132,6 @@ subroutine compute_microS_mushy (bgrid, cgrid, igrid, & iphin, ibrine_rho, ibrine_sal, & iDin, iSin) - real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - bgrid ! biology nondimensional vertical grid points - - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: & - cgrid ! CICE vertical coordinate - real (kind=dbl_kind), intent(in) :: & hice_old , & ! previous timestep ice height (m) sss , & ! ocean salinity (ppt) @@ -268,11 +259,10 @@ subroutine compute_microS_mushy (bgrid, cgrid, igrid, & ibrine_sal, ibrine_rho, & bphin, iphin, & kperm, bphi_min, & - igrid, sss, iSin) + sss, iSin) if (icepack_warnings_aborted(subname)) return - call calculate_drho(igrid, bgrid, & - brine_rho, ibrine_rho, drho) + call calculate_drho(brine_rho, ibrine_rho, drho) if (icepack_warnings_aborted(subname)) return do k= 2, nblyr+1 @@ -292,12 +282,11 @@ subroutine prepare_hbrine (bSin, bTin, iTin, & ibrine_sal, ibrine_rho, & bphin, iphin, & kperm, bphi_min, & - i_grid, sss, iSin) + sss, iSin) real (kind=dbl_kind), dimension (:), intent(in) :: & bSin , & ! salinity of ice layers on bio grid (ppt) - bTin , & ! temperature of ice layers on bio grid for history (C) - i_grid ! biology grid interface points + bTin ! temperature of ice layers on bio grid for history (C) real (kind=dbl_kind), dimension (:), intent(inout) :: & brine_sal , & ! equilibrium brine salinity (ppt) @@ -339,7 +328,7 @@ subroutine prepare_hbrine (bSin, bTin, iTin, & if (k == 1) then igrm = 0 else - igrm = i_grid(k) - i_grid(k-1) + igrm = igrid(k) - igrid(k-1) endif brine_sal(k) = a1*bTin(k) & @@ -378,9 +367,9 @@ subroutine prepare_hbrine (bSin, bTin, iTin, & kperm = k_min endif - igrp = i_grid(k+1) - i_grid(k ) - igrm = i_grid(k ) - i_grid(k-1) - rigr = c1 / (i_grid(k+1)-i_grid(k-1)) + igrp = igrid(k+1) - igrid(k ) + igrm = igrid(k ) - igrid(k-1) + rigr = c1 / (igrid(k+1)-igrid(k-1)) ibrine_sal(k) = (brine_sal(k+1)*igrp + brine_sal(k)*igrm) * rigr ibrine_rho(k) = (brine_rho(k+1)*igrp + brine_rho(k)*igrm) * rigr @@ -546,14 +535,7 @@ end subroutine update_hbrine ! Find density difference about interface grid points ! for gravity drainage parameterization - subroutine calculate_drho (i_grid, b_grid, & - brine_rho, ibrine_rho, drho) - - real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - b_grid ! biology nondimensional grid layer points - - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - i_grid ! biology grid interface points + subroutine calculate_drho (brine_rho, ibrine_rho, drho) real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & brine_rho ! Internal brine density (kg/m^3) @@ -588,29 +570,29 @@ subroutine calculate_drho (i_grid, b_grid, & rho_2b(:) = c0 drho (:) = c0 ! surface is snow or atmosphere - do k = 1, nblyr+1 ! i_grid values + do k = 1, nblyr+1 ! igrid values !---------------------------------------------- - ! h_avg(k) = i_grid(k) - ! Calculate rho_a(k), ie average rho above i_grid(k) + ! h_avg(k) = igrid(k) + ! Calculate rho_a(k), ie average rho above igrid(k) ! first part is good !---------------------------------------------- if (k == 2) then - rho_a(2) = (brine_rho(2)*b_grid(2) & + rho_a(2) = (brine_rho(2)*bgrid(2) & + (ibrine_rho(2) + brine_rho(2)) & - * p5*(i_grid(2)-b_grid(2)) )/i_grid(2) + * p5*(igrid(2)-bgrid(2)) )/igrid(2) rho_b(2) = brine_rho(2) elseif (k > 2 .AND. k < nblyr+1) then - rho_a(k) = (rho_a(k-1)*i_grid(k-1) + (ibrine_rho(k-1) + brine_rho(k)) & - * p5*(b_grid(k)-i_grid(k-1)) + (ibrine_rho(k ) + brine_rho(k)) & - * p5*(i_grid(k)-b_grid(k)))/i_grid(k) + rho_a(k) = (rho_a(k-1)*igrid(k-1) + (ibrine_rho(k-1) + brine_rho(k)) & + * p5*(bgrid(k)-igrid(k-1)) + (ibrine_rho(k ) + brine_rho(k)) & + * p5*(igrid(k)-bgrid(k)))/igrid(k) rho_b(k) = brine_rho(k) else - rho_a(nblyr+1) = (rho_a(nblyr)*i_grid(nblyr) + (ibrine_rho(nblyr) + & - brine_rho(nblyr+1))*p5*(b_grid(nblyr+1)-i_grid(nblyr)) + & - brine_rho(nblyr+1)*(i_grid(nblyr+1)-b_grid(nblyr+1)))/i_grid(nblyr+1) + rho_a(nblyr+1) = (rho_a(nblyr)*igrid(nblyr) + (ibrine_rho(nblyr) + & + brine_rho(nblyr+1))*p5*(bgrid(nblyr+1)-igrid(nblyr)) + & + brine_rho(nblyr+1)*(igrid(nblyr+1)-bgrid(nblyr+1)))/igrid(nblyr+1) rho_a(1) = brine_rho(2) !for k == 1 use grid point value rho_b(nblyr+1) = brine_rho(nblyr+1) rho_b(1) = brine_rho(2) @@ -622,10 +604,10 @@ subroutine calculate_drho (i_grid, b_grid, & ! Calculate average above and below k rho_2a !---------------------------------------------- - do k = 1, nblyr+1 !i_grid values + do k = 1, nblyr+1 !igrid values if (k == 1) then - rho_2a(1) = (rho_a(1)*b_grid(2) + p5*(brine_rho(2) + ibrine_rho(2)) & - * (i_grid(2)-b_grid(2)))/i_grid(2) + rho_2a(1) = (rho_a(1)*bgrid(2) + p5*(brine_rho(2) + ibrine_rho(2)) & + * (igrid(2)-bgrid(2)))/igrid(2) rho_2b(1) = brine_rho(2) else mstop = 2*(k-1) + 1 @@ -639,7 +621,7 @@ subroutine calculate_drho (i_grid, b_grid, & endif do mm = mstart,mstop - rho_2a(k) =(rho_a(nblyr+1) + rhow*(c2*i_grid(k)-c1))*p5/i_grid(k) + rho_2a(k) =(rho_a(nblyr+1) + rhow*(c2*igrid(k)-c1))*p5/igrid(k) enddo rho_2b(k) = brine_rho(k+1) endif @@ -653,22 +635,22 @@ end subroutine calculate_drho !autodocument_start icepack_init_hbrine ! Initialize brine height tracer - subroutine icepack_init_hbrine(bgrid, igrid, cgrid, & - icgrid, swgrid, phi_snow) + subroutine icepack_init_hbrine(bgrid_out, igrid_out, cgrid_out, & + icgrid_out, swgrid_out, phi_snow) - real (kind=dbl_kind), intent(inout) :: & + real (kind=dbl_kind), optional, intent(inout) :: & phi_snow ! porosity at the ice-snow interface - real (kind=dbl_kind), dimension (nblyr+2), intent(out) :: & - bgrid ! biology nondimensional vertical grid points + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + bgrid_out ! biology nondimensional vertical grid points - real (kind=dbl_kind), dimension (nblyr+1), intent(out) :: & - igrid ! biology vertical interface points + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + igrid_out ! biology vertical interface points - real (kind=dbl_kind), dimension (nilyr+1), intent(out) :: & - cgrid , & ! CICE vertical coordinate - icgrid , & ! interface grid for CICE (shortwave variable) - swgrid ! grid for ice tracers used in dEdd scheme + real (kind=dbl_kind), optional, dimension (:), intent(out) :: & + cgrid_out , & ! CICE vertical coordinate + icgrid_out , & ! interface grid for CICE (shortwave variable) + swgrid_out ! grid for ice tracers used in dEdd scheme !autodocument_end @@ -682,8 +664,17 @@ subroutine icepack_init_hbrine(bgrid, igrid, cgrid, & character(len=*),parameter :: subname='(icepack_init_hbrine)' + !----------------------------------------------------------------- + + if (present(phi_snow)) then + if (phi_snow .le. c0) phi_snow = c1-rhos/rhoi + endif - if (phi_snow .le. c0) phi_snow = c1-rhos/rhoi + allocate(bgrid (nblyr+2)) + allocate(igrid (nblyr+1)) + allocate(cgrid (nilyr+1)) + allocate(icgrid(nilyr+1)) + allocate(swgrid(nilyr+1)) !----------------------------------------------------------------- ! Calculate bio gridn: 0 to 1 corresponds to ice top to bottom @@ -739,6 +730,12 @@ subroutine icepack_init_hbrine(bgrid, igrid, cgrid, & swgrid(k) = zspace * (real(k,kind=dbl_kind)-c1p5) enddo + if (present( bgrid_out)) bgrid_out=bgrid + if (present( cgrid_out)) cgrid_out=cgrid + if (present( igrid_out)) igrid_out=igrid + if (present(icgrid_out)) icgrid_out=icgrid + if (present(swgrid_out)) swgrid_out=swgrid + end subroutine icepack_init_hbrine !======================================================================= diff --git a/columnphysics/icepack_shortwave.F90 b/columnphysics/icepack_shortwave.F90 index b8150fe3c..724ab5d23 100644 --- a/columnphysics/icepack_shortwave.F90 +++ b/columnphysics/icepack_shortwave.F90 @@ -64,7 +64,7 @@ module icepack_shortwave use icepack_tracers, only: nmodal1, nmodal2, max_aero use icepack_shortwave_data, only: nspint_3bd, nspint_5bd use icepack_zbgc_shared,only: R_chl2N, F_abs_chl - use icepack_zbgc_shared,only: remap_zbgc + use icepack_zbgc_shared,only: remap_zbgc, igrid, swgrid use icepack_orbital, only: compute_coszen use icepack_warnings, only: warnstr, icepack_warnings_add use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted @@ -3710,7 +3710,6 @@ end subroutine icepack_prep_radiation ! Elizabeth C. Hunke, LANL subroutine icepack_step_radiation (dt, & - swgrid, igrid, & fbri, & aicen, vicen, & vsnon, Tsfcn, & @@ -3772,12 +3771,6 @@ subroutine icepack_step_radiation (dt, & real (kind=dbl_kind), intent(inout) :: & coszen ! cosine solar zenith angle, < 0 for sun below horizon - real (kind=dbl_kind), dimension (:), intent(in) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (:), intent(in) :: & - swgrid ! grid for ice tracers used in dEdd scheme - real (kind=dbl_kind), dimension(:), intent(in) :: & aicen , & ! ice area fraction in each category vicen , & ! ice volume in each category (m) diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index 0cd1799ac..a68f27f36 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -52,6 +52,7 @@ module icepack_therm_itd use icepack_mushy_physics, only: liquidus_temperature_mush, icepack_enthalpy_mush use icepack_zbgc, only: add_new_ice_bgc use icepack_zbgc, only: lateral_melt_bgc + use icepack_zbgc_shared, only: bgrid, cgrid, igrid implicit none @@ -1281,8 +1282,6 @@ subroutine add_new_ice (dt, & Tf, sss, & salinz, phi_init, & dSin0_frazil, & - bgrid, cgrid, & - igrid, & flux_bio, & ocean_bio, & frazil_diag, & @@ -1341,14 +1340,6 @@ subroutine add_new_ice (dt, & dSin0_frazil ! initial frazil bulk salinity reduction from sss ! BGC - real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - bgrid ! biology nondimensional vertical grid points - - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: & - cgrid ! CICE vertical coordinate real (kind=dbl_kind), dimension (:), intent(inout) :: & flux_bio ! tracer flux to ocean from biology (mmol/m^2/s) @@ -1901,7 +1892,6 @@ subroutine add_new_ice (dt, & !----------------------------------------------------------------- if (tr_brine .or. nbtrcr > 0) then call add_new_ice_bgc(dt, ncats, & - bgrid, cgrid, igrid, & aicen_init, vicen_init, vi0_init, & aicen, vicen, vin0new, & trcrn, & @@ -1941,8 +1931,7 @@ subroutine icepack_step_therm2(dt, hin_max, & frain, fpond, & fresh, fsalt, & fhocn, update_ocn_f, & - bgrid, cgrid, & - igrid, faero_ocn, & + faero_ocn, & first_ice, fzsal, & flux_bio, ocean_bio, & frazil_diag, & @@ -1983,15 +1972,6 @@ subroutine icepack_step_therm2(dt, hin_max, & integer (kind=int_kind), dimension (:,:), intent(in) :: & nt_strata ! indices of underlying tracer layers - real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - bgrid ! biology nondimensional vertical grid points - - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: & - cgrid ! CICE vertical coordinate - real (kind=dbl_kind), dimension(:), intent(in) :: & salinz , & ! initial salinity profile ocean_bio ! ocean concentration of biological tracer @@ -2180,8 +2160,7 @@ subroutine icepack_step_therm2(dt, hin_max, & fresh, fsalt, & Tf, sss, & salinz, phi_init, & - dSin0_frazil, bgrid, & - cgrid, igrid, & + dSin0_frazil, & flux_bio, & ocean_bio, & frazil_diag, fiso_ocn, & diff --git a/columnphysics/icepack_zbgc.F90 b/columnphysics/icepack_zbgc.F90 index f4ef38897..32ad2d0c2 100644 --- a/columnphysics/icepack_zbgc.F90 +++ b/columnphysics/icepack_zbgc.F90 @@ -43,6 +43,7 @@ module icepack_zbgc use icepack_zbgc_shared, only: zbgc_init_frac use icepack_zbgc_shared, only: zbgc_frac_init + use icepack_zbgc_shared, only: bgrid, cgrid, igrid, icgrid use icepack_zbgc_shared, only: bgc_tracer_type, remap_zbgc use icepack_zbgc_shared, only: R_S2N, R_Si2N, R_Fe2C, R_Fe2N, R_Fe2DON, R_Fe2DOC use icepack_zbgc_shared, only: chlabs, alpha2max_low, beta2max @@ -86,7 +87,6 @@ module icepack_zbgc ! Adjust biogeochemical tracers when new frazil ice forms subroutine add_new_ice_bgc (dt, ncats, & - bgrid, cgrid, igrid, & aicen_init, vicen_init, vi0_init, & aicen, vicen, vin0new, & trcrn, & @@ -96,15 +96,6 @@ subroutine add_new_ice_bgc (dt, ncats, & integer (kind=int_kind), intent(in) :: & ncats ! 1 without floe size distribution or ncat - real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & - bgrid ! biology nondimensional vertical grid points - - real (kind=dbl_kind), dimension (nblyr+1), intent(in) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), intent(in) :: & - cgrid ! CICE vertical coordinate - real (kind=dbl_kind), intent(in) :: & dt ! time step (s) @@ -334,14 +325,7 @@ end subroutine lateral_melt_bgc !autodocument_start icepack_init_bgc ! subroutine icepack_init_bgc( & - cgrid, igrid, sicen, trcrn, sss, ocean_bio_all, & - DOCPoolFractions) - - real (kind=dbl_kind), dimension (nblyr+1), intent(inout) :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), intent(inout) :: & - cgrid ! CICE vertical coordinate + sicen, trcrn, sss, ocean_bio_all, DOCPoolFractions) real (kind=dbl_kind), dimension(nilyr, ncat), intent(in) :: & sicen ! salinity on the cice grid @@ -609,7 +593,6 @@ subroutine icepack_biogeochemistry(dt, & fbio_snoice, fbio_atmice, ocean_bio_dh, ocean_bio, & first_ice, fswpenln, bphi, bTiz, ice_bio_net, & snow_bio_net, totalChla, fswthrun, & - bgrid, igrid, icgrid, cgrid, & meltbn, melttn, congeln, snoicen, & sst, sss, Tf, fsnow, meltsn, & !hmix, & hin_old, flux_bio, flux_bio_atm, & @@ -622,10 +605,6 @@ subroutine icepack_biogeochemistry(dt, & dt ! time step real (kind=dbl_kind), dimension (:), intent(inout) :: & - bgrid , & ! biology nondimensional vertical grid points - igrid , & ! biology vertical interface points - cgrid , & ! CICE vertical coordinate - icgrid , & ! interface grid for CICE (shortwave variable) fbio_snoice , & ! fluxes from snow to ice fbio_atmice , & ! fluxes from atm to ice dhbr_top , & ! brine top change @@ -821,7 +800,6 @@ subroutine icepack_biogeochemistry(dt, & iDi(:,n) = c0 call compute_microS_mushy ( & - bgrid, cgrid, igrid, & trcrn(:,n), hin_old(n), hbr_old, & sss, sst, bTiz(:,n), & iTin(:), bphi(:,n), kavg, & @@ -875,8 +853,6 @@ subroutine icepack_biogeochemistry(dt, & zfswin(:,n), & hbrin, hbr_old, & darcy_V(n), & - bgrid, & - igrid, icgrid, & bphi_o, & iTin, & Zoo(:,n), & diff --git a/columnphysics/icepack_zbgc_shared.F90 b/columnphysics/icepack_zbgc_shared.F90 index a1c862689..08c6753d5 100644 --- a/columnphysics/icepack_zbgc_shared.F90 +++ b/columnphysics/icepack_zbgc_shared.F90 @@ -174,6 +174,7 @@ module icepack_zbgc_shared real (kind=dbl_kind), dimension(max_aero), public :: & zaerotype ! mobility type for aerosols + !----------------------------------------------------------------- ! brine !----------------------------------------------------------------- @@ -196,6 +197,13 @@ module icepack_zbgc_shared Dm = 1.0e-9_dbl_kind, & ! molecular diffusion (m^2/s) Ra_c = 0.05_dbl_kind ! critical Rayleigh number for bottom convection + real (kind=dbl_kind), dimension (:), allocatable, public :: & + bgrid , & ! biology nondimensional vertical grid points + igrid , & ! biology vertical interface points + cgrid , & ! CICE vertical coordinate + icgrid , & ! interface grid for CICE (shortwave variable) + swgrid ! grid for ice tracers used in dEdd scheme + !======================================================================= contains diff --git a/configuration/driver/icedrv_arrays_column.F90 b/configuration/driver/icedrv_arrays_column.F90 index e0a5c42bf..b55f129f4 100644 --- a/configuration/driver/icedrv_arrays_column.F90 +++ b/configuration/driver/icedrv_arrays_column.F90 @@ -122,17 +122,6 @@ module icedrv_arrays_column ! biogeochemistry components - real (kind=dbl_kind), dimension (nblyr+2), public :: & - bgrid ! biology nondimensional vertical grid points - - real (kind=dbl_kind), dimension (nblyr+1), public :: & - igrid ! biology vertical interface points - - real (kind=dbl_kind), dimension (nilyr+1), public :: & - cgrid , & ! CICE vertical coordinate - icgrid , & ! interface grid for CICE (shortwave variable) - swgrid ! grid for ice tracers used in dEdd scheme - real (kind=dbl_kind), dimension (nx,ncat), public :: & first_ice_real ! .true. = c1, .false. = c0 diff --git a/configuration/driver/icedrv_init_column.F90 b/configuration/driver/icedrv_init_column.F90 index 524ec7c56..877b362c1 100644 --- a/configuration/driver/icedrv_init_column.F90 +++ b/configuration/driver/icedrv_init_column.F90 @@ -99,7 +99,6 @@ subroutine init_shortwave use icedrv_arrays_column, only: fswsfcn, ffracn, snowfracn use icedrv_arrays_column, only: fswthrun, fswthrun_vdr, fswthrun_vdf, fswthrun_idr, fswthrun_idf use icedrv_arrays_column, only: fswintn, albpndn, apeffn, trcrn_sw, dhsn - use icedrv_arrays_column, only: swgrid, igrid use icedrv_calendar, only: istep1, dt, yday, sec use icedrv_system, only: icedrv_system_abort use icedrv_forcing, only: snw_ssp_table @@ -247,8 +246,6 @@ subroutine init_shortwave if (tmask(i)) then call icepack_step_radiation ( & dt=dt, & - swgrid=swgrid(:), & - igrid=igrid(:), & fbri=fbri(:), & aicen=aicen(i,:), & vicen=vicen(i,:), & @@ -368,7 +365,7 @@ subroutine init_bgc() use icedrv_arrays_column, only: zfswin, trcrn_sw use icedrv_arrays_column, only: ocean_bio_all, ice_bio_net, snow_bio_net - use icedrv_arrays_column, only: cgrid, igrid, bphi, iDi, bTiz, iki + use icedrv_arrays_column, only: bphi, iDi, bTiz, iki use icedrv_calendar, only: istep1 use icedrv_system, only: icedrv_system_abort use icedrv_flux, only: sss, nit, amm, sil, dmsp, dms, algalN, & @@ -473,7 +470,6 @@ subroutine init_bgc() enddo call icepack_init_bgc( & - cgrid=cgrid, igrid=igrid, & sicen=sicen(:,:), trcrn=trcrn_bgc(:,:), & sss=sss(i), ocean_bio_all=ocean_bio_all(i,:)) ! optional DOCPoolFractions=DOCPoolFractions) @@ -490,8 +486,7 @@ end subroutine init_bgc subroutine init_hbrine() - use icedrv_arrays_column, only: first_ice, bgrid, igrid, cgrid - use icedrv_arrays_column, only: icgrid, swgrid + use icedrv_arrays_column, only: first_ice use icedrv_state, only: trcrn real (kind=dbl_kind) :: phi_snow @@ -512,8 +507,7 @@ subroutine init_hbrine() !----------------------------------------------------------------- - call icepack_init_hbrine(bgrid=bgrid, igrid=igrid, cgrid=cgrid, icgrid=icgrid, & - swgrid=swgrid, phi_snow=phi_snow) + call icepack_init_hbrine(phi_snow=phi_snow) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, & file=__FILE__, line=__LINE__) diff --git a/configuration/driver/icedrv_step.F90 b/configuration/driver/icedrv_step.F90 index bcb45158c..181aca714 100644 --- a/configuration/driver/icedrv_step.F90 +++ b/configuration/driver/icedrv_step.F90 @@ -432,7 +432,7 @@ subroutine step_therm2 (dt) wavefreq, dwavefreq, & floe_rad_c, floe_binwidth, & d_afsd_latg, d_afsd_newi, d_afsd_latm, d_afsd_weld - use icedrv_arrays_column, only: first_ice, bgrid, cgrid, igrid + use icedrv_arrays_column, only: first_ice use icedrv_calendar, only: yday use icedrv_domain_size, only: ncat, nilyr, nslyr, n_aero, nblyr, & nx, nfsd @@ -505,8 +505,7 @@ subroutine step_therm2 (dt) frain=frain(i), fpond=fpond(i), & fresh=fresh(i), fsalt=fsalt(i), & fhocn=fhocn(i), & - bgrid=bgrid, cgrid=cgrid, & - igrid=igrid, faero_ocn=faero_ocn(i,:), & + faero_ocn=faero_ocn(i,:), & first_ice=first_ice(i,:), & flux_bio=flux_bio(i,1:nbtrcr), & ocean_bio=ocean_bio(i,1:nbtrcr), & @@ -1023,7 +1022,6 @@ subroutine step_radiation (dt) use icedrv_arrays_column, only: fswthrun, fswthrun_vdr, fswthrun_vdf, fswthrun_idr, fswthrun_idf use icedrv_arrays_column, only: albicen, albsnon, albpndn use icedrv_arrays_column, only: alvdrn, alidrn, alvdfn, alidfn, apeffn, trcrn_sw, snowfracn - use icedrv_arrays_column, only: swgrid, igrid use icedrv_calendar, only: yday, sec use icedrv_domain_size, only: ncat, n_aero, nilyr, nslyr, n_zaero, n_algae, nblyr, nx use icedrv_flux, only: swvdr, swvdf, swidr, swidf, coszen, fsnow @@ -1123,7 +1121,6 @@ subroutine step_radiation (dt) if (tmask(i)) then call icepack_step_radiation(dt=dt, & - swgrid=swgrid(:), igrid=igrid(:), & fbri=fbri(:), & aicen=aicen(i,:), vicen=vicen(i,:), & vsnon=vsnon(i,:), & @@ -1325,7 +1322,6 @@ subroutine biogeochemistry (dt) 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 - 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 @@ -1432,7 +1428,6 @@ subroutine biogeochemistry (dt) endif call icepack_biogeochemistry(dt=dt, & - bgrid=bgrid, igrid=igrid, icgrid=icgrid, cgrid=cgrid, & upNO = upNO(i), & upNH = upNH(i), & iDi = iDi(i,:,:), &