From 246b7f5d03355a49adbe152245beaea10030a469 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Wed, 11 Oct 2023 17:00:31 -0500 Subject: [PATCH 01/24] Adds mpas interface for icepack bgc Needs to be tested and merged with main icepack-integration branch BFB in the physics. --- .../namelist_defaults_mpassi.xml | 12 +- components/mpas-seaice/driver/ice_comp_mct.F | 107 +- components/mpas-seaice/src/Registry.xml | 12 +- .../mpas-seaice/src/column/ice_algae.F90 | 5 +- .../mpas-seaice/src/column/ice_colpkg.F90 | 1 + .../mpas_seaice_core_interface.F | 8 +- .../src/shared/mpas_seaice_column.F | 95 +- .../src/shared/mpas_seaice_icepack.F | 1191 ++++++++--------- .../src/shared/mpas_seaice_initialize.F | 6 +- 9 files changed, 711 insertions(+), 726 deletions(-) diff --git a/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml b/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml index 735be1ce8e11..fe88816d271a 100644 --- a/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml +++ b/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml @@ -317,12 +317,12 @@ 0.0 0.0 0.5 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 +-1.0 +-1.0 +-1.0 +-1.0 +-1.0 +-1.0 7.0 7.0 7.0 diff --git a/components/mpas-seaice/driver/ice_comp_mct.F b/components/mpas-seaice/driver/ice_comp_mct.F index 8649380aad8a..3385fa0c37d2 100644 --- a/components/mpas-seaice/driver/ice_comp_mct.F +++ b/components/mpas-seaice/driver/ice_comp_mct.F @@ -1909,6 +1909,7 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_pool_get_config(configs, "config_use_aerosols", config_use_aerosols) call mpas_pool_get_config(configs, "config_use_modal_aerosols", config_use_modal_aerosols) call mpas_pool_get_config(configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call mpas_pool_get_config(configs, "config_use_zaerosols", config_use_zaerosols) call mpas_pool_get_subpool(block_ptr % structs, 'mesh', meshPool) call mpas_pool_get_subpool(block_ptr % structs, 'ocean_coupling', oceanCoupling) @@ -1947,9 +1948,13 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_pool_get_array(aerosols, "atmosAerosolFlux", atmosAerosolFlux) endif + call mpas_pool_get_subpool(block_ptr % structs, 'biogeochemistry', biogeochemistry) + if (config_use_zaerosols) then + call mpas_pool_get_array(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConc) + call mpas_pool_get_array(biogeochemistry, 'atmosBlackCarbonFlux', atmosBlackCarbonFlux) + call mpas_pool_get_array(biogeochemistry, 'atmosDustFlux', atmosDustFlux) + endif if (config_use_column_biogeochemistry) then - call mpas_pool_get_config(configs, "config_use_zaerosols", config_use_zaerosols) - call mpas_pool_get_subpool(block_ptr % structs, 'biogeochemistry', biogeochemistry) call mpas_pool_get_array(biogeochemistry, 'oceanAlgaeConc', oceanAlgaeConc) call mpas_pool_get_array(biogeochemistry, 'oceanDOCConc', oceanDOCConc) @@ -1963,15 +1968,10 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_pool_get_array(biogeochemistry, 'oceanHumicsConc', oceanHumicsConc) call mpas_pool_get_array(biogeochemistry, 'oceanParticulateIronConc', oceanParticulateIronConc) call mpas_pool_get_array(biogeochemistry, 'oceanDissolvedIronConc', oceanDissolvedIronConc) - call mpas_pool_get_array(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConc) call mpas_pool_get_array(biogeochemistry, 'carbonToNitrogenRatioAlgae', carbonToNitrogenRatioAlgae) call mpas_pool_get_array(biogeochemistry, 'carbonToNitrogenRatioDON', carbonToNitrogenRatioDON) call mpas_pool_get_array(biogeochemistry, 'DOCPoolFractions', DOCPoolFractions) - if (config_use_zaerosols) then - call mpas_pool_get_array(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFlux) - call mpas_pool_get_array(biogeochemistry, "atmosDustFlux", atmosDustFlux) - endif endif do i = 1, nCellsSolve @@ -2060,6 +2060,42 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ endif endif + ! set aerosols, if configured + if (config_use_zaerosols) then + oceanZAerosolConc(1,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer1, n) + oceanZAerosolConc(2,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer2, n) + oceanZAerosolConc(3,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer3, n) + oceanZAerosolConc(4,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer4, n) + oceanZAerosolConc(5,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer5, n) + oceanZAerosolConc(6,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer6, n) + if (config_use_modal_aerosols) then + atmosBlackCarbonFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_bcphodry, n) & + + x2i_i % rAttr(index_x2i_Faxa_bcphidry, n) + atmosBlackCarbonFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_bcphiwet, n) + !combine wet and dry dust + atmosDustFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet1, n) & + + x2i_i % rAttr(index_x2i_Faxa_dstdry1, n) + atmosDustFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet2, n) & + + x2i_i % rAttr(index_x2i_Faxa_dstdry2, n) + atmosDustFlux(3,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet3, n) & + + x2i_i % rAttr(index_x2i_Faxa_dstdry3, n) + atmosDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet4, n) & + + x2i_i % rAttr(index_x2i_Faxa_dstdry4, n) + else + atmosBlackCarbonFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_bcphodry, n) + atmosBlackCarbonFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_bcphidry, n) & + + x2i_i % rAttr(index_x2i_Faxa_bcphiwet, n) + ! combine wet and dry dust + atmosDustFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet1, n) & + + x2i_i % rAttr(index_x2i_Faxa_dstdry1, n) + atmosDustFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet2, n) & + + x2i_i % rAttr(index_x2i_Faxa_dstdry2, n) + atmosDustFlux(3,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet3, n) & + + x2i_i % rAttr(index_x2i_Faxa_dstdry3, n) + atmosDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet4, n) & + + x2i_i % rAttr(index_x2i_Faxa_dstdry4, n) + endif + endif ! import biogeochemistry fields, if configured if (config_use_column_biogeochemistry) then oceanAlgaeConc(1,i) = x2i_i % rAttr(index_x2i_So_algae1, n) @@ -2081,42 +2117,6 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ oceanParticulateIronConc(2,i) = x2i_i % rAttr(index_x2i_So_fep2, n) oceanDissolvedIronConc(1,i) = x2i_i % rAttr(index_x2i_So_fed1, n) oceanDissolvedIronConc(2,i) = x2i_i % rAttr(index_x2i_So_fed2, n) - oceanZAerosolConc(1,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer1, n) - oceanZAerosolConc(2,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer2, n) - oceanZAerosolConc(3,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer3, n) - oceanZAerosolConc(4,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer4, n) - oceanZAerosolConc(5,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer5, n) - oceanZAerosolConc(6,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer6, n) - ! set aerosols, if configured - if (config_use_zaerosols) then - if (config_use_modal_aerosols) then - atmosBlackCarbonFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_bcphodry, n) & - + x2i_i % rAttr(index_x2i_Faxa_bcphidry, n) - atmosBlackCarbonFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_bcphiwet, n) - ! combine wet and dry dust - atmosDustFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet1, n) & - + x2i_i % rAttr(index_x2i_Faxa_dstdry1, n) - atmosDustFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet2, n) & - + x2i_i % rAttr(index_x2i_Faxa_dstdry2, n) - atmosDustFlux(3,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet3, n) & - + x2i_i % rAttr(index_x2i_Faxa_dstdry3, n) - atmosDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet4, n) & - + x2i_i % rAttr(index_x2i_Faxa_dstdry4, n) - else - atmosBlackCarbonFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_bcphodry, n) - atmosBlackCarbonFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_bcphidry, n) & - + x2i_i % rAttr(index_x2i_Faxa_bcphiwet, n) - ! combine wet and dry dust - atmosDustFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet1, n) & - + x2i_i % rAttr(index_x2i_Faxa_dstdry1, n) - atmosDustFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet2, n) & - + x2i_i % rAttr(index_x2i_Faxa_dstdry2, n) - atmosDustFlux(3,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet3, n) & - + x2i_i % rAttr(index_x2i_Faxa_dstdry3, n) - atmosDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet4, n) & - + x2i_i % rAttr(index_x2i_Faxa_dstdry4, n) - endif - endif endif end do @@ -2179,6 +2179,11 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_pool_get_field(aerosols, "atmosAerosolFlux", atmosAerosolFluxField) endif + if (config_use_zaerosols) then + call mpas_pool_get_field(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFluxField) + call mpas_pool_get_field(biogeochemistry, "atmosDustFlux", atmosDustFluxField) + call mpas_pool_get_field(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConcField) + endif if (config_use_column_biogeochemistry) then call mpas_pool_get_subpool(domain % blocklist % structs, 'biogeochemistry', biogeochemistry) @@ -2194,11 +2199,6 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_pool_get_field(biogeochemistry, 'oceanHumicsConc', oceanHumicsConcField) call mpas_pool_get_field(biogeochemistry, 'oceanParticulateIronConc', oceanParticulateIronConcField) call mpas_pool_get_field(biogeochemistry, 'oceanDissolvedIronConc', oceanDissolvedIronConcField) - call mpas_pool_get_field(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConcField) - if (config_use_zaerosols) then - call mpas_pool_get_field(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFluxField) - call mpas_pool_get_field(biogeochemistry, "atmosDustFlux", atmosDustFluxField) - endif endif call mpas_dmpar_exch_halo_field(seaSurfaceTemperatureField) @@ -2229,7 +2229,11 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ if (config_use_aerosols) then call mpas_dmpar_exch_halo_field(atmosAerosolFluxField) endif - + if (config_use_zaerosols) then + call mpas_dmpar_exch_halo_field(atmosBlackCarbonFluxField) + call mpas_dmpar_exch_halo_field(atmosDustFluxField) + call mpas_dmpar_exch_halo_field(oceanZAerosolConcField) + endif if (config_use_column_biogeochemistry) then call mpas_dmpar_exch_halo_field(oceanAlgaeConcField) call mpas_dmpar_exch_halo_field(oceanDOCConcField) @@ -2243,11 +2247,6 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_dmpar_exch_halo_field(oceanHumicsConcField) call mpas_dmpar_exch_halo_field(oceanParticulateIronConcField) call mpas_dmpar_exch_halo_field(oceanDissolvedIronConcField) - call mpas_dmpar_exch_halo_field(oceanZAerosolConcField) - if (config_use_zaerosols) then - call mpas_dmpar_exch_halo_field(atmosBlackCarbonFluxField) - call mpas_dmpar_exch_halo_field(atmosDustFluxField) - endif endif ! REVISION HISTORY: diff --git a/components/mpas-seaice/src/Registry.xml b/components/mpas-seaice/src/Registry.xml index c99741fe66ab..c424b92c718c 100644 --- a/components/mpas-seaice/src/Registry.xml +++ b/components/mpas-seaice/src/Registry.xml @@ -1414,32 +1414,32 @@ possible_values="-1 = entirely in the mobile phase; 0 = retention dominated; 1 = release dominated; 0.5 = equal but rapid exchange; 2 = equal but slow exchange" icepack_name="feptype_1" /> - - - - - - domain % blocklist do while (associated(block)) @@ -3206,7 +3214,7 @@ subroutine column_radiation(domain, clock, lInitialization) allocate(aerosolsArray(4*nAerosols,nCategories)) allocate(index_shortwaveAerosol(maxAerosolType)) - if (.not. config_use_column_biogeochemistry) then + if (.not. config_use_zaerosols) then index_shortwaveAerosol(1:maxAerosolType) = 1 else do iAerosol = 1, maxAerosolType @@ -3215,7 +3223,7 @@ subroutine column_radiation(domain, clock, lInitialization) endif setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) !$omp parallel do default(shared) firstprivate(aerosolsArray,index_shortwaveAerosol) & !$omp& private(iCategory,iAerosol,lonCellColumn) @@ -3382,7 +3390,8 @@ subroutine column_ridging(domain) ! configs logical, pointer :: & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols real(kind=RKIND), pointer :: & config_dt @@ -3479,6 +3488,7 @@ subroutine column_ridging(domain) call MPAS_pool_get_config(block % configs, "config_dynamics_subcycle_number", config_dynamics_subcycle_number) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_array(velocity_solver, "dynamicsTimeStep", dynamicsTimeStep) @@ -3535,7 +3545,7 @@ subroutine column_ridging(domain) allocate(newlyFormedIceLogical(nCategories)) setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) ! code abort abortFlag = .false. @@ -3994,12 +4004,14 @@ subroutine column_biogeochemistry(domain) endif setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) ! code abort abortFlag = .false. abortMessage = "" + atmosBioFluxes(:,:) = 0.0_RKIND + do iCell = 1, nCellsSolve ! newly formed ice do iCategory = 1, nCategories @@ -4041,7 +4053,6 @@ subroutine column_biogeochemistry(domain) atmosDustFlux(iBioTracers,iCell) = 1.e-13_RKIND enddo #endif - atmosBioFluxes(:,:) = 0.0_RKIND if (config_use_zaerosols) then indexj = ciceTracerObject % index_verticalAerosolsConcLayer(1) do iBioTracers = 1, maxBCType @@ -4492,7 +4503,8 @@ subroutine seaice_column_aggregate(domain) ocean_coupling logical, pointer :: & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols real(kind=RKIND), dimension(:), pointer :: & iceAreaCell, & @@ -4527,6 +4539,7 @@ subroutine seaice_column_aggregate(domain) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) @@ -4544,7 +4557,7 @@ subroutine seaice_column_aggregate(domain) call MPAS_pool_get_array(ocean_coupling, "seaFreezingTemperature", seaFreezingTemperature) setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) do iCell = 1, nCellsSolve @@ -4691,7 +4704,8 @@ subroutine seaice_column_coupling_prep(domain) logical, pointer :: & config_use_ocean_mixed_layer, & config_include_pond_freshwater_feedback, & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols type(MPAS_pool_type), pointer :: & oceanCoupling, & @@ -4802,6 +4816,7 @@ subroutine seaice_column_coupling_prep(domain) call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) call MPAS_pool_get_config(domain % configs, "config_include_pond_freshwater_feedback", config_include_pond_freshwater_feedback) call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_diatoms", config_ratio_C_to_N_diatoms) call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_small_plankton", config_ratio_C_to_N_small_plankton) call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_phaeocystis", config_ratio_C_to_N_phaeocystis) @@ -4994,10 +5009,12 @@ subroutine seaice_column_coupling_prep(domain) !----------------------------------------------------------------- ! Define ocean biogeochemical flux variables !----------------------------------------------------------------- - if (config_use_column_biogeochemistry) then + + oceanBioFluxesAll(:) = 0.0_RKIND + + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then totalOceanCarbonFlux(iCell) = 0.0_RKIND - oceanBioFluxesAll(:) = 0.0_RKIND oceanAlgaeFlux(:,iCell) = 0.0_RKIND oceanDOCFlux(:,iCell) = 0.0_RKIND oceanDICFlux(:,iCell) = 0.0_RKIND @@ -5108,7 +5125,7 @@ subroutine seaice_column_coupling_prep(domain) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanHumicsFlux(iCell) - endif ! config_use_column_biogeochemistry + endif ! config_use_column_biogeochemistry .or. config_use_zaerosols enddo ! iCell @@ -5156,7 +5173,8 @@ subroutine seaice_column_scale_fluxes(domain) mesh logical, pointer :: & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols real(kind=RKIND), dimension(:), pointer :: & iceAreaCell, & @@ -5216,6 +5234,7 @@ subroutine seaice_column_scale_fluxes(domain) iBioTracers call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) block => domain % blocklist do while (associated(block)) @@ -5308,6 +5327,9 @@ subroutine seaice_column_scale_fluxes(domain) albedoVisibleDiffuseCell(iCell) = albedoVisibleDiffuseCell(iCell) * iceAreaInverse albedoIRDiffuseCell(iCell) = albedoIRDiffuseCell(iCell) * iceAreaInverse + if (config_use_zaerosols) & + oceanDustIronFlux(iCell) = oceanDustIronFlux(iCell) * iceAreaInverse + if (config_use_column_biogeochemistry) then oceanNitrateFlux(iCell) = oceanNitrateFlux(iCell) * iceAreaInverse @@ -5317,7 +5339,6 @@ subroutine seaice_column_scale_fluxes(domain) oceanDMSPdFlux(iCell) = oceanDMSPdFlux(iCell) * iceAreaInverse oceanDMSFlux(iCell) = oceanDMSFlux(iCell) * iceAreaInverse oceanHumicsFlux(iCell) = oceanHumicsFlux(iCell) * iceAreaInverse - oceanDustIronFlux(iCell) = oceanDustIronFlux(iCell) * iceAreaInverse do iBioTracers = 1, maxAlgaeType oceanAlgaeFlux(iBioTracers,iCell) = oceanAlgaeFlux(iBioTracers,iCell) * iceAreaInverse @@ -5360,6 +5381,9 @@ subroutine seaice_column_scale_fluxes(domain) albedoVisibleDiffuseCell(iCell) = 0.0_RKIND albedoIRDiffuseCell(iCell) = 0.0_RKIND + if (config_use_zaerosols) & + oceanDustIronFlux(iCell) = 0.0_RKIND + if (config_use_column_biogeochemistry) then oceanNitrateFlux(iCell) = 0.0_RKIND @@ -5369,7 +5393,6 @@ subroutine seaice_column_scale_fluxes(domain) oceanDMSPdFlux(iCell) = 0.0_RKIND oceanDMSFlux(iCell) = 0.0_RKIND oceanHumicsFlux(iCell) = 0.0_RKIND - oceanDustIronFlux(iCell) = 0.0_RKIND oceanAlgaeFlux(:,iCell) = 0.0_RKIND oceanDOCFlux(:,iCell) = 0.0_RKIND oceanDICFlux(:,iCell) = 0.0_RKIND @@ -6399,12 +6422,14 @@ subroutine init_column_tracer_object(domain, tracerObject) nZBGCTracers logical, pointer :: & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nCategories", nCategories) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nZBGCTracers", nZBGCTracers) call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) ! get the number of CICE tracers in trcrn call init_column_tracer_object_tracer_number(domain, tracerObject) @@ -6428,7 +6453,7 @@ subroutine init_column_tracer_object(domain, tracerObject) call init_column_tracer_object_ancestor_indices(domain, tracerObject) ! biogeochemistry - if (config_use_column_biogeochemistry) then + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then allocate(tracerObject % index_LayerIndexToDataArray(nZBGCTracers)) allocate(tracerObject % index_LayerIndexToBioIndex(nZBGCTracers)) @@ -6636,7 +6661,7 @@ subroutine init_column_tracer_object_tracer_number(domain, tracerObject) ! biogeochemistry !----------------------------------------------------------------------- - if (config_use_column_biogeochemistry) then + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then ! save tracer number without bio tracers counted tracerObject % nTracersNotBio = tracerObject % nTracers @@ -10257,11 +10282,11 @@ subroutine check_column_package_configs(domain) endif ! check biogeochemistry flags: - if (.not. config_use_column_biogeochemistry .and. (config_use_brine .or. config_use_vertical_zsalinity .or. & - config_use_vertical_biochemistry .or. config_use_shortwave_bioabsorption .or. config_use_vertical_tracers .or. & + if (.not. config_use_column_biogeochemistry .and. (config_use_vertical_zsalinity .or. & + config_use_vertical_biochemistry .or. & config_use_skeletal_biochemistry .or. config_use_nitrate .or. config_use_carbon .or. config_use_chlorophyll .or. & config_use_ammonium .or. config_use_silicate .or. config_use_DMS .or. config_use_nonreactive .or. config_use_humics .or. & - config_use_DON .or. config_use_iron .or. config_use_modal_aerosols .or. config_use_zaerosols)) then + config_use_DON .or. config_use_iron)) then call mpas_log_write(& "check_column_package_configs: config_use_column_biogeochemistry = false. "//& "All biogeochemistry namelist flags must also be false", & @@ -14775,8 +14800,9 @@ subroutine seaice_column_reinitialize_diagnostics_bgc(domain) config_use_column_biogeochemistry, & config_use_column_shortwave, & config_use_column_package, & - config_use_vertical_biochemistry, & - config_use_vertical_zsalinity + config_use_vertical_tracers, & + config_use_vertical_zsalinity, & + config_use_zaerosols call MPAS_pool_get_config(domain % blocklist % configs, "config_use_column_package", config_use_column_package) @@ -14787,15 +14813,16 @@ subroutine seaice_column_reinitialize_diagnostics_bgc(domain) ! biogeochemistry call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) - call MPAS_pool_get_config(block % configs, "config_use_vertical_biochemistry", config_use_vertical_biochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) + call MPAS_pool_get_config(block % configs, "config_use_vertical_tracers", config_use_vertical_tracers) call MPAS_pool_get_config(block % configs, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) - if (config_use_column_biogeochemistry) then + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistryPool) call MPAS_pool_get_subpool(block % structs, "diagnostics_biogeochemistry", diagnostics_biogeochemistryPool) - if (config_use_vertical_biochemistry) then + if (config_use_vertical_tracers) then call MPAS_pool_get_array(biogeochemistryPool, "primaryProduction", primaryProduction) call MPAS_pool_get_array(biogeochemistryPool, "totalChlorophyll", totalChlorophyll) call MPAS_pool_get_array(biogeochemistryPool, "netSpecificAlgalGrowthRate", netSpecificAlgalGrowthRate) @@ -14842,7 +14869,7 @@ subroutine seaice_column_reinitialize_diagnostics_bgc(domain) call MPAS_pool_get_config(block % configs, "config_use_column_shortwave", config_use_column_shortwave) - if (config_use_column_biogeochemistry .or. config_use_column_shortwave) then + if (config_use_column_biogeochemistry .or. config_use_column_shortwave .or. config_use_zaerosols) then call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistryPool) call MPAS_pool_get_array(biogeochemistryPool, "bioTracerShortwave", bioTracerShortwave) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 9f039b8bb8a5..0b0e2216df46 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -264,10 +264,12 @@ subroutine seaice_init_icepack_physics_package_variables(domain, clock) config_do_restart, & config_use_column_biogeochemistry, & config_use_column_shortwave, & - config_use_column_snow_tracers + config_use_column_snow_tracers, & + config_use_zaerosols call MPAS_pool_get_config(domain % configs, "config_use_column_package", config_use_column_package) call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) if (config_use_column_package) then @@ -281,7 +283,7 @@ subroutine seaice_init_icepack_physics_package_variables(domain, clock) call init_column_thermodynamic_profiles(domain) ! initialize biogoechemistry profiles - if (config_use_column_biogeochemistry) & + if (config_use_column_biogeochemistry .or. config_use_zaerosols) & call init_column_biogeochemistry_profiles(domain, ciceTracerObject) ! history variables @@ -1032,7 +1034,8 @@ subroutine seaice_icepack_predynamics_time_integration(domain, clock) config_use_column_biogeochemistry, & config_use_column_itd_thermodynamics, & config_calc_surface_temperature, & - config_use_vertical_tracers + config_use_vertical_tracers, & + config_use_zaerosols real(kind=RKIND), pointer :: & config_dt @@ -1045,6 +1048,7 @@ subroutine seaice_icepack_predynamics_time_integration(domain, clock) call MPAS_pool_get_config(domain % configs, "config_use_column_vertical_thermodynamics", & config_use_column_vertical_thermodynamics) call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_config(domain % configs, "config_use_column_itd_thermodynamics", config_use_column_itd_thermodynamics) call MPAS_pool_get_config(domain % configs, "config_calc_surface_temperature", config_calc_surface_temperature) call MPAS_pool_get_config(domain % configs, "config_use_vertical_tracers", config_use_vertical_tracers) @@ -1074,7 +1078,7 @@ subroutine seaice_icepack_predynamics_time_integration(domain, clock) !----------------------------------------------------------------- call mpas_timer_start("Column biogeochemistry") - if (config_use_column_biogeochemistry) & + if (config_use_column_biogeochemistry .or. config_use_zaerosols) & call column_biogeochemistry(domain) call mpas_timer_stop("Column biogeochemistry") @@ -2126,7 +2130,8 @@ subroutine column_itd_thermodynamics(domain, clock) logical, pointer :: & config_update_ocean_fluxes, & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols ! dimensions integer, pointer :: & @@ -2263,6 +2268,7 @@ subroutine column_itd_thermodynamics(domain, clock) call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_config(block % configs, "config_update_ocean_fluxes", config_update_ocean_fluxes) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) @@ -2348,7 +2354,7 @@ subroutine column_itd_thermodynamics(domain, clock) verticalGridSpace(nBioLayersP1) = verticalGridSpace(1) setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) ! code abort abortFlag = .false. @@ -2926,7 +2932,8 @@ subroutine column_radiation(domain, clock, lInitialization) config_use_shortwave_bioabsorption, & config_use_brine, & config_use_modal_aerosols, & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols character(len=strKIND), pointer :: & config_snow_redistribution_scheme @@ -3049,6 +3056,7 @@ subroutine column_radiation(domain, clock, lInitialization) call MPAS_pool_get_config(domain % configs, "config_use_shortwave_bioabsorption", config_use_shortwave_bioabsorption) call MPAS_pool_get_config(domain % configs, "config_use_modal_aerosols",config_use_modal_aerosols) call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry",config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols",config_use_zaerosols) block => domain % blocklist do while (associated(block)) @@ -3140,28 +3148,31 @@ subroutine column_radiation(domain, clock, lInitialization) allocate(index_shortwaveAerosol(maxAerosolType)) allocate(index_verticalAerosolsConc(maxAerosolType)) allocate(index_algaeConc(nAlgae)) - if (.not. config_use_column_biogeochemistry) then + if (.not. config_use_zaerosols) then index_shortwaveAerosol(1:maxAerosolType) = 1 index_verticalAerosolsConc(1:maxAerosolType) = 1 - index_algaeConc(1:nAlgae) = 1 else do iAerosol = 1, maxAerosolType index_shortwaveAerosol(iAerosol) = ciceTracerObject % index_verticalAerosolsConcShortwave(iAerosol) index_verticalAerosolsConc(iAerosol) = ciceTracerObject % index_verticalAerosolsConc(iAerosol) enddo + endif + if (.not. config_use_column_biogeochemistry) then + index_algaeConc(1:nAlgae) = 1 + else do iBioTracers = 1, nAlgae index_algaeConc(iBioTracers) = ciceTracerObject % index_algaeConc(iBioTracers) enddo endif setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) ! snow grain radius array allocate(snow_grain_radius(nSnowLayers,nCategories)) - !$omp parallel do default(shared) firstprivate(aerosolsArray,index_shortwaveAerosol) & - !$omp& private(iCategory,iAerosol,lonCellColumn) + !$omp parallel do default(shared) firstprivate(aerosolsArray,index_shortwaveAerosol,snow_grain_radius) & + !$omp& private(iCategory,iAerosol,iSnowLayer,lonCellColumn) do iCell = 1, nCellsSolve ! set aerosols array @@ -3177,7 +3188,7 @@ subroutine column_radiation(domain, clock, lInitialization) enddo ! iCategory snow_grain_radius(:,:) = 0.0_RKIND - if (config_use_snow_grain_radius) then + if (config_use_snow_grain_radius) then do iCategory = 1, nCategories do iSnowLayer = 1, nSnowLayers snow_grain_radius(iSnowLayer, iCategory) = snowGrainRadius(iSnowLayer,iCategory,iCell) @@ -3306,7 +3317,8 @@ subroutine column_ridging(domain) ! configs logical, pointer :: & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols real(kind=RKIND), pointer :: & config_dt @@ -3398,6 +3410,7 @@ subroutine column_ridging(domain) call MPAS_pool_get_config(block % configs, "config_dynamics_subcycle_number", config_dynamics_subcycle_number) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_array(velocity_solver, "dynamicsTimeStep", dynamicsTimeStep) @@ -3454,7 +3467,7 @@ subroutine column_ridging(domain) allocate(newlyFormedIceLogical(nCategories)) setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) do iCell = 1, nCellsSolve @@ -3547,10 +3560,10 @@ end subroutine column_ridging subroutine column_biogeochemistry(domain) - use ice_colpkg, only: & - colpkg_biogeochemistry, & - colpkg_init_OceanConcArray, & - colpkg_clear_warnings + use icepack_intfc, only: & + icepack_biogeochemistry, & + icepack_load_ocean_bio_array, & + icepack_warnings_clear use seaice_constants, only: & seaicePuny @@ -3597,15 +3610,8 @@ subroutine column_biogeochemistry(domain) nDON, & nParticulateIron, & nDissolvedIron, & - nZBGCTracers, & - maxAlgaeType, & - maxDOCType, & - maxDICType, & - maxDONType, & - maxIronType, & maxBCType, & - maxDustType, & - maxAerosolType + maxDustType ! variables @@ -3625,9 +3631,6 @@ subroutine column_biogeochemistry(domain) seaSurfaceSalinity, & seaFreezingTemperature, & snowfallRate, & - zSalinityFlux, & - zSalinityGDFlux, & - oceanMixedLayerDepth, & totalSkeletalAlgae, & oceanNitrateConc, & oceanSilicateConc, & @@ -3652,7 +3655,6 @@ subroutine column_biogeochemistry(domain) totalVerticalBiologyIce, & totalVerticalBiologySnow, & penetratingShortwaveFlux, & - zSalinityIceDensity, & basalIceMeltCategory, & surfaceIceMeltCategory, & congelationCategory, & @@ -3779,13 +3781,6 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_dimension(mesh, "nDON", nDON) call MPAS_pool_get_dimension(mesh, "nParticulateIron", nParticulateIron) call MPAS_pool_get_dimension(mesh, "nDissolvedIron", nDissolvedIron) - call MPAS_pool_get_dimension(mesh, "nZBGCTracers", nZBGCTracers) - call MPAS_pool_get_dimension(mesh, "maxAlgaeType", maxAlgaeType) - call MPAS_pool_get_dimension(mesh, "maxDOCType", maxDOCType) - call MPAS_pool_get_dimension(mesh, "maxDICType", maxDICType) - call MPAS_pool_get_dimension(mesh, "maxDONType", maxDONType) - call MPAS_pool_get_dimension(mesh, "maxAerosolType", maxAerosolType) - call MPAS_pool_get_dimension(mesh, "maxIronType", maxIronType) call MPAS_pool_get_dimension(mesh, "maxBCType", maxBCType) call MPAS_pool_get_dimension(mesh, "maxDustType", maxDustType) @@ -3824,9 +3819,6 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrations", oceanBioConcentrations) call MPAS_pool_get_array(biogeochemistry, "totalVerticalBiologyIce", totalVerticalBiologyIce) call MPAS_pool_get_array(biogeochemistry, "totalVerticalBiologySnow", totalVerticalBiologySnow) - call MPAS_pool_get_array(biogeochemistry, "zSalinityIceDensity", zSalinityIceDensity) - call MPAS_pool_get_array(biogeochemistry, "zSalinityFlux", zSalinityFlux) - call MPAS_pool_get_array(biogeochemistry, "zSalinityGDFlux", zSalinityGDFlux) call MPAS_pool_get_array(biogeochemistry, "atmosBioFluxes", atmosBioFluxes) call MPAS_pool_get_array(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFlux) call MPAS_pool_get_array(biogeochemistry, "atmosDustFlux", atmosDustFlux) @@ -3856,7 +3848,6 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(ocean_coupling, "seaSurfaceTemperature", seaSurfaceTemperature) call MPAS_pool_get_array(ocean_coupling, "seaSurfaceSalinity", seaSurfaceSalinity) call MPAS_pool_get_array(ocean_coupling, "seaFreezingTemperature", seaFreezingTemperature) - call MPAS_pool_get_array(ocean_coupling, "oceanMixedLayerDepth", oceanMixedLayerDepth) call MPAS_pool_get_array(atmos_coupling, "snowfallRate", snowfallRate) @@ -3896,12 +3887,14 @@ subroutine column_biogeochemistry(domain) endif setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) - ! code abort - abortFlag = .false. - abortMessage = "" + atmosBioFluxes(:,:) = 0.0_RKIND + !$omp parallel do default(shared) private(iCategory,iBioTracers,iAlgae, rayleighCriteria, & + !$omp& rayleighCriteriaReal) firstprivate(atmosBioFluxes,atmosBlackCarbonFlux, & + !$omp& atmosDustFlux, bioShortwaveFluxCell, newlyFormedIce) + ! do iCell = 1, nCellsSolve ! newly formed ice do iCategory = 1, nCategories @@ -3913,28 +3906,23 @@ subroutine column_biogeochemistry(domain) !update ocean concentrations fields and atmospheric fluxes into allocated array #ifdef coupled - call colpkg_init_OceanConcArray(& - nZBGCTracers, & - maxAlgaeType, & - maxDONType, & - maxDOCType, & - maxDICType, & - maxAerosolType, & - maxIronType, & - oceanNitrateConc(iCell), & - oceanAmmoniumConc(iCell), & - oceanSilicateConc(iCell),& - oceanDMSPConc(iCell), & - oceanDMSConc(iCell), & - oceanAlgaeConc(:,iCell), & - oceanDOCConc(:,iCell), & - oceanDONConc(:,iCell), & - oceanDICConc(:,iCell), & - oceanDissolvedIronConc(:,iCell), & - oceanParticulateIronConc(:,iCell), & - oceanZAerosolConc(:,iCell), & - oceanBioConcentrations(:,iCell), & - oceanHumicsConc(iCell)) + + call icepack_load_ocean_bio_array(& + nit=oceanNitrateConc(iCell), & + amm=oceanAmmoniumConc(iCell), & + sil=oceanSilicateConc(iCell), & + dmsp=oceanDMSPConc(iCell), & + dms=oceanDMSConc(iCell), & + algalN=oceanAlgaeConc(:,iCell), & + doc=oceanDOCConc(:,iCell), & + don=oceanDONConc(:,iCell), & + dic=oceanDICConc(:,iCell), & + fed=oceanDissolvedIronConc(:,iCell), & + fep=oceanParticulateIronConc(:,iCell), & + zaeros=oceanZAerosolConc(:,iCell), & + ocean_bio_all=oceanBioConcentrations(:,iCell), & + hum=oceanHumicsConc(iCell)) + #else do iBioTracers = 1, maxBCType atmosBlackCarbonFlux(iBioTracers,iCell) = 1.e-12_RKIND @@ -3943,7 +3931,6 @@ subroutine column_biogeochemistry(domain) atmosDustFlux(iBioTracers,iCell) = 1.e-13_RKIND enddo #endif - atmosBioFluxes(:,:) = 0.0_RKIND if (config_use_zaerosols) then indexj = ciceTracerObject % index_verticalAerosolsConcLayer(1) do iBioTracers = 1, maxBCType @@ -3959,94 +3946,90 @@ subroutine column_biogeochemistry(domain) oceanBioConcentrationsUsed(iBioTracers) = oceanBioConcentrations(iBioData,iCell) enddo ! iBioTracers - abortFlag = .false. - call set_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) if (checkCarbon) call seaice_total_carbon_content_category(block,& totalCarbonCatInitial,iceAreaCategoryInitial,iceVolumeCategoryInitial,iCell) - call colpkg_clear_warnings() - call colpkg_biogeochemistry(& - config_dt, & - ciceTracerObject % nTracers, & - ciceTracerObject % nBioTracers, & - netNitrateUptake(iCell), & - netAmmoniumUptake(iCell), & - bioDiffusivity(:,:,iCell), & - bioPermeability(:,:,iCell), & - bioShortwaveFlux(:,:,iCell), & - totalVerticalSalinity(iCell), & - darcyVelocityBio(:,iCell), & - netSpecificAlgalGrowthRate(iCell), & - primaryProduction(iCell), & - netBrineHeight(iCell), & - brineBottomChange(:,iCell), & - brineTopChange(:,iCell), & - verticalNitrogenLosses(:,:,iCell), & - snowIceBioFluxes(:,iCell), & - atmosIceBioFluxes(:,iCell), & - oceanBioConcentrationsUsed(:), & - newlyFormedIceLogical(:), & - shortwaveLayerPenetration(:,:,iCell), & - bioPorosity(:,:,iCell), & - bioTemperature(:,:,iCell), & - totalVerticalBiologyIce(:,iCell), & - totalVerticalBiologySnow(:,iCell), & - totalChlorophyll(iCell), & - penetratingShortwaveFlux(:,iCell), & - rayleighCriteria, & - zSalinityIceDensity(:,iCell), & - zSalinityFlux(iCell), & - zSalinityGDFlux(iCell), & - biologyGrid, & - interfaceBiologyGrid, & - interfaceGrid, & - verticalGrid, & - nBioLayers, & - nIceLayers, & - nSnowLayers, & - nAlgae, & - nzAerosols, & - nCategories, & - nDOC, & - nDIC, & - nDON, & - nDissolvedIron, & - nParticulateIron, & - basalIceMeltCategory(:,iCell), & - surfaceIceMeltCategory(:,iCell), & - congelationCategory(:,iCell), & - snowiceFormationCategory(:,iCell), & - seaSurfaceTemperature(iCell), & - seaSurfaceSalinity(iCell), & - seaFreezingTemperature(iCell), & - snowfallRate(iCell), & - snowMeltCategory(:,iCell), & - oceanMixedLayerDepth(iCell), & - initialSalinityProfile(:,iCell), & - iceThicknessCategoryInitial(:,iCell), & - oceanBioFluxes(:,iCell), & - atmosBioFluxes(:,iCell), & - iceAreaCategoryInitial(:,iCell), & - iceVolumeCategoryInitial(:,iCell), & - iceAreaCategory(1,:,iCell), & - iceVolumeCategory(1,:,iCell), & - snowVolumeCategory(1,:,iCell), & - openWaterArea(iCell), & - tracerArrayCategory, & - snowVolumeCategoryInitial(:,iCell), & - config_use_skeletal_biochemistry, & - maxAlgaeType, & - nZBGCTracers, & - oceanBioFluxesCategory(:,:,iCell), & - bgridPorosityIceCell(:,iCell), & - bgridSalinityIceCell(:,iCell), & - bgridTemperatureIceCell(:,iCell), & - abortFlag, & - abortMessage) - call column_write_warnings(abortFlag) + ! code abort + abortFlag = .false. + abortMessage = "" + + call icepack_warnings_clear() + call icepack_biogeochemistry(& + dt=config_dt, & + ntrcr=ciceTracerObject % nTracers, & + nbtrcr=ciceTracerObject % nBioTracers, & + upNO=netNitrateUptake(iCell), & + upNH=netAmmoniumUptake(iCell), & + iDi=bioDiffusivity(:,:,iCell), & + iki=bioPermeability(:,:,iCell), & + zfswin=bioShortwaveFlux(:,:,iCell), & + zsal_tot=totalVerticalSalinity(iCell), & + darcy_V=darcyVelocityBio(:,iCell), & + grow_net=netSpecificAlgalGrowthRate(iCell), & + PP_net=primaryProduction(iCell), & + hbri=netBrineHeight(iCell), & + dhbr_bot=brineBottomChange(:,iCell), & + dhbr_top=brineTopChange(:,iCell), & + Zoo=verticalNitrogenLosses(:,:,iCell), & + fbio_snoice=snowIceBioFluxes(:,iCell), & + fbio_atmice=atmosIceBioFluxes(:,iCell), & + ocean_bio=oceanBioConcentrationsUsed(:), & + first_ice=newlyFormedIceLogical(:), & + fswpenln=shortwaveLayerPenetration(:,:,iCell), & + bphi=bioPorosity(:,:,iCell), & + bTiz=bioTemperature(:,:,iCell), & + ice_bio_net=totalVerticalBiologyIce(:,iCell), & + snow_bio_net=totalVerticalBiologySnow(:,iCell), & + totalChla=totalChlorophyll(iCell), & + fswthrun=penetratingShortwaveFlux(:,iCell), & + Rayleigh_criteria=rayleighCriteria, & + bgrid=biologyGrid, & + igrid=interfaceBiologyGrid, & + icgrid=interfaceGrid, & + cgrid=verticalGrid, & + nblyr=nBioLayers, & + nilyr=nIceLayers, & + nslyr=nSnowLayers, & + n_algae=nAlgae, & + n_zaero=nzAerosols, & + ncat=nCategories, & + n_doc=nDOC, & + n_dic=nDIC, & + n_don=nDON, & + n_fed=nDissolvedIron, & + n_fep=nParticulateIron, & + meltbn=basalIceMeltCategory(:,iCell), & + melttn=surfaceIceMeltCategory(:,iCell), & + congeln=congelationCategory(:,iCell), & + snoicen=snowiceFormationCategory(:,iCell), & + sst=seaSurfaceTemperature(iCell), & + sss=seaSurfaceSalinity(iCell), & + Tf=seaFreezingTemperature(iCell), & + fsnow=snowfallRate(iCell), & + meltsn=snowMeltCategory(:,iCell), & + !initialSalinityProfile(:,iCell), & !!!! + hin_old=iceThicknessCategoryInitial(:,iCell), & + flux_bio=oceanBioFluxes(:,iCell), & + flux_bio_atm=atmosBioFluxes(:,iCell), & + aicen_init=iceAreaCategoryInitial(:,iCell), & + vicen_init=iceVolumeCategoryInitial(:,iCell), & + aicen=iceAreaCategory(1,:,iCell), & + vicen=iceVolumeCategory(1,:,iCell), & + vsnon=snowVolumeCategory(1,:,iCell), & + aice0=openWaterArea(iCell), & + trcrn=tracerArrayCategory, & + vsnon_init=snowVolumeCategoryInitial(:,iCell), & + skl_bgc=config_use_skeletal_biochemistry, & + flux_bion=oceanBioFluxesCategory(:,:,iCell), & + bioPorosityIceCell=bgridPorosityIceCell(:,iCell), & + bioSalinityIceCell=bgridSalinityIceCell(:,iCell), & + bioTemperatureIceCell=bgridTemperatureIceCell(:,iCell)) + + abortFlag = icepack_warnings_aborted() + call seaice_icepack_write_warnings(abortFlag) call get_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) @@ -4076,9 +4059,6 @@ subroutine column_biogeochemistry(domain) enddo endif - ! code abort - if (abortFlag) exit - totalSkeletalAlgae(iCell) = 0.0_RKIND bioShortwaveFluxCell(:,iCell) = 0.0_RKIND @@ -4396,7 +4376,8 @@ subroutine seaice_icepack_aggregate(domain) ocean_coupling logical, pointer :: & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols real(kind=RKIND), dimension(:), pointer :: & iceAreaCell, & @@ -4431,6 +4412,7 @@ subroutine seaice_icepack_aggregate(domain) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) @@ -4448,7 +4430,7 @@ subroutine seaice_icepack_aggregate(domain) call MPAS_pool_get_array(ocean_coupling, "seaFreezingTemperature", seaFreezingTemperature) setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) do iCell = 1, nCellsSolve @@ -4597,7 +4579,8 @@ subroutine seaice_icepack_coupling_prep(domain) logical, pointer :: & config_use_ocean_mixed_layer, & config_include_pond_freshwater_feedback, & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols type(MPAS_pool_type), pointer :: & oceanCoupling, & @@ -4708,6 +4691,7 @@ subroutine seaice_icepack_coupling_prep(domain) call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) call MPAS_pool_get_config(domain % configs, "config_include_pond_freshwater_feedback", config_include_pond_freshwater_feedback) call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_diatoms", config_ratio_C_to_N_diatoms) call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_small_plankton", config_ratio_C_to_N_small_plankton) call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_phaeocystis", config_ratio_C_to_N_phaeocystis) @@ -4900,10 +4884,12 @@ subroutine seaice_icepack_coupling_prep(domain) !----------------------------------------------------------------- ! Define ocean biogeochemical flux variables !----------------------------------------------------------------- - if (config_use_column_biogeochemistry) then + + oceanBioFluxesAll(:) = 0.0_RKIND + + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then totalOceanCarbonFlux(iCell) = 0.0_RKIND - oceanBioFluxesAll(:) = 0.0_RKIND oceanAlgaeFlux(:,iCell) = 0.0_RKIND oceanDOCFlux(:,iCell) = 0.0_RKIND oceanDICFlux(:,iCell) = 0.0_RKIND @@ -5014,7 +5000,7 @@ subroutine seaice_icepack_coupling_prep(domain) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanHumicsFlux(iCell) - endif ! config_use_column_biogeochemistry + endif ! config_use_column_biogeochemistry .or. config_use_zaerosols enddo ! iCell @@ -5062,7 +5048,8 @@ subroutine seaice_column_scale_fluxes(domain) mesh logical, pointer :: & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols real(kind=RKIND), dimension(:), pointer :: & iceAreaCell, & @@ -5122,6 +5109,7 @@ subroutine seaice_column_scale_fluxes(domain) iBioTracers call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) block => domain % blocklist do while (associated(block)) @@ -5214,6 +5202,9 @@ subroutine seaice_column_scale_fluxes(domain) albedoVisibleDiffuseCell(iCell) = albedoVisibleDiffuseCell(iCell) * iceAreaInverse albedoIRDiffuseCell(iCell) = albedoIRDiffuseCell(iCell) * iceAreaInverse + if (config_use_zaerosols) & + oceanDustIronFlux(iCell) = oceanDustIronFlux(iCell) * iceAreaInverse + if (config_use_column_biogeochemistry) then oceanNitrateFlux(iCell) = oceanNitrateFlux(iCell) * iceAreaInverse @@ -5223,7 +5214,6 @@ subroutine seaice_column_scale_fluxes(domain) oceanDMSPdFlux(iCell) = oceanDMSPdFlux(iCell) * iceAreaInverse oceanDMSFlux(iCell) = oceanDMSFlux(iCell) * iceAreaInverse oceanHumicsFlux(iCell) = oceanHumicsFlux(iCell) * iceAreaInverse - oceanDustIronFlux(iCell) = oceanDustIronFlux(iCell) * iceAreaInverse do iBioTracers = 1, maxAlgaeType oceanAlgaeFlux(iBioTracers,iCell) = oceanAlgaeFlux(iBioTracers,iCell) * iceAreaInverse @@ -5266,6 +5256,9 @@ subroutine seaice_column_scale_fluxes(domain) albedoVisibleDiffuseCell(iCell) = 0.0_RKIND albedoIRDiffuseCell(iCell) = 0.0_RKIND + if (config_use_zaerosols) & + oceanDustIronFlux(iCell) = 0.0_RKIND + if (config_use_column_biogeochemistry) then oceanNitrateFlux(iCell) = 0.0_RKIND @@ -5275,7 +5268,6 @@ subroutine seaice_column_scale_fluxes(domain) oceanDMSPdFlux(iCell) = 0.0_RKIND oceanDMSFlux(iCell) = 0.0_RKIND oceanHumicsFlux(iCell) = 0.0_RKIND - oceanDustIronFlux(iCell) = 0.0_RKIND oceanAlgaeFlux(:,iCell) = 0.0_RKIND oceanDOCFlux(:,iCell) = 0.0_RKIND oceanDICFlux(:,iCell) = 0.0_RKIND @@ -5994,12 +5986,14 @@ subroutine init_column_tracer_object(domain, tracerObject) nZBGCTracers logical, pointer :: & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nCategories", nCategories) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nZBGCTracers", nZBGCTracers) call MPAS_pool_get_config(domain % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) ! get the number of CICE tracers in trcrn call init_column_tracer_object_tracer_number(domain, tracerObject) @@ -6023,7 +6017,7 @@ subroutine init_column_tracer_object(domain, tracerObject) call init_column_tracer_object_ancestor_indices(domain, tracerObject) ! biogeochemistry - if (config_use_column_biogeochemistry) then + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then allocate(tracerObject % index_LayerIndexToDataArray(nZBGCTracers)) allocate(tracerObject % index_LayerIndexToBioIndex(nZBGCTracers)) @@ -6231,7 +6225,7 @@ subroutine init_column_tracer_object_tracer_number(domain, tracerObject) ! biogeochemistry !----------------------------------------------------------------------- - if (config_use_column_biogeochemistry) then + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then ! save tracer number without bio tracers counted tracerObject % nTracersNotBio = tracerObject % nTracers @@ -6244,10 +6238,10 @@ subroutine init_column_tracer_object_tracer_number(domain, tracerObject) tracerObject % nTracers = tracerObject % nTracers + 1 ! vertical zSalinity - if (config_use_vertical_zsalinity) then - tracerObject % nTracers = tracerObject % nTracers + nBioLayers - tracerObject % nBioTracersLayer = tracerObject % nBioTracersLayer + 1 - endif + !if (config_use_vertical_zsalinity) then + ! tracerObject % nTracers = tracerObject % nTracers + nBioLayers + ! tracerObject % nBioTracersLayer = tracerObject % nBioTracersLayer + 1 + !endif nMobileTracers = 0 ! Skeletal Biogeochemistry @@ -9901,7 +9895,7 @@ subroutine check_column_package_configs(domain) config_use_vertical_biochemistry .or. config_use_shortwave_bioabsorption .or. config_use_vertical_tracers .or. & config_use_skeletal_biochemistry .or. config_use_nitrate .or. config_use_carbon .or. config_use_chlorophyll .or. & config_use_ammonium .or. config_use_silicate .or. config_use_DMS .or. config_use_nonreactive .or. config_use_humics .or. & - config_use_DON .or. config_use_iron .or. config_use_modal_aerosols .or. config_use_zaerosols)) then + config_use_DON .or. config_use_iron)) then call mpas_log_write(& "check_column_package_configs: config_use_column_biogeochemistry = false. "//& "All biogeochemistry namelist flags must also be false", & @@ -9909,12 +9903,12 @@ subroutine check_column_package_configs(domain) endif ! check vertical zSalinity requirements - if (config_use_vertical_zsalinity .and. ((.not. config_use_brine) .or. & - (.not. (trim(config_thermodynamics_type) == "BL99")))) then - call mpas_log_write(& - "check_column_package_configs: vertical zSalinity requires config_use_brine = true and 'BL99' ", & - messageType=MPAS_LOG_CRIT) - endif + !if (config_use_vertical_zsalinity .and. ((.not. config_use_brine) .or. & + ! (.not. (trim(config_thermodynamics_type) == "BL99")))) then + ! call mpas_log_write(& + ! "check_column_package_configs: vertical zSalinity requires config_use_brine = true and 'BL99' ", & + ! messageType=MPAS_LOG_CRIT) + !endif ! check that vertical bio tracers use brine height if ((config_use_vertical_biochemistry .or. config_use_zaerosols) .and. & @@ -10265,13 +10259,27 @@ subroutine init_icepack_package_tracer_sizes(domain, tracerObject) nIceLayers, & nSnowLayers, & nAerosols, & - nBioLayers + nBioLayers, & + nAlgae, & + nDOC, & + nDIC, & + nDON, & + nParticulateIron, & + nDissolvedIron, & + nzAerosols call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nCategories", nCategories) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nIceLayers", nIceLayers) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nSnowLayers", nSnowLayers) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nBioLayers", nBioLayers) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nAerosols", nAerosols) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nzAerosols", nzAerosols) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nAlgae", nAlgae) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDOC", nDOC) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDIC", nDIC) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDON", nDON) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nParticulateIron", nParticulateIron) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDissolvedIron", nDissolvedIron) call icepack_init_tracer_sizes(& ncat_in = nCategories, & @@ -10279,17 +10287,17 @@ subroutine init_icepack_package_tracer_sizes(domain, tracerObject) nslyr_in = nSnowLayers, & nblyr_in = nBioLayers, & !nfsd_in = , & - !n_algae_in = , & - !n_DOC_in = , & - n_aero_in = nAerosols, & !n_iso_in = , & - !n_DON_in = , & - !n_DIC_in = , & - !n_fed_in = , & - !n_fep_in = , & - !n_zaero_in = , & + !n_aero_in = nAerosols, & + n_algae_in = nAlgae, & + n_DOC_in = nDOC, & + n_DON_in = nDON, & + n_DIC_in = nDIC, & + n_fed_in = nDissolvedIron, & + n_fep_in = nParticulateIron, & + n_zaero_in = nzAerosols, & ntrcr_in = tracerObject % nTracers, & - !ntrcr_o_in = , & + ntrcr_o_in = tracerObject % nTracersNotBio, & nbtrcr_in = tracerObject % nBioTracers, & nbtrcr_sw_in = tracerObject % nBioTracersShortwave) @@ -10500,15 +10508,15 @@ subroutine init_column_package_tracer_indices(tracerObject) !nt_zbgc_S = tracerObject % index_verticalSalinity !nlt_chl_sw = tracerObject % index_chlorophyllShortwave !nlt_zaero_sw = tracerObject % index_verticalAerosolsConcShortwave - !max_algae = tracerObject % nAlgaeIndex - !max_algae = tracerObject % nAlgalCarbonIndex - !max_algae = tracerObject % nAlgalChlorophyllIndex - !max_doc = tracerObject % nDOCIndex - !max_don = tracerObject % nDONIndex - !max_dic = tracerObject % nDICIndex - !max_fe = tracerObject % nDissolvedIronIndex - !max_fe = tracerObject % nParticulateIronIndex - !max_aero = tracerObject % nzAerosolsIndex + !n_algae = tracerObject % nAlgaeIndex + !n_algae = tracerObject % nAlgalCarbonIndex + !n_algae = tracerObject % nAlgalChlorophyllIndex + !n_doc = tracerObject % nDOCIndex + !n_don = tracerObject % nDONIndex + !n_dic = tracerObject % nDICIndex + !n_fed = tracerObject % nDissolvedIronIndex + !n_fep = tracerObject % nParticulateIronIndex + !n_zaero = tracerObject % nzAerosolsIndex !bio_index_o = tracerObject % index_LayerIndexToDataArray !bio_index = tracerObject % index_LayerIndexToBioIndex !nbtrcr = tracerObject % nBioTracers @@ -12353,6 +12361,8 @@ subroutine init_icepack_package_configs(domain) config_use_skeletal_biochemistry, & config_use_vertical_zsalinity, & config_use_modal_aerosols, & + config_use_macromolecules, & + config_do_restart_bgc, & config_use_snow_liquid_ponds, & config_use_snow_grain_radius @@ -12607,6 +12617,8 @@ subroutine init_icepack_package_configs(domain) call MPAS_pool_get_config(domain % configs, "config_use_vertical_biochemistry", config_use_vertical_biochemistry) call MPAS_pool_get_config(domain % configs, "config_use_shortwave_bioabsorption", config_use_shortwave_bioabsorption) call MPAS_pool_get_config(domain % configs, "config_use_modal_aerosols", config_use_modal_aerosols) + call MPAS_pool_get_config(domain % configs, "config_use_macromolecules", config_use_macromolecules) + call MPAS_pool_get_config(domain % configs, "config_do_restart_bgc", config_do_restart_bgc) call MPAS_pool_get_config(domain % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) call MPAS_pool_get_config(domain % configs, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) call MPAS_pool_get_config(domain % configs, "config_biogrid_bottom_molecular_sublayer", & @@ -13040,37 +13052,137 @@ subroutine init_icepack_package_configs(domain) z_tracers_in = config_use_vertical_tracers, & scale_bgc_in = config_scale_initial_vertical_bgc, & solve_zbgc_in = config_use_vertical_biochemistry, & + dEdd_algae_in = config_use_shortwave_bioabsorption, & modal_aero_in = config_use_modal_aerosols, & + use_macromolecules_in = config_use_macromolecules, & + restartbgc_in = config_do_restart_bgc, & skl_bgc_in = config_use_skeletal_biochemistry, & solve_zsal_in = config_use_vertical_zsalinity, & grid_o_in = config_biogrid_bottom_molecular_sublayer, & l_sk_in = config_bio_gravity_drainage_length_scale, & - initbio_frac_in = config_new_ice_fraction_biotracer, & + grid_o_t_in = config_biogrid_top_molecular_sublayer, & + !initbio_frac_in = config_new_ice_fraction_biotracer, & + !frazil_scav_in = config_fraction_biotracer_in_frazil, & grid_oS_in = config_zsalinity_molecular_sublayer, & l_skS_in = config_zsalinity_gravity_drainage_scale, & - dEdd_algae_in = config_use_shortwave_bioabsorption, & phi_snow_in = config_snow_porosity_at_ice_surface, & - !T_max_in = , & ! BGC - !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 = , & - !fr_dFe_in = , & - !k_nitrif_in = , & - !t_iron_conv_in = , & - !max_loss_in = , & - !max_dfe_doc1_in = , & - !fr_resp_s_in = , & + !ratio_Si2N_diatoms_in = config_ratio_Si_to_N_diatoms, & + !ratio_Si2N_sp_in = config_ratio_Si_to_N_small_plankton, & + !ratio_Si2N_phaeo_in = config_ratio_Si_to_N_phaeocystis, & + !ratio_S2N_diatoms_in = config_ratio_S_to_N_diatoms, & + !ratio_S2N_sp_in = config_ratio_S_to_N_small_plankton, & + !ratio_S2N_phaeo_in = config_ratio_S_to_N_phaeocystis, & + !ratio_Fe2C_diatoms_in = config_ratio_Fe_to_C_diatoms, & + !ratio_Fe2C_sp_in = config_ratio_Fe_to_C_small_plankton, & + !ratio_Fe2C_phaeo_in = config_ratio_Fe_to_C_phaeocystis, & + !ratio_Fe2N_diatoms_in = config_ratio_Fe_to_N_diatoms, & + !ratio_Fe2N_sp_in = config_ratio_Fe_to_N_small_plankton, & + !ratio_Fe2N_phaeo_in = config_ratio_Fe_to_N_phaeocystis, & + !ratio_Fe2DON_in = config_ratio_Fe_to_DON, & + !ratio_Fe2DOC_s_in = config_ratio_Fe_to_DOC_saccharids, & + !ratio_Fe2DOC_l_in = config_ratio_Fe_to_DOC_lipids, & + fr_resp_in = config_respiration_fraction_of_growth, & + tau_min_in = config_rapid_mobile_to_stationary_time, & + tau_max_in = config_long_mobile_to_stationary_time, & + algal_vel_in = config_algal_maximum_velocity, & + R_dFe2dust_in = config_ratio_Fe_to_dust, & + dustFe_sol_in = config_solubility_of_Fe_in_dust, & + !chlabs_diatoms_in = config_chla_absorptivity_of_diatoms, & + !chlabs_sp_in = config_chla_absorptivity_of_small_plankton, & + !chlabs_phaeo_in = config_chla_absorptivity_of_phaeocystis, & + !alpha2max_low_diatoms_in = config_light_attenuation_diatoms, & + !alpha2max_low_sp_in = config_light_attenuation_small_plankton, & + !alpha2max_low_phaeo_in = config_light_attenuation_phaeocystis, & + !beta2max_diatoms_in = config_light_inhibition_diatoms, & + !beta2max_sp_in = config_light_inhibition_small_plankton, & + !beta2max_phaeo_in = config_light_inhibition_phaeocystis, & + !mu_max_diatoms_in = config_maximum_growth_rate_diatoms, & + !mu_max_sp_in = config_maximum_growth_rate_small_plankton, & + !mu_max_phaeo_in = config_maximum_growth_rate_phaeocystis, & + !grow_Tdep_diatoms_in = config_temperature_growth_diatoms, & + !grow_Tdep_sp_in = config_temperature_growth_small_plankton, & + !grow_Tdep_phaeo_in = config_temperature_growth_phaeocystis, & + !fr_graze_diatoms_in = config_grazed_fraction_diatoms, & + !fr_graze_sp_in = config_grazed_fraction_small_plankton, & + !fr_graze_phaeo_in = config_grazed_fraction_phaeocystis, & + !mort_pre_diatoms_in = config_mortality_diatoms, & + !mort_pre_sp_in = config_mortality_small_plankton, & + !mort_pre_phaeo_in = config_mortality_phaeocystis, & + !mort_Tdep_diatoms_in = config_temperature_mortality_diatoms, & + !mort_Tdep_sp_in = config_temperature_mortality_small_plankton, & + !mort_Tdep_phaeo_in = config_temperature_mortality_phaeocystis, & + !k_exude_diatoms_in = config_exudation_diatoms, & + !k_exude_sp_in = config_exudation_small_plankton, & + !k_exude_phaeo_in = config_exudation_phaeocystis, & + !K_Nit_diatoms_in = config_nitrate_saturation_diatoms, & + !K_Nit_sp_in = config_nitrate_saturation_small_plankton, & + !K_Nit_phaeo_in = config_nitrate_saturation_phaeocystis, & + !K_Am_diatoms_in = config_ammonium_saturation_diatoms, & + !K_Am_sp_in = config_ammonium_saturation_small_plankton, & + !K_Am_phaeo_in = config_ammonium_saturation_phaeocystis, & + !K_Sil_diatoms_in = config_silicate_saturation_diatoms, & + !K_Sil_sp_in = config_silicate_saturation_small_plankton, & + !K_Sil_phaeo_in = config_silicate_saturation_phaeocystis, & + !K_Fe_diatoms_in = config_iron_saturation_diatoms, & + !K_Fe_sp_in = config_iron_saturation_small_plankton, & + !K_Fe_phaeo_in = config_iron_saturation_phaeocystis, & + !f_don_protein_in = config_fraction_spilled_to_DON, & + !kn_bac_protein_in = config_degredation_of_DON, & + !f_don_Am_protein_in = config_fraction_DON_ammonium, & + !f_doc_s_in = config_fraction_loss_to_saccharids, & + !f_doc_l_in = config_fraction_loss_to_lipids, & + !f_exude_s_in = config_fraction_exudation_to_saccharids, & + !f_exude_l_in = config_fraction_exudation_to_lipids, & + !k_bac_s_in = config_remineralization_saccharids, & + !k_bac_l_in = config_remineralization_lipids, & + T_max_in = config_maximum_brine_temperature, & + fsal_in = config_salinity_dependence_of_growth, & + op_dep_min_in = config_minimum_optical_depth, & + fr_graze_s_in = config_slopped_grazing_fraction, & + fr_graze_e_in = config_excreted_fraction, & + fr_mort2min_in = config_fraction_mortality_to_ammonium, & + fr_dFe_in = config_fraction_iron_remineralized, & + k_nitrif_in = config_nitrification_rate, & + t_iron_conv_in = config_desorption_loss_particulate_iron, & + max_loss_in = config_maximum_loss_fraction, & + max_dfe_doc1_in = config_maximum_ratio_iron_to_saccharids, & + fr_resp_s_in = config_respiration_loss_to_DMSPd, & + y_sk_DMS_in = config_DMSP_to_DMS_conversion_fraction, & + t_sk_conv_in = config_DMSP_to_DMS_conversion_time, & + t_sk_ox_in = config_DMS_oxidation_time, & + algaltype_diatoms_in = config_mobility_type_diatoms, & + algaltype_sp_in = config_mobility_type_small_plankton, & + algaltype_phaeo_in = config_mobility_type_phaeocystis, & + nitratetype_in = config_mobility_type_nitrate, & + ammoniumtype_in = config_mobility_type_ammonium, & + silicatetype_in = config_mobility_type_silicate, & + dmspptype_in = config_mobility_type_DMSPp, & + dmspdtype_in = config_mobility_type_DMSPd, & + humtype_in = config_mobility_type_humics, & + doctype_s_in = config_mobility_type_saccharids, & + doctype_l_in = config_mobility_type_lipids, & + dictype_1_in = config_mobility_type_inorganic_carbon, & + dontype_protein_in = config_mobility_type_proteins, & + fedtype_1_in = config_mobility_type_dissolved_iron, & + feptype_1_in = config_mobility_type_particulate_iron, & + zaerotype_bc1_in = config_mobility_type_black_carbon1, & + zaerotype_bc2_in = config_mobility_type_black_carbon2, & + zaerotype_dust1_in = config_mobility_type_dust1, & + zaerotype_dust2_in = config_mobility_type_dust2, & + zaerotype_dust3_in = config_mobility_type_dust3, & + zaerotype_dust4_in = config_mobility_type_dust4, & + ratio_C2N_diatoms_in = config_ratio_C_to_N_diatoms, & + ratio_C2N_sp_in = config_ratio_C_to_N_small_plankton, & + ratio_C2N_phaeo_in = config_ratio_C_to_N_phaeocystis, & + ratio_chl2N_diatoms_in = config_ratio_chla_to_N_diatoms, & + ratio_chl2N_sp_in = config_ratio_chla_to_N_small_plankton, & + ratio_chl2N_phaeo_in = config_ratio_chla_to_N_phaeocystis, & + F_abs_chl_diatoms_in = config_scales_absorption_diatoms, & + F_abs_chl_sp_in = config_scales_absorption_small_plankton, & + F_abs_chl_phaeo_in = config_scales_absorption_phaeocystis, & + ratio_C2N_proteins_in = config_ratio_C_to_N_proteins, & !conserv_check_in = , & - !y_sk_DMS_in = , & - !t_sk_conv_in = , & - !t_sk_ox_in = , & - !frazil_scav_in = , & + ! !sw_redist_in = , & ! not yet implemented in MPAS-SI (stealth feature) !sw_frac_in = , & ! not yet implemented in MPAS-SI (stealth feature) !sw_dtemp_in = , & ! not yet implemented in MPAS-SI (stealth feature) @@ -13153,124 +13265,6 @@ subroutine init_icepack_package_configs(domain) !call icepack_init_parameters(& ! shortwave = config_shortwave_type, & ! not working correctly above ! oceanmixed_ice = config_use_ocean_mixed_layer, & ! not used in Icepack/columnphysics (driver only) - ! grid_o_t = config_biogrid_top_molecular_sublayer, & ! not used in Icepack - ! frazil_scav = config_fraction_biotracer_in_frazil, & ! BGC - ! ratio_Si2N_diatoms = config_ratio_Si_to_N_diatoms, & - ! ratio_Si2N_sp = config_ratio_Si_to_N_small_plankton, & - ! ratio_Si2N_phaeo = config_ratio_Si_to_N_phaeocystis, & - ! ratio_S2N_diatoms = config_ratio_S_to_N_diatoms, & - ! ratio_S2N_sp = config_ratio_S_to_N_small_plankton, & - ! ratio_S2N_phaeo = config_ratio_S_to_N_phaeocystis, & - ! ratio_Fe2C_diatoms = config_ratio_Fe_to_C_diatoms, & - ! ratio_Fe2C_sp = config_ratio_Fe_to_C_small_plankton, & - ! ratio_Fe2C_phaeo = config_ratio_Fe_to_C_phaeocystis, & - ! ratio_Fe2N_diatoms = config_ratio_Fe_to_N_diatoms, & - ! ratio_Fe2N_sp = config_ratio_Fe_to_N_small_plankton, & - ! ratio_Fe2N_phaeo = config_ratio_Fe_to_N_phaeocystis, & - ! ratio_Fe2DON = config_ratio_Fe_to_DON, & - ! ratio_Fe2DOC_s = config_ratio_Fe_to_DOC_saccharids, & - ! ratio_Fe2DOC_l = config_ratio_Fe_to_DOC_lipids, & - ! fr_resp = config_respiration_fraction_of_growth, & - ! tau_min = config_rapid_mobile_to_stationary_time, & - ! tau_max = config_long_mobile_to_stationary_time, & - ! algal_vel = config_algal_maximum_velocity, & - ! R_dFe2dust = config_ratio_Fe_to_dust, & - ! dustFe_sol = config_solubility_of_Fe_in_dust, & - ! chlabs_diatoms = config_chla_absorptivity_of_diatoms, & - ! chlabs_sp = config_chla_absorptivity_of_small_plankton, & - ! chlabs_phaeo = config_chla_absorptivity_of_phaeocystis, & - ! alpha2max_low_diatoms = config_light_attenuation_diatoms, & - ! alpha2max_low_sp = config_light_attenuation_small_plankton, & - ! alpha2max_low_phaeo = config_light_attenuation_phaeocystis, & - ! beta2max_diatoms = config_light_inhibition_diatoms, & - ! beta2max_sp = config_light_inhibition_small_plankton, & - ! beta2max_phaeo = config_light_inhibition_phaeocystis, & - ! mu_max_diatoms = config_maximum_growth_rate_diatoms, & - ! mu_max_sp = config_maximum_growth_rate_small_plankton, & - ! mu_max_phaeo = config_maximum_growth_rate_phaeocystis, & - ! mu_max_diatoms = config_temperature_growth_diatoms, & ! rename - ! mu_max_sp = config_temperature_growth_small_plankton, & - ! mu_max_phaeo = config_temperature_growth_phaeocystis, & - ! fr_graze_diatoms = config_grazed_fraction_diatoms, & - ! fr_graze_sp = config_grazed_fraction_small_plankton, & - ! fr_graze_phaeo = config_grazed_fraction_phaeocystis, & - ! mort_pre_diatoms = config_mortality_diatoms, & - ! mort_pre_sp = config_mortality_small_plankton, & - ! mort_pre_phaeo = config_mortality_phaeocystis, & - ! mort_Tdep_diatoms = config_temperature_mortality_diatoms, & - ! mort_Tdep_sp = config_temperature_mortality_small_plankton, & - ! mort_Tdep_phaeo = config_temperature_mortality_phaeocystis, & - ! k_exude_diatoms = config_exudation_diatoms, & - ! k_exude_sp = config_exudation_small_plankton, & - ! k_exude_phaeo = config_exudation_phaeocystis, & - ! K_Nit_diatoms = config_nitrate_saturation_diatoms, & - ! K_Nit_sp = config_nitrate_saturation_small_plankton, & - ! K_Nit_phaeo = config_nitrate_saturation_phaeocystis, & - ! K_Am_diatoms = config_ammonium_saturation_diatoms, & - ! K_Am_sp = config_ammonium_saturation_small_plankton, & - ! K_Am_phaeo = config_ammonium_saturation_phaeocystis, & - ! K_Sil_diatoms = config_silicate_saturation_diatoms, & - ! K_Sil_sp = config_silicate_saturation_small_plankton, & - ! K_Sil_phaeo = config_silicate_saturation_phaeocystis, & - ! K_Fe_diatoms = config_iron_saturation_diatoms, & - ! K_Fe_sp = config_iron_saturation_small_plankton, & - ! K_Fe_phaeo = config_iron_saturation_phaeocystis, & - ! f_don_protein = config_fraction_spilled_to_DON, & - ! kn_bac_protein = config_degredation_of_DON, & - ! f_don_Am_protein = config_fraction_DON_ammonium, & - ! f_doc_s = config_fraction_loss_to_saccharids, & - ! f_doc_l = config_fraction_loss_to_lipids, & - ! f_exude_s = config_fraction_exudation_to_saccharids, & - ! f_exude_l = config_fraction_exudation_to_lipids, & - ! k_bac_s = config_remineralization_saccharids, & - ! k_bac_l = config_remineralization_lipids, & - ! T_max = config_maximum_brine_temperature, & - ! fsal = config_salinity_dependence_of_growth, & - ! op_dep_min = config_minimum_optical_depth, & - ! fr_graze_s = config_slopped_grazing_fraction, & - ! fr_graze_e = config_excreted_fraction, & - ! fr_mort2min = config_fraction_mortality_to_ammonium, & - ! fr_dFe = config_fraction_iron_remineralized, & - ! k_nitrif = config_nitrification_rate, & - ! t_iron_conv = config_desorption_loss_particulate_iron, & - ! max_loss = config_maximum_loss_fraction, & - ! max_dfe_doc1 = config_maximum_ratio_iron_to_saccharids, & - ! fr_resp_s = config_respiration_loss_to_DMSPd, & - ! y_sk_DMS = config_DMSP_to_DMS_conversion_fraction, & - ! t_sk_conv = config_DMSP_to_DMS_conversion_time, & - ! t_sk_ox = config_DMS_oxidation_time, & - ! algaltype_diatoms = config_mobility_type_diatoms, & - ! algaltype_sp = config_mobility_type_small_plankton, & - ! algaltype_phaeo = config_mobility_type_phaeocystis, & - ! nitratetype = config_mobility_type_nitrate, & - ! ammoniumtype = config_mobility_type_ammonium, & - ! silicatetype = config_mobility_type_silicate, & - ! dmspptype = config_mobility_type_DMSPp, & - ! dmspdtype = config_mobility_type_DMSPd, & - ! humicstype = config_mobility_type_humics, & - ! doctype_s = config_mobility_type_saccharids, & - ! dictype_1 = config_mobility_type_lipids, & - ! dictype_1 = config_mobility_type_inorganic_carbon, & - ! dontype_protein = config_mobility_type_proteins, & - ! fedtype_1 = config_mobility_type_dissolved_iron, & - ! feptype_1 = config_mobility_type_particulate_iron, & - ! zaerotype_bc1 = config_mobility_type_black_carbon1, & - ! zaerotype_bc2 = config_mobility_type_black_carbon2, & - ! zaerotype_dust1 = config_mobility_type_dust1, & - ! zaerotype_dust2 = config_mobility_type_dust2, & - ! zaerotype_dust3 = config_mobility_type_dust3, & - ! zaerotype_dust4 = config_mobility_type_dust4, & - ! ratio_C2N_diatoms = config_ratio_C_to_N_diatoms, & - ! ratio_C2N_sp = config_ratio_C_to_N_small_plankton, & - ! ratio_C2N_phaeo = config_ratio_C_to_N_phaeocystis, & - ! ratio_chl2N_diatoms = config_ratio_chla_to_N_diatoms, & - ! ratio_chl2N_sp = config_ratio_chla_to_N_small_plankton, & - ! ratio_chl2N_phaeo = config_ratio_chla_to_N_phaeocystis, & - ! F_abs_chl_diatoms = config_scales_absorption_diatoms, & - ! F_abs_chl_sp = config_scales_absorption_small_plankton, & - ! F_abs_chl_phaeo = config_scales_absorption_phaeocystis, & - ! ratio_C2N_proteins = config_ratio_C_to_N_proteins, & - !----------------------------------------------------------------------- ! Parameters for thermodynamics !----------------------------------------------------------------------- @@ -15210,7 +15204,8 @@ end subroutine seaice_column_reinitialize_oceanic_fluxes subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) - use ice_colpkg, only: colpkg_init_zbgc + !use ice_colpkg, only: colpkg_init_zbgc + use icepack_intfc, only: icepack_init_zbgc type(domain_type), intent(in) :: & domain @@ -15550,188 +15545,186 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) allocate(tracerObject % index_dissolvedIronConcLayer(maxIronType)) tracerObject % nDissolvedIronIndex = nDissolvedIron - call colpkg_init_zbgc(& - nBioLayers, & - nIceLayers, & - nSnowLayers, & - nAlgae, & - nzAerosols, & - nDOC, & - nDIC, & - nDON, & - nDissolvedIron, & - nParticulateIron, & - tracerObject % firstAncestorMask, & - tracerObject % parentIndex, & - tracerObject % ancestorNumber, & - tracerObject % ancestorIndices, & - tracerObject % nBioTracersShortwave, & - config_use_brine, & - tracerObject % index_brineFraction,& - tracerObject % nTracers, & - tracerObject % nBioTracers, & - tracerObject % index_nitrateConc, & - tracerObject % index_ammoniumConc, & - tracerObject % index_silicateConc, & - tracerObject % index_DMSConc, & - tracerObject % index_nonreactiveConc, & - tracerObject % index_verticalSalinity, & - tracerObject % index_algaeConc, & - tracerObject % index_algalCarbon, & - tracerObject % index_algalChlorophyll, & - tracerObject % index_DOCConc, & - tracerObject % index_DONConc, & - tracerObject % index_DICConc, & - tracerObject % index_verticalAerosolsConc, & - tracerObject % index_DMSPpConc, & - tracerObject % index_DMSPdConc, & - tracerObject % index_dissolvedIronConc, & - tracerObject % index_particulateIronConc, & - tracerObject % index_mobileFraction, & - config_use_nitrate, & - config_use_ammonium, & - config_use_silicate, & - config_use_DMS, & - config_use_nonreactive, & - config_use_vertical_zsalinity, & - use_nitrogen, & - config_use_carbon, & - config_use_chlorophyll, & - config_use_DON, & - config_use_iron,& - config_use_zaerosols, & - tracerObject % index_verticalAerosolsConcShortwave, & - tracerObject % index_chlorophyllShortwave, & - tracerObject % index_algaeConcLayer, & - tracerObject % index_nitrateConcLayer, & - tracerObject % index_ammoniumConcLayer, & - tracerObject % index_silicateConcLayer, & - tracerObject % index_DMSConcLayer, & - tracerObject % index_DMSPpConcLayer, & - tracerObject % index_DMSPdConcLayer, & - tracerObject % index_algalCarbonLayer, & - tracerObject % index_algalChlorophyllLayer, & - tracerObject % index_DICConcLayer, & - tracerObject % index_DOCConcLayer, & - tracerObject % index_nonreactiveConcLayer, & - tracerObject % index_DONConcLayer, & - tracerObject % index_dissolvedIronConcLayer, & - tracerObject % index_particulateIronConcLayer, & - tracerObject % index_verticalAerosolsConcLayer, & - tracerObject % index_humicsConc, & - tracerObject % index_humicsConcLayer, & - config_use_humics, & - config_use_vertical_zsalinity, & - config_use_skeletal_biochemistry, & - config_use_vertical_tracers, & - config_use_shortwave_bioabsorption, & - config_use_vertical_biochemistry, & - config_fraction_biotracer_in_frazil, & - config_new_ice_fraction_biotracer, & - tracerObject % index_LayerIndexToDataArray, & - tracerObject % index_LayerIndexToBioIndex, & - tracerObject % nTracersNotBio, & - maxAlgaeType, & - maxDOCType, & - maxDICType, & - maxDONType, & - maxIronType, & - config_ratio_Si_to_N_diatoms, & - config_ratio_Si_to_N_small_plankton, & - config_ratio_Si_to_N_phaeocystis, & - config_ratio_S_to_N_diatoms, & - config_ratio_S_to_N_small_plankton, & - config_ratio_S_to_N_phaeocystis, & - config_ratio_Fe_to_C_diatoms, & - config_ratio_Fe_to_C_small_plankton, & - config_ratio_Fe_to_C_phaeocystis, & - config_ratio_Fe_to_N_diatoms, & - config_ratio_Fe_to_N_small_plankton, & - config_ratio_Fe_to_N_phaeocystis, & - config_ratio_Fe_to_DON, & - config_ratio_Fe_to_DOC_saccharids, & - config_ratio_Fe_to_DOC_lipids, & - config_chla_absorptivity_of_diatoms, & - config_chla_absorptivity_of_small_plankton, & - config_chla_absorptivity_of_phaeocystis, & - config_light_attenuation_diatoms, & - config_light_attenuation_small_plankton, & - config_light_attenuation_phaeocystis, & - config_light_inhibition_diatoms, & - config_light_inhibition_small_plankton, & - config_light_inhibition_phaeocystis, & - config_maximum_growth_rate_diatoms, & - config_maximum_growth_rate_small_plankton, & - config_maximum_growth_rate_phaeocystis, & - config_temperature_growth_diatoms, & - config_temperature_growth_small_plankton, & - config_temperature_growth_phaeocystis, & - config_grazed_fraction_diatoms, & - config_grazed_fraction_small_plankton, & - config_grazed_fraction_phaeocystis, & - config_mortality_diatoms, & - config_mortality_small_plankton, & - config_mortality_phaeocystis, & - config_temperature_mortality_diatoms, & - config_temperature_mortality_small_plankton, & - config_temperature_mortality_phaeocystis, & - config_exudation_diatoms, & - config_exudation_small_plankton, & - config_exudation_phaeocystis, & - config_nitrate_saturation_diatoms, & - config_nitrate_saturation_small_plankton, & - config_nitrate_saturation_phaeocystis, & - config_ammonium_saturation_diatoms, & - config_ammonium_saturation_small_plankton, & - config_ammonium_saturation_phaeocystis, & - config_silicate_saturation_diatoms, & - config_silicate_saturation_small_plankton, & - config_silicate_saturation_phaeocystis, & - config_iron_saturation_diatoms, & - config_iron_saturation_small_plankton, & - config_iron_saturation_phaeocystis, & - config_fraction_spilled_to_DON, & - config_degredation_of_DON, & - config_fraction_DON_ammonium, & - config_fraction_loss_to_saccharids, & - config_fraction_loss_to_lipids, & - config_fraction_exudation_to_saccharids, & - config_fraction_exudation_to_lipids, & - config_remineralization_saccharids, & - config_remineralization_lipids, & - config_mobility_type_diatoms, & - config_mobility_type_small_plankton, & - config_mobility_type_phaeocystis, & - config_mobility_type_saccharids, & - config_mobility_type_lipids, & - config_mobility_type_inorganic_carbon, & - config_mobility_type_proteins, & - config_mobility_type_dissolved_iron, & - config_mobility_type_particulate_iron, & - config_mobility_type_black_carbon1, & - config_mobility_type_black_carbon2, & - config_mobility_type_dust1, & - config_mobility_type_dust2, & - config_mobility_type_dust3, & - config_mobility_type_dust4, & - config_ratio_C_to_N_diatoms, & - config_ratio_C_to_N_small_plankton, & - config_ratio_C_to_N_phaeocystis, & - config_ratio_chla_to_N_diatoms, & - config_ratio_chla_to_N_small_plankton, & - config_ratio_chla_to_N_phaeocystis, & - config_scales_absorption_diatoms, & - config_scales_absorption_small_plankton, & - config_scales_absorption_phaeocystis, & - config_ratio_C_to_N_proteins, & - config_mobility_type_nitrate, & - config_mobility_type_ammonium, & - config_mobility_type_DMSPp, & - config_mobility_type_DMSPd, & - config_mobility_type_silicate, & - config_mobility_type_humics, & - config_rapid_mobile_to_stationary_time, & - config_long_mobile_to_stationary_time) + call icepack_init_zbgc(& + nblyr=nBioLayers, & + nilyr=nIceLayers, & + nslyr=nSnowLayers, & + n_algae=nAlgae, & + n_zaero=nzAerosols, & + n_doc=nDOC, & + n_dic=nDIC, & + n_don=nDON, & + n_fed=nDissolvedIron, & + n_fep=nParticulateIron, & + trcr_base=tracerObject % firstAncestorMask, & + trcr_depend=tracerObject % parentIndex, & + n_trcr_strata=tracerObject % ancestorNumber, & + nt_strata=tracerObject % ancestorIndices, & + nbtrcr_sw=tracerObject % nBioTracersShortwave, & + tr_brine=config_use_brine, & + nt_fbri=tracerObject % index_brineFraction,& + ntrcr=tracerObject % nTracers, & + nbtrcr=tracerObject % nBioTracers, & + nt_bgc_Nit=tracerObject % index_nitrateConc, & + nt_bgc_Am=tracerObject % index_ammoniumConc, & + nt_bgc_Sil=tracerObject % index_silicateConc, & + nt_bgc_DMS=tracerObject % index_DMSConc, & + nt_bgc_PON=tracerObject % index_nonreactiveConc, & + nt_bgc_S=tracerObject % index_verticalSalinity, & + nt_bgc_N=tracerObject % index_algaeConc, & + nt_bgc_C=tracerObject % index_algalCarbon, & + nt_bgc_chl=tracerObject % index_algalChlorophyll, & + nt_bgc_DOC=tracerObject % index_DOCConc, & + nt_bgc_DON=tracerObject % index_DONConc, & + nt_bgc_DIC=tracerObject % index_DICConc, & + nt_zaero=tracerObject % index_verticalAerosolsConc, & + nt_bgc_DMSPp=tracerObject % index_DMSPpConc, & + nt_bgc_DMSPd=tracerObject % index_DMSPdConc, & + nt_bgc_Fed=tracerObject % index_dissolvedIronConc, & + nt_bgc_Fep=tracerObject % index_particulateIronConc, & + nt_zbgc_frac=tracerObject % index_mobileFraction, & + tr_bgc_Nit=config_use_nitrate, & + tr_bgc_Am=config_use_ammonium, & + tr_bgc_Sil=config_use_silicate, & + tr_bgc_DMS=config_use_DMS, & + tr_bgc_PON=config_use_nonreactive, & + tr_bgc_N=use_nitrogen, & + tr_bgc_C=config_use_carbon, & + tr_bgc_chl=config_use_chlorophyll, & + tr_bgc_DON=config_use_DON, & + tr_bgc_Fe=config_use_iron,& + tr_zaero=config_use_zaerosols, & + nlt_zaero_sw=tracerObject % index_verticalAerosolsConcShortwave, & + nlt_chl_sw=tracerObject % index_chlorophyllShortwave, & + nlt_bgc_N=tracerObject % index_algaeConcLayer, & + nlt_bgc_Nit=tracerObject % index_nitrateConcLayer, & + nlt_bgc_Am=tracerObject % index_ammoniumConcLayer, & + nlt_bgc_Sil=tracerObject % index_silicateConcLayer, & + nlt_bgc_DMS=tracerObject % index_DMSConcLayer, & + nlt_bgc_DMSPp=tracerObject % index_DMSPpConcLayer, & + nlt_bgc_DMSPd=tracerObject % index_DMSPdConcLayer, & + nlt_bgc_C=tracerObject % index_algalCarbonLayer, & + nlt_bgc_chl=tracerObject % index_algalChlorophyllLayer, & + nlt_bgc_DIC=tracerObject % index_DICConcLayer, & + nlt_bgc_DOC=tracerObject % index_DOCConcLayer, & + nlt_bgc_PON=tracerObject % index_nonreactiveConcLayer, & + nlt_bgc_DON=tracerObject % index_DONConcLayer, & + nlt_bgc_Fed=tracerObject % index_dissolvedIronConcLayer, & + nlt_bgc_Fep=tracerObject % index_particulateIronConcLayer, & + nlt_zaero=tracerObject % index_verticalAerosolsConcLayer, & + nt_bgc_hum=tracerObject % index_humicsConc, & + nlt_bgc_hum=tracerObject % index_humicsConcLayer, & + tr_bgc_hum=config_use_humics, & + skl_bgc=config_use_skeletal_biochemistry, & + z_tracers=config_use_vertical_tracers, & + dEdd_algae=config_use_shortwave_bioabsorption, & + solve_zbgc=config_use_vertical_biochemistry, & + frazil_scav_in=config_fraction_biotracer_in_frazil, & + initbio_frac_in=config_new_ice_fraction_biotracer, & + bio_index_o_out=tracerObject % index_LayerIndexToDataArray, & + bio_index_out=tracerObject % index_LayerIndexToBioIndex, & + ntrcr_o=tracerObject % nTracersNotBio, & + max_algae_in=maxAlgaeType, & + max_doc_in=maxDOCType, & + max_dic_in=maxDICType, & + max_don_in=maxDONType, & + max_fe_in=maxIronType, & + ratio_Si2N_diatoms_in=config_ratio_Si_to_N_diatoms, & + ratio_Si2N_sp_in=config_ratio_Si_to_N_small_plankton, & + ratio_Si2N_phaeo_in=config_ratio_Si_to_N_phaeocystis, & + ratio_S2N_diatoms_in=config_ratio_S_to_N_diatoms, & + ratio_S2N_sp_in=config_ratio_S_to_N_small_plankton, & + ratio_S2N_phaeo_in=config_ratio_S_to_N_phaeocystis, & + ratio_Fe2C_diatoms_in=config_ratio_Fe_to_C_diatoms, & + ratio_Fe2C_sp_in=config_ratio_Fe_to_C_small_plankton, & + ratio_Fe2C_phaeo_in=config_ratio_Fe_to_C_phaeocystis, & + ratio_Fe2N_diatoms_in=config_ratio_Fe_to_N_diatoms, & + ratio_Fe2N_sp_in=config_ratio_Fe_to_N_small_plankton, & + ratio_Fe2N_phaeo_in=config_ratio_Fe_to_N_phaeocystis, & + ratio_Fe2DON_in=config_ratio_Fe_to_DON, & + ratio_Fe2DOC_s_in=config_ratio_Fe_to_DOC_saccharids, & + ratio_Fe2DOC_l_in=config_ratio_Fe_to_DOC_lipids, & + chlabs_diatoms_in=config_chla_absorptivity_of_diatoms, & + chlabs_sp_in=config_chla_absorptivity_of_small_plankton, & + chlabs_phaeo_in=config_chla_absorptivity_of_phaeocystis, & + alpha2max_low_diatoms_in=config_light_attenuation_diatoms, & + alpha2max_low_sp_in=config_light_attenuation_small_plankton, & + alpha2max_low_phaeo_in=config_light_attenuation_phaeocystis, & + beta2max_diatoms_in=config_light_inhibition_diatoms, & + beta2max_sp_in=config_light_inhibition_small_plankton, & + beta2max_phaeo_in=config_light_inhibition_phaeocystis, & + mu_max_diatoms_in=config_maximum_growth_rate_diatoms, & + mu_max_sp_in=config_maximum_growth_rate_small_plankton, & + mu_max_phaeo_in=config_maximum_growth_rate_phaeocystis, & + grow_Tdep_diatoms_in=config_temperature_growth_diatoms, & + grow_Tdep_sp_in=config_temperature_growth_small_plankton, & + grow_Tdep_phaeo_in=config_temperature_growth_phaeocystis, & + fr_graze_diatoms_in=config_grazed_fraction_diatoms, & + fr_graze_sp_in=config_grazed_fraction_small_plankton, & + fr_graze_phaeo_in=config_grazed_fraction_phaeocystis, & + mort_pre_diatoms_in=config_mortality_diatoms, & + mort_pre_sp_in=config_mortality_small_plankton, & + mort_pre_phaeo_in=config_mortality_phaeocystis, & + mort_Tdep_diatoms_in=config_temperature_mortality_diatoms, & + mort_Tdep_sp_in=config_temperature_mortality_small_plankton, & + mort_Tdep_phaeo_in=config_temperature_mortality_phaeocystis, & + k_exude_diatoms_in=config_exudation_diatoms, & + k_exude_sp_in=config_exudation_small_plankton, & + k_exude_phaeo_in=config_exudation_phaeocystis, & + K_Nit_diatoms_in=config_nitrate_saturation_diatoms, & + K_Nit_sp_in=config_nitrate_saturation_small_plankton, & + K_Nit_phaeo_in=config_nitrate_saturation_phaeocystis, & + K_Am_diatoms_in=config_ammonium_saturation_diatoms, & + K_Am_sp_in=config_ammonium_saturation_small_plankton, & + K_Am_phaeo_in=config_ammonium_saturation_phaeocystis, & + K_Sil_diatoms_in=config_silicate_saturation_diatoms, & + K_Sil_sp_in=config_silicate_saturation_small_plankton, & + K_Sil_phaeo_in=config_silicate_saturation_phaeocystis, & + K_Fe_diatoms_in=config_iron_saturation_diatoms, & + K_Fe_sp_in=config_iron_saturation_small_plankton, & + K_Fe_phaeo_in=config_iron_saturation_phaeocystis, & + f_don_protein_in=config_fraction_spilled_to_DON, & + kn_bac_protein_in=config_degredation_of_DON, & + f_don_Am_protein_in=config_fraction_DON_ammonium, & + f_doc_s_in=config_fraction_loss_to_saccharids, & + f_doc_l_in=config_fraction_loss_to_lipids, & + f_exude_s_in=config_fraction_exudation_to_saccharids, & + f_exude_l_in=config_fraction_exudation_to_lipids, & + k_bac_s_in=config_remineralization_saccharids, & + k_bac_l_in=config_remineralization_lipids, & + algaltype_diatoms_in=config_mobility_type_diatoms, & + algaltype_sp_in=config_mobility_type_small_plankton, & + algaltype_phaeo_in=config_mobility_type_phaeocystis, & + doctype_s_in=config_mobility_type_saccharids, & + doctype_l_in=config_mobility_type_lipids, & + dictype_1_in=config_mobility_type_inorganic_carbon, & + dontype_protein_in=config_mobility_type_proteins, & + fedtype_1_in=config_mobility_type_dissolved_iron, & + feptype_1_in=config_mobility_type_particulate_iron, & + zaerotype_bc1_in=config_mobility_type_black_carbon1, & + zaerotype_bc2_in=config_mobility_type_black_carbon2, & + zaerotype_dust1_in=config_mobility_type_dust1, & + zaerotype_dust2_in=config_mobility_type_dust2, & + zaerotype_dust3_in=config_mobility_type_dust3, & + zaerotype_dust4_in=config_mobility_type_dust4, & + ratio_C2N_diatoms_in=config_ratio_C_to_N_diatoms, & + ratio_C2N_sp_in=config_ratio_C_to_N_small_plankton, & + ratio_C2N_phaeo_in=config_ratio_C_to_N_phaeocystis, & + ratio_chl2N_diatoms_in=config_ratio_chla_to_N_diatoms, & + ratio_chl2N_sp_in=config_ratio_chla_to_N_small_plankton, & + ratio_chl2N_phaeo_in=config_ratio_chla_to_N_phaeocystis, & + F_abs_chl_diatoms_in=config_scales_absorption_diatoms, & + F_abs_chl_sp_in=config_scales_absorption_small_plankton, & + F_abs_chl_phaeo_in=config_scales_absorption_phaeocystis, & + ratio_C2N_proteins_in=config_ratio_C_to_N_proteins, & + nitratetype_in=config_mobility_type_nitrate, & + ammoniumtype_in=config_mobility_type_ammonium, & + dmspptype_in=config_mobility_type_DMSPp, & + dmspdtype_in=config_mobility_type_DMSPd, & + silicatetype_in=config_mobility_type_silicate, & + humtype_in=config_mobility_type_humics, & + tau_min_in=config_rapid_mobile_to_stationary_time, & + tau_max_in=config_long_mobile_to_stationary_time) ! check calculated tracer array size if (nTracers_temp /= tracerObject % nTracers) then @@ -15756,10 +15749,15 @@ end subroutine init_column_tracer_object_for_biogeochemistry subroutine init_column_biogeochemistry_profiles(domain, tracerObject) - use ice_colpkg, only: & - colpkg_init_bgc, & - colpkg_init_hbrine, & - colpkg_init_zsalinity + !use ice_colpkg, only: & + ! colpkg_init_bgc, & + ! colpkg_init_hbrine, & + ! colpkg_init_zsalinity + + use icepack_intfc, only: & + icepack_init_bgc, & + icepack_init_hbrine, & + icepack_load_ocean_bio_array type(domain_type), intent(inout) :: domain @@ -15781,9 +15779,7 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) config_use_vertical_tracers, & config_use_skeletal_biochemistry, & config_do_restart_zsalinity, & - config_do_restart_bgc, & - config_do_restart_hbrine, & - config_use_macromolecules + config_do_restart_hbrine real(kind=RKIND), pointer :: & config_dt, & @@ -15837,14 +15833,7 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) nBioLayersP1, & nBioLayersP2, & nCategories, & - nShortwaveBio, & - nZBGCTracers, & - maxAerosolType, & - maxAlgaeType, & - maxDOCType, & - maxDICType, & - maxDONType, & - maxIronType + nShortwaveBio integer :: & iCell @@ -15860,14 +15849,12 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) call MPAS_pool_get_config(domain % configs, "config_use_brine", config_use_brine) call MPAS_pool_get_config(domain % configs, "config_do_restart_zsalinity", config_do_restart_zsalinity) - call MPAS_pool_get_config(domain % configs, "config_do_restart_bgc", config_do_restart_bgc) call MPAS_pool_get_config(domain % configs, "config_do_restart_hbrine", config_do_restart_hbrine) call MPAS_pool_get_config(domain % configs, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) call MPAS_pool_get_config(domain % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) call MPAS_pool_get_config(domain % configs, "config_use_vertical_tracers", config_use_vertical_tracers) call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) call MPAS_pool_get_config(domain % configs, "config_snow_porosity_at_ice_surface", config_snow_porosity_at_ice_surface) - call MPAS_pool_get_config(domain % configs, "config_use_macromolecules", config_use_macromolecules) abortFlag = .false. @@ -15926,23 +15913,15 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP1", nBioLayersP1) call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP2", nBioLayersP2) call MPAS_pool_get_dimension(block % dimensions, "nShortwaveBio", nShortwaveBio) - call MPAS_pool_get_dimension(block % dimensions, "nZBGCTracers", nZBGCTracers) - call MPAS_pool_get_dimension(block % dimensions, "maxAerosolType", maxAerosolType) - call MPAS_pool_get_dimension(block % dimensions, "maxAlgaeType", maxAlgaeType) - call MPAS_pool_get_dimension(block % dimensions, "maxDOCType", maxDOCType) - call MPAS_pool_get_dimension(block % dimensions, "maxDICType", maxDICType) - call MPAS_pool_get_dimension(block % dimensions, "maxDONType", maxDONType) - call MPAS_pool_get_dimension(block % dimensions, "maxIronType", maxIronType) - - call colpkg_init_hbrine(& - biologyGrid, & - interfaceBiologyGrid, & - verticalGrid, & - interfaceGrid, & - verticalShortwaveGrid, & - nBioLayers, & - nIceLayers, & - config_snow_porosity_at_ice_surface) + call icepack_init_hbrine(& + bgrid=biologyGrid, & + igrid=interfaceBiologyGrid, & + cgrid=verticalGrid, & + icgrid=interfaceGrid, & + swgrid=verticalShortwaveGrid, & + nblyr=nBioLayers, & + nilyr=nIceLayers, & + phi_snow=config_snow_porosity_at_ice_surface) do iCell = 1, nCellsSolve if (.not. config_do_restart_hbrine) then @@ -15957,65 +15936,41 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) call set_cice_tracer_array_category(block, tracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - if (config_use_vertical_zsalinity) then - call colpkg_init_zsalinity(& - nBioLayers, & - tracerObject % nTracersNotBio, & - config_do_restart_zsalinity, & - rayleighCriteria, & - rayleighCriteriaReal(iCell), & - tracerArrayCategory(tracerObject % nTracersNotBio+1:tracerObject % nTracers,:), & - tracerObject % index_verticalSalinity, & - nCategories, & - seaSurfaceSalinity(iCell)) - endif - if (config_use_vertical_tracers .or. config_use_skeletal_biochemistry) then - call colpkg_init_bgc(& - config_dt, & - nCategories, & - nBioLayers, & - nIceLayers, & - tracerObject % nTracersNotBio, & - verticalGrid, & - interfaceBiologyGrid, & - config_do_restart_bgc, & - tracerObject % nTracers, & - tracerObject % nBiotracers, & - iceSalinity(:,:,iCell), & - tracerArrayCategory(tracerObject % nTracersNotBio+1:tracerObject % nTracers,:), & - seaSurfaceSalinity(iCell), & - oceanNitrateConc(iCell), & - oceanAmmoniumConc(iCell), & - oceanSilicateConc(iCell), & - oceanDMSPConc(iCell), & - oceanDMSConc(iCell), & - oceanAlgaeConc(:,iCell), & - oceanDOCConc(:,iCell), & - oceanDONConc(:,iCell), & - oceanDICConc(:,iCell), & - oceanDissolvedIronConc(:,iCell), & - oceanParticulateIronConc(:,iCell), & - oceanZAerosolConc(:,iCell), & - oceanHumicsConc(iCell), & - oceanBioConcentrations(:,iCell), & - maxAlgaeType, & - maxDOCType, & - maxDICType, & - maxDONType, & - maxIronType, & - nZBGCTracers, & - maxAerosolType, & - DOCPoolFractions, & - config_use_macromolecules, & - abortFlag, & - abortMessage) - - if (abortFlag) then - call mpas_log_write(& - "init_column_biogeochemistry_profiles: colpkg_init_bgc: "//trim(abortMessage), & - messageType=MPAS_LOG_CRIT) - endif + + call icepack_load_ocean_bio_array(& + nit=oceanNitrateConc(iCell), & + amm=oceanAmmoniumConc(iCell), & + sil=oceanSilicateConc(iCell), & + dmsp=oceanDMSPConc(iCell), & + dms=oceanDMSConc(iCell), & + algalN=oceanAlgaeConc(:,iCell), & + doc=oceanDOCConc(:,iCell), & + don=oceanDONConc(:,iCell), & + dic=oceanDICConc(:,iCell), & + fed=oceanDissolvedIronConc(:,iCell), & + fep=oceanParticulateIronConc(:,iCell), & + zaeros=oceanZAerosolConc(:,iCell), & + ocean_bio_all=oceanBioConcentrations(:,iCell), & + hum=oceanHumicsConc(iCell)) + + call icepack_init_bgc(& + ncat=nCategories, & + nblyr=nBioLayers, & + nilyr=nIceLayers, & + ntrcr_o=tracerObject % nTracersNotBio, & + cgrid=verticalGrid, & + igrid=interfaceBiologyGrid, & + ntrcr=tracerObject % nTracers, & + nbtrcr=tracerObject % nBiotracers, & + sicen=iceSalinity(:,:,iCell), & + trcrn=tracerArrayCategory(tracerObject % nTracersNotBio+1:tracerObject % nTracers,:), & + sss=seaSurfaceSalinity(iCell), & + ocean_bio_all=oceanBioConcentrations(:,iCell), & + DOCPoolFractions=DOCPoolFractions) + + call seaice_icepack_write_warnings(icepack_warnings_aborted()) + endif ! biogeochemistry ! get the category tracer array @@ -16527,8 +16482,9 @@ subroutine seaice_icepack_reinitialize_diagnostics_bgc(domain) config_use_column_biogeochemistry, & config_use_column_shortwave, & config_use_column_package, & - config_use_vertical_biochemistry, & - config_use_vertical_zsalinity + config_use_vertical_tracers, & + config_use_vertical_zsalinity, & + config_use_zaerosols call MPAS_pool_get_config(domain % blocklist % configs, "config_use_column_package", config_use_column_package) @@ -16539,15 +16495,16 @@ subroutine seaice_icepack_reinitialize_diagnostics_bgc(domain) ! biogeochemistry call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) - call MPAS_pool_get_config(block % configs, "config_use_vertical_biochemistry", config_use_vertical_biochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) + call MPAS_pool_get_config(block % configs, "config_use_vertical_tracers", config_use_vertical_tracers) call MPAS_pool_get_config(block % configs, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) - if (config_use_column_biogeochemistry) then + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistryPool) call MPAS_pool_get_subpool(block % structs, "diagnostics_biogeochemistry", diagnostics_biogeochemistryPool) - if (config_use_vertical_biochemistry) then + if (config_use_vertical_tracers) then call MPAS_pool_get_array(biogeochemistryPool, "primaryProduction", primaryProduction) call MPAS_pool_get_array(biogeochemistryPool, "totalChlorophyll", totalChlorophyll) call MPAS_pool_get_array(biogeochemistryPool, "netSpecificAlgalGrowthRate", netSpecificAlgalGrowthRate) @@ -16594,7 +16551,7 @@ subroutine seaice_icepack_reinitialize_diagnostics_bgc(domain) call MPAS_pool_get_config(block % configs, "config_use_column_shortwave", config_use_column_shortwave) - if (config_use_column_biogeochemistry .or. config_use_column_shortwave) then + if (config_use_column_biogeochemistry .or. config_use_column_shortwave .or. config_use_zaerosols) then call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistryPool) call MPAS_pool_get_array(biogeochemistryPool, "bioTracerShortwave", bioTracerShortwave) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F index ddbbaf0af2cd..3aa80c434277 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F @@ -2305,7 +2305,8 @@ subroutine initialize_coupler_fields(domain) config_do_restart, & config_use_column_biogeochemistry, & config_use_column_package, & - config_use_aerosols + config_use_aerosols, & + config_use_zaerosols integer, pointer :: & nCells @@ -2402,8 +2403,9 @@ subroutine initialize_coupler_fields(domain) endif call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) - if (config_use_column_biogeochemistry) then + if (config_use_column_biogeochemistry .or. config_use_zaerosols) then call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistry) From e09f1873484ffa3c20ad3bdc5ae1d4e16b52941a Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Fri, 13 Oct 2023 14:28:40 -0500 Subject: [PATCH 02/24] Clean-up from the merge --- components/mpas-seaice/src/column/ice_algae.F90 | 16 +++++++++++++--- .../model_forward/mpas_seaice_core_interface.F | 8 ++++---- .../mpas-seaice/src/shared/mpas_seaice_column.F | 1 + .../mpas-seaice/src/shared/mpas_seaice_icepack.F | 6 +++--- .../src/shared/mpas_seaice_initialize.F | 4 ++-- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/components/mpas-seaice/src/column/ice_algae.F90 b/components/mpas-seaice/src/column/ice_algae.F90 index f5c97b8f0a6a..6ba380a4f048 100644 --- a/components/mpas-seaice/src/column/ice_algae.F90 +++ b/components/mpas-seaice/src/column/ice_algae.F90 @@ -2259,6 +2259,10 @@ subroutine algal_dyn (dt, & write(warning, *) 'Conservation error!' call add_warning(warning) if (tr_bgc_DON) then + write(warning, *) 'Error bound = max(puny,maxval(abs(reactb(:)))*1.0e-13_dbl_kind)' + call add_warning(warning) + write(warning, *) max(puny,maxval(abs(reactb(:)))*1.0e-13_dbl_kind) + call add_warning(warning) write(warning, *) 'dN,DONin(1), kn_bac(1),secday,dt,n_doc' call add_warning(warning) write(warning, *) dN, DONin(1),kn_bac(1),secday,dt,n_doc @@ -2272,10 +2276,16 @@ subroutine algal_dyn (dt, & call add_warning(warning) write(warning, *) dN,secday,dt,n_doc call add_warning(warning) - write(warning, *) 'reactb(nlt_bgc_Nit),reactb(nlt_bgc_N(1)),reactb(nlt_bgc_N(2)' + write(warning, *) 'reactb(nlt_bgc_Nit),fr_resp' call add_warning(warning) - write(warning, *) reactb(nlt_bgc_Nit),reactb(nlt_bgc_N(1)),reactb(nlt_bgc_N(2)) + write(warning, *) reactb(nlt_bgc_Nit),fr_resp call add_warning(warning) + do k = 1,n_algae + write(warning, *) 'reactb(nlt_bgc_N(k)),fr_graze(k), grow_N(k), mort(k)' + call add_warning(warning) + write(warning, *) reactb(nlt_bgc_N(k)),fr_graze(k), grow_N(k), mort(k) + call add_warning(warning) + enddo if (tr_bgc_Am) then write(warning, *) 'reactb(nlt_bgc_Am),Am_r, Am_s' call add_warning(warning) @@ -2298,6 +2308,7 @@ subroutine algal_dyn (dt, & write(warning, *) 'DOC_r,DOC_s' call add_warning(warning) write(warning, *) DOC_r(k),DOC_s(k) + call add_warning(warning) end do do k = 1,n_dic write(warning, *) 'DICin' @@ -2312,7 +2323,6 @@ subroutine algal_dyn (dt, & call add_warning(warning) write(warning, *) DIC_r(k),DIC_s(k) end do - call add_warning(warning) write(warning, *) 'Zoo' call add_warning(warning) write(warning, *) Zoo diff --git a/components/mpas-seaice/src/model_forward/mpas_seaice_core_interface.F b/components/mpas-seaice/src/model_forward/mpas_seaice_core_interface.F index 5e83f651daba..d89cf9dd0db6 100644 --- a/components/mpas-seaice/src/model_forward/mpas_seaice_core_interface.F +++ b/components/mpas-seaice/src/model_forward/mpas_seaice_core_interface.F @@ -315,14 +315,14 @@ subroutine setup_packages_column_physics(configPool, packagePool, ierr)!{{{ call MPAS_pool_get_config(configPool, "config_use_column_physics", config_use_column_physics) call MPAS_pool_get_config(configPool, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) - call MPAS_pool_get_config(configPool, "config_use_column_zaerosols", config_use_zaerosols) + call MPAS_pool_get_config(configPool, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_package(packagePool, "pkgColumnPackageActive", pkgColumnPackageActive) call MPAS_pool_get_package(packagePool, "pkgColumnBiogeochemistryActive", pkgColumnBiogeochemistryActive) - pkgColumnPackageActive = config_use_column_package + pkgColumnPackageActive = config_use_column_physics pkgColumnBiogeochemistryActive = ((config_use_column_biogeochemistry .or. config_use_zaerosols) & - .and. config_use_column_package) + .and. config_use_column_physics) !pkgColumnPackageActive = .true. !pkgColumnBiogeochemistryActive = .true. @@ -494,7 +494,7 @@ subroutine setup_packages_column_physics(configPool, packagePool, ierr)!{{{ pkgColumnTracerSnowGrainRadiusActive = .false. endif - if (.not. config_use_column_biogeochemistry .and. config_use_column_package) then + if (.not. config_use_column_biogeochemistry .and. config_use_column_physics) then pkgTracerSkeletalAlgaeActive = .false. pkgTracerSkeletalNitrateActive = .false. pkgTracerSkeletalCarbonActive = .false. diff --git a/components/mpas-seaice/src/shared/mpas_seaice_column.F b/components/mpas-seaice/src/shared/mpas_seaice_column.F index 78155f0f73e1..4364e808a8e0 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_column.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_column.F @@ -14830,6 +14830,7 @@ subroutine seaice_column_reinitialize_diagnostics_bgc(domain) bioTracerShortwave logical, pointer :: & + config_use_column_physics, & config_use_column_biogeochemistry, & config_use_column_shortwave, & config_use_column_package, & diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 729707271286..050ec91c0741 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -12502,8 +12502,8 @@ subroutine init_icepack_package_configs(domain) grid_o_t_in = config_biogrid_top_molecular_sublayer, & !initbio_frac_in = config_new_ice_fraction_biotracer, & !frazil_scav_in = config_fraction_biotracer_in_frazil, & - grid_oS_in = config_zsalinity_molecular_sublayer, & - l_skS_in = config_zsalinity_gravity_drainage_scale, & + !grid_oS_in = config_zsalinity_molecular_sublayer, & + !l_skS_in = config_zsalinity_gravity_drainage_scale, & phi_snow_in = config_snow_porosity_at_ice_surface, & !ratio_Si2N_diatoms_in = config_ratio_Si_to_N_diatoms, & !ratio_Si2N_sp_in = config_ratio_Si_to_N_small_plankton, & @@ -15942,7 +15942,7 @@ subroutine seaice_icepack_reinitialize_diagnostics_bgc(domain) logical, pointer :: & config_use_column_biogeochemistry, & config_use_column_shortwave, & - config_use_column_package, & + config_use_column_physics, & config_use_vertical_tracers, & config_use_vertical_zsalinity, & config_use_zaerosols diff --git a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F index 87245eaecc80..e2ca0dbf2216 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F @@ -2577,10 +2577,10 @@ subroutine initialize_coupler_fields(domain) maxAerosolType, & nZBGCTracers - logical, pointer :: & + logical, pointer :: & config_do_restart, & config_use_column_biogeochemistry, & - config_use_column_package, & + config_use_column_physics, & config_use_aerosols, & config_use_zaerosols From e5b6cda92fdee34f2f7eab102c9539ce28494546 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Fri, 13 Oct 2023 15:02:50 -0500 Subject: [PATCH 03/24] Modified algal growth by mistake in merge. Changed back to original formulation. --- components/mpas-seaice/src/column/ice_algae.F90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/mpas-seaice/src/column/ice_algae.F90 b/components/mpas-seaice/src/column/ice_algae.F90 index 6ba380a4f048..c450e8ee059c 100644 --- a/components/mpas-seaice/src/column/ice_algae.F90 +++ b/components/mpas-seaice/src/column/ice_algae.F90 @@ -2016,9 +2016,8 @@ subroutine algal_dyn (dt, & N_r_g = graze(k) * dt N_r_r = resp(k) * dt N_r_mo = mort(k) * dt - N_s(k) = (c1- fr_resp - fr_graze(k)) * grow_N(k) *dt !N_s_p - N_r(k) = mort(k) * dt !N_r_g + N_r_mo + N_r_r - + N_s(k) = N_s_p !(c1- fr_resp - fr_graze(k)) * grow_N(k) *dt + N_r(k) = N_r_g + N_r_mo + N_r_r !mort(k) * dt graze_N = graze_N + graze(k) graze_C = graze_C + R_C2N(k)*graze(k) mort_N = mort_N + mort(k) From 4b776941b3eb936f43e83e2a6f3092ed01373489 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Tue, 24 Oct 2023 13:15:07 -0500 Subject: [PATCH 04/24] Adds the interface for icepack zaerosols and zbgc -bugfix in carbon conservation - Fluxes scaled by aicen not aicen_init -puts snow aerosols into ice rather than ocean for small snow volumes -Changes vertical z-tracer flags so that aerosols and bgc are turned on separately: 1) config_use_column_biogeochemistry indicates biogeochemical tracers are on 2) config_use_zaerosols indicates dust and black carbon are on BFB in the default configuration. nonBFB with zaerosols or column_biogeochemistry --- .../mpas-seaice/src/column/ice_aerosol.F90 | 20 ++- .../mpas-seaice/src/column/ice_algae.F90 | 22 ++- .../mpas-seaice/src/column/ice_warnings.F90 | 2 +- .../mpas-seaice/src/column/ice_zbgc.F90 | 6 +- .../src/shared/mpas_seaice_column.F | 22 ++- .../src/shared/mpas_seaice_icepack.F | 144 ++++++------------ 6 files changed, 101 insertions(+), 115 deletions(-) diff --git a/components/mpas-seaice/src/column/ice_aerosol.F90 b/components/mpas-seaice/src/column/ice_aerosol.F90 index c3e6a9d0bf27..a4a270713a80 100644 --- a/components/mpas-seaice/src/column/ice_aerosol.F90 +++ b/components/mpas-seaice/src/column/ice_aerosol.F90 @@ -580,17 +580,21 @@ subroutine update_snow_bgc (dt, nblyr, & if (dzssl_new .lt. hs_ssl_min) then ! Put atm BC/dust flux directly into the sea ice do k=1,nbtrcr - flux_bio(k) = flux_bio(k) + & + flux_bio_o(k) = flux_bio(k) + if (hilyr .lt. hs_ssl_min) then + flux_bio(k) = flux_bio(k) + & (trcrn(bio_index(k)+ nblyr+1)*dzssl+ & trcrn(bio_index(k)+ nblyr+2)*dzint)/dt - trcrn(bio_index(k) + nblyr+1) = c0 - trcrn(bio_index(k) + nblyr+2) = c0 - if (hilyr .lt. hs_ssl_min) then flux_bio(k) = flux_bio(k) + flux_bio_atm(k) else + zbgc_snow(k) = zbgc_snow(k) + & + (trcrn(bio_index(k)+ nblyr+1)*dzssl+ & + trcrn(bio_index(k)+ nblyr+2)*dzint) zbgc_atm(k) = zbgc_atm(k) & + flux_bio_atm(k)*dt end if + trcrn(bio_index(k) + nblyr+1) = c0 + trcrn(bio_index(k) + nblyr+2) = c0 enddo else @@ -616,7 +620,7 @@ subroutine update_snow_bgc (dt, nblyr, & end if if (dzint <= puny) then do k = 1,nbtrcr - flux_bio(k) = flux_bio(k) + (aerosno(k,2) + aerosno(k,1))/dt + zbgc_snow(k) = zbgc_snow(k) + (aerosno(k,2) + aerosno(k,1)) aerosno(k,2) = c0 aerosno(k,1) = c0 end do @@ -636,6 +640,7 @@ subroutine update_snow_bgc (dt, nblyr, & dzssl = dzssl - dz + fsnow/rhos*dt dzint = dzint + dz end if + if (dzssl <= puny) then do k = 1,nbtrcr aerosno(k,2) = aerosno(k,2) + aerosno(k,1) @@ -644,7 +649,7 @@ subroutine update_snow_bgc (dt, nblyr, & end if if (dzint <= puny) then do k = 1,nbtrcr - flux_bio(k) = flux_bio(k) + (aerosno(k,2) + aerosno(k,1))/dt + zbgc_snow(k) = zbgc_snow(k) + (aerosno(k,2) + aerosno(k,1)) aerosno(k,2) = c0 aerosno(k,1) = c0 end do @@ -664,7 +669,7 @@ subroutine update_snow_bgc (dt, nblyr, & sloss2 = kscavz(bio_index_o(k))*aerosno(k,2) & *max(-dhs_melts-dzssl,c0)/dzint aerosno(k,2) = max(c0,aerosno(k,2) - sloss2) - flux_bio(k) = flux_bio(k) + (sloss1+sloss2)/dt ! all not scavenged ends in ocean + zbgc_snow(k) = zbgc_snow(k) + (sloss1+sloss2) ! all not scavenged ends in ice enddo ! update snow thickness @@ -795,6 +800,7 @@ subroutine update_snow_bgc (dt, nblyr, & else if (aerotot(k) > c0) then aero_cons(k) = aero_cons(k)/aerotot(k) end if + if (aero_cons(k) > puny .or. zbgc_snow(k) + zbgc_atm(k) < c0) then write(warning,*) 'Conservation failure: aerosols in snow' call add_warning(warning) diff --git a/components/mpas-seaice/src/column/ice_algae.F90 b/components/mpas-seaice/src/column/ice_algae.F90 index c450e8ee059c..ec7afff60733 100644 --- a/components/mpas-seaice/src/column/ice_algae.F90 +++ b/components/mpas-seaice/src/column/ice_algae.F90 @@ -347,8 +347,12 @@ subroutine zbio (dt, nblyr, & call add_warning(warning) write(warning,*) Tot_BGC_i(mm) + flux_bio_atm(mm)*dt - flux_bion(mm)*dt call add_warning(warning) - !l_stop = .true. - !stop_label = "carbon conservation in ice_algae.F90" + write(warning,*) 'hbri, hbri_old' + call add_warning(warning) + write(warning,*) hbri, hbri_old + call add_warning(warning) + l_stop = .true. + stop_label = "carbon conservation in ice_algae.F90" enddo endif endif @@ -1021,7 +1025,7 @@ subroutine z_biogeochemistry (n_cat, dt, & Nquota_I = 0.0408_dbl_kind, & ! Intercept in N quota to cell volume fit f_s = p1, & ! fracton of sites available for saturation f_a = 0.3_dbl_kind, & !c1 , & ! fraction of collector available for attachment - f_v = 0.7854 ! fraction of algal coverage on area availabel for attachment + f_v = 0.7854_dbl_kind ! fraction of algal coverage on area availabel for attachment ! 4(pi r^2)/(4r)^2 [Johnson et al, 1995, water res. research] integer, parameter :: & @@ -1413,8 +1417,16 @@ subroutine z_biogeochemistry (n_cat, dt, & call add_warning(warning) write(warning, *) m, nlt_bgc_DIC(1), bio_tmp, react(k,m) call add_warning(warning) - flux_bio(m) = flux_bio(m) + bio_tmp*dz(k)*hbri_old/dt + write(warning,*)'flux_bio(m) Initial, hbri_old, dz(k)' + call add_warning(warning) + write(warning,*) flux_bio(m), hbri_old, dz(k) + call add_warning(warning) + flux_bio(m) = flux_bio(m) + bio_tmp*dz(k)*hbri/dt bio_tmp = c0 + write(warning,*) 'flux_bio(m)' + call add_warning(warning) + write(warning,*) flux_bio(m) + call add_warning(warning) end if if (m .eq. nlt_bgc_Nit) then initcons_mobile(k) = max(c0,(biomat_brine(k,m)-nitrification(k) + & @@ -1442,7 +1454,7 @@ subroutine z_biogeochemistry (n_cat, dt, & l_stop = .true. stop_label = 'C in algal_dyn not conserved' elseif (abs(bio_tmp) < puny) then - flux_bio(m) = flux_bio(m) + bio_tmp*dz(k)*hbri_old/dt + flux_bio(m) = flux_bio(m) + bio_tmp*dz(k)*hbri/dt bio_tmp = c0 elseif (bio_tmp > 1.0e8_dbl_kind) then write(warning, *) 'very large bgc value' diff --git a/components/mpas-seaice/src/column/ice_warnings.F90 b/components/mpas-seaice/src/column/ice_warnings.F90 index a3424c176bb7..091c8b2be944 100644 --- a/components/mpas-seaice/src/column/ice_warnings.F90 +++ b/components/mpas-seaice/src/column/ice_warnings.F90 @@ -82,7 +82,7 @@ subroutine add_warning(warning) deallocate(warningsTmp) endif - + endif ! increase warning number diff --git a/components/mpas-seaice/src/column/ice_zbgc.F90 b/components/mpas-seaice/src/column/ice_zbgc.F90 index 1f1c6a7d9106..e8cef6dcad9f 100644 --- a/components/mpas-seaice/src/column/ice_zbgc.F90 +++ b/components/mpas-seaice/src/column/ice_zbgc.F90 @@ -679,9 +679,9 @@ subroutine merge_bgc_fluxes (dt, nblyr, & snow_bio_net(mm) = snow_bio_net(mm) & + trcrn(bio_index(mm)+nblyr+1)*dvssl & + trcrn(bio_index(mm)+nblyr+2)*dvint - flux_bio (mm) = flux_bio (mm) + flux_bion (mm)*aice_init - zbgc_snow (mm) = zbgc_snow(mm) + zbgc_snown(mm)*aice_init/dt - zbgc_atm (mm) = zbgc_atm (mm) + zbgc_atmn (mm)*aice_init/dt + flux_bio (mm) = flux_bio (mm) + flux_bion (mm)*aicen + zbgc_snow (mm) = zbgc_snow(mm) + zbgc_snown(mm)*aicen/dt + zbgc_atm (mm) = zbgc_atm (mm) + zbgc_atmn (mm)*aicen/dt enddo ! mm ! diagnostics : mean cell bio interface grid profiles diff --git a/components/mpas-seaice/src/shared/mpas_seaice_column.F b/components/mpas-seaice/src/shared/mpas_seaice_column.F index 4364e808a8e0..cfebdab2e200 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_column.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_column.F @@ -2664,7 +2664,8 @@ subroutine column_snow(domain) logical, pointer :: & config_use_effective_snow_density, & config_use_snow_grain_radius, & - config_use_column_biogeochemistry + config_use_column_biogeochemistry, & + config_use_zaerosols real(kind=RKIND), dimension(:,:,:), pointer :: & snowIceMass, & @@ -2755,6 +2756,7 @@ subroutine column_snow(domain) call MPAS_pool_get_config(block % configs, "config_wind_compaction_factor", config_wind_compaction_factor) call MPAS_pool_get_config(block % configs, "config_snow_redistribution_factor", config_snow_redistribution_factor) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(block % dimensions, "nCategories", nCategories) @@ -2798,7 +2800,7 @@ subroutine column_snow(domain) call MPAS_pool_get_array(ocean_fluxes, "oceanHeatFlux", oceanHeatFlux) setGetPhysicsTracers = .true. - setGetBGCTracers = config_use_column_biogeochemistry + setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) ! code abort abortFlag = .false. @@ -10326,10 +10328,20 @@ subroutine check_column_package_configs(domain) messageType=MPAS_LOG_CRIT) endif - ! check that vertical bio tracers and not used with skeletal bio tracers - if (config_use_vertical_tracers .and. config_use_skeletal_biochemistry) then + ! check that vertical bio tracers use brine height + if ((config_use_vertical_biochemistry .or. config_use_zaerosols) .and. & + (.not. config_use_brine .or. .not. config_use_vertical_tracers )) then + call mpas_log_write(& + "check_column_package_configs: vertical biochemistry and zaerosols require " //& + "config_use_brine and config_use_vertical_tracer = true", & + messageType=MPAS_LOG_CRIT) + endif + + ! check that brine height is used with either aerosols or bgc + if (config_use_brine .and. & + (.not. config_use_column_biogeochemistry .and. .not. config_use_zaerosols)) then call mpas_log_write(& - "check_column_package_configs: vertical bio tracers and skeletal bio tracers cannot both be true", & + "check_column_package_configs: brine tracer must be used with vertical tracers - config_use_column_biogeochemistry and/or config_use_zaerosols equal to true", & messageType=MPAS_LOG_CRIT) endif diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 050ec91c0741..2c26fd08f400 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -2990,7 +2990,9 @@ subroutine column_radiation(domain, clock, lInitialization) iceBodyAerosol, & brineFraction, & bioTracerShortwave, & - snowGrainRadius + snowGrainRadius, & + verticalAerosolsConc, & + verticalAlgaeConc real(kind=RKIND), pointer :: & dayOfNextShortwaveCalculation ! needed for CESM like coupled simulations @@ -3060,11 +3062,11 @@ subroutine column_radiation(domain, clock, lInitialization) call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_config(block % configs, "config_snow_redistribution_scheme", config_snow_redistribution_scheme) - call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) - call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) - call MPAS_pool_get_dimension(mesh, "nIceLayers", nIceLayers) - call MPAS_pool_get_dimension(mesh, "nSnowLayers", nSnowLayers) - call MPAS_pool_get_dimension(mesh, "nAerosols", nAerosols) + call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) + call MPAS_pool_get_dimension(block % dimensions, "nCategories", nCategories) + call MPAS_pool_get_dimension(block % dimensions, "nIceLayers", nIceLayers) + call MPAS_pool_get_dimension(block % dimensions, "nSnowLayers", nSnowLayers) + call MPAS_pool_get_dimension(block % dimensions, "nAerosols", nAerosols) call MPAS_pool_get_dimension(block % dimensions, "nAlgae", nAlgae) call MPAS_pool_get_dimension(block % dimensions, "nBioLayers", nBioLayers) call MPAS_pool_get_dimension(block % dimensions, "nzAerosols", nzAerosols) @@ -3087,6 +3089,8 @@ subroutine column_radiation(domain, clock, lInitialization) call MPAS_pool_get_array(tracers, "iceBodyAerosol", iceBodyAerosol, 1) call MPAS_pool_get_array(tracers, "brineFraction", brineFraction, 1) call MPAS_pool_get_array(tracers, "snowGrainRadius", snowGrainRadius, 1) + call MPAS_pool_get_array(tracers, "verticalAlgaeConc", verticalAlgaeConc, 1) + call MPAS_pool_get_array(tracers, "verticalAerosolsConc", verticalAerosolsConc, 1) call MPAS_pool_get_array(atmos_coupling, "shortwaveVisibleDirectDown", shortwaveVisibleDirectDown) call MPAS_pool_get_array(atmos_coupling, "shortwaveVisibleDiffuseDown", shortwaveVisibleDiffuseDown) @@ -3137,6 +3141,7 @@ subroutine column_radiation(domain, clock, lInitialization) allocate(index_shortwaveAerosol(maxAerosolType)) allocate(index_verticalAerosolsConc(maxAerosolType)) allocate(index_algaeConc(nAlgae)) + if (.not. config_use_zaerosols) then index_shortwaveAerosol(1:maxAerosolType) = 1 index_verticalAerosolsConc(1:maxAerosolType) = 1 @@ -3146,6 +3151,7 @@ subroutine column_radiation(domain, clock, lInitialization) index_verticalAerosolsConc(iAerosol) = ciceTracerObject % index_verticalAerosolsConc(iAerosol) enddo endif + if (.not. config_use_column_biogeochemistry) then index_algaeConc(1:nAlgae) = 1 else @@ -3190,10 +3196,6 @@ subroutine column_radiation(domain, clock, lInitialization) lonCellColumn = lonCell(iCell) if (lonCellColumn > seaicePi) lonCellColumn = lonCellColumn - 2.0_RKIND * seaicePi - ! set the category tracer array - call set_cice_tracer_array_category(block, ciceTracerObject, & - tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - call icepack_step_radiation(& dt=config_dt, & swgrid=verticalShortwaveGrid(:), & @@ -3208,8 +3210,8 @@ subroutine column_radiation(domain, clock, lInitialization) hpndn=pondDepth(1,:,iCell), & ipndn=pondLidThickness(1,:,iCell), & aeron=aerosolsArray, & - bgcNn=tracerArrayCategory(index_algaeConc(:),:), & - zaeron=tracerArrayCategory(index_verticalAerosolsConc(:),:), & + bgcNn=verticalAlgaeConc(:,:,iCell), & + zaeron=verticalAerosolsConc(:,:,iCell), & trcrn_bgcsw=bioTracerShortwave(:,:,iCell), & TLAT=latCell(iCell), & TLON=lonCellColumn, & @@ -3249,10 +3251,6 @@ subroutine column_radiation(domain, clock, lInitialization) l_print_point=.false., & initonly=lInitialization) - ! set the category tracer array - call get_cice_tracer_array_category(block, ciceTracerObject, & - tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - enddo ! iCell deallocate(snow_grain_radius) @@ -3603,7 +3601,6 @@ subroutine column_biogeochemistry(domain) ! variables real(kind=RKIND), dimension(:), pointer :: & - rayleighCriteriaReal, & netNitrateUptake, & netAmmoniumUptake, & totalVerticalSalinity, & @@ -3722,7 +3719,6 @@ subroutine column_biogeochemistry(domain) logical :: & abortFlag, & - rayleighCriteria, & setGetPhysicsTracers, & setGetBGCTracers, & checkCarbon @@ -3791,7 +3787,6 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(biogeochemistry, "brineBottomChange", brineBottomChange) call MPAS_pool_get_array(biogeochemistry, "brineTopChange", brineTopChange) call MPAS_pool_get_array(biogeochemistry, "bioPorosity", bioPorosity) - call MPAS_pool_get_array(biogeochemistry, "rayleighCriteriaReal", rayleighCriteriaReal) call MPAS_pool_get_array(biogeochemistry, "biologyGrid", biologyGrid) call MPAS_pool_get_array(biogeochemistry, "interfaceBiologyGrid", interfaceBiologyGrid) call MPAS_pool_get_array(biogeochemistry, "interfaceGrid", interfaceGrid) @@ -3878,8 +3873,8 @@ subroutine column_biogeochemistry(domain) atmosBioFluxes(:,:) = 0.0_RKIND - !$omp parallel do default(shared) private(iCategory,iBioTracers,iAlgae, rayleighCriteria, & - !$omp& rayleighCriteriaReal) firstprivate(atmosBioFluxes,atmosBlackCarbonFlux, & + !$omp parallel do default(shared) private(iCategory,iBioTracers,iAlgae) & + !$omp& firstprivate(atmosBioFluxes,atmosBlackCarbonFlux, & !$omp& atmosDustFlux, bioShortwaveFluxCell, newlyFormedIce) ! do iCell = 1, nCellsSolve @@ -3889,7 +3884,6 @@ subroutine column_biogeochemistry(domain) brineHeightCatInitial(iCategory) = brineFraction(1,iCategory,iCell) * & iceVolumeCategoryInitial(iCategory,iCell)/(iceAreaCategoryInitial(iCategory,iCell) + seaicePuny) enddo ! iCategory - rayleighCriteria = (rayleighCriteriaReal(iCell) > 0.5_RKIND) !update ocean concentrations fields and atmospheric fluxes into allocated array #ifdef coupled @@ -3972,7 +3966,6 @@ subroutine column_biogeochemistry(domain) snow_bio_net=totalVerticalBiologySnow(:,iCell), & totalChla=totalChlorophyll(iCell), & fswthrun=penetratingShortwaveFlux(:,iCell), & - Rayleigh_criteria=rayleighCriteria, & bgrid=biologyGrid, & igrid=interfaceBiologyGrid, & icgrid=interfaceGrid, & @@ -4068,8 +4061,6 @@ subroutine column_biogeochemistry(domain) if (newlyFormedIceLogical(iCategory)) newlyFormedIce(iCategory,iCell) = 1 enddo ! iCategory - if (.not. rayleighCriteria) rayleighCriteriaReal(iCell) = 0.0_RKIND - enddo ! iCell ! code abort @@ -5585,8 +5576,8 @@ subroutine seaice_icepack_init_ocean_conc(& carbonToNitrogenRatioAlgae, & carbonToNitrogenRatioDON) - use ice_colpkg, only: & - colpkg_init_ocean_conc + use icepack_intfc, only: & + icepack_init_ocean_bio integer, intent(in) :: & maxDICType, & @@ -5615,26 +5606,26 @@ subroutine seaice_icepack_init_ocean_conc(& carbonToNitrogenRatioAlgae, & ! carbon to nitrogen ratio for algae carbonToNitrogenRatioDON ! nitrogen to carbon ratio for proteins - call colpkg_init_ocean_conc(& - oceanAmmoniumConc, & - oceanDMSPConc, & - oceanDMSConc, & - oceanAlgaeConc, & - oceanDOCConc, & - oceanDICConc, & - oceanDONConc, & - oceanDissolvedIronConc, & - oceanParticulateIronConc, & - oceanHumicsConc, & - oceanNitrateConc, & - oceanSilicateConc,& - oceanZAerosolConc, & - maxDICType, & - maxDONType, & - maxIronType, & - maxAerosolType, & - carbonToNitrogenRatioAlgae, & - carbonToNitrogenRatioDON) + call icepack_init_ocean_bio(& + amm=oceanAmmoniumConc, & + dmsp=oceanDMSPConc, & + dms=oceanDMSConc, & + algalN=oceanAlgaeConc, & + doc=oceanDOCConc, & + dic=oceanDICConc, & + don=oceanDONConc, & + fed=oceanDissolvedIronConc, & + fep=oceanParticulateIronConc, & + hum=oceanHumicsConc, & + nit=oceanNitrateConc, & + sil=oceanSilicateConc,& + zaeros=oceanZAerosolConc, & + max_dic=maxDICType, & + max_don=maxDONType, & + max_fe=maxIronType, & + max_aero=maxAerosolType, & + CToN=carbonToNitrogenRatioAlgae, & + CToN_DON=carbonToNitrogenRatioDON) end subroutine seaice_icepack_init_ocean_conc @@ -9560,10 +9551,10 @@ subroutine check_column_package_configs(domain) ! check biogeochemistry flags: ! if (.not. config_use_column_biogeochemistry .and. (config_use_brine .or. config_use_vertical_zsalinity .or. & - if (.not. config_use_column_biogeochemistry .and. (config_use_brine .or. & - config_use_vertical_biochemistry .or. config_use_shortwave_bioabsorption .or. config_use_vertical_tracers .or. & - config_use_skeletal_biochemistry .or. config_use_nitrate .or. config_use_carbon .or. config_use_chlorophyll .or. & - config_use_ammonium .or. config_use_silicate .or. config_use_DMS .or. config_use_nonreactive .or. config_use_humics .or. & + if (.not. config_use_column_biogeochemistry .and. (config_use_vertical_biochemistry .or. & + config_use_skeletal_biochemistry .or. config_use_nitrate .or. config_use_carbon .or. & + config_use_chlorophyll .or. config_use_ammonium .or. config_use_silicate .or. & + config_use_DMS .or. config_use_nonreactive .or. config_use_humics .or. & config_use_DON .or. config_use_iron)) then call mpas_log_write(& "check_column_package_configs: config_use_column_biogeochemistry = false. "//& @@ -9595,6 +9586,14 @@ subroutine check_column_package_configs(domain) messageType=MPAS_LOG_CRIT) endif + ! check that brine height is used with either aerosols or bgc + if (config_use_brine .and. & + (.not. config_use_column_biogeochemistry .and. .not. config_use_zaerosols)) then + call mpas_log_write(& + "check_column_package_configs: brine tracer must be used with vertical tracers - config_use_column_biogeochemistry and/or config_use_zaerosols equal to true", & + messageType=MPAS_LOG_CRIT) + endif + ! check that the shortwave scheme and bioabsorption is consistent if (config_use_shortwave_bioabsorption .and. .not. (trim(config_shortwave_type(1:4)) == "dEdd")) then call mpas_log_write(& @@ -14662,7 +14661,6 @@ end subroutine seaice_column_reinitialize_oceanic_fluxes subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) - !use ice_colpkg, only: colpkg_init_zbgc use icepack_intfc, only: icepack_init_zbgc type(domain_type), intent(in) :: & @@ -15207,11 +15205,6 @@ end subroutine init_column_tracer_object_for_biogeochemistry subroutine init_column_biogeochemistry_profiles(domain, tracerObject) - !use ice_colpkg, only: & - ! colpkg_init_bgc, & - ! colpkg_init_hbrine, & - ! colpkg_init_zsalinity - use icepack_intfc, only: & icepack_init_bgc, & icepack_init_hbrine, & @@ -15256,7 +15249,6 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) biologyGrid, & ! bgrid verticalShortwaveGrid, & ! swgrid interfaceGrid, & ! icgrid - rayleighCriteriaReal, & DOCPoolFractions real(kind=RKIND), dimension(:,:), pointer :: & @@ -15298,7 +15290,6 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) logical :: & abortFlag, & - rayleighCriteria, & setGetPhysicsTracers, & setGetBGCTracers @@ -15337,7 +15328,6 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) call MPAS_pool_get_array(biogeochemistry, "bioTracerShortwave", bioTracerShortwave) call MPAS_pool_get_array(biogeochemistry, "interfaceBiologyGrid", interfaceBiologyGrid) call MPAS_pool_get_array(biogeochemistry, "interfaceGrid", interfaceGrid) - call MPAS_pool_get_array(biogeochemistry, "rayleighCriteriaReal", rayleighCriteriaReal) call MPAS_pool_get_array(biogeochemistry, "verticalGrid", verticalGrid) call MPAS_pool_get_array(biogeochemistry, "biologyGrid", biologyGrid) call MPAS_pool_get_array(biogeochemistry, "verticalShortwaveGrid", verticalShortwaveGrid) @@ -17409,40 +17399,6 @@ subroutine seaice_total_carbon_content_category(block,totalCarbonContentCategory end subroutine seaice_total_carbon_content_category -!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -!----------------------------------------------------------------------- -! Warning messages -!----------------------------------------------------------------------- - -!echmod: remove this subroutine and all calls to it - - subroutine column_write_warnings(logAsErrors) - - use ice_colpkg, only: colpkg_get_warnings - - character(len=strKINDWarnings), dimension(:), allocatable :: & - warnings - - logical, intent(in) :: & - logAsErrors - - integer :: & - iWarning - - call colpkg_get_warnings(warnings) - - if (logAsErrors) then - do iWarning = 1, size(warnings) - call mpas_log_write(trim(warnings(iWarning)), messageType=MPAS_LOG_ERR) - enddo ! iWarning - else - do iWarning = 1, size(warnings) - call mpas_log_write(trim(warnings(iWarning)), messageType=MPAS_LOG_WARN) - enddo ! iWarning - endif - - end subroutine column_write_warnings - !----------------------------------------------------------------------- subroutine seaice_icepack_write_warnings(logAsErrors) From fb48cef43718554e736a903685a32b282ba90fcd Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Tue, 31 Oct 2023 15:29:58 -0500 Subject: [PATCH 05/24] Removed init_column_package_tracer_indices from mpas_seaice_icepack This column_package subroutine was accidentally added during the merge. BFB --- components/mpas-seaice/src/icepack | 2 +- .../src/shared/mpas_seaice_icepack.F | 218 ------------------ 2 files changed, 1 insertion(+), 219 deletions(-) diff --git a/components/mpas-seaice/src/icepack b/components/mpas-seaice/src/icepack index 96f2fc707fc7..37a6f97a4ea8 160000 --- a/components/mpas-seaice/src/icepack +++ b/components/mpas-seaice/src/icepack @@ -1 +1 @@ -Subproject commit 96f2fc707fc743d7ce6eb8f543bd449a35a1a649 +Subproject commit 37a6f97a4ea83d37a214b8dcde5d3630fe3a3316 diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 2c26fd08f400..79f5452c7309 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -9790,224 +9790,6 @@ subroutine init_icepack_package_tracer_sizes(domain, tracerObject) end subroutine init_icepack_package_tracer_sizes -!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -! -! init_column_package_tracer_indices -! -!> \brief -!> \author Adrian K. Turner, LANL -!> \date 5th Feburary 2015 -!> \details -!> -! -!----------------------------------------------------------------------- - - subroutine init_column_package_tracer_indices(tracerObject) - - !use ice_colpkg_tracers, only: & - ! nt_Tsfc, & ! ice/snow temperature - ! nt_qice, & ! volume-weighted ice enthalpy (in layers) - ! nt_qsno, & ! volume-weighted snow enthalpy (in layers) - ! nt_sice, & ! volume-weighted ice bulk salinity (CICE grid layers) - ! nt_fbri, & ! volume fraction of ice with dynamic salt (hinS/vicen*aicen) - ! nt_iage, & ! volume-weighted ice age - ! nt_FY, & ! area-weighted first-year ice area - ! nt_alvl, & ! level ice area fraction - ! nt_vlvl, & ! level ice volume fraction - ! nt_apnd, & ! melt pond area fraction - ! nt_hpnd, & ! melt pond depth - ! nt_ipnd, & ! melt pond refrozen lid thickness - ! nt_aero, & ! starting index for aerosols in ice - ! nt_smice, & ! snow ice mass - ! nt_smliq, & ! snow liquid mass - ! nt_rsnw, & ! snow grain radius - ! nt_rhos, & ! snow density tracer - ! nt_fbri, & ! volume fraction of ice with dynamic salt (hinS/vicen*aicen) - ! nt_bgc_Nit, & ! nutrients - ! nt_bgc_Am, & ! - ! nt_bgc_Sil, & ! - ! nt_bgc_DMSPp, & ! trace gases (skeletal layer) - ! nt_bgc_DMSPd, & ! - ! nt_bgc_DMS, & ! - ! nt_bgc_PON, & ! zooplankton and detritus - ! nt_bgc_hum, & ! humic material - ! ! bio layer indicess - ! nlt_bgc_Nit, & ! nutrients - ! nlt_bgc_Am, & ! - ! nlt_bgc_Sil, & ! - ! nlt_bgc_DMSPp, & ! trace gases (skeletal layer) - ! nlt_bgc_DMSPd, & ! - ! nlt_bgc_DMS, & ! - ! nlt_bgc_PON, & ! zooplankton and detritus - ! nlt_bgc_hum, & ! humic material - ! nlt_chl_sw, & ! points to total chla in trcrn_sw - ! nt_zbgc_frac, & ! fraction of tracer in the mobile phase - ! nt_bgc_S, & ! Bulk salinity in fraction ice with dynamic salinity (Bio grid) - ! nt_bgc_N, & ! diatoms, phaeocystis, pico/small - ! nt_bgc_C, & ! diatoms, phaeocystis, pico/small - ! nt_bgc_chl, & ! diatoms, phaeocystis, pico/small - ! nlt_bgc_N, & ! diatoms, phaeocystis, pico/small - ! nlt_bgc_C, & ! diatoms, phaeocystis, pico/small - ! nlt_bgc_chl, & ! diatoms, phaeocystis, pico/small - ! nt_bgc_DOC, & ! dissolved organic carbon - ! nlt_bgc_DOC, & ! dissolved organic carbon - ! nt_bgc_DON, & ! dissolved organic nitrogen - ! nlt_bgc_DON, & ! dissolved organic nitrogen - ! nt_bgc_DIC, & ! dissolved inorganic carbon - ! nlt_bgc_DIC, & ! dissolved inorganic carbon - ! nt_bgc_Fed, & ! dissolved iron - ! nt_bgc_Fep, & ! particulate iron - ! nlt_bgc_Fed, & ! dissolved iron - ! nlt_bgc_Fep, & ! particulate iron - ! nt_zaero, & ! black carbon and other aerosols - ! nlt_zaero, & ! black carbon and other aerosols - ! nlt_zaero_sw ! black carbon and other aerosols - - use ice_colpkg, only: & - colpkg_init_tracer_indices - - type(ciceTracerObjectType), intent(in) :: & - tracerObject - - call colpkg_init_tracer_indices(& - tracerObject % index_surfaceTemperature, & - tracerObject % index_iceEnthalpy, & - tracerObject % index_snowEnthalpy, & - tracerObject % index_iceSalinity, & - tracerObject % index_brineFraction, & - tracerObject % index_iceAge, & - tracerObject % index_firstYearIceArea, & - tracerObject % index_levelIceArea, & - tracerObject % index_levelIceVolume, & - tracerObject % index_pondArea, & - tracerObject % index_pondDepth, & - tracerObject % index_pondLidThickness, & - tracerObject % index_aerosols, & - tracerObject % index_snowIceMass, & - tracerObject % index_snowLiquidMass, & - tracerObject % index_snowGrainRadius, & - tracerObject % index_snowDensity, & - tracerObject % index_verticalAerosolsConc, & - tracerObject % index_algaeConc, & - tracerObject % index_algalCarbon, & - tracerObject % index_algalChlorophyll, & - tracerObject % index_DOCConc, & - tracerObject % index_DONConc, & - tracerObject % index_DICConc, & - tracerObject % index_dissolvedIronConc, & - tracerObject % index_particulateIronConc, & - tracerObject % index_nitrateConc, & - tracerObject % index_ammoniumConc, & - tracerObject % index_silicateConc, & - tracerObject % index_DMSPpConc, & - tracerObject % index_DMSPdConc, & - tracerObject % index_DMSConc, & - tracerObject % index_humicsConc, & - tracerObject % index_nonreactiveConc, & - tracerObject % index_verticalAerosolsConcLayer, & - tracerObject % index_algaeConcLayer, & - tracerObject % index_algalCarbonLayer, & - tracerObject % index_algalChlorophyllLayer, & - tracerObject % index_DOCConcLayer, & - tracerObject % index_DONConcLayer, & - tracerObject % index_DICConcLayer, & - tracerObject % index_dissolvedIronConcLayer, & - tracerObject % index_particulateIronConcLayer, & - tracerObject % index_nitrateConcLayer, & - tracerObject % index_ammoniumConcLayer, & - tracerObject % index_silicateConcLayer, & - tracerObject % index_DMSPpConcLayer, & - tracerObject % index_DMSPdConcLayer, & - tracerObject % index_DMSConcLayer, & - tracerObject % index_humicsConcLayer, & - tracerObject % index_nonreactiveConcLayer, & - tracerObject % index_mobileFraction, & - tracerObject % index_verticalSalinity, & - tracerObject % index_chlorophyllShortwave, & - tracerObject % index_verticalAerosolsConcShortwave, & - tracerObject % nAlgaeIndex, & - tracerObject % nAlgalCarbonIndex, & - tracerObject % nAlgalChlorophyllIndex, & - tracerObject % nDOCIndex, & - tracerObject % nDONIndex, & - tracerObject % nDICIndex, & - tracerObject % nDissolvedIronIndex, & - tracerObject % nParticulateIronIndex, & - tracerObject % nzAerosolsIndex, & - tracerObject % index_LayerIndexToDataArray, & - tracerObject % index_LayerIndexToBioIndex, & - tracerObject % nBioTracers) - - !nt_Tsfc = tracerObject % index_surfaceTemperature - !nt_qice = tracerObject % index_iceEnthalpy - !nt_qsno = tracerObject % index_snowEnthalpy - !nt_sice = tracerObject % index_iceSalinity - !nt_iage = tracerObject % index_iceAge - !nt_FY = tracerObject % index_firstYearIceArea - !nt_alvl = tracerObject % index_levelIceArea - !nt_vlvl = tracerObject % index_levelIceVolume - !nt_apnd = tracerObject % index_pondArea - !nt_hpnd = tracerObject % index_pondDepth - !nt_ipnd = tracerObject % index_pondLidThickness - !nt_aero = tracerObject % index_aerosols - !nt_smice = tracerObject % index_snowIceMass - !nt_rsnw = tracerObject % index_snowGrainRadius - !nt_rhos = tracerObject % index_snowDensity - !nt_smliq = tracerObject % index_snowLiquidMass - !nt_fbri = tracerObject % index_brineFraction - !nt_zaeros = tracerObject % index_verticalAerosolsConc - !nt_bgc_N = tracerObject % index_algaeConc - !nt_bgc_C = tracerObject % index_algalCarbon - !nt_bgc_chl = tracerObject % index_algalChlorophyll - !nt_bgc_DOC = tracerObject % index_DOCConc - !nt_bgc_DON = tracerObject % index_DONConc - !nt_bgc_DIC = tracerObject % index_DICConc - !nt_bgc_Fed = tracerObject % index_dissolvedIronConc - !nt_bgc_Fep = tracerObject % index_particulateIronConc - !nt_bgc_Nit = tracerObject % index_nitrateConc - !nt_bgc_Am = tracerObject % index_ammoniumConc - !nt_bgc_Sil = tracerObject % index_silicateConc - !nt_bgc_DMSPp = tracerObject % index_DMSPpConc - !nt_bgc_DMSPd = tracerObject % index_DMSPdConc - !nt_bgc_DMS = tracerObject % index_DMSConc - !nt_bgc_hum = tracerObject % index_humicsConc - !nt_bgc_PON = tracerObject % index_nonreactiveConc - !nlt_zaero = tracerObject % index_verticalAerosolsConcLayer - !nlt_bgc_N = tracerObject % index_algaeConcLayer - !nlt_bgc_C = tracerObject % index_algalCarbonLayer - !nlt_bgc_chl = tracerObject % index_algalChlorophyllLayer - !nlt_bgc_DOC = tracerObject % index_DOCConcLayer - !nlt_bgc_DON = tracerObject % index_DONConcLayer - !nlt_bgc_DIC = tracerObject % index_DICConcLayer - !nlt_bgc_Fed = tracerObject % index_dissolvedIronConcLayer - !nlt_bgc_Fep = tracerObject % index_particulateIronConcLayer - !nlt_bgc_Nit = tracerObject % index_nitrateConcLayer - !nlt_bgc_Am = tracerObject % index_ammoniumConcLayer - !nlt_bgc_Sil = tracerObject % index_silicateConcLayer - !nlt_bgc_DMSPp = tracerObject % index_DMSPpConcLayer - !nlt_bgc_DMSPd = tracerObject % index_DMSPdConcLayer - !nlt_bgc_DMS = tracerObject % index_DMSConcLayer - !nlt_bgc_hum = tracerObject % index_humicsConcLayer - !nlt_bgc_PON = tracerObject % index_nonreactiveConcLayer - !nt_zbgc_frac = tracerObject % index_mobileFraction - !nt_zbgc_S = tracerObject % index_verticalSalinity - !nlt_chl_sw = tracerObject % index_chlorophyllShortwave - !nlt_zaero_sw = tracerObject % index_verticalAerosolsConcShortwave - !n_algae = tracerObject % nAlgaeIndex - !n_algae = tracerObject % nAlgalCarbonIndex - !n_algae = tracerObject % nAlgalChlorophyllIndex - !n_doc = tracerObject % nDOCIndex - !n_don = tracerObject % nDONIndex - !n_dic = tracerObject % nDICIndex - !n_fed = tracerObject % nDissolvedIronIndex - !n_fep = tracerObject % nParticulateIronIndex - !n_zaero = tracerObject % nzAerosolsIndex - !bio_index_o = tracerObject % index_LayerIndexToDataArray - !bio_index = tracerObject % index_LayerIndexToBioIndex - !nbtrcr = tracerObject % nBioTracers - - end subroutine init_column_package_tracer_indices - !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! init_icepack_package_tracer_indices From 961ca5907851d724e95ddff580e2c8a485494a54 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Thu, 16 Nov 2023 15:51:36 -0600 Subject: [PATCH 06/24] Updates mpas icepack bgc interface for optional arguments Most of the updates are for use in init_zbgc which now initializes many of the configs, indices and size declarations for bgc Contains updates to column package to make puny and accuracy consistent with carbon conservation check BFB with bgc and aerosols off --- components/mpas-seaice/src/build_options.mk | 2 +- .../mpas-seaice/src/column/ice_algae.F90 | 12 +- .../src/shared/mpas_seaice_icepack.F | 180 +++++++----------- .../src/shared/mpas_seaice_initialize.F | 4 - 4 files changed, 78 insertions(+), 120 deletions(-) diff --git a/components/mpas-seaice/src/build_options.mk b/components/mpas-seaice/src/build_options.mk index 5f2bdcfe2771..0ef6fc91e5d7 100644 --- a/components/mpas-seaice/src/build_options.mk +++ b/components/mpas-seaice/src/build_options.mk @@ -3,7 +3,7 @@ ifeq "$(ROOT_DIR)" "" endif EXE_NAME=seaice_model NAMELIST_SUFFIX=seaice -FCINCLUDES += -I$(ROOT_DIR)/column -I$(ROOT_DIR)/shared -I$(ROOT_DIR)/analysis_members -I$(ROOT_DIR)/model_forward +FCINCLUDES += -I$(ROOT_DIR)/icepack/columnphysics -I$(ROOT_DIR)/column -I$(ROOT_DIR)/shared -I$(ROOT_DIR)/analysis_members -I$(ROOT_DIR)/model_forward override CPPFLAGS += -DCORE_SEAICE -DUSE_SNICARHC ifneq "$(ESM)" "" override CPPFLAGS += -Dcoupled -DCCSMCOUPLED diff --git a/components/mpas-seaice/src/column/ice_algae.F90 b/components/mpas-seaice/src/column/ice_algae.F90 index ec7afff60733..78dce86e2d31 100644 --- a/components/mpas-seaice/src/column/ice_algae.F90 +++ b/components/mpas-seaice/src/column/ice_algae.F90 @@ -304,7 +304,7 @@ subroutine zbio (dt, nblyr, & carbonError = carbonInitial-carbonFlux*dt-carbonFinal - if (abs(carbonError) > accuracy * maxval ((/carbonInitial, carbonFinal/))) then + if (abs(carbonError) > max(puny,accuracy * maxval ((/carbonInitial, carbonFinal/)))) then write(warning,*) 'carbonError:', carbonError call add_warning(warning) write(warning,*) 'carbonInitial:', carbonInitial @@ -315,6 +315,8 @@ subroutine zbio (dt, nblyr, & call add_warning(warning) write(warning,*) 'accuracy * maxval ((/carbonInitial, carbonFinal/:)', accuracy * maxval ((/carbonInitial, carbonFinal/)) call add_warning(warning) + write(warning,*) 'puny', puny + call add_warning(warning) if (aicen > c0) then hsnow_f = vsnon/aicen write(warning,*) 'after z_biogeochemistry' @@ -1016,7 +1018,7 @@ subroutine z_biogeochemistry (n_cat, dt, & ! local parameters real (kind=dbl_kind), parameter :: & - accuracy = 1.0e-14_dbl_kind, & + accuracy = 1.0e-13_dbl_kind, & ! 1.0e-14_dbl_kind, & r_c = 3.0e3_dbl_kind , & ! ice crystal radius (um) r_bac= 4.7_dbl_kind , & ! diatom large radius (um) r_alg= 10.0_dbl_kind , & ! diatom small radius (um) @@ -1062,7 +1064,7 @@ subroutine z_biogeochemistry (n_cat, dt, & iphin_N(k) = iphin(k) bphin_N(1) = bphi_min - if (abs(trcrn(bio_index(m) + k-1)) < puny) then + if (abs(trcrn(bio_index(m) + k-1)) < accuracy) then flux_bio(m) = flux_bio(m) + trcrn(bio_index(m) + k-1)* hbri_old * dz(k)/dt trcrn(bio_index(m) + k-1) = c0 in_init_cons(k,m) = c0 @@ -1410,7 +1412,7 @@ subroutine z_biogeochemistry (n_cat, dt, & do m = 1,nbtrcr do k = 1,nblyr+1 ! back to bulk quantity bio_tmp = (biomat_brine(k,m) + react(k,m))*iphin_N(k) - if (tr_bgc_C .and. m .eq. nlt_bgc_DIC(1) .and. bio_tmp < -puny) then ! satisfy DIC demands from ocean + if (tr_bgc_C .and. m .eq. nlt_bgc_DIC(1) .and. bio_tmp .le. -accuracy) then ! satisfy DIC demands from ocean write(warning, *) 'DIC demand from ocean' call add_warning(warning) write(warning, *) 'm, nlt_bgc_DIC(1), bio_tmp, react(k,m):' @@ -1453,7 +1455,7 @@ subroutine z_biogeochemistry (n_cat, dt, & call add_warning(warning) l_stop = .true. stop_label = 'C in algal_dyn not conserved' - elseif (abs(bio_tmp) < puny) then + elseif (abs(bio_tmp) < accuracy) then flux_bio(m) = flux_bio(m) + bio_tmp*dz(k)*hbri/dt bio_tmp = c0 elseif (bio_tmp > 1.0e8_dbl_kind) then diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 79f5452c7309..fa228e9daf37 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -3590,11 +3590,6 @@ subroutine column_biogeochemistry(domain) nBioLayers, & nBioLayersP1, & nAlgae, & - nDOC, & - nDIC, & - nDON, & - nParticulateIron, & - nDissolvedIron, & maxBCType, & maxDustType @@ -3603,7 +3598,6 @@ subroutine column_biogeochemistry(domain) real(kind=RKIND), dimension(:), pointer :: & netNitrateUptake, & netAmmoniumUptake, & - totalVerticalSalinity, & netSpecificAlgalGrowthRate, & primaryProduction, & netBrineHeight, & @@ -3759,11 +3753,6 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_dimension(mesh, "nBioLayers", nBioLayers) call MPAS_pool_get_dimension(mesh, "nBioLayersP1", nBioLayersP1) call MPAS_pool_get_dimension(mesh, "nAlgae", nAlgae) - call MPAS_pool_get_dimension(mesh, "nDOC", nDOC) - call MPAS_pool_get_dimension(mesh, "nDIC", nDIC) - call MPAS_pool_get_dimension(mesh, "nDON", nDON) - call MPAS_pool_get_dimension(mesh, "nParticulateIron", nParticulateIron) - call MPAS_pool_get_dimension(mesh, "nDissolvedIron", nDissolvedIron) call MPAS_pool_get_dimension(mesh, "maxBCType", maxBCType) call MPAS_pool_get_dimension(mesh, "maxDustType", maxDustType) @@ -3779,7 +3768,6 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(biogeochemistry, "newlyFormedIce", newlyFormedIce) call MPAS_pool_get_array(biogeochemistry, "netNitrateUptake", netNitrateUptake) call MPAS_pool_get_array(biogeochemistry, "netAmmoniumUptake", netAmmoniumUptake) - call MPAS_pool_get_array(biogeochemistry, "totalVerticalSalinity", totalVerticalSalinity) call MPAS_pool_get_array(biogeochemistry, "totalChlorophyll", totalChlorophyll) call MPAS_pool_get_array(biogeochemistry, "netSpecificAlgalGrowthRate", netSpecificAlgalGrowthRate) call MPAS_pool_get_array(biogeochemistry, "primaryProduction", primaryProduction) @@ -3940,14 +3928,11 @@ subroutine column_biogeochemistry(domain) call icepack_warnings_clear() call icepack_biogeochemistry(& dt=config_dt, & - ntrcr=ciceTracerObject % nTracers, & - nbtrcr=ciceTracerObject % nBioTracers, & upNO=netNitrateUptake(iCell), & upNH=netAmmoniumUptake(iCell), & iDi=bioDiffusivity(:,:,iCell), & iki=bioPermeability(:,:,iCell), & zfswin=bioShortwaveFlux(:,:,iCell), & - zsal_tot=totalVerticalSalinity(iCell), & darcy_V=darcyVelocityBio(:,iCell), & grow_net=netSpecificAlgalGrowthRate(iCell), & PP_net=primaryProduction(iCell), & @@ -3973,14 +3958,7 @@ subroutine column_biogeochemistry(domain) nblyr=nBioLayers, & nilyr=nIceLayers, & nslyr=nSnowLayers, & - n_algae=nAlgae, & - n_zaero=nzAerosols, & ncat=nCategories, & - n_doc=nDOC, & - n_dic=nDIC, & - n_don=nDON, & - n_fed=nDissolvedIron, & - n_fep=nParticulateIron, & meltbn=basalIceMeltCategory(:,iCell), & melttn=surfaceIceMeltCategory(:,iCell), & congeln=congelationCategory(:,iCell), & @@ -3990,7 +3968,6 @@ subroutine column_biogeochemistry(domain) Tf=seaFreezingTemperature(iCell), & fsnow=snowfallRate(iCell), & meltsn=snowMeltCategory(:,iCell), & - !initialSalinityProfile(:,iCell), & !!!! hin_old=iceThicknessCategoryInitial(:,iCell), & flux_bio=oceanBioFluxes(:,iCell), & flux_bio_atm=atmosBioFluxes(:,iCell), & @@ -4002,7 +3979,6 @@ subroutine column_biogeochemistry(domain) aice0=openWaterArea(iCell), & trcrn=tracerArrayCategory, & vsnon_init=snowVolumeCategoryInitial(:,iCell), & - skl_bgc=config_use_skeletal_biochemistry, & flux_bion=oceanBioFluxesCategory(:,:,iCell), & bioPorosityIceCell=bgridPorosityIceCell(:,iCell), & bioSalinityIceCell=bgridSalinityIceCell(:,iCell), & @@ -5569,22 +5545,12 @@ subroutine seaice_icepack_init_ocean_conc(& oceanNitrateConc, & oceanSilicateConc,& oceanZAerosolConc, & - maxDICType, & - maxDONType, & - maxIronType, & - maxAerosolType, & carbonToNitrogenRatioAlgae, & carbonToNitrogenRatioDON) use icepack_intfc, only: & icepack_init_ocean_bio - integer, intent(in) :: & - maxDICType, & - maxDONType, & - maxIronType, & - maxAerosolType - real(kind=RKIND), intent(out):: & oceanAmmoniumConc, & ! ammonium oceanDMSPConc, & ! DMSPp @@ -5620,10 +5586,6 @@ subroutine seaice_icepack_init_ocean_conc(& nit=oceanNitrateConc, & sil=oceanSilicateConc,& zaeros=oceanZAerosolConc, & - max_dic=maxDICType, & - max_don=maxDONType, & - max_fe=maxIronType, & - max_aero=maxAerosolType, & CToN=carbonToNitrogenRatioAlgae, & CToN_DON=carbonToNitrogenRatioDON) @@ -14787,86 +14749,86 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) nblyr=nBioLayers, & nilyr=nIceLayers, & nslyr=nSnowLayers, & - n_algae=nAlgae, & - n_zaero=nzAerosols, & - n_doc=nDOC, & - n_dic=nDIC, & - n_don=nDON, & - n_fed=nDissolvedIron, & - n_fep=nParticulateIron, & + n_algae_in=nAlgae, & + n_zaero_in=nzAerosols, & + n_doc_in=nDOC, & + n_dic_in=nDIC, & + n_don_in=nDON, & + n_fed_in=nDissolvedIron, & + n_fep_in=nParticulateIron, & trcr_base=tracerObject % firstAncestorMask, & trcr_depend=tracerObject % parentIndex, & n_trcr_strata=tracerObject % ancestorNumber, & nt_strata=tracerObject % ancestorIndices, & - nbtrcr_sw=tracerObject % nBioTracersShortwave, & - tr_brine=config_use_brine, & - nt_fbri=tracerObject % index_brineFraction,& - ntrcr=tracerObject % nTracers, & - nbtrcr=tracerObject % nBioTracers, & - nt_bgc_Nit=tracerObject % index_nitrateConc, & - nt_bgc_Am=tracerObject % index_ammoniumConc, & - nt_bgc_Sil=tracerObject % index_silicateConc, & - nt_bgc_DMS=tracerObject % index_DMSConc, & - nt_bgc_PON=tracerObject % index_nonreactiveConc, & - nt_bgc_S=tracerObject % index_verticalSalinity, & - nt_bgc_N=tracerObject % index_algaeConc, & - nt_bgc_C=tracerObject % index_algalCarbon, & - nt_bgc_chl=tracerObject % index_algalChlorophyll, & - nt_bgc_DOC=tracerObject % index_DOCConc, & - nt_bgc_DON=tracerObject % index_DONConc, & - nt_bgc_DIC=tracerObject % index_DICConc, & - nt_zaero=tracerObject % index_verticalAerosolsConc, & - nt_bgc_DMSPp=tracerObject % index_DMSPpConc, & - nt_bgc_DMSPd=tracerObject % index_DMSPdConc, & - nt_bgc_Fed=tracerObject % index_dissolvedIronConc, & - nt_bgc_Fep=tracerObject % index_particulateIronConc, & - nt_zbgc_frac=tracerObject % index_mobileFraction, & - tr_bgc_Nit=config_use_nitrate, & - tr_bgc_Am=config_use_ammonium, & - tr_bgc_Sil=config_use_silicate, & - tr_bgc_DMS=config_use_DMS, & - tr_bgc_PON=config_use_nonreactive, & - tr_bgc_N=use_nitrogen, & - tr_bgc_C=config_use_carbon, & - tr_bgc_chl=config_use_chlorophyll, & - tr_bgc_DON=config_use_DON, & - tr_bgc_Fe=config_use_iron,& - tr_zaero=config_use_zaerosols, & - nlt_zaero_sw=tracerObject % index_verticalAerosolsConcShortwave, & - nlt_chl_sw=tracerObject % index_chlorophyllShortwave, & - nlt_bgc_N=tracerObject % index_algaeConcLayer, & - nlt_bgc_Nit=tracerObject % index_nitrateConcLayer, & - nlt_bgc_Am=tracerObject % index_ammoniumConcLayer, & - nlt_bgc_Sil=tracerObject % index_silicateConcLayer, & - nlt_bgc_DMS=tracerObject % index_DMSConcLayer, & - nlt_bgc_DMSPp=tracerObject % index_DMSPpConcLayer, & - nlt_bgc_DMSPd=tracerObject % index_DMSPdConcLayer, & - nlt_bgc_C=tracerObject % index_algalCarbonLayer, & - nlt_bgc_chl=tracerObject % index_algalChlorophyllLayer, & - nlt_bgc_DIC=tracerObject % index_DICConcLayer, & - nlt_bgc_DOC=tracerObject % index_DOCConcLayer, & - nlt_bgc_PON=tracerObject % index_nonreactiveConcLayer, & - nlt_bgc_DON=tracerObject % index_DONConcLayer, & - nlt_bgc_Fed=tracerObject % index_dissolvedIronConcLayer, & - nlt_bgc_Fep=tracerObject % index_particulateIronConcLayer, & - nlt_zaero=tracerObject % index_verticalAerosolsConcLayer, & - nt_bgc_hum=tracerObject % index_humicsConc, & - nlt_bgc_hum=tracerObject % index_humicsConcLayer, & - tr_bgc_hum=config_use_humics, & - skl_bgc=config_use_skeletal_biochemistry, & - z_tracers=config_use_vertical_tracers, & - dEdd_algae=config_use_shortwave_bioabsorption, & - solve_zbgc=config_use_vertical_biochemistry, & - frazil_scav_in=config_fraction_biotracer_in_frazil, & - initbio_frac_in=config_new_ice_fraction_biotracer, & + nbtrcr_sw_out=tracerObject % nBioTracersShortwave, & + tr_brine_in=config_use_brine, & + nt_fbri_out=tracerObject % index_brineFraction,& + ntrcr_out=tracerObject % nTracers, & + nbtrcr_out=tracerObject % nBioTracers, & + ntrcr_o_out=tracerObject % nTracersNotBio, & + nt_bgc_Nit_out=tracerObject % index_nitrateConc, & + nt_bgc_Am_out=tracerObject % index_ammoniumConc, & + nt_bgc_Sil_out=tracerObject % index_silicateConc, & + nt_bgc_DMS_out=tracerObject % index_DMSConc, & + nt_bgc_PON_out=tracerObject % index_nonreactiveConc, & + nt_bgc_N_out=tracerObject % index_algaeConc, & + nt_bgc_C_out=tracerObject % index_algalCarbon, & + nt_bgc_chl_out=tracerObject % index_algalChlorophyll, & + nt_bgc_DOC_out=tracerObject % index_DOCConc, & + nt_bgc_DON_out=tracerObject % index_DONConc, & + nt_bgc_DIC_out=tracerObject % index_DICConc, & + nt_zaero_out=tracerObject % index_verticalAerosolsConc, & + nt_bgc_DMSPp_out=tracerObject % index_DMSPpConc, & + nt_bgc_DMSPd_out=tracerObject % index_DMSPdConc, & + nt_bgc_Fed_out=tracerObject % index_dissolvedIronConc, & + nt_bgc_Fep_out=tracerObject % index_particulateIronConc, & + nt_zbgc_frac_out=tracerObject % index_mobileFraction, & + tr_bgc_Nit_in=config_use_nitrate, & + tr_bgc_Am_in=config_use_ammonium, & + tr_bgc_Sil_in=config_use_silicate, & + tr_bgc_DMS_in=config_use_DMS, & + tr_bgc_PON_in=config_use_nonreactive, & + tr_bgc_N_in=use_nitrogen, & + tr_bgc_C_in=config_use_carbon, & + tr_bgc_chl_in=config_use_chlorophyll, & + tr_bgc_DON_in=config_use_DON, & + tr_bgc_Fe_in=config_use_iron,& + tr_zaero_in=config_use_zaerosols, & + nlt_zaero_sw_out=tracerObject % index_verticalAerosolsConcShortwave, & + nlt_chl_sw_out=tracerObject % index_chlorophyllShortwave, & + nlt_bgc_N_out=tracerObject % index_algaeConcLayer, & + nlt_bgc_Nit_out=tracerObject % index_nitrateConcLayer, & + nlt_bgc_Am_out=tracerObject % index_ammoniumConcLayer, & + nlt_bgc_Sil_out=tracerObject % index_silicateConcLayer, & + nlt_bgc_DMS_out=tracerObject % index_DMSConcLayer, & + nlt_bgc_DMSPp_out=tracerObject % index_DMSPpConcLayer, & + nlt_bgc_DMSPd_out=tracerObject % index_DMSPdConcLayer, & + nlt_bgc_C_out=tracerObject % index_algalCarbonLayer, & + nlt_bgc_chl_out=tracerObject % index_algalChlorophyllLayer, & + nlt_bgc_DIC_out=tracerObject % index_DICConcLayer, & + nlt_bgc_DOC_out=tracerObject % index_DOCConcLayer, & + nlt_bgc_PON_out=tracerObject % index_nonreactiveConcLayer, & + nlt_bgc_DON_out=tracerObject % index_DONConcLayer, & + nlt_bgc_Fed_out=tracerObject % index_dissolvedIronConcLayer, & + nlt_bgc_Fep_out=tracerObject % index_particulateIronConcLayer, & + nlt_zaero_out=tracerObject % index_verticalAerosolsConcLayer, & + nt_bgc_hum_out=tracerObject % index_humicsConc, & + nlt_bgc_hum_out=tracerObject % index_humicsConcLayer, & + tr_bgc_hum_in=config_use_humics, & + skl_bgc_in=config_use_skeletal_biochemistry, & + z_tracers_in=config_use_vertical_tracers, & + dEdd_algae_in=config_use_shortwave_bioabsorption, & + solve_zbgc_in=config_use_vertical_biochemistry, & bio_index_o_out=tracerObject % index_LayerIndexToDataArray, & bio_index_out=tracerObject % index_LayerIndexToBioIndex, & - ntrcr_o=tracerObject % nTracersNotBio, & + frazil_scav_in=config_fraction_biotracer_in_frazil, & + initbio_frac_in=config_new_ice_fraction_biotracer, & max_algae_in=maxAlgaeType, & max_doc_in=maxDOCType, & max_dic_in=maxDICType, & max_don_in=maxDONType, & max_fe_in=maxIronType, & + max_aero_in=maxAerosolType, & ratio_Si2N_diatoms_in=config_ratio_Si_to_N_diatoms, & ratio_Si2N_sp_in=config_ratio_Si_to_N_small_plankton, & ratio_Si2N_phaeo_in=config_ratio_Si_to_N_phaeocystis, & @@ -15143,6 +15105,7 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP1", nBioLayersP1) call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP2", nBioLayersP2) call MPAS_pool_get_dimension(block % dimensions, "nShortwaveBio", nShortwaveBio) + call icepack_init_hbrine(& bgrid=biologyGrid, & igrid=interfaceBiologyGrid, & @@ -15188,11 +15151,8 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) ncat=nCategories, & nblyr=nBioLayers, & nilyr=nIceLayers, & - ntrcr_o=tracerObject % nTracersNotBio, & cgrid=verticalGrid, & igrid=interfaceBiologyGrid, & - ntrcr=tracerObject % nTracers, & - nbtrcr=tracerObject % nBiotracers, & sicen=iceSalinity(:,:,iCell), & trcrn=tracerArrayCategory(tracerObject % nTracersNotBio+1:tracerObject % nTracers,:), & sss=seaSurfaceSalinity(iCell), & diff --git a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F index e2ca0dbf2216..3ae1c14aec9f 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F @@ -2747,10 +2747,6 @@ subroutine initialize_coupler_fields(domain) oceanNitrateConc(iCell), & oceanSilicateConc(iCell),& oceanZAerosolConc(:,iCell), & - maxDICType, & - maxDONType, & - maxIronType, & - maxAerosolType, & carbonToNitrogenRatioAlgae, & carbonToNitrogenRatioDON) From 5f73ff08a62fd0b2decd2eaa72af98746b985f4e Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Mon, 11 Dec 2023 14:57:29 -0600 Subject: [PATCH 07/24] Added bgc parameter checks Removed zsalinity references BFB --- .../src/shared/mpas_seaice_icepack.F | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index fa228e9daf37..0588cc790eef 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -14406,6 +14406,7 @@ end subroutine seaice_column_reinitialize_oceanic_fluxes subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) use icepack_intfc, only: icepack_init_zbgc + use icepack_intfc, only: icepack_query_parameters type(domain_type), intent(in) :: & domain @@ -14558,6 +14559,10 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) nTracers_temp, & iAerosols + real(kind=RKIND) :: & + rtmp1, & + rtmp2 + ! save tracer array size nTracers_temp = tracerObject % nTracers tracerObject % nTracers = tracerObject % nTracersNotBio @@ -14933,6 +14938,20 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) messageType=MPAS_LOG_CRIT, intArgs=(/nTracers_temp, tracerObject % nTracers/)) endif + call mpas_log_write(" ----- compare values after init_zbgc -----") + + rtmp1 = config_new_ice_fraction_biotracer + call icepack_query_parameters(initbio_frac_out=rtmp2) + if (rtmp1 /= rtmp2) call mpas_log_write('initbio_frac differs $r $r',realArgs=(/rtmp1,rtmp2/)) + + rtmp1 = config_rapid_mobile_to_stationary_time + call icepack_query_parameters(tau_min_out=rtmp2) + if (rtmp1 /= rtmp2) call mpas_log_write('tau_min differs $r $r',realArgs=(/rtmp1,rtmp2/)) + + rtmp1 = config_long_mobile_to_stationary_time + call icepack_query_parameters(tau_max_out=rtmp2) + if (rtmp1 /= rtmp2) call mpas_log_write('tau_max differs $r $r',realArgs=(/rtmp1,rtmp2/)) + end subroutine init_column_tracer_object_for_biogeochemistry !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| @@ -14970,10 +14989,8 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) logical, pointer :: & config_use_brine, & -! config_use_vertical_zsalinity, & !echmod deprecate config_use_vertical_tracers, & config_use_skeletal_biochemistry, & - config_do_restart_zsalinity, & config_do_restart_hbrine real(kind=RKIND), pointer :: & @@ -15041,9 +15058,7 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) abortMessage call MPAS_pool_get_config(domain % configs, "config_use_brine", config_use_brine) - call MPAS_pool_get_config(domain % configs, "config_do_restart_zsalinity", config_do_restart_zsalinity) call MPAS_pool_get_config(domain % configs, "config_do_restart_hbrine", config_do_restart_hbrine) -! call MPAS_pool_get_config(domain % configs, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) !echmod deprecate call MPAS_pool_get_config(domain % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) call MPAS_pool_get_config(domain % configs, "config_use_vertical_tracers", config_use_vertical_tracers) call MPAS_pool_get_config(domain % configs, "config_dt", config_dt) From a90e0e6301ab194b2878b093f15c5834a837bd53 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Wed, 13 Mar 2024 12:37:01 -0500 Subject: [PATCH 08/24] More changes for the icepack BGC interface Added flag to turn off BGC coupling between the ocean and sea ice: config_couple_bgc_fields=false Added black carbon conservation analysis member -track ocean black carbon flux Added carbon conservation check options in interfaces for both icepack and column Bugfixes to column package version: 1. Bugfixes to lateral melt BGC snow flux and ice flux 2. Bugfix to add_new_ice_bgc -replaces adjust_tracer_profile with simpler and more accurate version update_vertical_bio_tracers Define carbon molar mass in mpas constants Commented out problematic omp directives in icepack interface Corrections to some bgc Registry descriptions (still more to do) NOTE: Changed submodule path for Icepack to a branch that works with the BGC interface. nonBFB with BGC --- .gitmodules | 2 +- components/mpas-seaice/bld/build-namelist | 10 +- .../mpas-seaice/bld/build-namelist-section | 2 +- .../namelist_defaults_mpassi.xml | 2 +- .../namelist_definition_mpassi.xml | 16 +- components/mpas-seaice/cime_config/buildnml | 9 + components/mpas-seaice/driver/ice_comp_mct.F | 22 +- components/mpas-seaice/src/Registry.xml | 62 +- .../Registry_seaice_conservation_check.xml | 108 + .../mpas_seaice_conservation_check.F | 577 ++++- .../mpas-seaice/src/column/ice_algae.F90 | 9 +- .../mpas-seaice/src/column/ice_colpkg.F90 | 5 +- .../mpas-seaice/src/column/ice_therm_itd.F90 | 10 +- .../mpas-seaice/src/column/ice_zbgc.F90 | 214 +- .../src/shared/mpas_seaice_column.F | 342 ++- .../src/shared/mpas_seaice_constants.F | 2 +- .../src/shared/mpas_seaice_icepack.F | 2286 ++++------------- 17 files changed, 1607 insertions(+), 2071 deletions(-) diff --git a/.gitmodules b/.gitmodules index 2652b041ac83..84c10e97a8c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,7 +76,7 @@ [submodule "components/mpas-seaice/src/icepack"] path = components/mpas-seaice/src/icepack url = git@github.com:E3SM-Project/Icepack.git - branch = origin/njeffery/merge-fixes-to-bgc + branch = njeffery/merge-fixes-to-bgc [submodule "externals/haero"] path = externals/haero url = git@github.com:eagles-project/haero.git diff --git a/components/mpas-seaice/bld/build-namelist b/components/mpas-seaice/bld/build-namelist index 71f8a0e8c87f..d8bfcaa68c05 100755 --- a/components/mpas-seaice/bld/build-namelist +++ b/components/mpas-seaice/bld/build-namelist @@ -628,12 +628,7 @@ add_default($nl, 'config_recover_tracer_means_check'); ################################## # Namelist group: column_package # ################################## - -if ($ice_bgc eq 'ice_bgc') { - add_default($nl, 'config_column_physics_type', 'val'=>"column_package"); -} else { - add_default($nl, 'config_column_physics_type'); -} +add_default($nl, 'config_column_physics_type'); add_default($nl, 'config_use_column_shortwave'); add_default($nl, 'config_use_column_vertical_thermodynamics'); if ($ice_bgc eq 'ice_bgc') { @@ -681,6 +676,7 @@ if ($ice_bgc eq 'ice_bgc') { add_default($nl, 'config_use_humics', 'val'=>".true."); add_default($nl, 'config_use_DON', 'val'=>".true."); add_default($nl, 'config_use_iron', 'val'=>".true."); + add_default($nl, 'config_couple_biogeochemistry_fields'); } else { add_default($nl, 'config_use_vertical_biochemistry', 'val'=>".false."); add_default($nl, 'config_use_vertical_tracers', 'val'=>".false."); @@ -694,6 +690,7 @@ if ($ice_bgc eq 'ice_bgc') { add_default($nl, 'config_use_humics', 'val'=>".false."); add_default($nl, 'config_use_DON', 'val'=>".false."); add_default($nl, 'config_use_iron', 'val'=>".false."); + add_default($nl, 'config_couple_biogeochemistry_fields', 'val'=>".false."); } add_default($nl, 'config_use_chlorophyll'); add_default($nl, 'config_use_macromolecules'); @@ -943,7 +940,6 @@ if ($iceberg_mode eq 'data') { add_default($nl, 'config_use_data_icebergs', 'val'=>"false"); } add_default($nl, 'config_salt_flux_coupling_type'); -add_default($nl, 'config_couple_biogeochemistry_fields'); add_default($nl, 'config_ice_ocean_drag_coefficient'); ############################### diff --git a/components/mpas-seaice/bld/build-namelist-section b/components/mpas-seaice/bld/build-namelist-section index 28a6053f050a..8b6a06dd6740 100644 --- a/components/mpas-seaice/bld/build-namelist-section +++ b/components/mpas-seaice/bld/build-namelist-section @@ -193,6 +193,7 @@ add_default($nl, 'config_use_floe_size_distribution'); # Namelist group: biogeochemistry # ################################### +add_default($nl, 'config_couple_biogeochemistry_fields'); add_default($nl, 'config_use_brine'); add_default($nl, 'config_use_vertical_zsalinity'); add_default($nl, 'config_use_vertical_biochemistry'); @@ -447,7 +448,6 @@ add_default($nl, 'config_min_friction_velocity'); add_default($nl, 'config_ocean_heat_transfer_type'); add_default($nl, 'config_sea_freezing_temperature_type'); add_default($nl, 'config_ocean_surface_type'); -add_default($nl, 'config_couple_biogeochemistry_fields'); add_default($nl, 'config_use_data_icebergs'); add_default($nl, 'config_salt_flux_coupling_type'); add_default($nl, 'config_ice_ocean_drag_coefficient'); diff --git a/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml b/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml index e7abd738eb26..118cc1e2581e 100644 --- a/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml +++ b/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml @@ -203,6 +203,7 @@ false +false false false false @@ -430,7 +431,6 @@ 'constant' 'mushy' 'free' -false false 'constant' 0.00536 diff --git a/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml b/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml index 53649226f8eb..bee39c08070e 100644 --- a/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml +++ b/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml @@ -955,6 +955,14 @@ Default: Defined in namelist_defaults.xml + +Couple ocean and seaice biogeochemical fields + +Valid values: true or false +Default: Defined in namelist_defaults.xml + + Use the brine height tracer @@ -2654,14 +2662,6 @@ Valid values: 'free' or 'non-free' Default: Defined in namelist_defaults.xml - - - -Valid values: true or false -Default: Defined in namelist_defaults.xml - - Use data iceberg meltwater forcing diff --git a/components/mpas-seaice/cime_config/buildnml b/components/mpas-seaice/cime_config/buildnml index 8a890c9ce474..955a64144f72 100755 --- a/components/mpas-seaice/cime_config/buildnml +++ b/components/mpas-seaice/cime_config/buildnml @@ -688,6 +688,15 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append(' ') lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') lines.append('') lines.append('') lines.append(' - + + - + + + @@ -5306,7 +5328,7 @@ type="real" dimensions="nZBGCTracers nCategories nCells Time" units="mmol m-2 s-1" - description="Tracers are ordered: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon, ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m2/s, particulate iron in umol/m2/s, humic carbon, black carbon1 in mg/m2/s, black carbon2 in mg/m2/s, dust1 in mg/m2/s, dust2 in mg/m2/s, dust3 in mg/m2/s, dust4 in mg/m2/s" + description="Only bio tracers used in the order: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon, dissolved inorganic carbon,ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m2/s, particulate iron in umol/m2/s, humic carbon, black carbon1 in mg/m2/s, black carbon2 in mg/m2/s, dust1 in mg/m2/s, dust2 in mg/m2/s, dust3 in mg/m2/s, dust4 in mg/m2/s" icepack_name="flux_bion" packages="pkgColumnBiogeochemistry;pkgColumnPackage" /> @@ -5314,7 +5336,23 @@ type="real" dimensions="nZBGCTracers nCells Time" units="mmol m-3" - description="Tracers are ordered: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon, ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m3, particulate iron in umol/m3, humic carbon, black carbon1 in mg/m3, black carbon2 in mg/m3,dust1 in mg/m3, dust2 in mg/m3, dust3 in mg/m3, dust4 in mg/m3" + description="All bio tracers including those not used in the order: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon, dissolved inorganic carbon,ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m3, particulate iron in umol/m3, humic carbon, black carbon1 in mg/m3, black carbon2 in mg/m3,dust1 in mg/m3, dust2 in mg/m3, dust3 in mg/m3, dust4 in mg/m3" + icepack_name="ocean_bio" + packages="pkgColumnBiogeochemistry;pkgColumnPackage" + /> + + @@ -5426,6 +5464,10 @@ type="real" dimensions="nCells Time" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \brief Compute MPAS-Seaice analysis member +!> \author Nicole Jeffery +!> \date 11 Mar 2024 +!> \details +!> This routine conducts all computations to verify black carbon conservation +! +!----------------------------------------------------------------------- + + subroutine black_carbon_conservation(domain, err) + + type (domain_type), intent(inout) :: & + domain + + integer, intent(out) :: & + err !< Output: error flag + + type(block_type), pointer :: & + blockPtr + + type(MPAS_pool_type), pointer :: & + conservationCheckBlackCarbonAMPool, & + conservationCheckAMPool, & + conservationCheckAreaAMPool + + real(kind=RKIND), dimension(:), pointer :: & + initialBlackCarbon, & + finalBlackCarbon, & + blackCarbonChange, & + blackCarbonChangeFlux, & + netBlackCarbonFlux, & + absoluteBlackCarbonError, & + relativeBlackCarbonError, & + iceAreaCell, & + iceAreaCellInitial, & + accumAbsoluteBlackCarbonError, & + accumRelativeBlackCarbonError + + real(kind=RKIND), dimension(:), pointer :: & + blackCarbonConsAtmBlackCarbonFlux, & + blackCarbonConsOceanBlackCarbonFlux, & + blackCarbonConsAtmBC1Flux, & + blackCarbonConsAtmBC2Flux + + real(kind=RKIND), dimension(:), allocatable :: & + sumArray, & + sumArrayOut + + type(MPAS_pool_type), pointer :: & + meshPool, & + tracersAggregatePool, & + biogeochemistryPool, & + icestatePool + + real(kind=RKIND), dimension(:), pointer :: & + areaCell, & + totalAtmBlackCarbonFlux, & + totalOceanBlackCarbonFlux, & + oceanBlackCarbonFlux + + real(kind=RKIND), dimension(:,:), pointer :: & + atmosBlackCarbonFlux + + integer, dimension(:,:), pointer :: & + cellInHemisphere + + real(kind=RKIND), pointer :: & + dt, & + earthArea + + logical, pointer :: & + config_AM_conservationCheck_write_to_logfile + + real(kind=RKIND) :: & + totalAtmBlackCarbonCell, & + totalAtmBC1Cell, & + totalAtmBC2Cell, & + totalOceanBlackCarbonCell + + integer, pointer :: & + nCellsSolve, & + nHemispheres, & + nAccumulate + + type (MPAS_Time_Type) :: & + currTime, & + startTime + + integer :: & + iCell, & + iHemisphere, & + iSumPrev, & + ierr + + integer :: & + nVars, & + nZBGC, & + nSums + + real(kind=RKIND) :: & + fluxScale + + character(len=strKIND) :: & + timeStr, & + timeStrStart + + character(len=16) :: & + valStr + + err = 0 + + call MPAS_pool_get_config(domain % configs, "config_dt", dt) + call MPAS_pool_get_config(domain % configs, "config_AM_conservationCheck_write_to_logfile", & + config_AM_conservationCheck_write_to_logfile) + + !------------------------------------------------------------- + ! Net carbon flux to ice + !------------------------------------------------------------- + + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nHemispheres", nHemispheres) + + nVars = 4 + + nSums = nHemispheres * nVars + + allocate(sumArray(nSums)) + allocate(sumArrayOut(nSums)) + + sumArray = 0.0_RKIND + + blockPtr => domain % blocklist + do while (associated(blockPtr)) + + call MPAS_pool_get_dimension(blockPtr % dimensions, "nCellsSolve", nCellsSolve) + + call MPAS_pool_get_subpool(blockPtr % structs, "mesh", meshPool) + call MPAS_pool_get_subpool(blockPtr % structs, "biogeochemistry", biogeochemistryPool) + call MPAS_pool_get_subpool(blockPtr % structs, "tracers_aggregate", tracersAggregatePool) + call MPAS_pool_get_subpool(blockPtr % structs, "icestate", icestatePool) + call MPAS_pool_get_subpool(blockPtr % structs, "conservationCheckAM", conservationCheckAMPool) + + + call MPAS_pool_get_array(tracersAggregatePool, "iceAreaCell", iceAreaCell) + call MPAS_pool_get_array(icestatePool, "iceAreaCellInitial", iceAreaCellInitial) + call MPAS_pool_get_array(meshPool, "areaCell", areaCell) + call MPAS_pool_get_array(biogeochemistryPool, "totalAtmBlackCarbonFlux", totalAtmBlackCarbonFlux) + call MPAS_pool_get_array(biogeochemistryPool, "totalOceanBlackCarbonFlux", totalOceanBlackCarbonFlux) + call MPAS_pool_get_array(biogeochemistryPool, "atmosBlackCarbonFlux", atmosBlackCarbonFlux) + call MPAS_pool_get_array(biogeochemistryPool, "oceanBlackCarbonFlux", oceanBlackCarbonFlux) + call MPAS_pool_get_array(conservationCheckAMPool, "cellInHemisphere", cellInHemisphere) + + do iCell = 1, nCellsSolve + + ! compute total black carbon flux to ocean from individual fluxes + + nZBGC = 1 + totalAtmBC1Cell = atmosBlackCarbonFlux(nZBGC,iCell) * areaCell(iCell)* & + iceAreaCellInitial(iCell) + nZBGC = nZBGC+1 + totalAtmBC2Cell = atmosBlackCarbonFlux(nZBGC,iCell) * areaCell(iCell)* & + iceAreaCellInitial(iCell) + totalOceanBlackCarbonCell = oceanBlackCarbonFlux(iCell) * areaCell(iCell)* & + iceAreaCell(iCell) + totalAtmBlackCarbonCell = totalAtmBC1Cell + totalAtmBC2Cell + + do iHemisphere = 1, nHemispheres + iSumPrev = (iHemisphere-1) * nVars + if (cellInHemisphere(iHemisphere,iCell) == 1) then + sumArray(iSumPrev+1) = sumArray(iSumPrev+1) + totalAtmBlackCarbonCell + sumArray(iSumPrev+2) = sumArray(iSumPrev+2) + totalAtmBC1Cell + sumArray(iSumPrev+3) = sumArray(iSumPrev+3) + totalAtmBC2Cell + sumArray(iSumPrev+4) = sumArray(iSumPrev+4) + totalOceanBlackCarbonCell + endif + enddo ! iHemisphere + + enddo ! iCell + + blockPtr => blockPtr % next + enddo + + ! perform the sums over processors + call MPAS_dmpar_sum_real_array(domain % dminfo, nSums, sumArray, sumArrayOut) + + ! accumulate fluxes + call MPAS_pool_get_subpool(domain % blocklist % structs, "conservationCheckBlackCarbonAM", conservationCheckBlackCarbonAMPool) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonConsOceanBlackCarbonFlux", blackCarbonConsOceanBlackCarbonFlux) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonConsAtmBlackCarbonFlux", blackCarbonConsAtmBlackCarbonFlux) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonConsAtmBC1Flux", blackCarbonConsAtmBC1Flux) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonConsAtmBC2Flux", blackCarbonConsAtmBC2Flux) + + do iHemisphere = 1, nHemispheres + iSumPrev = (iHemisphere-1) * nVars + blackCarbonConsAtmBlackCarbonFlux(iHemisphere) = blackCarbonConsAtmBlackCarbonFlux(iHemisphere) + sumArrayOut(iSumPrev+1) + blackCarbonConsAtmBC1Flux(iHemisphere) = blackCarbonConsAtmBC1Flux(iHemisphere) + sumArrayOut(iSumPrev+2) + blackCarbonConsAtmBC2Flux(iHemisphere) = blackCarbonConsAtmBC2Flux(iHemisphere) + sumArrayOut(iSumPrev+3) + blackCarbonConsOceanBlackCarbonFlux(iHemisphere) = blackCarbonConsOceanBlackCarbonFlux(iHemisphere) + sumArrayOut(iSumPrev+4) + enddo ! iHemisphere + + ! cleanup + deallocate(sumArray) + deallocate(sumArrayOut) + + !------------------------------------------------------------- + ! Black carbon conservation error + !------------------------------------------------------------- + + if (MPAS_stream_mgr_ringing_alarms(domain % streamManager, "conservationCheckOutput", ierr=ierr)) then + + ! convert fluxes to fluxes per m2 of whole earth and per second + call MPAS_pool_get_subpool(domain % blocklist % structs, "conservationCheckAM", conservationCheckAMPool) + call MPAS_pool_get_array(conservationCheckAMPool, "nAccumulate", nAccumulate) + call MPAS_pool_get_subpool(domain % blocklist % structs, "conservationCheckAreaAM", conservationCheckAreaAMPool) + call MPAS_pool_get_array(conservationCheckAreaAMPool, "earthArea", earthArea) + fluxScale = 1.0_RKIND / (earthArea * real(nAccumulate)) + + ! get initial black carbon content + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "initialBlackCarbon", initialBlackCarbon) + + ! get final black carbon content + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "finalBlackCarbon", finalBlackCarbon) + call compute_total_black_carbon(domain, finalBlackCarbon) + + ! compute the black carbon content change + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonChange", blackCarbonChange) + blackCarbonChange(:) = finalBlackCarbon(:) - initialBlackCarbon(:) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonChangeFlux", blackCarbonChangeFlux) + blackCarbonChangeFlux(:) = blackCarbonChange(:) * (fluxScale / dt) + + ! calculate the final net black carbon flux to the ice + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "netBlackCarbonFlux", netBlackCarbonFlux) + netBlackCarbonFlux(:) = blackCarbonConsAtmBlackCarbonFlux(:) & + - blackCarbonConsOceanBlackCarbonFlux(:) + + ! absolute error + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "absoluteBlackCarbonError", absoluteBlackCarbonError) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "accumAbsoluteBlackCarbonError", accumAbsoluteBlackCarbonError) + absoluteBlackCarbonError(:) = netBlackCarbonFlux(:) * dt - blackCarbonChange(:) + + ! rescale fluxes + blackCarbonConsOceanBlackCarbonFlux(:) = blackCarbonConsOceanBlackCarbonFlux(:) * fluxScale + blackCarbonConsAtmBlackCarbonFlux(:) = blackCarbonConsAtmBlackCarbonFlux(:) * fluxScale + blackCarbonConsAtmBC1Flux(:) = blackCarbonConsAtmBC1Flux(:) * fluxScale + blackCarbonConsAtmBC2Flux(:) = blackCarbonConsAtmBC2Flux(:) * fluxScale + netBlackCarbonFlux(:) = netBlackCarbonFlux(:) * fluxScale + + ! compute the final black carbon error + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "relativeBlackCarbonError", relativeBlackCarbonError) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "accumRelativeBlackCarbonError", accumRelativeBlackCarbonError) + do iHemisphere = 1, nHemispheres + if (abs(finalBlackCarbon(iHemisphere)) > 0.0) then + relativeBlackCarbonError(iHemisphere) = absoluteBlackCarbonError(iHemisphere) / finalBlackCarbon(iHemisphere) + else + relativeBlackCarbonError(iHemisphere) = 0.0_RKIND + endif + enddo ! iHemisphere + + startTime = mpas_get_clock_time(domain % clock, MPAS_START_TIME, ierr=ierr) + currTime = mpas_get_clock_time(domain % clock, MPAS_NOW, ierr=ierr) + + call MPAS_get_time(currTime, dateTimeString=timeStr, ierr=ierr) + call MPAS_get_time(startTime, dateTimeString=timeStrStart, ierr=ierr) + + if (trim(timeStr) /= trim(timeStrStart)) then + accumRelativeBlackCarbonError(:) = accumRelativeBlackCarbonError(:) + relativeBlackCarbonError(:) + accumAbsoluteBlackCarbonError(:) = accumAbsoluteBlackCarbonError(:) + absoluteBlackCarbonError(:) + !------------------------------------------------------------- + ! Output to log file + !------------------------------------------------------------- + + if (config_AM_conservationCheck_write_to_logfile) then + + call mpas_log_write('-----------------------------------------------------------------------------') + call mpas_log_write(' Black carbon conservation check') + call mpas_log_write(' ') + call mpas_log_write(' Initial black carbon (kg) = '//trim(hemisphere_format(initialBlackCarbon))) + call mpas_log_write(' Final black carbon (kg) = '//trim(hemisphere_format(finalBlackCarbon))) + call mpas_log_write(' Black carbon change (kg) = '//trim(hemisphere_format(blackCarbonChange))) + call mpas_log_write(' Black carbon change flux (kg/m2s) = '//trim(hemisphere_format(blackCarbonChangeFlux))) + call mpas_log_write(' ') + call mpas_log_write(' Ocean black carbon flux (kg/m2s) = '//trim(hemisphere_format(blackCarbonConsOceanBlackCarbonFlux))) + call mpas_log_write(' Atmos black carbon flux (kg/m2s) = '//trim(hemisphere_format(blackCarbonConsAtmBlackCarbonFlux))) + call mpas_log_write(' Net black carbon flux (kg/m2s) = '//trim(hemisphere_format(netBlackCarbonFlux))) + call mpas_log_write(' ') + call mpas_log_write(' Individual atmosphere black carbon fluxes :') + call mpas_log_write(' Atmos BC1 flux (kg/m2s) = '//trim(hemisphere_format(blackCarbonConsAtmBC1Flux))) + call mpas_log_write(' Atmos BC2 flux (kg/m2s) = '//trim(hemisphere_format(blackCarbonConsAtmBC2Flux))) + call mpas_log_write(' ') + + call mpas_log_write(' Net black carbon change (kg) = '//trim(hemisphere_format((netBlackCarbonFlux * dt) / fluxScale))) + call mpas_log_write(' Net black carbon flux (kg/m2s) = '//trim(hemisphere_format(netBlackCarbonFlux))) + call mpas_log_write(' ') + call mpas_log_write(' Absolute black carbon error (kg) = '//trim(hemisphere_format(absoluteBlackCarbonError))) + call mpas_log_write(' Absolute BC error/s (kg/m2s) = '//trim(hemisphere_format((absoluteBlackCarbonError * fluxScale) / dt))) + call mpas_log_write(' Relative black carbon error = '//trim(hemisphere_format(relativeBlackCarbonError))) + + call mpas_log_write(' ') + call mpas_log_write(' Total run accumulated error ') + call mpas_log_write(' Accum. abs black carbon error(kg) = '//trim(hemisphere_format(accumAbsoluteBlackCarbonError))) + call mpas_log_write(' Accum. rel black carbon error = '//trim(hemisphere_format(accumRelativeBlackCarbonError))) + endif + endif + endif + + end subroutine black_carbon_conservation + !*********************************************************************** ! ! routine compute_total_energy @@ -2800,6 +3132,100 @@ subroutine compute_total_carbon(domain, totalCarbon) end subroutine compute_total_carbon +!*********************************************************************** +! +! routine compute_total_black_carbon +! +!> \brief Compute total black carbon +!> \author Nicole Jeffery +!> \date 11 Mar 2024 +!> \details +!> Calculate the total black carbon +! +!----------------------------------------------------------------------- + + subroutine compute_total_black_carbon(domain, totalBlackCarbon) + + type (domain_type), intent(inout) :: & + domain + + real(kind=RKIND), dimension(:), intent(out) :: & + totalBlackCarbon + + type(block_type), pointer :: & + blockPtr + + type(MPAS_pool_type), pointer :: & + meshPool, & + biogeochemistryPool, & + conservationCheckAMPool + + integer, pointer :: & + nCellsSolve, & + nHemispheres + + real(kind=RKIND), dimension(:), pointer :: & + totalBlackCarbonContentCell, & + areaCell + + integer, dimension(:,:), pointer :: & + cellInHemisphere + + integer :: & + iCell, & + iHemisphere + + real(kind=RKIND) :: & + blackCarbonCell + + real(kind=RKIND), dimension(:), allocatable :: & + blackCarbon + + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nHemispheres", nHemispheres) + + allocate(blackCarbon(nHemispheres)) + blackCarbon(:) = 0.0_RKIND + + blockPtr => domain % blocklist + do while (associated(blockPtr)) + + call MPAS_pool_get_subpool(blockPtr % structs, "mesh", meshPool) + call MPAS_pool_get_subpool(blockPtr % structs, "biogeochemistry", biogeochemistryPool) + call MPAS_pool_get_subpool(blockPtr % structs, "conservationCheckAM", conservationCheckAMPool) + + call MPAS_pool_get_dimension(blockPtr % dimensions, 'nCellsSolve', nCellsSolve) + call MPAS_pool_get_dimension(blockPtr % dimensions, 'nHemispheres', nHemispheres) + + call MPAS_pool_get_array(meshPool, "areaCell", areaCell) + call MPAS_pool_get_array(biogeochemistryPool, "totalBlackCarbonContentCell", totalBlackCarbonContentCell) + call MPAS_pool_get_array(conservationCheckAMPool, "cellInHemisphere", cellInHemisphere) + + call compute_black_carbon_cell(blockPtr,totalBlackCarbonContentCell) + + do iCell = 1, nCellsSolve + + ! black carbon mass (kg) + blackCarbonCell = totalBlackCarbonContentCell(iCell) * areaCell(iCell) + + do iHemisphere = 1, nHemispheres + if (cellInHemisphere(iHemisphere,iCell) == 1) then + blackCarbon(iHemisphere) = blackCarbon(iHemisphere) + blackCarbonCell + endif + enddo ! iHemisphere + + enddo ! iCell + + blockPtr => blockPtr % next + enddo + + ! sum across processors + call MPAS_dmpar_sum_real_array(domain % dminfo, nHemispheres, blackCarbon, totalBlackCarbon) + + ! clean up + deallocate(blackCarbon) + + end subroutine compute_total_black_carbon + !*********************************************************************** ! ! compute_carbon_cell @@ -3059,6 +3485,127 @@ subroutine compute_carbon_cell(blockPtr,totalCarbonContentCell) end subroutine compute_carbon_cell +!*********************************************************************** +! +! compute_black_carbon_cell +! +!> \brief +!> \author Nicole Jeffery, LANL +!> \date 11 Mar 2024 +!> \details Calculate the total carbon concentration in the sea ice cell +!> by summing the appropriate biogeochemical tracers in units of kg C +!> +!> Total black carbon = black carbon 1 + black carbon 2 +! +!----------------------------------------------------------------------- + + subroutine compute_black_carbon_cell(blockPtr,totalBlackCarbonContentCell) + + real(kind=RKIND), dimension(:), intent(out) :: & + totalBlackCarbonContentCell + + type(block_type), intent(in) :: & + blockPtr + + logical, pointer :: & + config_use_zaerosols + + integer, pointer :: & + nBioLayersP1, & + nBioLayersP3, & + nBioLayers, & + nzAerosols, & + maxBCType, & + TWO + + type(MPAS_pool_type), pointer :: & + mesh, & + biogeochemistry, & + tracers_aggregate + + real(kind=RKIND), dimension(:), pointer :: & + brineFractionCell, & + iceVolumeCell, & + snowVolumeCell + + real(kind=RKIND), dimension(:,:), pointer :: & + verticalAerosolsConcCell + + integer, pointer :: & + nCellsSolve, & + nSnowLayers + + real(kind=RKIND), dimension(:), allocatable :: & + verticalGridSpace + + real(kind=RKIND) :: & + snowleveltop, & + snowlevelint + + integer :: & + iBioTracers, & + iBioCount, & + iBioData, & + iCell, & + nBC + + call MPAS_pool_get_config(blockPtr % configs, "config_use_zaerosols",config_use_zaerosols) + + call MPAS_pool_get_dimension(blockPtr % dimensions, "nBioLayers", nBioLayers) + call MPAS_pool_get_dimension(blockPtr % dimensions, "nBioLayersP1", nBioLayersP1) + call MPAS_pool_get_dimension(blockPtr % dimensions, "nBioLayersP3", nBioLayersP3) + call MPAS_pool_get_dimension(blockPtr % dimensions, "nzAerosols", nzAerosols) + call MPAS_pool_get_dimension(blockPtr % dimensions, "maxBCType", maxBCType) + call MPAS_pool_get_dimension(blockPtr % dimensions, "TWO", TWO) + + call MPAS_pool_get_subpool(blockPtr % structs, "tracers_aggregate", tracers_aggregate) + call MPAS_pool_get_subpool(blockPtr % structs, "mesh", mesh) + call MPAS_pool_get_subpool(blockPtr % structs, "biogeochemistry", biogeochemistry) + + call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) + call MPAS_pool_get_dimension(mesh, 'nSnowLayers', nSnowLayers) + + call MPAS_pool_get_array(tracers_aggregate, "verticalAerosolsConcCell", verticalAerosolsConcCell) + call MPAS_pool_get_array(tracers_aggregate, "brineFractionCell", brineFractionCell) + call MPAS_pool_get_array(tracers_aggregate, "iceVolumeCell", iceVolumeCell) + call MPAS_pool_get_array(tracers_aggregate, "snowVolumeCell", snowVolumeCell) + + allocate(verticalGridSpace(nBioLayersP1)) + + verticalGridSpace(:) = 1.0_RKIND/real(nBioLayers,kind=RKIND) + verticalGridSpace(1) = verticalGridSpace(1)/2.0_RKIND + verticalGridSpace(nBioLayersP1) = verticalGridSpace(1) + + totalBlackCarbonContentCell(:) = 0.0_RKIND + + if (config_use_zaerosols) then + nBC = min(nzAerosols,maxBCType) + do iCell = 1, nCellsSolve + iBioCount = 0 + + ! BC + snowleveltop = snowVolumeCell(iCell)/real(nSnowLayers,kind=RKIND)/2.0_RKIND + snowlevelint = snowVolumeCell(iCell) - snowleveltop + do iBioTracers = 1, nBC + iBioData = (iBioTracers-1)*nBioLayersP3 + ! ice BC + do iBioCount = 1, nBioLayersP1 + totalBlackCarbonContentCell(iCell) = totalBlackCarbonContentCell(iCell) + & + verticalAerosolsConcCell(iBioData + iBioCount,iCell) * verticalGridSpace(iBioCount) * & + iceVolumeCell(iCell) * brineFractionCell(iCell) + end do + ! snow BC + totalBlackCarbonContentCell(iCell) = totalBlackCarbonContentCell(iCell) + & + verticalAerosolsConcCell(iBioData+nBioLayersP1+1,iCell) * snowleveltop + & + verticalAerosolsConcCell(iBioData+nBioLayersP1+2,iCell) * snowlevelint + enddo + enddo + endif + + deallocate(verticalGridSpace) + + end subroutine compute_black_carbon_cell + !*********************************************************************** ! ! routine reset_accumulated_variables @@ -3082,7 +3629,8 @@ subroutine reset_accumulated_variables(domain) conservationCheckEnergyAMPool, & conservationCheckMassAMPool, & conservationCheckSaltAMPool, & - conservationCheckCarbonAMPool + conservationCheckCarbonAMPool, & + conservationCheckBlackCarbonAMPool integer, pointer :: & nAccumulate @@ -3125,6 +3673,12 @@ subroutine reset_accumulated_variables(domain) carbonConsHumicsFlux, & carbonConsSemiLabileDOCFlux + real(kind=RKIND), dimension(:), pointer :: & + blackCarbonConsOceanBlackCarbonFlux, & + blackCarbonConsAtmBlackCarbonFlux, & + blackCarbonConsAtmBC1Flux, & + blackCarbonConsAtmBC2Flux + ! number of accumulations call MPAS_pool_get_subpool(domain % blocklist % structs, "conservationCheckAM", conservationCheckAMPool) call MPAS_pool_get_array(conservationCheckAMPool, "nAccumulate", nAccumulate) @@ -3209,6 +3763,19 @@ subroutine reset_accumulated_variables(domain) carbonConsHumicsFlux(:) = 0.0_RKIND carbonConsSemiLabileDOCFlux(:) = 0.0_RKIND + ! black carbon + + call MPAS_pool_get_subpool(domain % blocklist % structs, "conservationCheckBlackCarbonAM", conservationCheckBlackCarbonAMPool) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonConsOceanBlackCarbonFlux", blackCarbonConsOceanBlackCarbonFlux) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonConsAtmBlackCarbonFlux", blackCarbonConsAtmBlackCarbonFlux) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonConsAtmBC1Flux", blackCarbonConsAtmBC1Flux) + call MPAS_pool_get_array(conservationCheckBlackCarbonAMPool, "blackCarbonConsAtmBC2Flux", blackCarbonConsAtmBC2Flux) + + blackCarbonConsOceanBlackCarbonFlux(:) = 0.0_RKIND + blackCarbonConsAtmBlackCarbonFlux(:) = 0.0_RKIND + blackCarbonConsAtmBC1Flux(:) = 0.0_RKIND + blackCarbonConsAtmBC2Flux(:) = 0.0_RKIND + end subroutine reset_accumulated_variables !*********************************************************************** diff --git a/components/mpas-seaice/src/column/ice_algae.F90 b/components/mpas-seaice/src/column/ice_algae.F90 index 78dce86e2d31..e3fb475d72bf 100644 --- a/components/mpas-seaice/src/column/ice_algae.F90 +++ b/components/mpas-seaice/src/column/ice_algae.F90 @@ -1325,7 +1325,8 @@ subroutine z_biogeochemistry (n_cat, dt, & trcrn(nt_zbgc_frac+mm-1) = zbgc_frac_init(mm) if (sum_tot > c0) trcrn(nt_zbgc_frac+mm-1) = sum_new/sum_tot - if (abs(sum_initial-sum_tot-flux_bio(mm)*dt + source(mm)) > accuracy*max(sum_initial,sum_tot) .or. & + if (abs(sum_initial-sum_tot-flux_bio(mm)*dt + source(mm)) > accuracy*max(sum_initial,sum_tot) .\ +or. & ! if (abs(sum_new-sum_old) > accuracy*sum_old .or. & minval(biocons(:)) < c0 .or. minval(initcons_stationary(:)) < c0 & .or. l_stop) then @@ -2874,8 +2875,8 @@ subroutine check_conservation_FCT & C_low(k) = C_new(k) enddo - accuracy = 1.0e-14_dbl_kind*max(c1, C_init_tot, C_new_tot) - fluxbio = (C_init_tot - C_new_tot + source)/dt + accuracy = 1.0e-11_dbl_kind*max(c1, C_init_tot, C_new_tot) + fluxbio = fluxbio + (C_init_tot - C_new_tot + source)/dt diff_dt =C_new_tot - C_init_tot - (S_top+S_bot+L_bot*C_new(nblyr+1)+L_top*C_new(1))*dt if (minval(C_low) < c0) then @@ -2885,7 +2886,7 @@ subroutine check_conservation_FCT & endif if (abs(diff_dt) > accuracy ) then - !l_stop = .true. + l_stop = .true. write(warning,*) 'Conservation of zbgc low order solution failed: diff_dt:',& diff_dt call add_warning(warning) diff --git a/components/mpas-seaice/src/column/ice_colpkg.F90 b/components/mpas-seaice/src/column/ice_colpkg.F90 index ce21d8a69eab..ee140abdbf7f 100644 --- a/components/mpas-seaice/src/column/ice_colpkg.F90 +++ b/components/mpas-seaice/src/column/ice_colpkg.F90 @@ -5459,7 +5459,8 @@ subroutine colpkg_biogeochemistry(dt, & upNO, upNH, iDi, iki, zfswin, & zsal_tot, darcy_V, grow_net, & PP_net, hbri,dhbr_bot, dhbr_top, Zoo,& - fbio_snoice, fbio_atmice, ocean_bio, & + fbio_snoice, fbio_atmice, & + ocean_bio, & first_ice, fswpenln, bphi, bTiz, ice_bio_net, & snow_bio_net, totalChla, fswthrun, Rayleigh_criteria, & sice_rho, fzsal, fzsal_g, & @@ -5816,7 +5817,7 @@ subroutine colpkg_biogeochemistry(dt, & n_don, & n_fed, n_fep, & n_zaero, first_ice(n), & - hin_old(n), ocean_bio(:), & + hin_old(n), ocean_bio(1:nbtrcr), & bphi(:,n), iphin, & iDi(:,n), sss, & fswpenln(:,n), & diff --git a/components/mpas-seaice/src/column/ice_therm_itd.F90 b/components/mpas-seaice/src/column/ice_therm_itd.F90 index 81930d017e49..7adcbc9c1c66 100644 --- a/components/mpas-seaice/src/column/ice_therm_itd.F90 +++ b/components/mpas-seaice/src/column/ice_therm_itd.F90 @@ -913,7 +913,9 @@ subroutine lateral_melt (dt, ncat, & dvint ! snow interior layer real (kind=dbl_kind), dimension (ncat) :: & - vicen_init ! volume per unit area of ice (m) + vicen_init, & ! initial volume per unit area of ice (m) + aicen_init, & ! initial area + vsnon_init ! initial volume of snow (m) if (rside > c0) then ! grid cells with lateral melting. @@ -944,6 +946,8 @@ subroutine lateral_melt (dt, ncat, & ! state variables vicen_init(n) = vicen(n) + aicen_init(n) = aicen(n) + vsnon_init(n) = vsnon(n) aicen(n) = aicen(n) * (c1 - rside) vicen(n) = vicen(n) * (c1 - rside) vsnon(n) = vsnon(n) * (c1 - rside) @@ -980,8 +984,8 @@ subroutine lateral_melt (dt, ncat, & !----------------------------------------------------------------- if (z_tracers) then ! snow tracers - dvssl = min(p5*vsnon(n)/real(nslyr,kind=dbl_kind), hs_ssl*aicen(n)) !snow surface layer - dvint = vsnon(n)- dvssl !snow interior + dvssl = min(p5*vsnon_init(n)/real(nslyr,kind=dbl_kind), hs_ssl*aicen_init(n)) !snow surface layer + dvint = vsnon_init(n)- dvssl !snow interior do k = 1, nbtrcr flux_bio(k) = flux_bio(k) & + (trcrn(bio_index(k)+nblyr+1,n)*dvssl & diff --git a/components/mpas-seaice/src/column/ice_zbgc.F90 b/components/mpas-seaice/src/column/ice_zbgc.F90 index e8cef6dcad9f..de31fbf702f7 100644 --- a/components/mpas-seaice/src/column/ice_zbgc.F90 +++ b/components/mpas-seaice/src/column/ice_zbgc.F90 @@ -11,6 +11,7 @@ module ice_zbgc use ice_kinds_mod use ice_zbgc_shared ! everything + use ice_warnings, only: add_warning implicit none @@ -109,7 +110,8 @@ subroutine add_new_ice_bgc (dt, nblyr, & location , & ! 1 (add frazil to bottom), 0 (add frazil throughout) n , & ! ice category index k , & ! ice layer index - m + m , & + nbiolayer real (kind=dbl_kind) :: & vbri1 , & ! starting volume of existing brine @@ -119,12 +121,14 @@ subroutine add_new_ice_bgc (dt, nblyr, & real (kind=dbl_kind) :: & vsurp , & ! volume of new ice added to each cat vtmp ! total volume of new and old ice - + real (kind=dbl_kind), dimension (ncat) :: & - vbrin ! trcrn(nt_fbri,n)*vicen(n) + vbrin , & ! trcrn(nt_fbri,n)*vicen(n) + brine_frac_init ! initial trcrn(nt_fbri,n) real (kind=dbl_kind) :: & - vice_new ! vicen_init + vsurp + vice_new , & ! vicen_init + vsurp + bio0new ! ocean_bio * zbgc_init_fac real (kind=dbl_kind) :: & Tmlts ! melting temperature (oC) @@ -132,9 +136,8 @@ subroutine add_new_ice_bgc (dt, nblyr, & character (len=char_len) :: & fieldid ! field identifier - real (kind=dbl_kind), dimension (nbtrcr) :: & - total_bio_initial, & ! Initial column bio concentration (mmol/m2) - total_bio_final ! final column bio concentration (mmol/m2) + character(len=char_len_long) :: & + warning real (kind=dbl_kind), dimension (nblyr+1) :: & zspace ! vertical grid spacing @@ -152,19 +155,13 @@ subroutine add_new_ice_bgc (dt, nblyr, & if (tr_brine) vbrin(n) = trcrn(nt_fbri,n)*vicen_init(n) enddo - do m = 1, nbtrcr - total_bio_initial(m) = c0 - do n = 1, ncat - do k = 1, nblyr+1 - total_bio_initial(m) = total_bio_initial(m) + vbrin(n) * zspace(k)*trcrn(bio_index(m)+k-1,n) - enddo - enddo - enddo - call column_sum (ncat, vbrin, vbri_init) vbri_init = vbri_init + vi0_init + do k = 1, nbtrcr + flux_bio(k) = flux_bio(k) - vi0_init/dt*ocean_bio(k)*zbgc_init_frac(k) + enddo !----------------------------------------------------------------- ! Distribute bgc in new ice volume among all ice categories by ! increasing ice thickness, leaving ice area unchanged. @@ -178,34 +175,27 @@ subroutine add_new_ice_bgc (dt, nblyr, & vtmp = c0 do n = 1,ncat - - if (hsurp > c0) then + brine_frac_init(n) = c1 + if (hsurp > c0) then ! add ice to all categories vtmp = vbrin(n) - vsurp = hsurp * aicen_init(n) + vsurp = hsurp * aicen_init(n) vbrin(n) = vbrin(n) + vsurp vice_new = vicen_init(n) + vsurp - if (tr_brine .and. vicen(n) > c0) then - trcrn(nt_fbri,n) = vbrin(n)/vicen(n) + if (tr_brine .and. vice_new > c0) then ! NJvicen(n) > c0) then + brine_frac_init(n) = trcrn(nt_fbri,n) !NJ + trcrn(nt_fbri,n) = vbrin(n)/vice_new !NJ vicen(n) elseif (tr_brine .and. vicen(n) <= c0) then trcrn(nt_fbri,n) = c1 endif - if (nbtrcr > 0) then - location = 1 - call adjust_tracer_profile(nbtrcr, dt, ntrcr, & - aicen_init(n), & - vbrin(n), & - vice_new, & - trcrn(:,n), & - vtmp, & - vsurp, sss, & - nilyr, nblyr, & - solve_zsal, bgrid, & - cgrid, & - ocean_bio, igrid, & - location, & - l_stop, stop_label) + if (nbtrcr > 0) then + do m = 1, nbtrcr + bio0new = ocean_bio(m)*zbgc_init_frac(m) + nbiolayer = nblyr+1 + call update_vertical_bio_tracers(nbiolayer, trcrn(bio_index(m):bio_index(m) + nblyr,n), & + vtmp, vbrin(n), bio0new,zspace(:)) + enddo !nbtrcr if (l_stop) return endif ! nbtrcr endif ! hsurp > 0 @@ -214,36 +204,30 @@ subroutine add_new_ice_bgc (dt, nblyr, & !----------------------------------------------------------------- ! Combine bgc in new ice grown in open water with category 1 ice. !----------------------------------------------------------------- - + if (vi0new > c0) then - vbri1 = vbrin(1) + vbri1 = vbrin(1) vbrin(1) = vbrin(1) + vi0new if (tr_brine .and. vicen(1) > c0) then trcrn(nt_fbri,1) = vbrin(1)/vicen(1) elseif (tr_brine .and. vicen(1) <= c0) then trcrn(nt_fbri,1) = c1 endif - + ! Diffuse_bio handles concentration changes from ice growth/melt ! ice area changes ! add salt throughout, location = 0 - if (nbtrcr > 0) then - location = 0 - call adjust_tracer_profile(nbtrcr, dt, ntrcr, & - aicen(1), & - vbrin(1), & - vicen(1), & - trcrn(:,1), & - vbri1, & - vi0new, sss, & - nilyr, nblyr, & - solve_zsal, bgrid, & - cgrid, & - ocean_bio, igrid, & - location, & - l_stop, stop_label) + if (nbtrcr > 0 .and. vbrin(1) > c0) then + do m = 1, nbtrcr + bio0new = ocean_bio(m)*zbgc_init_frac(m) + do k = 1, nblyr+1 + trcrn(bio_index(m) + k-1,1) = & + (trcrn(bio_index(m) + k-1,1)*vbri1 + bio0new * vi0new)/vbrin(1) + enddo + enddo + if (l_stop) return if (solve_zsal .and. vsnon1 .le. c0) then @@ -253,16 +237,6 @@ subroutine add_new_ice_bgc (dt, nblyr, & endif ! nbtrcr > 0 endif ! vi0new > 0 - do m = 1, nbtrcr - total_bio_final(m) = c0 - do n = 1, ncat - do k = 1, nblyr+1 - total_bio_final(m) = total_bio_final(m) + trcrn(nt_fbri,n) * vicen(n) *zspace(k)*trcrn(bio_index(m)+k-1,n) - enddo - enddo - flux_bio(m) = flux_bio(m) + (total_bio_initial(m) - total_bio_final(m))/dt - enddo - if (tr_brine .and. l_conservation_check) then call column_sum (ncat, vbrin, vbri_final) @@ -320,10 +294,6 @@ subroutine lateral_melt_bgc (dt, & ! local variables - real (kind=dbl_kind) :: & - total_bio_initial, & ! initial column tracer concentration (mmol/m2) - total_bio_final ! final column tracer concentration (mmol/m20 - integer (kind=int_kind) :: & k , & ! layer index m , & ! @@ -332,9 +302,12 @@ subroutine lateral_melt_bgc (dt, & real (kind=dbl_kind), dimension (nblyr+1) :: & zspace ! vertical grid spacing + character(len=char_len_long) :: & + warning + zspace(:) = c1/real(nblyr,kind=dbl_kind) - zspace(1) = p5*zspace(1) - zspace(nblyr+1) = p5*zspace(nblyr+1) + zspace(1) = p5*zspace(2) + zspace(nblyr+1) = p5*zspace(nblyr) if (solve_zsal) then do n = 1, ncat @@ -347,15 +320,13 @@ subroutine lateral_melt_bgc (dt, & endif do m = 1, nbtrcr - total_bio_initial = c0 - total_bio_final = c0 do n = 1, ncat do k = 1, nblyr+1 - total_bio_initial = total_bio_initial + trcrn(nt_fbri,n) * vicen_init(n) *zspace(k)*trcrn(bio_index(m)+k-1,n) - total_bio_final = total_bio_final + trcrn(nt_fbri,n) * vicen(n) *zspace(k)*trcrn(bio_index(m)+k-1,n) + flux_bio(m) = flux_bio(m) + trcrn(nt_fbri,n) & + * vicen_init(n)*zspace(k)*trcrn(bio_index(m)+k-1,n) & + * rside/dt enddo - enddo - flux_bio(m) = flux_bio(m) + (total_bio_initial - total_bio_final)/dt + enddo enddo end subroutine lateral_melt_bgc @@ -462,7 +433,7 @@ subroutine adjust_tracer_profile (nbtrcr, dt, ntrcr, & hbri_old = vtmp if (solve_zsal) then top_conc = sss * salt_loss - do k = 1, nblyr + do k = 1, nblyr S_stationary(k) = trcrn(nt_bgc_S+k-1)* hbri_old enddo call regrid_stationary (S_stationary, hbri_old, & @@ -472,7 +443,7 @@ subroutine adjust_tracer_profile (nbtrcr, dt, ntrcr, & bgrid(2:nblyr+1), fluxb,& l_stop, stop_label) if (l_stop) return - do k = 1, nblyr + do k = 1, nblyr trcrn(nt_bgc_S+k-1) = S_stationary(k)/hbri trtmp0(nt_sice+k-1) = trcrn(nt_bgc_S+k-1) enddo @@ -480,7 +451,7 @@ subroutine adjust_tracer_profile (nbtrcr, dt, ntrcr, & do m = 1, nbtrcr top_conc = ocean_bio(m)*zbgc_init_frac(m) - do k = 1, nblyr+1 + do k = 1, nblyr+1 C_stationary(k) = trcrn(bio_index(m) + k-1)* hbri_old enddo !k call regrid_stationary (C_stationary, hbri_old, & @@ -789,6 +760,91 @@ subroutine merge_bgc_fluxes_skl (ntrcr, & enddo end subroutine merge_bgc_fluxes_skl +!======================================================================= +! +! Given some added new ice to the base of the existing ice, recalculate +! vertical bio tracer so that new grid cells are all the same size. +! +! author: N. Jeffery, LANL +! + subroutine update_vertical_bio_tracers(nbiolyr, trc, h1, h2, trc0, zspace) + + use ice_constants_colpkg, only: c0 + + integer (kind=int_kind), intent(in) :: & + nbiolyr ! number of bio layers nblyr+1 + + real (kind=dbl_kind), dimension(:), intent(inout) :: & + trc ! vertical tracer + + real (kind=dbl_kind), intent(in) :: & + h1, & ! old thickness + h2, & ! new thickness + trc0 ! tracer value of added ice on ice bottom + + real (kind=dbl_kind), dimension(nbiolyr), intent(in) :: & + zspace + + ! local variables + + real(kind=dbl_kind), dimension(nbiolyr) :: trc2 ! updated tracer temporary + + ! vertical indices for old and new grid + integer :: k1, k2 + + real (kind=dbl_kind) :: & + z1a, z1b, & ! upper, lower boundary of old cell/added new ice at bottom + z2a, z2b, & ! upper, lower boundary of new cell + overlap , & ! overlap between old and new cell + rnilyr + + !rnilyr = real(nilyr,dbl_kind) + z2a = c0 + z2b = c0 + ! loop over new grid cells + do k2 = 1, nbiolyr + + ! initialize new tracer + trc2(k2) = c0 + + ! calculate upper and lower boundary of new cell + z2a = z2b !((k2 - 1) * h2) * zspace(k2)+z2b ! / rnilyr + z2b = z2b + h2 * zspace(k2) !(k2 * h2) * zspace(k2)+z2a !/ rnilyr + + z1a = c0 + z1b = c0 + ! loop over old grid cells + do k1 = 1, nbiolyr + + ! calculate upper and lower boundary of old cell + z1a = z1b !((k1 - 1) * h1) * zspace(k1)+z1b !/ rnilyr + z1b = z1b + h1 * zspace(k1) !(k1 * h1) * zspace(k1)+z1a !/ rnilyr + + ! calculate overlap between old and new cell + overlap = max(min(z1b, z2b) - max(z1a, z2a), c0) + + ! aggregate old grid cell contribution to new cell + trc2(k2) = trc2(k2) + overlap * trc(k1) + + enddo ! k1 + + ! calculate upper and lower boundary of added new ice at bottom + z1a = h1 + z1b = h2 + + ! calculate overlap between added ice and new cell + overlap = max(min(z1b, z2b) - max(z1a, z2a), c0) + ! aggregate added ice contribution to new cell + trc2(k2) = trc2(k2) + overlap * trc0 + ! renormalize new grid cell + trc2(k2) = trc2(k2)/zspace(k2)/h2 !(rnilyr * trc2(k2)) / h2 + + enddo ! k2 + + ! update vertical tracer array with the adjusted tracer + trc = trc2 + + end subroutine update_vertical_bio_tracers !======================================================================= diff --git a/components/mpas-seaice/src/shared/mpas_seaice_column.F b/components/mpas-seaice/src/shared/mpas_seaice_column.F index cfebdab2e200..1b736c4b0ccb 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_column.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_column.F @@ -2110,6 +2110,9 @@ subroutine column_itd_thermodynamics(domain, clock) colpkg_step_therm2, & colpkg_clear_warnings + use seaice_constants, only: & + seaicePuny + type(domain_type), intent(inout) :: domain type(MPAS_clock_type), intent(in) :: clock @@ -2202,13 +2205,13 @@ subroutine column_itd_thermodynamics(domain, clock) iBioLayers ! test carbon conservation - real(kind=RKIND), dimension(:), allocatable :: & + real(kind=RKIND), dimension(:,:), allocatable :: & totalCarbonCatFinal, & totalCarbonCatInitial, & - oceanBioFluxesTemp, & - verticalGridSpace + oceanBioFluxesTemp - real(kind=RKIND) :: & + real(kind=RKIND), dimension(:), allocatable :: & + verticalGridSpace, & oceanCarbonFlux, & totalCarbonFinal, & totalCarbonInitial, & @@ -2317,11 +2320,22 @@ subroutine column_itd_thermodynamics(domain, clock) ! newly formed ice allocate(newlyFormedIceLogical(nCategories)) allocate(oceanBioConcentrationsUsed(ciceTracerObject % nBioTracers)) - allocate(oceanBioFluxesTemp(ciceTracerObject % nBioTracers)) + allocate(oceanBioFluxesTemp(ciceTracerObject % nBioTracers,nCellsSolve)) allocate(verticalGridSpace(nBioLayersP1)) if (checkCarbon) then - allocate(totalCarbonCatFinal(nCategories)) - allocate(totalCarbonCatInitial(nCategories)) + allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) + allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) + allocate(totalCarbonInitial(nCellsSolve)) + allocate(totalCarbonFinal(nCellsSolve)) + allocate(oceanCarbonFlux(nCellsSolve)) + allocate(carbonError(nCellsSolve)) + else + allocate(totalCarbonCatFinal(1,1)) + allocate(totalCarbonCatInitial(1,1)) + allocate(totalCarbonInitial(1)) + allocate(totalCarbonFinal(1)) + allocate(oceanCarbonFlux(1)) + allocate(carbonError(1)) endif verticalGridSpace(:) = 1.0_RKIND/real(nBioLayers,kind=RKIND) @@ -2337,8 +2351,10 @@ subroutine column_itd_thermodynamics(domain, clock) anyAbort = .false. !$omp parallel do default(shared) private(iCategory,iBioTracers,iBioData,& - !$omp& totalCarbonInitial,abortMessage,oceanBioFluxesTemp,totalCarbonFinal,& - !$omp& carbonError) firstprivate(newlyFormedIceLogical,oceanBioConcentrationsUsed) & + !$omp& totalCarbonInitial,totalCarbonCatInitial,totalCarbonCatFinal,& + !$omp& abortMessage,oceanBioFluxesTemp,totalCarbonFinal,& + !$omp& oceanCarbonFlux, carbonError) & + !$omp& firstprivate(newlyFormedIceLogical,oceanBioConcentrationsUsed) & !$omp& reduction(.or.:abortFlag) do iCell = 1, nCellsSolve @@ -2358,14 +2374,14 @@ subroutine column_itd_thermodynamics(domain, clock) tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) if (checkCarbon) then - totalCarbonInitial = 0.0_RKIND - call seaice_total_carbon_content_category(block,totalCarbonCatInitial,iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + totalCarbonInitial(iCell) = 0.0_RKIND + call seaice_total_carbon_content_category(block,totalCarbonCatInitial(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) do iCategory = 1,nCategories - totalCarbonInitial = totalCarbonInitial + totalCarbonCatInitial(iCategory)*iceAreaCategory(1,iCategory,iCell) + totalCarbonInitial(iCell) = totalCarbonInitial(iCell) + totalCarbonCatInitial(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) enddo endif - oceanBioFluxesTemp(:) = 0.0_RKIND + oceanBioFluxesTemp(:,iCell) = 0.0_RKIND call colpkg_clear_warnings() call colpkg_step_therm2(& @@ -2408,7 +2424,7 @@ subroutine column_itd_thermodynamics(domain, clock) oceanAerosolFlux(:,iCell), & newlyFormedIceLogical(:), & !first_ice, intent(inout) zSalinityFlux(iCell), & - oceanBioFluxesTemp(:), & + oceanBioFluxesTemp(:,iCell), & oceanBioConcentrationsUsed(:), & !ocean_bio, intent(in) abortFlag, & abortMessage, & @@ -2417,7 +2433,7 @@ subroutine column_itd_thermodynamics(domain, clock) dayOfYear) do iBioTracers = 1, ciceTracerObject % nBioTracers - oceanBioFluxes(iBioTracers,iCell) = oceanBioFluxes(iBioTracers,iCell) + oceanBioFluxesTemp(iBioTracers) + oceanBioFluxes(iBioTracers,iCell) = oceanBioFluxes(iBioTracers,iCell) + oceanBioFluxesTemp(iBioTracers,iCell) enddo call column_write_warnings(abortFlag) @@ -2433,26 +2449,26 @@ subroutine column_itd_thermodynamics(domain, clock) tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) if (checkCarbon) then - totalCarbonFinal = 0.0_RKIND - call seaice_total_carbon_content_category(block,totalCarbonCatFinal,iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) - call seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux,oceanBioFluxesTemp,iCell) + totalCarbonFinal(iCell) = 0.0_RKIND + call seaice_total_carbon_content_category(block,totalCarbonCatFinal(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + call seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux(iCell),oceanBioFluxesTemp(:,iCell),iCell) do iCategory = 1,nCategories - totalCarbonFinal = totalCarbonFinal + totalCarbonCatFinal(iCategory)*iceAreaCategory(1,iCategory,iCell) + totalCarbonFinal(iCell) = totalCarbonFinal(iCell) + totalCarbonCatFinal(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) enddo - carbonError = totalCarbonInitial - oceanCarbonFlux*config_dt - totalCarbonFinal + carbonError(iCell) = (totalCarbonFinal(iCell) - totalCarbonInitial(iCell))/config_dt + oceanCarbonFlux(iCell) - if (abs(carbonError) > 1.0e-14_RKIND*MAXVAL((/totalCarbonInitial,totalCarbonFinal/))) then + if (abs(carbonError(iCell)) > max(seaicePuny,1.0e-14_RKIND*abs(oceanCarbonFlux(iCell)))) then call mpas_log_write("column_step_therm2, carbon conservation error", messageType=MPAS_LOG_ERR) call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError/)) - call mpas_log_write("totalCarbonInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonInitial/)) - call mpas_log_write("totalCarbonFinal: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonFinal/)) - call mpas_log_write("oceanCarbonFlux: $r", messageType=MPAS_LOG_ERR, realArgs=(/oceanCarbonFlux/)) + call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)/)) + call mpas_log_write("totalCarbonInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonInitial(iCell)/)) + call mpas_log_write("totalCarbonFinal: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonFinal(iCell)/)) + call mpas_log_write("oceanCarbonFlux: $r", messageType=MPAS_LOG_ERR, realArgs=(/oceanCarbonFlux(iCell)/)) do iCategory = 1, nCategories call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) - call mpas_log_write("totalCarbonCatFinal(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory)/)) - call mpas_log_write("totalCarbonCatInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory)/)) + call mpas_log_write("totalCarbonCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) enddo endif endif @@ -2472,10 +2488,12 @@ subroutine column_itd_thermodynamics(domain, clock) call seaice_critical_error_write_block(domain, block, anyAbort) call seaice_check_critical_error(domain, anyAbort) - if (checkCarbon) then - deallocate(totalCarbonCatFinal) - deallocate(totalCarbonCatInitial) - endif + deallocate(totalCarbonCatFinal) + deallocate(totalCarbonCatInitial) + deallocate(totalCarbonInitial) + deallocate(totalCarbonFinal) + deallocate(oceanCarbonFlux) + deallocate(carbonError) ! newly formed ice deallocate(newlyFormedIceLogical) @@ -3372,6 +3390,9 @@ subroutine column_ridging(domain) colpkg_step_ridge, & colpkg_clear_warnings + use seaice_constants, only: & + seaicePuny + type(domain_type), intent(inout) :: domain type(block_type), pointer :: block @@ -3408,7 +3429,8 @@ subroutine column_ridging(domain) nIceLayers, & nSnowLayers, & nAerosols, & - nBioLayers + nBioLayers, & + nBioLayersP1 ! variables real(kind=RKIND), dimension(:), pointer :: & @@ -3458,7 +3480,24 @@ subroutine column_ridging(domain) ! local integer :: & iCell, & - iCategory + iCategory, & + iBioTracers, & + iBioData, & + iBioLayers + + ! test carbon conservation + real(kind=RKIND), dimension(:,:), allocatable :: & + totalCarbonCatFinal, & + totalCarbonCatInitial, & + oceanBioFluxesTemp + + real(kind=RKIND), dimension(:), allocatable :: & + verticalGridSpace, & + oceanCarbonFlux, & + totalCarbonFinal, & + totalCarbonInitial, & + carbonError, & + iceAreaCategoryInitial logical, dimension(:), allocatable :: & newlyFormedIceLogical @@ -3466,12 +3505,15 @@ subroutine column_ridging(domain) logical :: & abortFlag, & setGetPhysicsTracers, & - setGetBGCTracers + setGetBGCTracers, & + checkCarbon character(len=strKIND) :: & abortMessage, & abortLocation + checkCarbon = .false. + block => domain % blocklist do while (associated(block)) @@ -3491,6 +3533,7 @@ subroutine column_ridging(domain) call MPAS_pool_get_config(block % configs, "config_dynamics_subcycle_number", config_dynamics_subcycle_number) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) + call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_array(velocity_solver, "dynamicsTimeStep", dynamicsTimeStep) @@ -3500,6 +3543,7 @@ subroutine column_ridging(domain) call MPAS_pool_get_dimension(mesh, "nSnowLayers", nSnowLayers) call MPAS_pool_get_dimension(mesh, "nAerosols", nAerosols) call MPAS_pool_get_dimension(block % dimensions, "nBioLayers", nBioLayers) + call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP1", nBioLayersP1) call MPAS_pool_get_array(mesh, "indexToCellID", indexToCellID) @@ -3546,6 +3590,30 @@ subroutine column_ridging(domain) ! newly formed ice allocate(newlyFormedIceLogical(nCategories)) + allocate(oceanBioFluxesTemp(ciceTracerObject % nBioTracers,nCellsSolve)) + allocate(verticalGridSpace(nBioLayersP1)) + if (checkCarbon) then + allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) + allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) + allocate(totalCarbonInitial(nCellsSolve)) + allocate(totalCarbonFinal(nCellsSolve)) + allocate(oceanCarbonFlux(nCellsSolve)) + allocate(carbonError(nCellsSolve)) + allocate(iceAreaCategoryInitial(nCategories)) + else + allocate(totalCarbonCatFinal(1,1)) + allocate(totalCarbonCatInitial(1,1)) + allocate(totalCarbonInitial(1)) + allocate(totalCarbonFinal(1)) + allocate(oceanCarbonFlux(1)) + allocate(carbonError(1)) + allocate(iceAreaCategoryInitial(1)) + endif + + verticalGridSpace(:) = 1.0_RKIND/real(nBioLayers,kind=RKIND) + verticalGridSpace(1) = verticalGridSpace(2)/2.0_RKIND + verticalGridSpace(nBioLayersP1) = verticalGridSpace(1) + setGetPhysicsTracers = .true. setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) @@ -3564,6 +3632,17 @@ subroutine column_ridging(domain) call set_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) + if (checkCarbon) then + totalCarbonInitial(iCell) = 0.0_RKIND + call seaice_total_carbon_content_category(block,totalCarbonCatInitial(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + do iCategory = 1,nCategories + iceAreaCategoryInitial(iCategory) = iceAreaCategory(1,iCategory,iCell) + totalCarbonInitial(iCell) = totalCarbonInitial(iCell) + totalCarbonCatInitial(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) + enddo + endif + + oceanBioFluxesTemp(:,iCell) = 0.0_RKIND + call colpkg_clear_warnings() call colpkg_step_ridge(& dynamicsTimeStep, & @@ -3607,11 +3686,15 @@ subroutine column_ridging(domain) oceanSaltFlux(iCell), & newlyFormedIceLogical(:), & zSalinityFlux(iCell), & - oceanBioFluxes(:,iCell), & + oceanBioFluxesTemp(:,iCell), & abortFlag, & abortMessage) call column_write_warnings(abortFlag) + do iBioTracers = 1, ciceTracerObject % nBioTracers + oceanBioFluxes(iBioTracers,iCell) = oceanBioFluxes(iBioTracers,iCell) + oceanBioFluxesTemp(iBioTracers,iCell) + enddo + ! update do iCategory = 1, nCategories newlyFormedIce(iCategory,iCell) = 0 @@ -3622,6 +3705,35 @@ subroutine column_ridging(domain) call get_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) + if (checkCarbon) then + totalCarbonFinal(iCell) = 0.0_RKIND + call seaice_total_carbon_content_category(block,totalCarbonCatFinal(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + call seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux(iCell),oceanBioFluxesTemp(:,iCell),iCell) + do iCategory = 1,nCategories + totalCarbonFinal(iCell) = totalCarbonFinal(iCell) + totalCarbonCatFinal(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) + enddo + carbonError(iCell) = (totalCarbonFinal(iCell) - totalCarbonInitial(iCell))/config_dt + oceanCarbonFlux(iCell) + + if (abs(carbonError(iCell)) > max(10.0_RKIND*seaicePuny,1.0e-14_RKIND*abs(oceanCarbonFlux(iCell))) .and. & + MAXVAL(iceAreaCategory(1,:,iCell)) > seaicePuny .and. & + MAXVAL(iceAreaCategoryInitial(:)) > seaicePuny) then + call mpas_log_write("column_step_ridge, carbon conservation error", messageType=MPAS_LOG_ERR) + call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) + call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)/)) + call mpas_log_write("totalCarbonInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonInitial(iCell)/)) + call mpas_log_write("totalCarbonFinal: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonFinal(iCell)/)) + call mpas_log_write("oceanCarbonFlux: $r", messageType=MPAS_LOG_ERR, realArgs=(/oceanCarbonFlux(iCell)/)) + + do iCategory = 1, nCategories + call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) + call mpas_log_write("totalCarbonCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) + call mpas_log_write("iceAreaCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategory(1,iCategory,iCell)/)) + call mpas_log_write("iceAreaCategoryInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategoryInitial(iCategory)/)) + enddo + endif + endif + ! code abort if (abortFlag) then call mpas_log_write("column_ridging: "//trim(abortMessage) , messageType=MPAS_LOG_ERR) @@ -3635,6 +3747,16 @@ subroutine column_ridging(domain) call seaice_critical_error_write_block(domain, block, abortFlag) call seaice_check_critical_error(domain, abortFlag) + deallocate(oceanBioFluxesTemp) + deallocate(verticalGridSpace) + deallocate(totalCarbonCatFinal) + deallocate(totalCarbonCatInitial) + deallocate(totalCarbonInitial) + deallocate(totalCarbonFinal) + deallocate(oceanCarbonFlux) + deallocate(carbonError) + deallocate(iceAreaCategoryInitial) + ! newly formed ice deallocate(newlyFormedIceLogical) @@ -3759,6 +3881,7 @@ subroutine column_biogeochemistry(domain) snowIceBioFluxes, & atmosIceBioFluxes, & oceanBioConcentrations, & + oceanBioConcentrationsInUse, & totalVerticalBiologyIce, & totalVerticalBiologySnow, & penetratingShortwaveFlux, & @@ -3823,7 +3946,7 @@ subroutine column_biogeochemistry(domain) iBioLayers ! test carbon conservation - real(kind=RKIND), dimension(:), allocatable :: & + real(kind=RKIND), dimension(:,:), allocatable :: & totalCarbonCatFinal, & totalCarbonCatInitial, & totalCarbonCatFlux, & @@ -3831,12 +3954,13 @@ subroutine column_biogeochemistry(domain) brineHeightCatFinal real(kind=RKIND), dimension(:), allocatable :: & - oceanBioConcentrationsUsed, & - iceCarbonInitialCategory, & - iceCarbonFinalCategory, & - iceCarbonFluxCategory, & - iceBrineInitialCategory, & - iceBrineFinalCategory + totalCarbonFinal, & + totalCarbonInitial, & + totalCarbonFlux, & + carbonError + + real(kind=RKIND):: & + errorCheck logical, dimension(:), allocatable :: & newlyFormedIceLogical @@ -3852,12 +3976,8 @@ subroutine column_biogeochemistry(domain) abortMessage, & abortLocation - real(kind=RKIND) :: & - carbonErrorCat, & - carbonErrorColumnPackage - real(kind=RKIND), parameter :: & - accuracy = 1.0e-14_RKIND + accuracy = 1.0e-13_RKIND ! test carbon conservation checkCarbon = .false. @@ -3932,6 +4052,7 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(biogeochemistry, "snowIceBioFluxes", snowIceBioFluxes) call MPAS_pool_get_array(biogeochemistry, "atmosIceBioFluxes", atmosIceBioFluxes) call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrations", oceanBioConcentrations) + call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrationsInUse", oceanBioConcentrationsInUse) call MPAS_pool_get_array(biogeochemistry, "totalVerticalBiologyIce", totalVerticalBiologyIce) call MPAS_pool_get_array(biogeochemistry, "totalVerticalBiologySnow", totalVerticalBiologySnow) call MPAS_pool_get_array(biogeochemistry, "zSalinityIceDensity", zSalinityIceDensity) @@ -3995,16 +4116,37 @@ subroutine column_biogeochemistry(domain) ! newly formed ice allocate(newlyFormedIceLogical(nCategories)) - allocate(oceanBioConcentrationsUsed(ciceTracerObject % nBioTracers)) - allocate(brineHeightCatInitial(nCategories)) + allocate(brineHeightCatInitial(nCategories,nCellsSolve)) + allocate(carbonError(nCellsSolve)) if (checkCarbon) then - allocate(totalCarbonCatFinal(nCategories)) - allocate(totalCarbonCatInitial(nCategories)) - allocate(totalCarbonCatFlux(nCategories)) - allocate(brineHeightCatFinal(nCategories)) + allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) + allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) + allocate(totalCarbonCatFlux(nCategories,nCellsSolve)) + allocate(brineHeightCatFinal(nCategories,nCellsSolve)) + allocate(totalCarbonFinal(nCellsSolve)) + allocate(totalCarbonInitial(nCellsSolve)) + allocate(totalCarbonFlux(nCellsSolve)) + else + allocate(totalCarbonCatFinal(1,1)) + allocate(totalCarbonCatInitial(1,1)) + allocate(totalCarbonCatFlux(1,1)) + allocate(brineHeightCatFinal(1,1)) + allocate(totalCarbonFinal(1)) + allocate(totalCarbonInitial(1)) + allocate(totalCarbonFlux(1)) endif + brineHeightCatInitial(:,:) = 0.0_RKIND + carbonError(:) = 0.0_RKIND + totalCarbonCatFinal(:,:) = 0.0_RKIND + totalCarbonCatInitial(:,:) = 0.0_RKIND + totalCarbonCatFlux(:,:) = 0.0_RKIND + brineHeightCatFinal(:,:) = 0.0_RKIND + totalCarbonFinal(:) = 0.0_RKIND + totalCarbonInitial(:) = 0.0_RKIND + totalCarbonFlux(:) = 0.0_RKIND + setGetPhysicsTracers = .true. setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) @@ -4013,12 +4155,19 @@ subroutine column_biogeochemistry(domain) abortMessage = "" atmosBioFluxes(:,:) = 0.0_RKIND - + oceanBioConcentrationsInUse(:,:) = 0.0_RKIND + + !$offomp parallel do default(shared) private(iCategory,iBioTracers,iAlgae, iBioLayers) & + !$offomp& firstprivate(atmosBioFluxes,atmosBlackCarbonFlux, & + !$offomp& totalCarbonCatInitial, totalCarbonCatFinal, & + !$offomp& totalCarbonInitial, totalCarbonFinal, totalCarbonFlux, & + !$offomp& atmosDustFlux, bioShortwaveFluxCell, newlyFormedIce) + ! do iCell = 1, nCellsSolve ! newly formed ice do iCategory = 1, nCategories newlyFormedIceLogical(iCategory) = (newlyFormedIce(iCategory,iCell) == 1) - brineHeightCatInitial(iCategory) = brineFraction(1,iCategory,iCell) * & + brineHeightCatInitial(iCategory,iCell) = brineFraction(1,iCategory,iCell) * & iceVolumeCategoryInitial(iCategory,iCell)/(iceAreaCategoryInitial(iCategory,iCell) + seaicePuny) enddo ! iCategory rayleighCriteria = (rayleighCriteriaReal(iCell) > 0.5_RKIND) @@ -4067,14 +4216,20 @@ subroutine column_biogeochemistry(domain) do iBioTracers = 1, ciceTracerObject % nBioTracers iBioData = ciceTracerObject % index_LayerIndexToDataArray(iBioTracers) - oceanBioConcentrationsUsed(iBioTracers) = oceanBioConcentrations(iBioData,iCell) + oceanBioConcentrationsInUse(iBioTracers,iCell) = oceanBioConcentrations(iBioData,iCell) enddo ! iBioTracers call set_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - if (checkCarbon) call seaice_total_carbon_content_category(block,& - totalCarbonCatInitial,iceAreaCategoryInitial,iceVolumeCategoryInitial,iCell) + if (checkCarbon) then + call seaice_total_carbon_content_category(block,& + totalCarbonCatInitial(:,iCell),iceAreaCategoryInitial(:,:),iceVolumeCategoryInitial(:,:),iCell) + totalCarbonInitial(iCell) = 0.0_RKIND + do iCategory = 1, nCategories + totalCarbonInitial(iCell) = totalCarbonInitial(iCell) + totalCarbonCatInitial(iCategory,iCell)*iceAreaCategoryInitial(iCategory,iCell) + enddo + endif call colpkg_clear_warnings() call colpkg_biogeochemistry(& @@ -4096,7 +4251,7 @@ subroutine column_biogeochemistry(domain) verticalNitrogenLosses(:,:,iCell), & snowIceBioFluxes(:,iCell), & atmosIceBioFluxes(:,iCell), & - oceanBioConcentrationsUsed(:), & + oceanBioConcentrationsInUse(:,iCell), & newlyFormedIceLogical(:), & shortwaveLayerPenetration(:,:,iCell), & bioPorosity(:,:,iCell), & @@ -4161,35 +4316,43 @@ subroutine column_biogeochemistry(domain) tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) if (checkCarbon) then - call seaice_total_carbon_content_category(block,totalCarbonCatFinal,iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) - call seaice_ocean_carbon_flux(block,totalCarbonCatFlux,oceanBioFluxesCategory(:,:,:),iCell) - do iCategory = 1,nCategories - brineHeightCatFinal(iCategory) = brineFraction(1,iCategory,iCell) * & + call seaice_total_carbon_content_category(block,totalCarbonCatFinal(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + call seaice_ocean_carbon_flux(block,totalCarbonCatFlux(:,iCell),oceanBioFluxesCategory(:,:,:),iCell) + totalCarbonFinal(iCell) = 0.0_RKIND + totalCarbonFlux(iCell) = 0.0_RKIND + do iCategory = 1, nCategories + totalCarbonFinal(iCell) = totalCarbonFinal(iCell) + totalCarbonCatFinal(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) + totalCarbonFlux(iCell) = totalCarbonFlux(iCell) + totalCarbonCatFlux(iCategory,iCell) * iceAreaCategory(1,iCategory,iCell) + enddo + carbonError(iCell) = (totalCarbonFinal(iCell) - totalCarbonInitial(iCell))/config_dt + totalCarbonFlux(iCell) + errorCheck = MAX(accuracy,accuracy*abs(totalCarbonFlux(iCell))) + + if (abs(carbonError(iCell)) > errorCheck) then + do iCategory = 1,nCategories + if (iceAreaCategory(1,iCategory,iCell) > seaicePuny) then + brineHeightCatFinal(iCategory,iCell) = brineFraction(1,iCategory,iCell) * & iceVolumeCategory(1,iCategory,iCell)/(iceAreaCategory(1,iCategory,iCell) + seaicePuny) - carbonErrorCat = totalCarbonCatInitial(iCategory) - totalCarbonCatFlux(iCategory)*config_dt - & - totalCarbonCatFinal(iCategory) - if (abs(carbonErrorCat) > accuracy*MAXVAL((/totalCarbonCatInitial(iCategory),totalCarbonCatFinal(iCategory)/))) then -! abortFlag = .true. -! abortMessage = "carbon conservation errror after column bgc" - call mpas_log_write("column_biogeochemistry, carbon conservation error", messageType=MPAS_LOG_ERR) - call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) - call mpas_log_write("carbonErrorCat: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonErrorCat/)) - call mpas_log_write("carbonErrorCat*iceAreaCategory: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonErrorCat*iceAreaCategory(1,iCategory,iCell)/)) - call mpas_log_write("totalCarbonCatInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatInitial(iCategory)/)) - call mpas_log_write("totalCarbonCatFinal(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory)/)) - call mpas_log_write("totalCarbonCatFlux(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFlux(iCategory)/)) - call mpas_log_write("brineHeightCatInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/brineHeightCatInitial(iCategory)/)) - call mpas_log_write("brineHeightCatFinal(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/brineHeightCatFinal(iCategory)/)) - endif - enddo - endif + call mpas_log_write("column_biogeochemistry, carbon conservation error", messageType=MPAS_LOG_ERR) + call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) + call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) + call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)/)) + call mpas_log_write("carbonError*iceAreaCategory: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)*iceAreaCategory(1,iCategory,iCell)/)) + call mpas_log_write("iceAreaCategory: $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategory(1,iCategory,iCell)/)) + call mpas_log_write("iceAreaCategoryInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategoryInitial(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatInitial(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatFlux(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFlux(iCategory,iCell)/)) + call mpas_log_write("brineHeightCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/brineHeightCatInitial(iCategory,iCell)/)) + call mpas_log_write("brineHeightCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/brineHeightCatFinal(iCategory,iCell)/)) + endif + enddo + endif !carbonError + endif ! code abort if (abortFlag) then call mpas_log_write("column_biogeochemistry: "//trim(abortMessage) , messageType=MPAS_LOG_ERR) call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - exit endif totalSkeletalAlgae(iCell) = 0.0_RKIND @@ -4222,16 +4385,17 @@ subroutine column_biogeochemistry(domain) call seaice_critical_error_write_block(domain, block, abortFlag) call seaice_check_critical_error(domain, abortFlag) - if (checkCarbon) then - deallocate(totalCarbonCatFinal) - deallocate(totalCarbonCatInitial) - deallocate(totalCarbonCatFlux) - deallocate(brineHeightCatFinal) - endif + deallocate(totalCarbonCatFinal) + deallocate(totalCarbonCatInitial) + deallocate(totalCarbonCatFlux) + deallocate(brineHeightCatFinal) + deallocate(totalCarbonFinal) + deallocate(totalCarbonInitial) + deallocate(totalCarbonFlux) deallocate(brineHeightCatInitial) deallocate(newlyFormedIceLogical) - deallocate(oceanBioConcentrationsUsed) + deallocate(carbonError) block => block % next end do diff --git a/components/mpas-seaice/src/shared/mpas_seaice_constants.F b/components/mpas-seaice/src/shared/mpas_seaice_constants.F index 9a36d97b0919..5c6a270704b2 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_constants.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_constants.F @@ -187,7 +187,7 @@ module seaice_constants ! biogeochemistry constants real(kind=RKIND), public :: & skeletalLayerThickness = 0.03_RKIND ,&! (m) skeletal layer thickness - gramsCarbonPerMolCarbon ! g carbon per mol carbon + gramsCarbonPerMolCarbon = 12.0107_RKIND ! g carbon per mol carbon ! ocean biogeochemistry ISPOL values real(kind=RKIND), parameter, public :: & diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index fe3b3d5e977e..05e6f98f3375 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -2092,6 +2092,9 @@ subroutine column_itd_thermodynamics(domain, clock) use icepack_intfc, only: & icepack_step_therm2 + use seaice_constants, only: & + seaicePuny + type(domain_type), intent(inout) :: domain type(MPAS_clock_type), intent(in) :: clock @@ -2171,6 +2174,7 @@ subroutine column_itd_thermodynamics(domain, clock) oceanAerosolFlux, & oceanBioFluxes, & oceanBioConcentrations, & + oceanBioConcentrationsInUse, & initialSalinityProfile ! WaveSpectra, & ! DFloeSizeNewIce, & @@ -2200,21 +2204,18 @@ subroutine column_itd_thermodynamics(domain, clock) iBioLayers ! test carbon conservation - real(kind=RKIND), dimension(:), allocatable :: & + real(kind=RKIND), dimension(:,:), allocatable :: & totalCarbonCatFinal, & totalCarbonCatInitial, & - oceanBioFluxesTemp, & - verticalGridSpace + oceanBioFluxesTemp - real(kind=RKIND) :: & - oceanCarbonFlux, & + real(kind=RKIND), dimension(:), allocatable :: & + verticalGridSpace, & totalCarbonFinal, & totalCarbonInitial, & + oceanCarbonFlux, & carbonError - real(kind=RKIND), dimension(:), allocatable :: & - oceanBioConcentrationsUsed - logical, dimension(:), allocatable :: & newlyFormedIceLogical @@ -2319,6 +2320,7 @@ subroutine column_itd_thermodynamics(domain, clock) call MPAS_pool_get_array(biogeochemistry, "newlyFormedIce", newlyFormedIce) call MPAS_pool_get_array(biogeochemistry, "oceanBioFluxes", oceanBioFluxes) call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrations", oceanBioConcentrations) + call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrationsInUse", oceanBioConcentrationsInUse) call MPAS_pool_get_array(biogeochemistry, "biologyGrid", biologyGrid) call MPAS_pool_get_array(biogeochemistry, "verticalGrid", verticalGrid) call MPAS_pool_get_array(biogeochemistry, "interfaceBiologyGrid", interfaceBiologyGrid) @@ -2330,12 +2332,22 @@ subroutine column_itd_thermodynamics(domain, clock) ! newly formed ice allocate(newlyFormedIceLogical(nCategories)) - allocate(oceanBioConcentrationsUsed(ciceTracerObject % nBioTracers)) - allocate(oceanBioFluxesTemp(ciceTracerObject % nBioTracers)) + allocate(oceanBioFluxesTemp(ciceTracerObject % nBioTracers,nCellsSolve)) allocate(verticalGridSpace(nBioLayersP1)) if (checkCarbon) then - allocate(totalCarbonCatFinal(nCategories)) - allocate(totalCarbonCatInitial(nCategories)) + allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) + allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) + allocate(totalCarbonInitial(nCellsSolve)) + allocate(totalCarbonFinal(nCellsSolve)) + allocate(oceanCarbonFlux(nCellsSolve)) + allocate(carbonError(nCellsSolve)) + else + allocate(totalCarbonCatFinal(1,1)) + allocate(totalCarbonCatInitial(1,1)) + allocate(totalCarbonInitial(1)) + allocate(totalCarbonFinal(1)) + allocate(oceanCarbonFlux(1)) + allocate(carbonError(1)) endif verticalGridSpace(:) = 1.0_RKIND/real(nBioLayers,kind=RKIND) @@ -2345,14 +2357,17 @@ subroutine column_itd_thermodynamics(domain, clock) setGetPhysicsTracers = .true. setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) + oceanBioConcentrationsInUse(:,:) = 0.0_RKIND ! code abort abortFlag = .false. abortMessage = "" - !$omp parallel do default(shared) private(iCategory,iBioTracers,iBioData,& - !$omp& totalCarbonInitial,abortMessage,oceanBioFluxesTemp,totalCarbonFinal,& - !$omp& carbonError) firstprivate(newlyFormedIceLogical,oceanBioConcentrationsUsed) & - !$omp& reduction(.or.:abortFlag) + !$offomp parallel do default(shared) private(iCategory,iBioTracers,iBioData,& + !$offomp& totalCarbonInitial,abortMessage,oceanBioFluxesTemp,totalCarbonFinal,& + !$offomp& totalCarbonCatInitial, totalCarbonCatFinal, & + !$offomp& oceanCarbonFlux, carbonError) & + !$offomp& firstprivate(newlyFormedIceLogical) & + !$offomp& reduction(.or.:abortFlag) do iCell = 1, nCellsSolve ! newly formed ice @@ -2363,7 +2378,7 @@ subroutine column_itd_thermodynamics(domain, clock) ! read the required ocean concentration fields into the allocated array do iBioTracers = 1, ciceTracerObject % nBioTracers iBioData = ciceTracerObject % index_LayerIndexToDataArray(iBioTracers) - oceanBioConcentrationsUsed(iBioTracers) = oceanBioConcentrations(iBioData, iCell) + oceanBioConcentrationsInUse(iBioTracers, iCell) = oceanBioConcentrations(iBioData, iCell) enddo ! iBioTracers ! set the category tracer array @@ -2371,14 +2386,14 @@ subroutine column_itd_thermodynamics(domain, clock) tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) if (checkCarbon) then - totalCarbonInitial = 0.0_RKIND - call seaice_total_carbon_content_category(block,totalCarbonCatInitial,iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + totalCarbonInitial(iCell) = 0.0_RKIND + call seaice_total_carbon_content_category(block,totalCarbonCatInitial(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) do iCategory = 1,nCategories - totalCarbonInitial = totalCarbonInitial + totalCarbonCatInitial(iCategory)*iceAreaCategory(1,iCategory,iCell) + totalCarbonInitial(iCell) = totalCarbonInitial(iCell) + totalCarbonCatInitial(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) enddo endif - oceanBioFluxesTemp(:) = 0.0_RKIND + oceanBioFluxesTemp(:,iCell) = 0.0_RKIND ! CICE calculates the Sig Wave Height from the wave spectrum as follows before step therm2: ! we will use the Sig Wave Height from WW3, but could use this for testing without WW3 @@ -2387,10 +2402,10 @@ subroutine column_itd_thermodynamics(domain, clock) call icepack_step_therm2(& dt=config_dt, & ncat=nCategories, & - nltrcr=ciceTracerObject % nBioTracers, & ! CHECK/FIX for BGC nilyr=nIcelayers, & nslyr=nSnowLayers, & hin_max=categoryThicknessLimits(:), & + nbtrcr=ciceTracerObject % nBioTracers, & nblyr=nBioLayers, & aicen=iceAreaCategory(1,:,iCell), & vicen=iceVolumeCategory(1,:,iCell), & @@ -2423,8 +2438,8 @@ subroutine column_itd_thermodynamics(domain, clock) igrid=interfaceBiologyGrid(:), & faero_ocn=oceanAerosolFlux(:,iCell), & first_ice=newlyFormedIceLogical(:), & - flux_bio=oceanBioFluxesTemp(:), & - ocean_bio=oceanBioConcentrationsUsed(:), & + flux_bio=oceanBioFluxesTemp(:,iCell), & + ocean_bio=oceanBioConcentrationsInUse(:,iCell), & frazil_diag=frazilGrowthDiagnostic(iCell), & frz_onset=freezeOnset(iCell), & ! optional yday=dayOfYear) ! optional @@ -2442,9 +2457,13 @@ subroutine column_itd_thermodynamics(domain, clock) ! d_afsd_newi=DFloeSizeNewIce(:,iCell), & ! d_afsd_latm=DFloeSizeLateralMelt(:,iCell), & ! d_afsd_weld=DFloeSizeWeld(:,iCell), & -! floe_rad_c=FloeSizeBinCenter(:), & +! floe_rad_c=FloeSizeBinCenter(:), & ! floe_binwidth=FloeSizeBinWidth(:)) + do iBioTracers = 1, ciceTracerObject % nBioTracers + oceanBioFluxes(iBioTracers,iCell) = oceanBioFluxes(iBioTracers,iCell) + oceanBioFluxesTemp(iBioTracers,iCell) + enddo + abortFlag = icepack_warnings_aborted() call seaice_icepack_write_warnings(abortFlag) @@ -2459,26 +2478,31 @@ subroutine column_itd_thermodynamics(domain, clock) tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) if (checkCarbon) then - totalCarbonFinal = 0.0_RKIND - call seaice_total_carbon_content_category(block,totalCarbonCatFinal,iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) - call seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux,oceanBioFluxesTemp,iCell) + totalCarbonFinal(iCell) = 0.0_RKIND + call seaice_total_carbon_content_category(block,totalCarbonCatFinal(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + call seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux(iCell),oceanBioFluxesTemp(:,iCell)) do iCategory = 1,nCategories - totalCarbonFinal = totalCarbonFinal + totalCarbonCatFinal(iCategory)*iceAreaCategory(1,iCategory,iCell) + totalCarbonFinal(iCell) = totalCarbonFinal(iCell) + totalCarbonCatFinal(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) enddo - carbonError = totalCarbonInitial - oceanCarbonFlux*config_dt - totalCarbonFinal + carbonError(iCell) = (totalCarbonFinal(iCell) - totalCarbonInitial(iCell))/config_dt + oceanCarbonFlux(iCell) - if (abs(carbonError) > 1.0e-14_RKIND*MAXVAL((/totalCarbonInitial,totalCarbonFinal/))) then + if (abs(carbonError(iCell)) > max(seaicePuny,1.0e-14_RKIND*abs(oceanCarbonFlux(iCell)))) then call mpas_log_write("column_step_therm2, carbon conservation error", messageType=MPAS_LOG_ERR) call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError/)) - call mpas_log_write("totalCarbonInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonInitial/)) - call mpas_log_write("totalCarbonFinal: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonFinal/)) - call mpas_log_write("oceanCarbonFlux: $r", messageType=MPAS_LOG_ERR, realArgs=(/oceanCarbonFlux/)) + call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)/)) + call mpas_log_write("totalCarbonInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonInitial(iCell)/)) + call mpas_log_write("totalCarbonFinal: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonFinal(iCell)/)) + call mpas_log_write("oceanCarbonFlux: $r", messageType=MPAS_LOG_ERR, realArgs=(/oceanCarbonFlux(iCell)/)) + call mpas_log_write("config_dt: $r", messageType=MPAS_LOG_ERR, realArgs=(/config_dt/)) do iCategory = 1, nCategories call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) - call mpas_log_write("totalCarbonCatFinal(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory)/)) - call mpas_log_write("totalCarbonCatInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory)/)) + call mpas_log_write("totalCarbonCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatInitial(iCategory,iCell)/)) + call mpas_log_write("iceAreaCategoryInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategoryInitial(iCategory,iCell)/)) + call mpas_log_write("iceVolumeCategoryInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceVolumeCategoryInitial(iCategory,iCell)/)) + call mpas_log_write("iceAreaCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategory(1,iCategory,iCell)/)) + call mpas_log_write("iceVolumeCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceVolumeCategory(1,iCategory,iCell)/)) enddo endif endif @@ -2495,14 +2519,15 @@ subroutine column_itd_thermodynamics(domain, clock) call seaice_critical_error_write_block(domain, block, abortFlag) call seaice_check_critical_error(domain, abortFlag) - if (checkCarbon) then - deallocate(totalCarbonCatFinal) - deallocate(totalCarbonCatInitial) - endif + deallocate(totalCarbonCatFinal) + deallocate(totalCarbonCatInitial) + deallocate(totalCarbonInitial) + deallocate(totalCarbonFinal) + deallocate(oceanCarbonFlux) + deallocate(carbonError) ! newly formed ice deallocate(newlyFormedIceLogical) - deallocate(oceanBioConcentrationsUsed) deallocate(oceanBioFluxesTemp) deallocate(verticalGridSpace) @@ -3285,6 +3310,9 @@ subroutine column_ridging(domain) use icepack_intfc, only: & icepack_step_ridge + use seaice_constants, only: & + seaicePuny + type(domain_type), intent(inout) :: domain type(block_type), pointer :: block @@ -3321,7 +3349,8 @@ subroutine column_ridging(domain) nIceLayers, & nSnowLayers, & nAerosols, & - nBioLayers + nBioLayers, & + nBioLayersP1 ! variables real(kind=RKIND), dimension(:), pointer :: & @@ -3370,14 +3399,34 @@ subroutine column_ridging(domain) ! local integer :: & iCell, & - iCategory + iCategory, & + iBioTracers, & + iBioData, & + iBioLayers + + ! test carbon conservation + real(kind=RKIND), dimension(:,:), allocatable :: & + totalCarbonCatFinal, & + totalCarbonCatInitial, & + oceanBioFluxesTemp + + real(kind=RKIND), dimension(:), allocatable :: & + verticalGridSpace, & + totalCarbonFinal, & + totalCarbonInitial, & + oceanCarbonFlux, & + carbonError, & + iceAreaCategoryInitial logical, dimension(:), allocatable :: & newlyFormedIceLogical logical :: & setGetPhysicsTracers, & - setGetBGCTracers + setGetBGCTracers, & + checkCarbon + + checkCarbon = .false. block => domain % blocklist do while (associated(block)) @@ -3398,6 +3447,7 @@ subroutine column_ridging(domain) call MPAS_pool_get_config(block % configs, "config_dynamics_subcycle_number", config_dynamics_subcycle_number) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) + call MPAS_pool_get_config(block % configs, "config_dt", config_dt) call MPAS_pool_get_array(velocity_solver, "dynamicsTimeStep", dynamicsTimeStep) @@ -3407,6 +3457,7 @@ subroutine column_ridging(domain) call MPAS_pool_get_dimension(mesh, "nSnowLayers", nSnowLayers) call MPAS_pool_get_dimension(mesh, "nAerosols", nAerosols) call MPAS_pool_get_dimension(block % dimensions, "nBioLayers", nBioLayers) + call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP1", nBioLayersP1) call MPAS_pool_get_array(mesh, "indexToCellID", indexToCellID) @@ -3455,6 +3506,30 @@ subroutine column_ridging(domain) setGetPhysicsTracers = .true. setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) + allocate(oceanBioFluxesTemp(ciceTracerObject % nBioTracers,nCellsSolve)) + allocate(verticalGridSpace(nBioLayersP1)) + if (checkCarbon) then + allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) + allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) + allocate(totalCarbonInitial(nCellsSolve)) + allocate(totalCarbonFinal(nCellsSolve)) + allocate(oceanCarbonFlux(nCellsSolve)) + allocate(carbonError(nCellsSolve)) + allocate(iceAreaCategoryInitial(nCategories)) + else + allocate(totalCarbonCatFinal(1,1)) + allocate(totalCarbonCatInitial(1,1)) + allocate(totalCarbonInitial(1)) + allocate(totalCarbonFinal(1)) + allocate(oceanCarbonFlux(1)) + allocate(carbonError(1)) + allocate(iceAreaCategoryInitial(1)) + endif + + verticalGridSpace(:) = 1.0_RKIND/real(nBioLayers,kind=RKIND) + verticalGridSpace(1) = verticalGridSpace(1)/2.0_RKIND + verticalGridSpace(nBioLayersP1) = verticalGridSpace(1) + do iCell = 1, nCellsSolve ! newly formed ice @@ -3466,6 +3541,17 @@ subroutine column_ridging(domain) call set_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) + if (checkCarbon) then + totalCarbonInitial(iCell) = 0.0_RKIND + call seaice_total_carbon_content_category(block,totalCarbonCatInitial(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + do iCategory = 1,nCategories + iceAreaCategoryInitial(iCategory) = iceAreaCategory(1,iCategory,iCell) + totalCarbonInitial(iCell) = totalCarbonInitial(iCell) + totalCarbonCatInitial(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) + enddo + endif + + oceanBioFluxesTemp(:,iCell) = 0.0_RKIND + call icepack_step_ridge(& dt=dynamicsTimeStep, & ndtd=config_dynamics_subcycle_number, & @@ -3506,7 +3592,7 @@ subroutine column_ridging(domain) aice=iceAreaCell(iCell), & fsalt=oceanSaltFlux(iCell), & first_ice=newlyFormedIceLogical(:), & - flux_bio=oceanBioFluxes(:,iCell), & ! DC no closing argument + flux_bio=oceanBioFluxesTemp(:,iCell), & Tf=seaFreezingTemperature(iCell)) ! update @@ -3515,13 +3601,58 @@ subroutine column_ridging(domain) if (newlyFormedIceLogical(iCategory)) newlyFormedIce(iCategory,iCell) = 1 enddo ! iCategory + do iBioTracers = 1, ciceTracerObject % nBioTracers + oceanBioFluxes(iBioTracers,iCell) = oceanBioFluxes(iBioTracers,iCell) + oceanBioFluxesTemp(iBioTracers,iCell) + enddo + ! get category tracer array call get_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) + if (checkCarbon) then + totalCarbonFinal(iCell) = 0.0_RKIND + call seaice_total_carbon_content_category(block,totalCarbonCatFinal(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + call seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux(iCell),oceanBioFluxesTemp(:,iCell)) + do iCategory = 1,nCategories + totalCarbonFinal(iCell) = totalCarbonFinal(iCell) + totalCarbonCatFinal(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) + enddo + carbonError(iCell) = (totalCarbonFinal(iCell) - totalCarbonInitial(iCell))/config_dt + oceanCarbonFlux(iCell) + + if (abs(carbonError(iCell)) > max(10.0_RKIND*seaicePuny,1.0e-14_RKIND*abs(oceanCarbonFlux(iCell))) .and. & + MAXVAL(iceAreaCategory(1,:,iCell)) > seaicePuny .and. & + MAXVAL(iceAreaCategoryInitial(:)) > seaicePuny) then + call mpas_log_write("icepack_step_ridge, carbon conservation error", messageType=MPAS_LOG_ERR) + call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) + call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)/)) + call mpas_log_write("totalCarbonInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonInitial(iCell)/)) + call mpas_log_write("totalCarbonFinal: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonFinal(iCell)/)) + call mpas_log_write("oceanCarbonFlux: $r", messageType=MPAS_LOG_ERR, realArgs=(/oceanCarbonFlux(iCell)/)) + call mpas_log_write("config_dt: $r", messageType=MPAS_LOG_ERR, realArgs=(/config_dt/)) + + do iCategory = 1, nCategories + call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) + call mpas_log_write("totalCarbonCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatInitial(iCategory,iCell)/)) + call mpas_log_write("iceAreaCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategory(1,iCategory,iCell)/)) + call mpas_log_write("iceAreaCategoryInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategoryInitial(iCategory)/)) + call mpas_log_write("iceVolumeCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceVolumeCategory(1,iCategory,iCell)/)) + enddo + endif + endif + enddo ! iCell call seaice_icepack_write_warnings(icepack_warnings_aborted()) +! check carbon + deallocate(oceanBioFluxesTemp) + deallocate(verticalGridSpace) + deallocate(totalCarbonCatFinal) + deallocate(totalCarbonCatInitial) + deallocate(totalCarbonInitial) + deallocate(totalCarbonFinal) + deallocate(oceanCarbonFlux) + deallocate(carbonError) + deallocate(iceAreaCategoryInitial) ! newly formed ice deallocate(newlyFormedIceLogical) @@ -3591,7 +3722,8 @@ subroutine column_biogeochemistry(domain) nBioLayersP1, & nAlgae, & maxBCType, & - maxDustType + maxDustType, & + maxAerosolType ! variables @@ -3630,6 +3762,8 @@ subroutine column_biogeochemistry(domain) snowIceBioFluxes, & atmosIceBioFluxes, & oceanBioConcentrations, & + oceanBioConcentrationsInUse, & + oceanBioToIceInUse, & totalVerticalBiologyIce, & totalVerticalBiologySnow, & penetratingShortwaveFlux, & @@ -3690,10 +3824,12 @@ subroutine column_biogeochemistry(domain) iSnowCount, & iIceCount, & indexj, & - iBioLayers + iBioLayers, & + iWarning, & + nWarnings ! test carbon conservation - real(kind=RKIND), dimension(:), allocatable :: & + real(kind=RKIND), dimension(:,:), allocatable :: & totalCarbonCatFinal, & totalCarbonCatInitial, & totalCarbonCatFlux, & @@ -3701,12 +3837,12 @@ subroutine column_biogeochemistry(domain) brineHeightCatFinal real(kind=RKIND), dimension(:), allocatable :: & - oceanBioConcentrationsUsed, & - iceCarbonInitialCategory, & - iceCarbonFinalCategory, & - iceCarbonFluxCategory, & - iceBrineInitialCategory, & - iceBrineFinalCategory + totalCarbonFinal, & + totalCarbonInitial, & + totalCarbonFlux + + real(kind=RKIND) :: & + errorCheck logical, dimension(:), allocatable :: & newlyFormedIceLogical @@ -3721,12 +3857,11 @@ subroutine column_biogeochemistry(domain) abortMessage, & abortLocation - real(kind=RKIND) :: & - carbonErrorCat, & - carbonErrorColumnPackage + real(kind=RKIND), dimension(:), allocatable :: & + carbonError real(kind=RKIND), parameter :: & - accuracy = 1.0e-14_RKIND + accuracy = 1.0e-13_RKIND ! test carbon conservation checkCarbon = .false. @@ -3787,6 +3922,8 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(biogeochemistry, "snowIceBioFluxes", snowIceBioFluxes) call MPAS_pool_get_array(biogeochemistry, "atmosIceBioFluxes", atmosIceBioFluxes) call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrations", oceanBioConcentrations) + call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrationsInUse", oceanBioConcentrationsInUse) + call MPAS_pool_get_array(biogeochemistry, "oceanBioToIceInUse", oceanBioToIceInUse) call MPAS_pool_get_array(biogeochemistry, "totalVerticalBiologyIce", totalVerticalBiologyIce) call MPAS_pool_get_array(biogeochemistry, "totalVerticalBiologySnow", totalVerticalBiologySnow) call MPAS_pool_get_array(biogeochemistry, "atmosBioFluxes", atmosBioFluxes) @@ -3846,36 +3983,61 @@ subroutine column_biogeochemistry(domain) ! newly formed ice allocate(newlyFormedIceLogical(nCategories)) - allocate(oceanBioConcentrationsUsed(ciceTracerObject % nBioTracers)) - allocate(brineHeightCatInitial(nCategories)) + allocate(brineHeightCatInitial(nCategories,nCellsSolve)) + allocate(carbonError(nCellsSolve)) if (checkCarbon) then - allocate(totalCarbonCatFinal(nCategories)) - allocate(totalCarbonCatInitial(nCategories)) - allocate(totalCarbonCatFlux(nCategories)) - allocate(brineHeightCatFinal(nCategories)) + allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) + allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) + allocate(totalCarbonCatFlux(nCategories,nCellsSolve)) + allocate(brineHeightCatFinal(nCategories,nCellsSolve)) + allocate(totalCarbonFinal(nCellsSolve)) + allocate(totalCarbonInitial(nCellsSolve)) + allocate(totalCarbonFlux(nCellsSolve)) + else + allocate(totalCarbonCatFinal(1,1)) + allocate(totalCarbonCatInitial(1,1)) + allocate(totalCarbonCatFlux(1,1)) + allocate(brineHeightCatFinal(1,1)) + allocate(totalCarbonFinal(1)) + allocate(totalCarbonInitial(1)) + allocate(totalCarbonFlux(1)) endif + brineHeightCatInitial(:,:) = 0.0_RKIND + carbonError(:) = 0.0_RKIND + totalCarbonCatFinal(:,:) = 0.0_RKIND + totalCarbonCatInitial(:,:) = 0.0_RKIND + totalCarbonCatFlux(:,:) = 0.0_RKIND + brineHeightCatFinal(:,:) = 0.0_RKIND + totalCarbonFinal(:) = 0.0_RKIND + totalCarbonInitial(:) = 0.0_RKIND + totalCarbonFlux(:) = 0.0_RKIND + setGetPhysicsTracers = .true. setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) atmosBioFluxes(:,:) = 0.0_RKIND - - !$omp parallel do default(shared) private(iCategory,iBioTracers,iAlgae) & - !$omp& firstprivate(atmosBioFluxes,atmosBlackCarbonFlux, & - !$omp& atmosDustFlux, bioShortwaveFluxCell, newlyFormedIce) + oceanBioConcentrationsInUse(:,:) = 0.0_RKIND + oceanBioToIceInUse(:,:) = 0.0_RKIND + + !$offomp parallel do default(shared) private(iCategory,iBioTracers,iAlgae, iBioLayers) & + !$offomp& firstprivate(atmosBioFluxes,atmosBlackCarbonFlux, & + !$offomp& totalCarbonCatInitial, totalCarbonCatFinal, & + !$offomp& totalCarbonInitial, totalCarbonFinal, totalCarbonFlux, & + !$offomp& atmosDustFlux, bioShortwaveFluxCell, newlyFormedIce) ! do iCell = 1, nCellsSolve ! newly formed ice do iCategory = 1, nCategories newlyFormedIceLogical(iCategory) = (newlyFormedIce(iCategory,iCell) == 1) - brineHeightCatInitial(iCategory) = brineFraction(1,iCategory,iCell) * & + brineHeightCatInitial(iCategory,iCell) = brineFraction(1,iCategory,iCell) * & iceVolumeCategoryInitial(iCategory,iCell)/(iceAreaCategoryInitial(iCategory,iCell) + seaicePuny) enddo ! iCategory !update ocean concentrations fields and atmospheric fluxes into allocated array -#ifdef coupled +#ifdef coupled call icepack_load_ocean_bio_array(& nit=oceanNitrateConc(iCell), & amm=oceanAmmoniumConc(iCell), & @@ -3891,7 +4053,6 @@ subroutine column_biogeochemistry(domain) zaeros=oceanZAerosolConc(:,iCell), & ocean_bio_all=oceanBioConcentrations(:,iCell), & hum=oceanHumicsConc(iCell)) - #else do iBioTracers = 1, maxBCType atmosBlackCarbonFlux(iBioTracers,iCell) = 1.e-12_RKIND @@ -3912,14 +4073,20 @@ subroutine column_biogeochemistry(domain) do iBioTracers = 1, ciceTracerObject % nBioTracers iBioData = ciceTracerObject % index_LayerIndexToDataArray(iBioTracers) - oceanBioConcentrationsUsed(iBioTracers) = oceanBioConcentrations(iBioData,iCell) + oceanBioConcentrationsInUse(iBioTracers,iCell) = oceanBioConcentrations(iBioData,iCell) enddo ! iBioTracers call set_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - if (checkCarbon) call seaice_total_carbon_content_category(block,& - totalCarbonCatInitial,iceAreaCategoryInitial,iceVolumeCategoryInitial,iCell) + if (checkCarbon) then + call seaice_total_carbon_content_category(block,& + totalCarbonCatInitial(:,iCell),iceAreaCategoryInitial(:,:),iceVolumeCategoryInitial(:,:),iCell) + totalCarbonInitial(iCell) = 0.0_RKIND + do iCategory = 1, nCategories + totalCarbonInitial(iCell) = totalCarbonInitial(iCell) + totalCarbonCatInitial(iCategory,iCell)*iceAreaCategoryInitial(iCategory,iCell) + enddo + endif ! code abort abortFlag = .false. @@ -3942,7 +4109,8 @@ subroutine column_biogeochemistry(domain) Zoo=verticalNitrogenLosses(:,:,iCell), & fbio_snoice=snowIceBioFluxes(:,iCell), & fbio_atmice=atmosIceBioFluxes(:,iCell), & - ocean_bio=oceanBioConcentrationsUsed(:), & + ocean_bio_dh=oceanBioToIceInUse(:,iCell), & + ocean_bio=oceanBioConcentrationsInUse(:,iCell), & first_ice=newlyFormedIceLogical(:), & fswpenln=shortwaveLayerPenetration(:,:,iCell), & bphi=bioPorosity(:,:,iCell), & @@ -3991,29 +4159,39 @@ subroutine column_biogeochemistry(domain) tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) if (checkCarbon) then - call seaice_total_carbon_content_category(block,totalCarbonCatFinal,iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) - call seaice_ocean_carbon_flux(block,totalCarbonCatFlux,oceanBioFluxesCategory(:,:,:),iCell) - do iCategory = 1,nCategories - brineHeightCatFinal(iCategory) = brineFraction(1,iCategory,iCell) * & - iceVolumeCategory(1,iCategory,iCell)/(iceAreaCategory(1,iCategory,iCell) + seaicePuny) - carbonErrorCat = totalCarbonCatInitial(iCategory) - totalCarbonCatFlux(iCategory)*config_dt - & - totalCarbonCatFinal(iCategory) - if (abs(carbonErrorCat) > accuracy*MAXVAL((/totalCarbonCatInitial(iCategory),totalCarbonCatFinal(iCategory)/))) then -! abortFlag = .true. -! abortMessage = "carbon conservation errror after column bgc" - call mpas_log_write("column_biogeochemistry, carbon conservation error", messageType=MPAS_LOG_ERR) - call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) - call mpas_log_write("carbonErrorCat: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonErrorCat/)) - call mpas_log_write("carbonErrorCat*iceAreaCategory: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonErrorCat*iceAreaCategory(1,iCategory,iCell)/)) - call mpas_log_write("totalCarbonCatInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatInitial(iCategory)/)) - call mpas_log_write("totalCarbonCatFinal(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory)/)) - call mpas_log_write("totalCarbonCatFlux(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFlux(iCategory)/)) - call mpas_log_write("brineHeightCatInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/brineHeightCatInitial(iCategory)/)) - call mpas_log_write("brineHeightCatFinal(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/brineHeightCatFinal(iCategory)/)) - endif + call seaice_total_carbon_content_category(block,totalCarbonCatFinal(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) + call seaice_ocean_carbon_flux(block,totalCarbonCatFlux(:,iCell),oceanBioFluxesCategory(:,:,:),iCell) + totalCarbonFinal(iCell) = 0.0_RKIND + totalCarbonFlux(iCell) = 0.0_RKIND + do iCategory = 1, nCategories + totalCarbonFinal(iCell) = totalCarbonFinal(iCell) + totalCarbonCatFinal(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) + totalCarbonFlux(iCell) = totalCarbonFlux(iCell) + totalCarbonCatFlux(iCategory,iCell) * iceAreaCategory(1,iCategory,iCell) enddo - endif + carbonError(iCell) = (totalCarbonFinal(iCell) - totalCarbonInitial(iCell))/config_dt +totalCarbonFlux(iCell) + errorCheck = max(accuracy,accuracy*abs(totalCarbonFlux(iCell))) + + if (abs(carbonError(iCell)) > errorCheck) then + do iCategory = 1,nCategories + if (iceAreaCategory(1,iCategory,iCell) > seaicePuny) then + brineHeightCatFinal(iCategory,iCell) = brineFraction(1,iCategory,iCell) * & + iceVolumeCategory(1,iCategory,iCell)/(iceAreaCategory(1,iCategory,iCell) + seaicePuny) + call mpas_log_write("column_biogeochemistry, carbon conservation error", messageType=MPAS_LOG_ERR) + call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) + call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) + call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)/)) + call mpas_log_write("carbonError*iceAreaCategory: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)*iceAreaCategory(1,iCategory,iCell)/)) + call mpas_log_write("iceAreaCategory: $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategory(1,iCategory,iCell)/)) + call mpas_log_write("iceAreaCategoryInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategoryInitial(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatInitial(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) + call mpas_log_write("totalCarbonCatFlux(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFlux(iCategory,iCell)/)) + call mpas_log_write("brineHeightCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/brineHeightCatInitial(iCategory,iCell)/)) + call mpas_log_write("brineHeightCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/brineHeightCatFinal(iCategory,iCell)/)) + call mpas_log_write("iceAreaCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategory(1,iCategory,iCell)/)) + end if + enddo !categories + endif ! carbonError + endif ! checkCarbon totalSkeletalAlgae(iCell) = 0.0_RKIND bioShortwaveFluxCell(:,iCell) = 0.0_RKIND @@ -4047,16 +4225,17 @@ subroutine column_biogeochemistry(domain) call seaice_critical_error_write_block(domain, block, abortFlag) call seaice_check_critical_error(domain, abortFlag) - if (checkCarbon) then - deallocate(totalCarbonCatFinal) - deallocate(totalCarbonCatInitial) - deallocate(totalCarbonCatFlux) - deallocate(brineHeightCatFinal) - endif + deallocate(totalCarbonCatFinal) + deallocate(totalCarbonCatInitial) + deallocate(totalCarbonCatFlux) + deallocate(brineHeightCatFinal) + deallocate(totalCarbonFinal) + deallocate(totalCarbonInitial) + deallocate(totalCarbonFlux) deallocate(brineHeightCatInitial) deallocate(newlyFormedIceLogical) - deallocate(oceanBioConcentrationsUsed) + deallocate(carbonError) block => block % next end do @@ -4585,6 +4764,7 @@ subroutine seaice_icepack_coupling_prep(domain) oceanDMSPdFlux, & oceanHumicsFlux, & oceanDustIronFlux, & + oceanBlackCarbonFlux, & totalOceanCarbonFlux real(kind=RKIND), dimension(:,:), pointer :: & @@ -4725,6 +4905,7 @@ subroutine seaice_icepack_coupling_prep(domain) call MPAS_pool_get_array(biogeochemistry, "oceanDMSPdFlux", oceanDMSPdFlux) call MPAS_pool_get_array(biogeochemistry, "oceanHumicsFlux", oceanHumicsFlux) call MPAS_pool_get_array(biogeochemistry, "oceanDustIronFlux", oceanDustIronFlux) + call MPAS_pool_get_array(biogeochemistry, "oceanBlackCarbonFlux", oceanBlackCarbonFlux) call MPAS_pool_get_array(biogeochemistry, "oceanBioFluxes", oceanBioFluxes) call MPAS_pool_get_array(biogeochemistry, "oceanAlgaeFlux", oceanAlgaeFlux) call MPAS_pool_get_array(biogeochemistry, "oceanDOCFlux", oceanDOCFlux) @@ -4857,6 +5038,7 @@ subroutine seaice_icepack_coupling_prep(domain) oceanDMSPdFlux(iCell) = 0.0_RKIND oceanDMSFlux(iCell) = 0.0_RKIND oceanDustIronFlux(iCell) = 0.0_RKIND + oceanBlackCarbonFlux(iCell) = 0.0_RKIND oceanHumicsFlux(iCell) = 0.0_RKIND do iBioTracers = 1, ciceTracerObject % nBioTracers @@ -4939,8 +5121,11 @@ subroutine seaice_icepack_coupling_prep(domain) oceanParticulateIronFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) enddo - ! Black Carbon (not saved) - iBioData = iBioData + maxBCType + ! Black Carbon (combined; saved for conservation) + do iBioTracers = 1, maxBCType + iBioData = iBioData + 1 + oceanBlackCarbonFlux(iCell) = oceanBlackCarbonFlux(iCell) + oceanBioFluxesAll(iBioData) + enddo ! Dust (combined) do iBioTracers = 1, maxDustType @@ -5034,6 +5219,7 @@ subroutine seaice_column_scale_fluxes(domain) oceanDMSPpFlux, & oceanDMSPdFlux, & oceanHumicsFlux, & + oceanBlackCarbonFlux, & oceanDustIronFlux real(kind=RKIND), dimension(:,:), pointer :: & @@ -5116,6 +5302,7 @@ subroutine seaice_column_scale_fluxes(domain) call MPAS_pool_get_array(biogeochemistry, "oceanDMSPdFlux", oceanDMSPdFlux) call MPAS_pool_get_array(biogeochemistry, "oceanHumicsFlux", oceanHumicsFlux) call MPAS_pool_get_array(biogeochemistry, "oceanDustIronFlux", oceanDustIronFlux) + call MPAS_pool_get_array(biogeochemistry, "oceanBlackCarbonFlux", oceanBlackCarbonFlux) call MPAS_pool_get_array(biogeochemistry, "oceanAlgaeFlux", oceanAlgaeFlux) call MPAS_pool_get_array(biogeochemistry, "oceanDOCFlux", oceanDOCFlux) call MPAS_pool_get_array(biogeochemistry, "oceanDICFlux", oceanDICFlux) @@ -5156,8 +5343,10 @@ subroutine seaice_column_scale_fluxes(domain) albedoVisibleDiffuseCell(iCell) = albedoVisibleDiffuseCell(iCell) * iceAreaInverse albedoIRDiffuseCell(iCell) = albedoIRDiffuseCell(iCell) * iceAreaInverse - if (config_use_zaerosols) & + if (config_use_zaerosols) then oceanDustIronFlux(iCell) = oceanDustIronFlux(iCell) * iceAreaInverse + oceanBlackCarbonFlux(iCell) = oceanBlackCarbonFlux(iCell) * iceAreaInverse + end if if (config_use_column_biogeochemistry) then @@ -5210,8 +5399,10 @@ subroutine seaice_column_scale_fluxes(domain) albedoVisibleDiffuseCell(iCell) = 0.0_RKIND albedoIRDiffuseCell(iCell) = 0.0_RKIND - if (config_use_zaerosols) & - oceanDustIronFlux(iCell) = 0.0_RKIND + if (config_use_zaerosols) then + oceanDustIronFlux(iCell) = 0.0_RKIND + oceanBlackCarbonFlux(iCell) = 0.0_RKIND + end if if (config_use_column_biogeochemistry) then @@ -9125,7 +9316,6 @@ subroutine init_icepack_package_parameters(domain, tracerObject) call init_icepack_package_tracer_indices(tracerObject) ! set the column parameters - call init_column_package_configs(domain) !echmod - temporary until colpkg_constants are moved call init_icepack_package_configs(domain) end subroutine init_icepack_package_parameters @@ -9654,7 +9844,7 @@ subroutine init_icepack_package_tracer_flags(domain) tr_pond_in = use_meltponds, & tr_pond_lvl_in = config_use_level_meltponds, & tr_pond_topo_in = config_use_topo_meltponds, & - !tr_fsd_in = , & + !tr_fsd_in = config_use_floe_size_distribution, & tr_aero_in = config_use_aerosols, & !tr_iso_in = , & tr_brine_in = config_use_brine, & @@ -9837,203 +10027,84 @@ end subroutine init_icepack_package_tracer_indices !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! -! init_column_package_configs +! init_icepack_package_configs ! !> \brief -!> \author Adrian K. Turner, LANL -!> \date 2nd Feburary 2015 +!> \author Adrian K. Turner, Elizabeth Hunke, Darin Comeau, Nicole Jeffery, Andrew Roberts, Erin Thomas, Jon Wolfe, LANL, Anthony Craig, NOAA (cntr), David Bailey, NCAR +!> \date 2022-2023 !> \details !> ! !----------------------------------------------------------------------- - subroutine init_column_package_configs(domain) !colpkg routine - remove - - !use ice_colpkg_shared, only: & - ! ktherm, & - ! conduct, & - ! fbot_xfer_type, & - ! heat_capacity, & - ! calc_Tsfc, & - ! ustar_min, & - ! a_rapid_mode, & - ! Rac_rapid_mode, & - ! aspect_rapid_mode, & - ! dSdt_slow_mode, & - ! phi_c_slow_mode, & - ! phi_i_mushy, & - ! shortwave, & - ! albedo_type, & - ! albicev, & - ! albicei, & - ! albsnowv, & - ! albsnowi, & - ! ahmax, & - ! R_ice, & - ! R_pnd, & - ! R_snw, & - ! dT_mlt, & - ! rsnw_mlt, & - ! kalg, & - ! kstrength, & - ! krdg_partic, & - ! krdg_redist, & - ! mu_rdg, & - ! Cf, & - ! atmbndy, & - ! calc_strair, & - ! formdrag, & - ! highfreq, & - ! natmiter, & - ! oceanmixed_ice, & - ! tfrz_option, & - ! kitd, & - ! kcatbound, & - ! hs0, & - ! frzpnd, & - ! dpscale, & - ! rfracmin, & - ! rfracmax, & - ! pndaspect, & - ! hs1, & - ! hp1 - ! bgc_flux_type, & - ! z_tracers, & - ! scale_bgc, & - ! solve_zbgc, & - ! dEdd_algae, & - ! modal_aero, & - ! skl_bgc, & - ! solve_zsal, & - ! grid_o, & - ! l_sk, & - ! grid_o_t, & - ! initbio_frac, & - ! frazil_scav, & - ! grid_oS, & - ! l_skS, & - ! phi_snow, & - ! ratio_Si2N_diatoms, & - ! ratio_Si2N_sp , & - ! ratio_Si2N_phaeo , & - ! ratio_S2N_diatoms , & - ! ratio_S2N_sp , & - ! ratio_S2N_phaeo , & - ! ratio_Fe2C_diatoms, & - ! ratio_Fe2C_sp , & - ! ratio_Fe2C_phaeo , & - ! ratio_Fe2N_diatoms, & - ! ratio_Fe2N_sp , & - ! ratio_Fe2N_phaeo , & - ! ratio_Fe2DON , & - ! ratio_Fe2DOC_s , & - ! ratio_Fe2DOC_l , & - ! fr_resp , & - ! tau_min , & - ! tau_max , & - ! algal_vel , & - ! R_dFe2dust , & - ! dustFe_sol , & - ! chlabs_diatoms , & - ! chlabs_sp , & - ! chlabs_phaeo , & - ! alpha2max_low_diatoms , & - ! alpha2max_low_sp , & - ! alpha2max_low_phaeo , & - ! beta2max_diatoms , & - ! beta2max_sp , & - ! beta2max_phaeo , & - ! mu_max_diatoms , & - ! mu_max_sp , & - ! mu_max_phaeo , & - ! grow_Tdep_diatoms, & - ! grow_Tdep_sp , & - ! grow_Tdep_phaeo , & - ! fr_graze_diatoms , & - ! fr_graze_sp , & - ! fr_graze_phaeo , & - ! mort_pre_diatoms , & - ! mort_pre_sp , & - ! mort_pre_phaeo , & - ! mort_Tdep_diatoms, & - ! mort_Tdep_sp , & - ! mort_Tdep_phaeo , & - ! k_exude_diatoms , & - ! k_exude_sp , & - ! k_exude_phaeo , & - ! K_Nit_diatoms , & - ! K_Nit_sp , & - ! K_Nit_phaeo , & - ! K_Am_diatoms , & - ! K_Am_sp , & - ! K_Am_phaeo , & - ! K_Sil_diatoms , & - ! K_Sil_sp , & - ! K_Sil_phaeo , & - ! K_Fe_diatoms , & - ! K_Fe_sp , & - ! K_Fe_phaeo , & - ! f_don_protein , & - ! kn_bac_protein , & - ! f_don_Am_protein , & - ! f_doc_s , & - ! f_doc_l , & - ! f_exude_s , & - ! f_exude_l , & - ! k_bac_s , & - ! k_bac_l , & - ! T_max , & - ! fsal , & - ! op_dep_min , & - ! fr_graze_s , & - ! fr_graze_e , & - ! fr_mort2min , & - ! fr_dFe , & - ! k_nitrif , & - ! t_iron_conv , & - ! max_loss , & - ! max_dfe_doc1 , & - ! fr_resp_s , & - ! y_sk_DMS , & - ! t_sk_conv , & - ! t_sk_ox , & - ! algaltype_diatoms , & - ! algaltype_sp , & - ! algaltype_phaeo , & - ! nitratetype , & - ! ammoniumtype , & - ! silicatetype , & - ! dmspptype , & - ! dmspdtype , & - ! humtype , & - ! doctype_s , & - ! doctype_l , & - ! dontype_protein , & - ! fedtype_1 , & - ! feptype_1 , & - ! zaerotype_bc1 , & - ! zaerotype_bc2 , & - ! zaerotype_dust1 , & - ! zaerotype_dust2 , & - ! zaerotype_dust3 , & - ! zaerotype_dust4 , & - ! ratio_C2N_diatoms , & - ! ratio_C2N_sp , & - ! ratio_C2N_phaeo , & - ! ratio_chl2N_diatoms, & - ! ratio_chl2N_sp , & - ! ratio_chl2N_phaeo , & - ! F_abs_chl_diatoms , & - ! F_abs_chl_sp , & - ! F_abs_chl_phaeo , & - ! ratio_C2N_proteins - - use ice_colpkg, only: & - colpkg_init_parameters + subroutine init_icepack_package_configs(domain) + + use icepack_intfc, only: & + icepack_init_parameters, & + icepack_write_parameters, & + icepack_configure, & + icepack_query_parameters ! debugging + + use seaice_constants, only: & + seaicePuny, & ! a small number + seaiceBigNumber, & ! a large number + seaiceSecondsPerDay, & ! number of seconds in 1 day + seaiceDensityIce, & ! density of ice (kg/m^3) + seaiceDensitySnow, & ! density of snow (kg/m^3) + seaiceDensitySeaWater, & ! density of seawater (kg/m^3) + seaiceDensityFreshwater, & ! density of freshwater (kg/m^3) + seaiceFreshIceSpecificHeat, & ! specific heat of fresh ice (J/kg/K) + seaiceWaterVaporSpecificHeat, & ! specific heat of water vapor (J/kg/K) + seaiceAirSpecificHeat, & ! specific heat of air (J/kg/K) + seaiceSeaWaterSpecificHeat, & ! specific heat of ocn (J/kg/K) + seaiceLatentHeatVaporization, & ! latent heat, vaporization freshwater (J/kg) + seaiceZvir, & ! rh2o/rair - 1.0 + seaiceLatentHeatSublimation, & ! latent heat, sublimation freshwater (J/kg) + seaiceLatentHeatMelting, & ! latent heat of melting of fresh ice (J/kg) + seaiceIceSurfaceMeltingTemperature, & ! melting temp. ice top surface (C) + seaiceSnowSurfaceMeltingTemperature, & ! melting temp. snow top surface (C) + seaiceStefanBoltzmann, & ! J m-2 K-4 s-1 + seaiceIceSnowEmissivity, & ! emissivity of snow and ice + seaiceSnowSurfaceScatteringLayer, & ! snow surface scattering layer thickness (m) + seaiceStabilityReferenceHeight, & ! stability reference height (m) + seaiceFreshWaterFreezingPoint, & ! freezing temp of fresh ice (K) + seaiceIceSurfaceRoughness, & ! ice surface roughness (m) + seaiceVonKarmanConstant, & ! Von Karman constant + seaiceOceanAlbedo, & ! Ocean albedo + seaiceReferenceSalinity, & ! ice reference salinity (ppt) + seaiceMaximumSalinity, & ! ice maximum salinity (ppt) + seaiceMeltingTemperatureDepression, & ! melting temperature depression factor (C/ppt) + seaiceFrazilSalinityReduction, & ! bulk salinity reduction of newly formed frazil (ppt) + seaiceFrazilIcePorosity, & ! initial liquid fraction of frazil + seaicePi, & ! pi + seaiceGravity, & ! gravitational acceleration (m/s^2) + seaiceSnowPatchiness, & ! snow patchiness parameter + seaiceIceStrengthConstantHiblerP, & ! P* constant in Hibler strength formulation + seaiceIceStrengthConstantHiblerC, & ! C* constant in Hibler strength formulation + skeletalLayerThickness, & ! skeletal layer thickness + gramsCarbonPerMolCarbon, & ! grams carbon per mol carbon + seaiceSnowMinimumDensity, & ! minimum snow density (kg/m^3) + seaiceBrineDynamicViscosity, & ! dynamic viscosity of brine (kg/m/s) + seaiceFreezingTemperatureConstant, &! constant freezing temp of seawater (C) + seaiceExtinctionCoef, & ! vis extnctn coef in ice, wvlngth<700nm (1/m) + seaiceFreshIceConductivity, & ! thermal conductivity of fresh ice(W/m/deg) + seaiceSnowMinimumThickness, & ! min snow thickness for computing zTsn (m) + seaiceFrazilMinimumThickness, & ! min thickness of new frazil ice + seaiceAlbedoWtVisibleDirect, & ! visible, direct + seaiceAlbedoWtNearIRDirect, & ! near IR, direct + seaiceAlbedoWtVisibleDiffuse, & ! visible, diffuse + seaiceAlbedoWtNearIRDiffuse, & ! near IR, diffuse + seaiceQsatQiceConstant, & ! constant for saturation humidity over ice + seaiceQsatTiceConstant, & ! constant for saturation humidity over ice + seaiceQsatQocnConstant, & ! constant for saturation humidity over ocean + seaiceQsatTocnConstant ! constant for saturation humidity over ocean type(domain_type), intent(inout) :: & domain + type(MPAS_pool_type), pointer :: & + snow + character(len=strKIND), pointer :: & config_thermodynamics_type, & config_heat_conductivity_type, & @@ -10046,13 +10117,17 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove config_itd_conversion_type, & config_category_bounds_type, & config_pond_refreezing_type, & + config_salt_flux_coupling_type, & config_ocean_heat_transfer_type, & + config_frazil_coupling_type, & config_sea_freezing_temperature_type, & config_skeletal_bgc_flux_type, & config_snow_redistribution_scheme logical, pointer :: & + config_use_snicar_ad, & config_calc_surface_temperature, & + config_update_ocean_fluxes, & config_use_form_drag, & config_use_high_frequency_coupling, & config_use_ocean_mixed_layer, & @@ -10062,10 +10137,12 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove config_use_vertical_biochemistry, & config_use_shortwave_bioabsorption, & config_use_skeletal_biochemistry, & - config_use_vertical_zsalinity, & config_use_modal_aerosols, & - config_use_snicar_ad, & - config_use_snow_liquid_ponds + config_use_macromolecules, & + config_do_restart_bgc, & + config_use_snow_liquid_ponds, & + config_use_snow_grain_radius, & + config_use_shortwave_redistribution real(kind=RKIND), pointer :: & config_min_friction_velocity, & @@ -10076,15 +10153,21 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove config_rapid_mode_aspect_ratio, & config_slow_mode_drainage_strength, & config_slow_mode_critical_porosity, & + config_macro_drainage_timescale, & config_congelation_ice_porosity, & +! config_frazil_ice_porosity, & +! config_frazil_salinity_reduction, & config_visible_ice_albedo, & config_infrared_ice_albedo, & config_visible_snow_albedo, & config_infrared_snow_albedo, & config_variable_albedo_thickness_limit, & +! config_snow_surface_scattering_layer_depth, & config_ice_shortwave_tuning_parameter, & config_pond_shortwave_tuning_parameter, & config_snow_shortwave_tuning_parameter, & + config_shortwave_redistribution_fraction, & + config_shortwave_redistribution_threshold, & config_temp_change_snow_grain_radius_change, & config_max_melting_snow_grain_radius, & config_algae_absorption_coefficient, & @@ -10102,8 +10185,6 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove config_biogrid_top_molecular_sublayer, & config_new_ice_fraction_biotracer, & config_fraction_biotracer_in_frazil, & - config_zsalinity_molecular_sublayer, & - config_zsalinity_gravity_drainage_scale, & config_snow_porosity_at_ice_surface, & config_ratio_Si_to_N_diatoms, & config_ratio_Si_to_N_small_plankton, & @@ -10228,13 +10309,40 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove config_snow_redistribution_factor, & config_max_dry_snow_radius + real(kind=RKIND), dimension(:,:,:), pointer :: & + snowEmpiricalGrowthParameterTau, & + snowEmpiricalGrowthParameterKappa, & + snowPropertyRate + integer, pointer :: & - config_boundary_layer_iteration_number + config_boundary_layer_iteration_number, & + nGrainAgingTemperature, & + nGrainAgingTempGradient, & + nGrainAgingSnowDensity + + integer :: & + config_thermodynamics_type_int, & + config_ice_strength_formulation_int, & + config_ridging_participation_function_int, & + config_ridging_redistribution_function_int, & + config_itd_conversion_type_int, & + config_category_bounds_type_int + + character(len=strKIND) :: tmp_config_shortwave_type + character(len=strKIND) :: tmp_config_snw_ssp_table + character(len=strKIND) :: snw_aging_table = 'snicar' + + ! debugging + integer :: itmp1, itmp2 + real(kind=RKIND) :: rtmp1, rtmp2 + character(len=strKIND) :: ctmp1, ctmp2 call MPAS_pool_get_config(domain % configs, "config_thermodynamics_type", config_thermodynamics_type) call MPAS_pool_get_config(domain % configs, "config_heat_conductivity_type", config_heat_conductivity_type) call MPAS_pool_get_config(domain % configs, "config_ocean_heat_transfer_type", config_ocean_heat_transfer_type) call MPAS_pool_get_config(domain % configs, "config_calc_surface_temperature", config_calc_surface_temperature) + call MPAS_pool_get_config(domain % configs, "config_update_ocean_fluxes", config_update_ocean_fluxes) + call MPAS_pool_get_config(domain % configs, "config_frazil_coupling_type", config_frazil_coupling_type) call MPAS_pool_get_config(domain % configs, "config_min_friction_velocity", config_min_friction_velocity) call MPAS_pool_get_config(domain % configs, "config_ice_ocean_drag_coefficient", config_ice_ocean_drag_coefficient) call MPAS_pool_get_config(domain % configs, "config_snow_thermal_conductivity", config_snow_thermal_conductivity) @@ -10243,7 +10351,10 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove call MPAS_pool_get_config(domain % configs, "config_rapid_mode_aspect_ratio", config_rapid_mode_aspect_ratio) call MPAS_pool_get_config(domain % configs, "config_slow_mode_drainage_strength", config_slow_mode_drainage_strength) call MPAS_pool_get_config(domain % configs, "config_slow_mode_critical_porosity", config_slow_mode_critical_porosity) + call MPAS_pool_get_config(domain % configs, "config_macro_drainage_timescale", config_macro_drainage_timescale) call MPAS_pool_get_config(domain % configs, "config_congelation_ice_porosity", config_congelation_ice_porosity) +! call MPAS_pool_get_config(domain % configs, "config_frazil_ice_porosity", config_frazil_ice_porosity) +! call MPAS_pool_get_config(domain % configs, "config_frazil_salinity_reduction", config_frazil_salinity_reduction) call MPAS_pool_get_config(domain % configs, "config_shortwave_type", config_shortwave_type) call MPAS_pool_get_config(domain % configs, "config_use_snicar_ad", config_use_snicar_ad) call MPAS_pool_get_config(domain % configs, "config_albedo_type", config_albedo_type) @@ -10252,9 +10363,13 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove call MPAS_pool_get_config(domain % configs, "config_visible_snow_albedo", config_visible_snow_albedo) call MPAS_pool_get_config(domain % configs, "config_infrared_snow_albedo", config_infrared_snow_albedo) call MPAS_pool_get_config(domain % configs, "config_variable_albedo_thickness_limit", config_variable_albedo_thickness_limit) +! call MPAS_pool_get_config(domain % configs, "config_snow_surface_scattering_layer_depth", config_snow_surface_scattering_layer_depth) call MPAS_pool_get_config(domain % configs, "config_ice_shortwave_tuning_parameter", config_ice_shortwave_tuning_parameter) call MPAS_pool_get_config(domain % configs, "config_pond_shortwave_tuning_parameter", config_pond_shortwave_tuning_parameter) call MPAS_pool_get_config(domain % configs, "config_snow_shortwave_tuning_parameter", config_snow_shortwave_tuning_parameter) + call MPAS_pool_get_config(domain % configs, "config_use_shortwave_redistribution", config_use_shortwave_redistribution) + call MPAS_pool_get_config(domain % configs, "config_shortwave_redistribution_fraction", config_shortwave_redistribution_fraction) + call MPAS_pool_get_config(domain % configs, "config_shortwave_redistribution_threshold", config_shortwave_redistribution_threshold) call MPAS_pool_get_config(domain % configs, "config_temp_change_snow_grain_radius_change", & config_temp_change_snow_grain_radius_change) call MPAS_pool_get_config(domain % configs, "config_max_melting_snow_grain_radius", config_max_melting_snow_grain_radius) @@ -10275,6 +10390,7 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove call MPAS_pool_get_config(domain % configs, "config_category_bounds_type", config_category_bounds_type) call MPAS_pool_get_config(domain % configs, "config_snow_to_ice_transition_depth", config_snow_to_ice_transition_depth) call MPAS_pool_get_config(domain % configs, "config_pond_refreezing_type", config_pond_refreezing_type) + call MPAS_pool_get_config(domain % configs, "config_salt_flux_coupling_type", config_salt_flux_coupling_type) call MPAS_pool_get_config(domain % configs, "config_pond_flushing_factor", config_pond_flushing_factor) call MPAS_pool_get_config(domain % configs, "config_min_meltwater_retained_fraction", config_min_meltwater_retained_fraction) call MPAS_pool_get_config(domain % configs, "config_max_meltwater_retained_fraction", config_max_meltwater_retained_fraction) @@ -10288,17 +10404,16 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove call MPAS_pool_get_config(domain % configs, "config_use_vertical_biochemistry", config_use_vertical_biochemistry) call MPAS_pool_get_config(domain % configs, "config_use_shortwave_bioabsorption", config_use_shortwave_bioabsorption) call MPAS_pool_get_config(domain % configs, "config_use_modal_aerosols", config_use_modal_aerosols) + call MPAS_pool_get_config(domain % configs, "config_use_macromolecules", config_use_macromolecules) + call MPAS_pool_get_config(domain % configs, "config_do_restart_bgc", config_do_restart_bgc) call MPAS_pool_get_config(domain % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) - call MPAS_pool_get_config(domain % configs, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) call MPAS_pool_get_config(domain % configs, "config_biogrid_bottom_molecular_sublayer", & config_biogrid_bottom_molecular_sublayer) call MPAS_pool_get_config(domain % configs, "config_bio_gravity_drainage_length_scale", & config_bio_gravity_drainage_length_scale) call MPAS_pool_get_config(domain % configs, "config_biogrid_top_molecular_sublayer", config_biogrid_top_molecular_sublayer) - call MPAS_pool_get_config(domain % configs, "config_zsalinity_gravity_drainage_scale", config_zsalinity_gravity_drainage_scale) call MPAS_pool_get_config(domain % configs, "config_new_ice_fraction_biotracer", config_new_ice_fraction_biotracer) call MPAS_pool_get_config(domain % configs, "config_fraction_biotracer_in_frazil", config_fraction_biotracer_in_frazil) - call MPAS_pool_get_config(domain % configs, "config_zsalinity_molecular_sublayer", config_zsalinity_molecular_sublayer) call MPAS_pool_get_config(domain % configs, "config_snow_porosity_at_ice_surface", config_snow_porosity_at_ice_surface) call MPAS_pool_get_config(domain % configs, "config_ratio_Si_to_N_diatoms", config_ratio_Si_to_N_diatoms) call MPAS_pool_get_config(domain % configs, "config_ratio_Si_to_N_small_plankton", config_ratio_Si_to_N_small_plankton) @@ -10433,1534 +10548,14 @@ subroutine init_column_package_configs(domain) !colpkg routine - remove call MPAS_pool_get_config(domain % configs, "config_wind_compaction_factor", config_wind_compaction_factor) call MPAS_pool_get_config(domain % configs, "config_snow_redistribution_factor", config_snow_redistribution_factor) call MPAS_pool_get_config(domain % configs, "config_max_dry_snow_radius", config_max_dry_snow_radius) - - call colpkg_init_parameters(& - config_cice_int("config_thermodynamics_type", config_thermodynamics_type), & - config_heat_conductivity_type, & - config_ocean_heat_transfer_type, & - config_calc_surface_temperature, & - config_min_friction_velocity, & - config_ice_ocean_drag_coefficient, & - config_snow_thermal_conductivity, & - config_rapid_mode_channel_radius, & - config_rapid_model_critical_Ra, & - config_rapid_mode_aspect_ratio, & - config_slow_mode_drainage_strength, & - config_slow_mode_critical_porosity, & - config_congelation_ice_porosity, & - config_shortwave_type, & - config_use_snicar_ad, & - config_albedo_type, & - config_visible_ice_albedo, & - config_infrared_ice_albedo, & - config_visible_snow_albedo, & - config_infrared_snow_albedo, & - config_variable_albedo_thickness_limit, & - config_ice_shortwave_tuning_parameter, & - config_pond_shortwave_tuning_parameter, & - config_snow_shortwave_tuning_parameter, & - config_temp_change_snow_grain_radius_change, & - config_max_melting_snow_grain_radius, & - config_algae_absorption_coefficient, & - config_cice_int("config_ice_strength_formulation", config_ice_strength_formulation), & - config_cice_int("config_ridging_participation_function", config_ridging_participation_function), & - config_cice_int("config_ridging_redistribution_function", config_ridging_redistribution_function), & - config_ridging_efolding_scale, & - config_ratio_ridging_work_to_PE, & - config_atmos_boundary_method, & - config_calc_surface_stresses, & - config_use_form_drag, & - config_use_high_frequency_coupling, & - config_boundary_layer_iteration_number, & - config_use_ocean_mixed_layer, & - config_sea_freezing_temperature_type, & - config_cice_int("config_itd_conversion_type", config_itd_conversion_type), & - config_cice_int("config_category_bounds_type", config_category_bounds_type), & - config_snow_to_ice_transition_depth, & - config_pond_refreezing_type, & - config_pond_flushing_factor, & - config_min_meltwater_retained_fraction, & - config_max_meltwater_retained_fraction, & - config_pond_depth_to_fraction_ratio, & - config_snow_on_pond_ice_tapering_parameter, & - config_critical_pond_ice_thickness, & - config_skeletal_bgc_flux_type, & - config_use_vertical_tracers, & - config_scale_initial_vertical_bgc, & - config_use_vertical_biochemistry, & - config_use_shortwave_bioabsorption, & - config_use_modal_aerosols, & - config_use_skeletal_biochemistry, & - config_use_vertical_zsalinity, & - config_biogrid_bottom_molecular_sublayer, & - config_bio_gravity_drainage_length_scale, & - config_biogrid_top_molecular_sublayer, & - config_new_ice_fraction_biotracer, & - config_fraction_biotracer_in_frazil, & - config_zsalinity_molecular_sublayer, & - config_zsalinity_gravity_drainage_scale, & - config_snow_porosity_at_ice_surface, & - config_ratio_Si_to_N_diatoms, & - config_ratio_Si_to_N_small_plankton, & - config_ratio_Si_to_N_phaeocystis, & - config_ratio_S_to_N_diatoms, & - config_ratio_S_to_N_small_plankton, & - config_ratio_S_to_N_phaeocystis, & - config_ratio_Fe_to_C_diatoms, & - config_ratio_Fe_to_C_small_plankton, & - config_ratio_Fe_to_C_phaeocystis, & - config_ratio_Fe_to_N_diatoms, & - config_ratio_Fe_to_N_small_plankton, & - config_ratio_Fe_to_N_phaeocystis, & - config_ratio_Fe_to_DON, & - config_ratio_Fe_to_DOC_saccharids, & - config_ratio_Fe_to_DOC_lipids, & - config_respiration_fraction_of_growth, & - config_rapid_mobile_to_stationary_time, & - config_long_mobile_to_stationary_time, & - config_algal_maximum_velocity, & - config_ratio_Fe_to_dust, & - config_solubility_of_Fe_in_dust, & - config_chla_absorptivity_of_diatoms, & - config_chla_absorptivity_of_small_plankton, & - config_chla_absorptivity_of_phaeocystis, & - config_light_attenuation_diatoms, & - config_light_attenuation_small_plankton, & - config_light_attenuation_phaeocystis, & - config_light_inhibition_diatoms, & - config_light_inhibition_small_plankton, & - config_light_inhibition_phaeocystis, & - config_maximum_growth_rate_diatoms, & - config_maximum_growth_rate_small_plankton, & - config_maximum_growth_rate_phaeocystis, & - config_temperature_growth_diatoms, & - config_temperature_growth_small_plankton, & - config_temperature_growth_phaeocystis, & - config_grazed_fraction_diatoms, & - config_grazed_fraction_small_plankton, & - config_grazed_fraction_phaeocystis, & - config_mortality_diatoms, & - config_mortality_small_plankton, & - config_mortality_phaeocystis, & - config_temperature_mortality_diatoms, & - config_temperature_mortality_small_plankton, & - config_temperature_mortality_phaeocystis, & - config_exudation_diatoms, & - config_exudation_small_plankton, & - config_exudation_phaeocystis, & - config_nitrate_saturation_diatoms, & - config_nitrate_saturation_small_plankton, & - config_nitrate_saturation_phaeocystis, & - config_ammonium_saturation_diatoms, & - config_ammonium_saturation_small_plankton, & - config_ammonium_saturation_phaeocystis, & - config_silicate_saturation_diatoms, & - config_silicate_saturation_small_plankton, & - config_silicate_saturation_phaeocystis, & - config_iron_saturation_diatoms, & - config_iron_saturation_small_plankton, & - config_iron_saturation_phaeocystis, & - config_fraction_spilled_to_DON, & - config_degredation_of_DON, & - config_fraction_DON_ammonium, & - config_fraction_loss_to_saccharids, & - config_fraction_loss_to_lipids, & - config_fraction_exudation_to_saccharids, & - config_fraction_exudation_to_lipids, & - config_remineralization_saccharids, & - config_remineralization_lipids, & - config_maximum_brine_temperature, & - config_salinity_dependence_of_growth, & - config_minimum_optical_depth, & - config_slopped_grazing_fraction, & - config_excreted_fraction, & - config_fraction_mortality_to_ammonium, & - config_fraction_iron_remineralized, & - config_nitrification_rate, & - config_desorption_loss_particulate_iron, & - config_maximum_loss_fraction, & - config_maximum_ratio_iron_to_saccharids, & - config_respiration_loss_to_DMSPd, & - config_DMSP_to_DMS_conversion_fraction, & - config_DMSP_to_DMS_conversion_time, & - config_DMS_oxidation_time, & - config_mobility_type_diatoms, & - config_mobility_type_small_plankton, & - config_mobility_type_phaeocystis, & - config_mobility_type_nitrate, & - config_mobility_type_ammonium, & - config_mobility_type_silicate, & - config_mobility_type_DMSPp, & - config_mobility_type_DMSPd, & - config_mobility_type_humics, & - config_mobility_type_saccharids, & - config_mobility_type_lipids, & - config_mobility_type_inorganic_carbon, & - config_mobility_type_proteins, & - config_mobility_type_dissolved_iron, & - config_mobility_type_particulate_iron, & - config_mobility_type_black_carbon1, & - config_mobility_type_black_carbon2, & - config_mobility_type_dust1, & - config_mobility_type_dust2, & - config_mobility_type_dust3, & - config_mobility_type_dust4, & - config_ratio_C_to_N_diatoms, & - config_ratio_C_to_N_small_plankton, & - config_ratio_C_to_N_phaeocystis, & - config_ratio_chla_to_N_diatoms, & - config_ratio_chla_to_N_small_plankton, & - config_ratio_chla_to_N_phaeocystis, & - config_scales_absorption_diatoms, & - config_scales_absorption_small_plankton, & - config_scales_absorption_phaeocystis, & - config_ratio_C_to_N_proteins, & - config_snow_redistribution_scheme, & - config_use_snow_liquid_ponds, & - config_fallen_snow_radius, & - config_max_dry_snow_radius, & - config_new_snow_density, & - config_max_snow_density, & - config_minimum_wind_compaction, & - config_wind_compaction_factor, & - config_snow_redistribution_factor) - - !----------------------------------------------------------------------- - ! Parameters for thermodynamics - !----------------------------------------------------------------------- - - ! ktherm: - ! type of thermodynamics - ! 1 = Bitz and Lipscomb 1999 - ! 2 = mushy layer theory - !ktherm = config_cice_int("config_thermodynamics_type", config_thermodynamics_type) - - ! conduct: - ! 'MU71' or 'bubbly' - !conduct = config_heat_conductivity_type - - ! calc_Tsfc: - ! if true, calculate surface temperature - ! if false, Tsfc is computed elsewhere and - ! atmos-ice fluxes are provided to CICE - !calc_Tsfc = config_calc_surface_temperature - - ! ustar_min: - ! minimum friction velocity for ice-ocean heat flux - !ustar_min = config_min_friction_velocity - - ! mushy thermodynamics: - - ! a_rapid_mode: - ! channel radius for rapid drainage mode (m) - !a_rapid_mode = config_rapid_mode_channel_radius - - ! Rac_rapid_mode: - ! critical rayleigh number for rapid drainage mode - !Rac_rapid_mode = config_rapid_model_critical_Ra - - ! aspect_rapid_mode: - ! aspect ratio for rapid drainage mode (larger=wider) - !aspect_rapid_mode = config_rapid_mode_aspect_ratio - - ! dSdt_slow_mode: - ! slow mode drainage strength (m s-1 K-1) - !dSdt_slow_mode = config_slow_mode_drainage_strength - - ! phi_c_slow_mode: - ! liquid fraction porosity cutoff for slow mode - !phi_c_slow_mode = config_slow_mode_critical_porosity - - ! phi_i_mushy: - ! liquid fraction of congelation ice - !phi_i_mushy = config_congelation_ice_porosity - - !----------------------------------------------------------------------- - ! Parameters for radiation - !----------------------------------------------------------------------- - - ! shortwave: - ! shortwave method, 'default' ('ccsm3') or 'dEdd' - !shortwave = config_shortwave_type - - ! albedo_type: - ! albedo parameterization, 'default' ('ccsm3') or 'constant' - ! shortwave='dEdd' overrides this parameter - !albedo_type = config_albedo_type - - ! baseline albedos for ccsm3 shortwave, set in namelist - - ! albicev: - ! visible ice albedo for h > ahmax - !albicev = config_visible_ice_albedo - - ! albicei: - ! near-ir ice albedo for h > ahmax - !albicei = config_infrared_ice_albedo - - ! albsnowv: - ! cold snow albedo, visible - !albsnowv = config_visible_snow_albedo - - ! albsnowi: - ! cold snow albedo, near IR - !albsnowi = config_infrared_snow_albedo - - ! ahmax: - ! thickness above which ice albedo is constant (m) - !ahmax = config_variable_albedo_thickness_limit - - ! dEdd tuning parameters, set in namelist - - ! R_ice: - ! sea ice tuning parameter; +1 > 1sig increase in albedo - !R_ice = config_ice_shortwave_tuning_parameter - - ! R_pnd: - ! ponded ice tuning parameter; +1 > 1sig increase in albedo - !R_pnd = config_pond_shortwave_tuning_parameter - - ! R_snw: - ! snow tuning parameter; +1 > ~.01 change in broadband albedo - !R_snw = config_snow_shortwave_tuning_parameter - - ! dT_mlt: - ! change in temp for non-melt to melt snow grain radius change (C) - !dT_mlt = config_temp_change_snow_grain_radius_change - - ! rsnw_mlt: - ! maximum melting snow grain radius (10^-6 m) - !rsnw_mlt = config_max_melting_snow_grain_radius - - ! kalg: - ! algae absorption coefficient for 0.5 m thick layer - !kalg = config_algae_absorption_coefficient - - !----------------------------------------------------------------------- - ! Parameters for ridging and strength - !----------------------------------------------------------------------- - - ! kstrength: - ! 0 for simple Hibler (1979) formulation - ! 1 for Rothrock (1975) pressure formulation - !kstrength = config_cice_int("config_ice_strength_formulation", config_ice_strength_formulation) - - ! krdg_partic: - ! 0 for Thorndike et al. (1975) formulation - ! 1 for exponential participation function - !krdg_partic = config_cice_int("config_ridging_participation_function", config_ridging_participation_function) - - ! krdg_redist: - ! 0 for Hibler (1980) formulation - ! 1 for exponential redistribution function - !krdg_redist = config_cice_int("config_ridging_redistribution_function", config_ridging_redistribution_function) - - ! mu_rdg: - ! gives e-folding scale of ridged ice (m^.5) - ! (krdg_redist = 1) - !mu_rdg = config_ridging_efolding_scale - - ! Cf - ! ratio of ridging work to PE change in ridging (kstrength = 1) - !Cf = config_ratio_ridging_work_to_PE - - !----------------------------------------------------------------------- - ! Parameters for atmosphere - !----------------------------------------------------------------------- - - ! atmbndy: - ! atmo boundary method, 'default' ('ccsm3') or 'constant' - !atmbndy = config_atmos_boundary_method - - ! calc_strair: - ! if true, calculate wind stress components - !calc_strair = config_calc_surface_stresses - - ! formdrag: - ! if true, calculate form drag - !formdrag = config_use_form_drag - - ! highfreq: - ! if true, use high frequency coupling - !highfreq = config_use_high_frequency_coupling - - ! natmiter: - ! number of iterations for boundary layer calculations - !natmiter = config_boundary_layer_iteration_number - - !----------------------------------------------------------------------- - ! Parameters for ocean - !----------------------------------------------------------------------- - - ! oceanmixed_ice: - ! if true, use ocean mixed layer - !oceanmixed_ice = config_use_ocean_mixed_layer - - ! fbot_xfer_type: - ! transfer coefficient type for ice-ocean heat flux - !fbot_xfer_type = config_ocean_heat_transfer_type - - ! tfrz_option: - ! form of ocean freezing temperature - ! 'minus1p8' = -1.8 C - ! 'linear_salt' = -depressT * sss - ! 'mushy' conforms with ktherm=2 - !tfrz_option = config_sea_freezing_temperature_type - - !----------------------------------------------------------------------- - ! Parameters for the ice thickness distribution - !----------------------------------------------------------------------- - - ! kitd: - ! type of itd conversions - ! 0 = delta function - ! 1 = linear remap - !kitd = config_cice_int("config_itd_conversion_type", config_itd_conversion_type) - - ! kcatbound: - ! 0 = old category boundary formula - ! 1 = new formula giving round numbers - ! 2 = WMO standard - ! 3 = asymptotic formula - !kcatbound = config_cice_int("config_category_bounds_type", config_category_bounds_type) - - !----------------------------------------------------------------------- - ! Parameters for melt ponds - !----------------------------------------------------------------------- - - ! hs0: - ! snow depth for transition to bare sea ice (m) - !hs0 = config_snow_to_ice_transition_depth - - ! level-ice ponds - - ! frzpnd: - ! pond refreezing parameterization - !frzpnd = config_pond_refreezing_type - - ! dpscale: - ! alters e-folding time scale for flushing with BL99 thermodynamics - !dpscale = config_pond_flushing_factor - - ! rfracmin: - ! minimum retained fraction of meltwater - !rfracmin = config_min_meltwater_retained_fraction - - ! rfracmax: - ! maximum retained fraction of meltwater - !rfracmax = config_max_meltwater_retained_fraction - - ! pndaspect: - ! ratio of pond depth to pond fraction - !pndaspect = config_pond_depth_to_fraction_ratio - - ! hs1: - ! tapering parameter for snow on pond ice - !hs1 = config_snow_on_pond_ice_tapering_parameter - - ! topo ponds - - ! hp1 - ! critical parameter for pond ice thickness - !hp1 = config_critical_pond_ice_thickness - - !----------------------------------------------------------------------- - ! Parameters for biogeochemistry - !----------------------------------------------------------------------- - - ! bgc_flux_type: - ! bgc_flux_type = config_skeletal_bgc_flux_type - - ! z_tracers: - ! if .true., bgc or aerosol tracers are vertically resolved - !z_tracers = config_use_vertical_tracers - - ! scale_bgc: - ! if .true., initialize bgc tracers proportionally with salinity - !scale_bgc = config_scale_initial_vertical_bgc - - ! solve_zbgc: - ! if .true., solve vertical biochemistry portion of code - !solve_zbgc = config_use_vertical_biochemistry - - ! dEdd_algae: - ! if .true., algal absorption of Shortwave is computed in the - !dEdd_algae = config_use_shortwave_bioabsorption - - ! skl_bgc: - ! if true, solve skeletal biochemistry - !skl_bgc = config_use_skeletal_biochemistry - -! zsalinity has been deprecated -! ! solve_zsal: -! ! if true, update salinity profile from solve_S_dt -! !solve_zsal = config_use_vertical_zsalinity - - ! modal_aero: - ! if true, use modal aerosal optical properties - ! only for use with tr_aero or tr_zaero - !modal_aero = config_use_shortwave_bioabsorption - - ! grid_o: - ! for bottom flux - !grid_o = config_biogrid_bottom_molecular_sublayer - - ! l_sk: - ! characteristic diffusive scale (zsalinity) (m) - !l_sk =config_bio_gravity_drainage_length_scale - - ! grid_o_t: - ! top grid point length scale - !grid_o_t = config_biogrid_top_molecular_sublayer - - ! phi_snow: - ! porosity of snow - !phi_snow = config_snow_porosity_at_ice_surface - - ! initbio_frac: - ! fraction of ocean tracer concentration used to initialize tracer - !initbio_frac = config_new_ice_fraction_biotracer - - ! frazil_scav: - ! multiple of ocean tracer concentration due to frazil scavenging - !frazil_scav = config_fraction_biotracer_in_frazil - - ! ratio_Si2N_diatoms: - ! ratio of algal Silicate to Nitrate (mol/mol) - ! ratio_Si2N_diatoms = config_ratio_Si_to_N_diatoms - - ! ratio_Si2N_sp: - ! ratio of algal Silicate to Nitrogen (mol/mol) - ! ratio_Si2N_sp = config_ratio_Si_to_N_small_plankton - - ! ratio_Si2N_phaeo: - ! ratio of algal Silicate to Nitrogen (mol/mol) - ! ratio_Si2N_phaeo = config_ratio_Si_to_N_phaeocystis - - ! ratio_S2N_diatoms: - ! ratio of algal Sulphur to Nitrogen (mol/mol) - ! ratio_S2N_diatoms = config_ratio_S_to_N_diatoms - - ! ratio_S2N_sp: - ! ratio of algal Sulphur to Nitrogen (mol/mol) - ! ratio_S2N_sp = config_ratio_S_to_N_small_plankton - - ! ratio_S2N_phaeo: - ! ratio of algal Sulphur to Nitrogen (mol/mol) - ! ratio_S2N_phaeo = config_ratio_S_to_N_phaeocystis - - ! ratio_Fe2C_diatoms: - ! ratio of algal iron to carbon (umol/mol) - ! ratio_Fe2C_diatoms = config_ratio_Fe_to_C_diatoms - - ! ratio_Fe2C_sp: - ! ratio of algal iron to carbon (umol/mol) - ! ratio_Fe2C_sp = config_ratio_Fe_to_C_small_plankton - - ! ratio_Fe2C_phaeo: - ! ratio of algal iron to carbon (umol/mol) - ! ratio_Fe2C_phaeo = config_ratio_Fe_to_C_phaeocystis - - ! ratio_Fe2N_diatoms: - ! ratio of algal iron to nitrogen (umol/mol) - ! ratio_Fe2N_diatoms = config_ratio_Fe_to_N_diatoms - - ! ratio_Fe2N_sp: - ! ratio of algal iron to nitrogen (umol/mol) - ! ratio_Fe2N_sp = config_ratio_Fe_to_N_small_plankton - - ! ratio_Fe2N_phaeo: - ! ratio of algal iron to nitrogen (umol/mol) - ! ratio_Fe2N_phaeo = config_ratio_Fe_to_N_phaeocystis - - ! ratio_Fe2DON: - ! ratio of iron to nitrogen of DON (nmol/umol) - ! ratio_Fe2DON = config_ratio_Fe_to_DON - - ! ratio_Fe2DOC_s: - ! ratio of iron to carbon of DOC (nmol/umol) saccharids - ! ratio_Fe2DOC_s = config_ratio_Fe_to_DOC_saccharids - - ! ratio_Fe2DOC_l: - ! ratio of iron to carbon of DOC (nmol/umol) lipids - ! ratio_Fe2DOC_l = config_ratio_Fe_to_DOC_lipids - - ! fr_resp: - ! fraction of algal growth lost due to respiration - ! fr_resp = config_respiration_fraction_of_growth - - ! tau_min: - ! rapid mobile to stationary exchanges (s) = 1.5 hours - ! tau_min = config_rapid_mobile_to_stationary_time - - ! tau_max: - ! long time mobile to stationary exchanges (s) = 2 days - ! tau_max = config_long_mobile_to_stationary_time - - ! algal_vel: - ! 0.5 cm/d(m/s) Lavoie 2005 1.5 cm/day - ! algal_vel = config_algal_maximum_velocity - - ! R_dFe2dust: - ! g/g (3.5% content) Tagliabue 2009 - ! R_dFe2dust = config_ratio_Fe_to_dust - - ! dustFe_sol; - ! solubility fraction - ! dustFe_sol = config_solubility_of_Fe_in_dust - - ! chlabs_diatoms: - ! chl absorption (1/m/(mg/m^3)) - ! chlabs_diatoms = config_chla_absorptivity_of_diatoms - - ! chlabs_sp: - ! chl absorption (1/m/(mg/m^3)) - ! chlabs_sp = config_chla_absorptivity_of_small_plankton - - ! chlabs_phaeo: - ! chl absorption (1/m/(mg/m^3)) - ! chlabs_phaeo = config_chla_absorptivity_of_phaeocystis - - ! alpha2max_low_diatoms: - ! light limitation diatoms (1/(W/m^2)) - ! alpha2max_low_diatoms = config_light_attenuation_diatoms - - ! alpha2max_low_sp: - ! light limitation small plankton (1/(W/m^2)) - ! alpha2max_low_sp = config_light_attenuation_small_plankton - - ! alpha2max_low_phaeo: - ! light limitation phaeocystis (1/(W/m^2)) - ! alpha2max_low_phaeo = config_light_attenuation_phaeocystis - - ! beta2max_diatoms: - ! light inhibition diatoms(1/(W/m^2)) - ! beta2max_diatoms = config_light_inhibition_diatoms - - ! beta2max_sp: - ! light inhibition small plankton(1/(W/m^2)) - ! beta2max_sp = config_light_inhibition_small_plankton - - ! beta2max_phaeo: - ! light inhibition phaeocystis (1/(W/m^2)) - ! beta2max_phaeo = config_light_inhibition_phaeocystis - - ! mu_max_diatoms: - ! maximum growth rate diatoms (1/day) - ! mu_max_diatoms = config_maximum_growth_rate_diatoms - - ! mu_max_sp: - ! maximum growth rate small plankton (1/day) - ! mu_max_sp = config_maximum_growth_rate_small plankton - - ! mu_max_phaeo: - ! maximum growth rate phaeocystis (1/day) - ! mu_max_phaeo = config_maximum_growth_rate_phaeocystis - - ! grow_Tdep_sp: - ! Temperature dependence of growth small plankton (1/C) - ! grow_Tdep_sp = config_temperature_growth_small_plankton - - ! grow_Tdep_phaeo: - ! Temperature dependence of growth phaeocystis (1/C) - ! grow_Tdep_phaeo = config_temperature_growth_phaeocystis - - ! fr_graze_diatoms: - ! Fraction grazed diatoms - ! fr_graze_diatoms = config_grazed_fraction_diatoms - - ! fr_graze_sp: - ! Fraction grazed small_plankton - ! fr_graze_sp = config_grazed_fraction_small_plankton - - ! fr_graze_phaeo: - ! Fraction grazed phaeocystis - ! fr_graze_phaeo = config_grazed_fraction_phaeocystis - - ! mort_pre_diatoms: - ! Mortality diatoms (1/day) - ! mort_pre_diatoms = config_mortality_diatoms - - ! mort_pre_sp: - ! Mortality small_plankton (1/day) - ! mort_pre_sp = config_mortality_small_plankton - - ! mort_pre_phaeo: - ! Mortality phaeocystis (1/day) - ! mort_pre_phaeo = config_mortality_phaeocystis - - ! mort_Tdep_diatoms: - ! T dependence of mortality diatoms (1/C) - ! mort_Tdep_diatoms = config_temperature_mortality_diatoms - - ! mort_Tdep_sp: - ! T dependence of mortality small plankton (1/C) - ! mort_Tdep_sp = config_temperature_mortality_small_plankton - - ! mort_Tdep_phaeo: - ! T dependence of mortality phaeocystis (1/C) - ! mort_Tdep_phaeo = config_temperature_mortality_phaeocystis - - ! k_exude_diatoms: - ! algal exudation diatoms (1/d) - ! k_exude_diatoms = config_exudation_diatoms - - ! k_exude_sp: - ! algal exudation small_plankton (1/d) - ! k_exude_sp = config_exudation_small_plankton - - ! k_exude_phaeo: - ! algal exudation phaeocystis (1/d) - ! k_exude_phaeo = config_exudation_phaeocystis - - ! K_Nit_diatoms: - ! nitrate half saturation diatoms (mmol/m^3) - ! K_Nit_diatoms = config_nitrate_saturation_diatoms - - ! K_Nit_sp: - ! nitrate half saturation small_plankton (mmol/m^3) - ! K_Nit_sp = config_nitrate_saturation_small_plankton - - ! K_Nit_phaeo: - ! nitrate half saturation phaeocystis (mmol/m^3) - ! K_Nit_phaeocystis = config_nitrate_saturation_phaeocystis - - ! K_Am_diatoms: - ! ammonium half saturation diatoms (mmol/m^3) - ! K_Am_diatoms = config_ammonium_saturation_diatoms - - ! K_Am_sp: - ! ammonium half saturation small_plankton (mmol/m^3) - ! K_Am_sp = config_ammonium_saturation_small_plankton - - ! K_Am_phaeo: - ! ammonium half saturation phaeocystis (mmol/m^3) - ! K_Am_phaeocystis = config_ammonium_saturation_phaeocystis - - ! K_Sil_diatoms: - ! silicate half saturation diatoms (mmol/m^3) - ! K_Sil_diatoms = config_silicate_saturation_diatoms - - ! K_Sil_sp: - ! silicate half saturation small_plankton (mmol/m^3) - ! K_Sil_sp = config_silicate_saturation_small_plankton - - ! K_Sil_phaeo: - ! silicate half saturation phaeocystis (mmol/m^3) - ! K_Sil_phaeocystis = config_silicate_saturation_phaeocystis - - ! K_Fe_diatoms: - ! iron half saturation diatoms (nM) - ! K_Fe_diatoms = config_iron_saturation_diatoms - - ! K_Fe_sp: - ! iron half saturation small_plankton (nM) - ! K_Fe_sp = config_iron_saturation_small_plankton - - ! K_Fe_phaeo: - ! iron half saturation phaeocystis (nM) - ! K_Fe_phaeocystis = config_iron_saturation_phaeocystis - - ! f_don_protein: - ! fraction of spilled grazing to proteins ! - ! f_don_protein = config_fraction_spilled_to_DON - - ! kn_bac_protein: - ! Bacterial degredation of DON (1/d) ! ! - ! kn_bac_protein = config_degredation_of_DON - - ! f_don_Am_protein: - ! fraction of remineralized DON to ammonium ! - ! f_don_Am_protein = config_fraction_DON_ammonium - - ! f_doc_s: - ! fraction of mortality to DOC saccharids - ! f_doc_s = config_fraction_loss_to_saccharids - - ! f_doc_l: - ! fraction of mortality to DOC lipids - ! f_doc_l = config_fraction_loss_to_lipids - - ! f_exude_s: - ! fraction of exudation to DOC saccharids - ! f_exude_s = config_fraction_exudation_to_saccharids - - ! f_exude_l: - ! fraction of exudation to DOC lipids - ! f_exude_l = config_fraction_exudation_to_lipids - - ! k_bac_s: - ! Bacterial degredation of DOC (1/d) saccharids - ! k_bac_s = config_remineralization_saccharids - - ! k_bac_l: - ! Bacterial degredation of DOC (1/d) lipids - ! k_bac_l = config_remineralization_lipids - - ! T_max: - ! maximum temperature (C) - ! T_max = config_maximum_brine_temperature - - ! fsal: - ! Salinity limitation (ppt) - ! fsal = config_salinity_dependence_of_growth - - ! op_dep_min: - ! Light attenuates for optical depths exceeding min - ! op_dep_min = config_minimum_optical_depth - - ! fr_graze_s: - ! fraction of grazing spilled or slopped - ! fr_graze_s = config_slopped_grazing_fraction - - ! fr_graze_e: - ! fraction of assimilation excreted - ! fr_graze_e = config_excreted_fraction - - ! fr_mort2min: - ! fractionation of mortality to Am - ! fr_mort2min = config_fraction_mortality_to_ammonium - - ! fr_dFe: - ! remineralized nitrogen (in units of algal iron) - ! fr_dFe = config_fraction_iron_remineralized - - ! k_nitrif: - ! nitrification rate (1/day) - ! k_nitrif = config_nitrification_rate - - ! t_iron_conv: - ! desorption loss pFe to dFe (day) - ! t_iron_conv = config_desorption_loss_particulate_iron - - ! max_loss: - ! restrict uptake to % of remaining value - ! max_loss = config_maximum_loss_fraction - - ! max_dfe_doc1: - ! max ratio of dFe to saccharides in the ice (nM Fe/muM C) - ! max_dfe_doc1 = config_maximum_ratio_iron_to_saccharids - - ! fr_resp_s: - ! DMSPd fraction of respiration loss as DMSPd - ! fr_resp_s = config_respiration_loss_to_DMSPd - - ! y_sk_DMS: - ! fraction conversion given high yield - ! y_sk_DMS = config_DMSP_to_DMS_conversion_fraction - - ! t_sk_conv: - ! Stefels conversion time (d) - ! t_sk_conv = config_DMSP_to_DMS_conversion_time - - ! t_sk_ox: - ! DMS oxidation time (d) - ! t_sk_ox = config_DMS_oxidation_time - - ! algaltype_diatoms: - ! mobility type diatoms - ! algaltype_diatoms = config_mobility_type_diatoms - - ! algaltype_sp: - ! mobility type small_plankton - ! algaltype_sp = config_mobility_type_small_plankton - - ! algaltype_phaeo: - ! mobility type phaeocystis - ! algaltype_phaeo = config_mobility_type_phaeocystis - - ! nitratetype: - ! mobility type nitrate - ! nitratetype = config_mobility_type_nitrate - - ! ammoniumtype: - ! mobility type ammonium - ! ammoniumtype = config_mobility_type_ammonium - - ! silicatetype: - ! mobility type silicate - ! silicatetype = config_mobility_type_silicate - - ! dmspptype: - ! mobility type DMSPp - ! dmspptype = config_mobility_type_DMSPp - - ! dmspdtype: - ! mobility type DMSPd - ! dmspdtype = config_mobility_type_DMSPd - - ! humicstype: - ! mobility type humics - ! humicstype = config_mobility_type_humics - - ! doctype_s: - ! mobility type sachharids - ! doctype_s = config_mobility_type_saccharids - - ! doctype_l: - ! mobility type lipids - ! doctype_l = config_mobility_type_lipids - - ! dictype_1: - ! mobility type dissolved inorganic carbon - ! dictype_1 = config_mobility_type_inorganic_carbon - - ! dontype_protein: - ! mobility type proteins - ! dontype_protein = config_mobility_type_proteins - - ! fedtype_1: - ! mobility type dissolved iron - ! fedtype_1 = config_mobility_type_dissolved_iron - - ! feptype_1: - ! mobility type particulate iron - ! feptype_1 = config_mobility_type_particulate_iron - - ! zaerotype_bc1: - ! mobility type for black carbon 1 - ! zaerotype_bc1 = config_mobility_type_black_carbon1 - - ! zaerotype_bc2: - ! mobility type for black carbon 2 - ! zaerotype_bc2 = config_mobility_type_black_carbon2 - - ! zaerotype_dust1: - ! mobility type for dust 1 - ! zaerotype_dust1 = config_mobility_type_dust1 - - ! zaerotype_dust2: - ! mobility type for dust 2 - ! zaerotype_dust2 = config_mobility_type_dust2 - - ! zaerotype_dust3: - ! mobility type for dust 3 - ! zaerotype_dust3 = config_mobility_type_dust3 - - ! zaerotype_dust4: - ! mobility type for dust 4 - ! zaerotype_dust4 = config_mobility_type_dust4 - - ! ratio_C2N_diatoms: - ! algal C to N ratio (mol/mol) diatoms - ! ratio_C2N_diatoms = config_ratio_C_to_N_diatoms - - ! ratio_C2N_sp: - ! algal C to N ratio (mol/mol) small_plankton - ! ratio_C2N_sp = config_ratio_C_to_N_small_plankton - - ! ratio_C2N_phaeo: - ! algal C to N ratio (mol/mol) phaeocystis - ! ratio_C2N_phaeo = config_ratio_C_to_N_phaeocystis - - ! ratio_chl2N_diatoms: - ! algal chla to N ratio (mol/mol) diatoms - ! ratio_chl2N_diatoms = config_ratio_chla_to_N_diatoms - - ! ratio_chl2N_sp: - ! algal chla to N ratio (mol/mol) small_plankton - ! ratio_chl2N_sp = config_ratio_chla_to_N_small_plankton - - ! ratio_chl2N_phaeo: - ! algal chla to N ratio (mol/mol) phaeocystis - ! ratio_chl2N_phaeo = config_ratio_chla_to_N_phaeocystis - - ! F_abs_chl_diatoms: - ! scales absorbed radiation for dEdd diatoms - ! F_abs_chl_diatoms = config_scales_absorption_diatoms - - ! F_abs_chl_sp: - ! scales absorbed radiation for dEdd small_plankton - ! F_abs_chl_sp = config_scales_absorption_small_plankton - - ! F_abs_chl_phaeo: - ! scales absorbed radiation for dEdd phaeocystis - ! F_abs_chl_phaeo = config_scales_absorption_phaeocystis - - ! ratio_C2N_proteins: - ! ratio of C to N in proteins (mol/mol) - ! ratio_C2N_proteins = config_ratio_C_to_N_proteins - -! ! grid_oS: -! ! for bottom flux (zsalinity) -! !grid_oS = config_zsalinity_molecular_sublayer - - ! l_skS: -! ! 0.02 characteristic skeletal layer thickness (m) (zsalinity) -! !l_skS = config_zsalinity_gravity_drainage_scale - - !----------------------------------------------------------------------- - ! Parameters for snow - !----------------------------------------------------------------------- - - ! snwredist: - ! snow redistribution type - ! snwredist = config_snow_redistribution_scheme - - ! use_smliq_pnd: - ! convert excess snow liquid to ponds - ! use_smliq_pnd = config_use_snow_liquid_ponds - - ! rsnw_fall: - ! fallen snow grain radius (um) - ! rsnw_fall = config_fallen_snow_radius - - ! rsnw_tmax: - ! maximum dry metamorphism snow grain radius (um) - ! rsnw_tmax = config_max_dry_snow_radius - - ! rhosnew: - ! new snow density (kg/m^3) - ! rhosnew = config_new_snow_density - - ! rhosmax: - ! maximum snow density (kg/m^3) - ! rhosmax = config_max_snow_density - - ! windmin: - ! minimum wind speed to compact snow (m/s) - ! windmin = config_minimum_wind_compaction - - ! snwlvlfac: - ! snow loss factor for wind redistribution - ! snwlvlfac = config_snow_redistribution_factor - - ! drhosdwind: - ! wind compaction factor (kg s/m^4) - ! drhosdwind = config_wind_compaction_factor - - end subroutine init_column_package_configs - -!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -! -! init_icepack_package_configs -! -!> \brief -!> \author Adrian K. Turner, Elizabeth Hunke, Darin Comeau, Nicole Jeffery, Andrew Roberts, Erin Thomas, Jon Wolfe, LANL, Anthony Craig, NOAA (cntr), David Bailey, NCAR -!> \date 2022-2023 -!> \details -!> -! -!----------------------------------------------------------------------- - - subroutine init_icepack_package_configs(domain) - - use icepack_intfc, only: & - icepack_init_parameters, & - icepack_write_parameters, & - icepack_configure, & - icepack_query_parameters ! debugging - - use seaice_constants, only: & - seaicePuny, & ! a small number - seaiceBigNumber, & ! a large number - seaiceSecondsPerDay, & ! number of seconds in 1 day - seaiceDensityIce, & ! density of ice (kg/m^3) - seaiceDensitySnow, & ! density of snow (kg/m^3) - seaiceDensitySeaWater, & ! density of seawater (kg/m^3) - seaiceDensityFreshwater, & ! density of freshwater (kg/m^3) - seaiceFreshIceSpecificHeat, & ! specific heat of fresh ice (J/kg/K) - seaiceWaterVaporSpecificHeat, & ! specific heat of water vapor (J/kg/K) - seaiceAirSpecificHeat, & ! specific heat of air (J/kg/K) - seaiceSeaWaterSpecificHeat, & ! specific heat of ocn (J/kg/K) - seaiceLatentHeatVaporization, & ! latent heat, vaporization freshwater (J/kg) - seaiceZvir, & ! rh2o/rair - 1.0 - seaiceLatentHeatSublimation, & ! latent heat, sublimation freshwater (J/kg) - seaiceLatentHeatMelting, & ! latent heat of melting of fresh ice (J/kg) - seaiceIceSurfaceMeltingTemperature, & ! melting temp. ice top surface (C) - seaiceSnowSurfaceMeltingTemperature, & ! melting temp. snow top surface (C) - seaiceStefanBoltzmann, & ! J m-2 K-4 s-1 - seaiceIceSnowEmissivity, & ! emissivity of snow and ice - seaiceSnowSurfaceScatteringLayer, & ! snow surface scattering layer thickness (m) - seaiceStabilityReferenceHeight, & ! stability reference height (m) - seaiceFreshWaterFreezingPoint, & ! freezing temp of fresh ice (K) - seaiceIceSurfaceRoughness, & ! ice surface roughness (m) - seaiceVonKarmanConstant, & ! Von Karman constant - seaiceOceanAlbedo, & ! Ocean albedo - seaiceReferenceSalinity, & ! ice reference salinity (ppt) - seaiceMaximumSalinity, & ! ice maximum salinity (ppt) - seaiceMeltingTemperatureDepression, & ! melting temperature depression factor (C/ppt) - seaiceFrazilSalinityReduction, & ! bulk salinity reduction of newly formed frazil (ppt) - seaiceFrazilIcePorosity, & ! initial liquid fraction of frazil - seaicePi, & ! pi - seaiceGravity, & ! gravitational acceleration (m/s^2) - seaiceSnowPatchiness, & ! snow patchiness parameter - seaiceIceStrengthConstantHiblerP, & ! P* constant in Hibler strength formulation - seaiceIceStrengthConstantHiblerC, & ! C* constant in Hibler strength formulation - skeletalLayerThickness, & ! skeletal layer thickness - seaiceSnowMinimumDensity, & ! minimum snow density (kg/m^3) - seaiceBrineDynamicViscosity, & ! dynamic viscosity of brine (kg/m/s) - seaiceFreezingTemperatureConstant, &! constant freezing temp of seawater (C) - seaiceExtinctionCoef, & ! vis extnctn coef in ice, wvlngth<700nm (1/m) - seaiceFreshIceConductivity, & ! thermal conductivity of fresh ice(W/m/deg) - seaiceSnowMinimumThickness, & ! min snow thickness for computing zTsn (m) - seaiceFrazilMinimumThickness, & ! min thickness of new frazil ice - seaiceAlbedoWtVisibleDirect, & ! visible, direct - seaiceAlbedoWtNearIRDirect, & ! near IR, direct - seaiceAlbedoWtVisibleDiffuse, & ! visible, diffuse - seaiceAlbedoWtNearIRDiffuse, & ! near IR, diffuse - seaiceQsatQiceConstant, & ! constant for saturation humidity over ice - seaiceQsatTiceConstant, & ! constant for saturation humidity over ice - seaiceQsatQocnConstant, & ! constant for saturation humidity over ocean - seaiceQsatTocnConstant ! constant for saturation humidity over ocean - - type(domain_type), intent(inout) :: & - domain - - type(MPAS_pool_type), pointer :: & - snow - - character(len=strKIND), pointer :: & - config_thermodynamics_type, & - config_heat_conductivity_type, & - config_shortwave_type, & - config_albedo_type, & - config_ice_strength_formulation, & - config_ridging_participation_function, & - config_ridging_redistribution_function, & - config_atmos_boundary_method, & - config_itd_conversion_type, & - config_category_bounds_type, & - config_pond_refreezing_type, & - config_salt_flux_coupling_type, & - config_ocean_heat_transfer_type, & - config_frazil_coupling_type, & - config_sea_freezing_temperature_type, & - config_skeletal_bgc_flux_type, & - config_snow_redistribution_scheme - - logical, pointer :: & - config_use_snicar_ad, & - config_calc_surface_temperature, & - config_update_ocean_fluxes, & - config_use_form_drag, & - config_use_high_frequency_coupling, & - config_use_ocean_mixed_layer, & - config_calc_surface_stresses, & - config_use_vertical_tracers, & - config_scale_initial_vertical_bgc, & - config_use_vertical_biochemistry, & - config_use_shortwave_bioabsorption, & - config_use_skeletal_biochemistry, & - config_use_modal_aerosols, & - config_use_macromolecules, & - config_do_restart_bgc, & - config_use_snow_liquid_ponds, & - config_use_snow_grain_radius, & - config_use_shortwave_redistribution - - real(kind=RKIND), pointer :: & - config_min_friction_velocity, & - config_ice_ocean_drag_coefficient, & - config_snow_thermal_conductivity, & - config_rapid_mode_channel_radius, & - config_rapid_model_critical_Ra, & - config_rapid_mode_aspect_ratio, & - config_slow_mode_drainage_strength, & - config_slow_mode_critical_porosity, & - config_macro_drainage_timescale, & - config_congelation_ice_porosity, & -! config_frazil_ice_porosity, & -! config_frazil_salinity_reduction, & - config_visible_ice_albedo, & - config_infrared_ice_albedo, & - config_visible_snow_albedo, & - config_infrared_snow_albedo, & - config_variable_albedo_thickness_limit, & -! config_snow_surface_scattering_layer_depth, & - config_ice_shortwave_tuning_parameter, & - config_pond_shortwave_tuning_parameter, & - config_snow_shortwave_tuning_parameter, & - config_shortwave_redistribution_fraction, & - config_shortwave_redistribution_threshold, & - config_temp_change_snow_grain_radius_change, & - config_max_melting_snow_grain_radius, & - config_algae_absorption_coefficient, & - config_ridging_efolding_scale, & - config_ratio_ridging_work_to_PE, & - config_snow_to_ice_transition_depth, & - config_pond_flushing_factor, & - config_min_meltwater_retained_fraction, & - config_max_meltwater_retained_fraction, & - config_pond_depth_to_fraction_ratio, & - config_snow_on_pond_ice_tapering_parameter, & - config_critical_pond_ice_thickness, & - config_biogrid_bottom_molecular_sublayer, & - config_bio_gravity_drainage_length_scale, & - config_biogrid_top_molecular_sublayer, & - config_new_ice_fraction_biotracer, & - config_fraction_biotracer_in_frazil, & - config_snow_porosity_at_ice_surface, & - config_ratio_Si_to_N_diatoms, & - config_ratio_Si_to_N_small_plankton, & - config_ratio_Si_to_N_phaeocystis, & - config_ratio_S_to_N_diatoms, & - config_ratio_S_to_N_small_plankton, & - config_ratio_S_to_N_phaeocystis, & - config_ratio_Fe_to_C_diatoms, & - config_ratio_Fe_to_C_small_plankton, & - config_ratio_Fe_to_C_phaeocystis, & - config_ratio_Fe_to_N_diatoms, & - config_ratio_Fe_to_N_small_plankton, & - config_ratio_Fe_to_N_phaeocystis, & - config_ratio_Fe_to_DON, & - config_ratio_Fe_to_DOC_saccharids, & - config_ratio_Fe_to_DOC_lipids, & - config_respiration_fraction_of_growth, & - config_rapid_mobile_to_stationary_time, & - config_long_mobile_to_stationary_time, & - config_algal_maximum_velocity, & - config_ratio_Fe_to_dust, & - config_solubility_of_Fe_in_dust, & - config_chla_absorptivity_of_diatoms, & - config_chla_absorptivity_of_small_plankton, & - config_chla_absorptivity_of_phaeocystis, & - config_light_attenuation_diatoms, & - config_light_attenuation_small_plankton, & - config_light_attenuation_phaeocystis, & - config_light_inhibition_diatoms, & - config_light_inhibition_small_plankton, & - config_light_inhibition_phaeocystis, & - config_maximum_growth_rate_diatoms, & - config_maximum_growth_rate_small_plankton, & - config_maximum_growth_rate_phaeocystis, & - config_temperature_growth_diatoms, & - config_temperature_growth_small_plankton, & - config_temperature_growth_phaeocystis, & - config_grazed_fraction_diatoms, & - config_grazed_fraction_small_plankton, & - config_grazed_fraction_phaeocystis, & - config_mortality_diatoms, & - config_mortality_small_plankton, & - config_mortality_phaeocystis, & - config_temperature_mortality_diatoms, & - config_temperature_mortality_small_plankton, & - config_temperature_mortality_phaeocystis, & - config_exudation_diatoms, & - config_exudation_small_plankton, & - config_exudation_phaeocystis, & - config_nitrate_saturation_diatoms, & - config_nitrate_saturation_small_plankton, & - config_nitrate_saturation_phaeocystis, & - config_ammonium_saturation_diatoms, & - config_ammonium_saturation_small_plankton, & - config_ammonium_saturation_phaeocystis, & - config_silicate_saturation_diatoms, & - config_silicate_saturation_small_plankton, & - config_silicate_saturation_phaeocystis, & - config_iron_saturation_diatoms, & - config_iron_saturation_small_plankton, & - config_iron_saturation_phaeocystis, & - config_fraction_spilled_to_DON, & - config_degredation_of_DON, & - config_fraction_DON_ammonium, & - config_fraction_loss_to_saccharids, & - config_fraction_loss_to_lipids, & - config_fraction_exudation_to_saccharids, & - config_fraction_exudation_to_lipids, & - config_remineralization_saccharids, & - config_remineralization_lipids, & - config_maximum_brine_temperature, & - config_salinity_dependence_of_growth, & - config_minimum_optical_depth, & - config_slopped_grazing_fraction, & - config_excreted_fraction, & - config_fraction_mortality_to_ammonium, & - config_fraction_iron_remineralized, & - config_nitrification_rate, & - config_desorption_loss_particulate_iron, & - config_maximum_loss_fraction, & - config_maximum_ratio_iron_to_saccharids, & - config_respiration_loss_to_DMSPd, & - config_DMSP_to_DMS_conversion_fraction, & - config_DMSP_to_DMS_conversion_time, & - config_DMS_oxidation_time, & - config_mobility_type_diatoms, & - config_mobility_type_small_plankton, & - config_mobility_type_phaeocystis, & - config_mobility_type_nitrate, & - config_mobility_type_ammonium, & - config_mobility_type_silicate, & - config_mobility_type_DMSPp, & - config_mobility_type_DMSPd, & - config_mobility_type_humics, & - config_mobility_type_saccharids, & - config_mobility_type_lipids, & - config_mobility_type_inorganic_carbon, & - config_mobility_type_proteins, & - config_mobility_type_dissolved_iron, & - config_mobility_type_particulate_iron, & - config_mobility_type_black_carbon1, & - config_mobility_type_black_carbon2, & - config_mobility_type_dust1, & - config_mobility_type_dust2, & - config_mobility_type_dust3, & - config_mobility_type_dust4, & - config_ratio_C_to_N_diatoms, & - config_ratio_C_to_N_small_plankton, & - config_ratio_C_to_N_phaeocystis, & - config_ratio_chla_to_N_diatoms, & - config_ratio_chla_to_N_small_plankton, & - config_ratio_chla_to_N_phaeocystis, & - config_scales_absorption_diatoms, & - config_scales_absorption_small_plankton, & - config_scales_absorption_phaeocystis, & - config_ratio_C_to_N_proteins, & - config_fallen_snow_radius, & - config_new_snow_density, & - config_max_snow_density, & - config_minimum_wind_compaction, & - config_wind_compaction_factor, & - config_snow_redistribution_factor, & - config_max_dry_snow_radius - - real(kind=RKIND), dimension(:,:,:), pointer :: & - snowEmpiricalGrowthParameterTau, & - snowEmpiricalGrowthParameterKappa, & - snowPropertyRate - - integer, pointer :: & - config_boundary_layer_iteration_number, & - nGrainAgingTemperature, & - nGrainAgingTempGradient, & - nGrainAgingSnowDensity - - integer :: & - config_thermodynamics_type_int, & - config_ice_strength_formulation_int, & - config_ridging_participation_function_int, & - config_ridging_redistribution_function_int, & - config_itd_conversion_type_int, & - config_category_bounds_type_int - - character(len=strKIND) :: tmp_config_shortwave_type - character(len=strKIND) :: tmp_config_snw_ssp_table - character(len=strKIND) :: snw_aging_table = 'snicar' - - ! debugging - integer :: itmp1, itmp2 - real(kind=RKIND) :: rtmp1, rtmp2 - character(len=strKIND) :: ctmp1, ctmp2 - - call MPAS_pool_get_config(domain % configs, "config_thermodynamics_type", config_thermodynamics_type) - call MPAS_pool_get_config(domain % configs, "config_heat_conductivity_type", config_heat_conductivity_type) - call MPAS_pool_get_config(domain % configs, "config_ocean_heat_transfer_type", config_ocean_heat_transfer_type) - call MPAS_pool_get_config(domain % configs, "config_calc_surface_temperature", config_calc_surface_temperature) - call MPAS_pool_get_config(domain % configs, "config_update_ocean_fluxes", config_update_ocean_fluxes) - call MPAS_pool_get_config(domain % configs, "config_frazil_coupling_type", config_frazil_coupling_type) - call MPAS_pool_get_config(domain % configs, "config_min_friction_velocity", config_min_friction_velocity) - call MPAS_pool_get_config(domain % configs, "config_ice_ocean_drag_coefficient", config_ice_ocean_drag_coefficient) - call MPAS_pool_get_config(domain % configs, "config_snow_thermal_conductivity", config_snow_thermal_conductivity) - call MPAS_pool_get_config(domain % configs, "config_rapid_mode_channel_radius", config_rapid_mode_channel_radius) - call MPAS_pool_get_config(domain % configs, "config_rapid_model_critical_Ra", config_rapid_model_critical_Ra) - call MPAS_pool_get_config(domain % configs, "config_rapid_mode_aspect_ratio", config_rapid_mode_aspect_ratio) - call MPAS_pool_get_config(domain % configs, "config_slow_mode_drainage_strength", config_slow_mode_drainage_strength) - call MPAS_pool_get_config(domain % configs, "config_slow_mode_critical_porosity", config_slow_mode_critical_porosity) - call MPAS_pool_get_config(domain % configs, "config_macro_drainage_timescale", config_macro_drainage_timescale) - call MPAS_pool_get_config(domain % configs, "config_congelation_ice_porosity", config_congelation_ice_porosity) -! call MPAS_pool_get_config(domain % configs, "config_frazil_ice_porosity", config_frazil_ice_porosity) -! call MPAS_pool_get_config(domain % configs, "config_frazil_salinity_reduction", config_frazil_salinity_reduction) - call MPAS_pool_get_config(domain % configs, "config_shortwave_type", config_shortwave_type) - call MPAS_pool_get_config(domain % configs, "config_use_snicar_ad", config_use_snicar_ad) - call MPAS_pool_get_config(domain % configs, "config_albedo_type", config_albedo_type) - call MPAS_pool_get_config(domain % configs, "config_visible_ice_albedo", config_visible_ice_albedo) - call MPAS_pool_get_config(domain % configs, "config_infrared_ice_albedo", config_infrared_ice_albedo) - call MPAS_pool_get_config(domain % configs, "config_visible_snow_albedo", config_visible_snow_albedo) - call MPAS_pool_get_config(domain % configs, "config_infrared_snow_albedo", config_infrared_snow_albedo) - call MPAS_pool_get_config(domain % configs, "config_variable_albedo_thickness_limit", config_variable_albedo_thickness_limit) -! call MPAS_pool_get_config(domain % configs, "config_snow_surface_scattering_layer_depth", config_snow_surface_scattering_layer_depth) - call MPAS_pool_get_config(domain % configs, "config_ice_shortwave_tuning_parameter", config_ice_shortwave_tuning_parameter) - call MPAS_pool_get_config(domain % configs, "config_pond_shortwave_tuning_parameter", config_pond_shortwave_tuning_parameter) - call MPAS_pool_get_config(domain % configs, "config_snow_shortwave_tuning_parameter", config_snow_shortwave_tuning_parameter) - call MPAS_pool_get_config(domain % configs, "config_use_shortwave_redistribution", config_use_shortwave_redistribution) - call MPAS_pool_get_config(domain % configs, "config_shortwave_redistribution_fraction", config_shortwave_redistribution_fraction) - call MPAS_pool_get_config(domain % configs, "config_shortwave_redistribution_threshold", config_shortwave_redistribution_threshold) - call MPAS_pool_get_config(domain % configs, "config_temp_change_snow_grain_radius_change", & - config_temp_change_snow_grain_radius_change) - call MPAS_pool_get_config(domain % configs, "config_max_melting_snow_grain_radius", config_max_melting_snow_grain_radius) - call MPAS_pool_get_config(domain % configs, "config_algae_absorption_coefficient", config_algae_absorption_coefficient) - call MPAS_pool_get_config(domain % configs, "config_ice_strength_formulation", config_ice_strength_formulation) - call MPAS_pool_get_config(domain % configs, "config_ridging_participation_function", config_ridging_participation_function) - call MPAS_pool_get_config(domain % configs, "config_ridging_redistribution_function", config_ridging_redistribution_function) - call MPAS_pool_get_config(domain % configs, "config_ridging_efolding_scale", config_ridging_efolding_scale) - call MPAS_pool_get_config(domain % configs, "config_ratio_ridging_work_to_PE", config_ratio_ridging_work_to_PE) - call MPAS_pool_get_config(domain % configs, "config_atmos_boundary_method", config_atmos_boundary_method) - call MPAS_pool_get_config(domain % configs, "config_calc_surface_stresses", config_calc_surface_stresses) - call MPAS_pool_get_config(domain % configs, "config_use_form_drag", config_use_form_drag) - call MPAS_pool_get_config(domain % configs, "config_use_high_frequency_coupling", config_use_high_frequency_coupling) - call MPAS_pool_get_config(domain % configs, "config_boundary_layer_iteration_number", config_boundary_layer_iteration_number) - call MPAS_pool_get_config(domain % configs, "config_use_ocean_mixed_layer", config_use_ocean_mixed_layer) - call MPAS_pool_get_config(domain % configs, "config_sea_freezing_temperature_type", config_sea_freezing_temperature_type) - call MPAS_pool_get_config(domain % configs, "config_itd_conversion_type", config_itd_conversion_type) - call MPAS_pool_get_config(domain % configs, "config_category_bounds_type", config_category_bounds_type) - call MPAS_pool_get_config(domain % configs, "config_snow_to_ice_transition_depth", config_snow_to_ice_transition_depth) - call MPAS_pool_get_config(domain % configs, "config_pond_refreezing_type", config_pond_refreezing_type) - call MPAS_pool_get_config(domain % configs, "config_salt_flux_coupling_type", config_salt_flux_coupling_type) - call MPAS_pool_get_config(domain % configs, "config_pond_flushing_factor", config_pond_flushing_factor) - call MPAS_pool_get_config(domain % configs, "config_min_meltwater_retained_fraction", config_min_meltwater_retained_fraction) - call MPAS_pool_get_config(domain % configs, "config_max_meltwater_retained_fraction", config_max_meltwater_retained_fraction) - call MPAS_pool_get_config(domain % configs, "config_pond_depth_to_fraction_ratio", config_pond_depth_to_fraction_ratio) - call MPAS_pool_get_config(domain % configs, "config_snow_on_pond_ice_tapering_parameter", & - config_snow_on_pond_ice_tapering_parameter) - call MPAS_pool_get_config(domain % configs, "config_critical_pond_ice_thickness", config_critical_pond_ice_thickness) - call MPAS_pool_get_config(domain % configs, "config_skeletal_bgc_flux_type", config_skeletal_bgc_flux_type) - call MPAS_pool_get_config(domain % configs, "config_use_vertical_tracers", config_use_vertical_tracers) - call MPAS_pool_get_config(domain % configs, "config_scale_initial_vertical_bgc", config_scale_initial_vertical_bgc) - call MPAS_pool_get_config(domain % configs, "config_use_vertical_biochemistry", config_use_vertical_biochemistry) - call MPAS_pool_get_config(domain % configs, "config_use_shortwave_bioabsorption", config_use_shortwave_bioabsorption) - call MPAS_pool_get_config(domain % configs, "config_use_modal_aerosols", config_use_modal_aerosols) - call MPAS_pool_get_config(domain % configs, "config_use_macromolecules", config_use_macromolecules) - call MPAS_pool_get_config(domain % configs, "config_do_restart_bgc", config_do_restart_bgc) - call MPAS_pool_get_config(domain % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) - call MPAS_pool_get_config(domain % configs, "config_biogrid_bottom_molecular_sublayer", & - config_biogrid_bottom_molecular_sublayer) - call MPAS_pool_get_config(domain % configs, "config_bio_gravity_drainage_length_scale", & - config_bio_gravity_drainage_length_scale) - call MPAS_pool_get_config(domain % configs, "config_biogrid_top_molecular_sublayer", config_biogrid_top_molecular_sublayer) - call MPAS_pool_get_config(domain % configs, "config_new_ice_fraction_biotracer", config_new_ice_fraction_biotracer) - call MPAS_pool_get_config(domain % configs, "config_fraction_biotracer_in_frazil", config_fraction_biotracer_in_frazil) - call MPAS_pool_get_config(domain % configs, "config_snow_porosity_at_ice_surface", config_snow_porosity_at_ice_surface) - call MPAS_pool_get_config(domain % configs, "config_ratio_Si_to_N_diatoms", config_ratio_Si_to_N_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ratio_Si_to_N_small_plankton", config_ratio_Si_to_N_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ratio_Si_to_N_phaeocystis", config_ratio_Si_to_N_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ratio_S_to_N_diatoms", config_ratio_S_to_N_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ratio_S_to_N_small_plankton", config_ratio_S_to_N_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ratio_S_to_N_phaeocystis", config_ratio_S_to_N_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_C_diatoms", config_ratio_Fe_to_C_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_C_small_plankton", config_ratio_Fe_to_C_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_C_phaeocystis", config_ratio_Fe_to_C_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_N_diatoms", config_ratio_Fe_to_N_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_N_small_plankton", config_ratio_Fe_to_N_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_N_phaeocystis", config_ratio_Fe_to_N_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_DON", config_ratio_Fe_to_DON) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_DOC_saccharids", config_ratio_Fe_to_DOC_saccharids) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_DOC_lipids", config_ratio_Fe_to_DOC_lipids) - call MPAS_pool_get_config(domain % configs, "config_respiration_fraction_of_growth", config_respiration_fraction_of_growth) - call MPAS_pool_get_config(domain % configs, "config_rapid_mobile_to_stationary_time", config_rapid_mobile_to_stationary_time) - call MPAS_pool_get_config(domain % configs, "config_long_mobile_to_stationary_time", config_long_mobile_to_stationary_time) - call MPAS_pool_get_config(domain % configs, "config_algal_maximum_velocity", config_algal_maximum_velocity) - call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_dust", config_ratio_Fe_to_dust) - call MPAS_pool_get_config(domain % configs, "config_solubility_of_Fe_in_dust", config_solubility_of_Fe_in_dust) - call MPAS_pool_get_config(domain % configs, "config_chla_absorptivity_of_diatoms", config_chla_absorptivity_of_diatoms) - call MPAS_pool_get_config(domain % configs, "config_chla_absorptivity_of_small_plankton", & - config_chla_absorptivity_of_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_chla_absorptivity_of_phaeocystis", config_chla_absorptivity_of_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_light_attenuation_diatoms", config_light_attenuation_diatoms) - call MPAS_pool_get_config(domain % configs, "config_light_attenuation_small_plankton", config_light_attenuation_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_light_attenuation_phaeocystis", config_light_attenuation_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_light_inhibition_diatoms", config_light_inhibition_diatoms) - call MPAS_pool_get_config(domain % configs, "config_light_inhibition_small_plankton", config_light_inhibition_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_light_inhibition_phaeocystis", config_light_inhibition_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_maximum_growth_rate_diatoms", config_maximum_growth_rate_diatoms) - call MPAS_pool_get_config(domain % configs, "config_maximum_growth_rate_small_plankton", & - config_maximum_growth_rate_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_maximum_growth_rate_phaeocystis", config_maximum_growth_rate_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_temperature_growth_diatoms", config_temperature_growth_diatoms) - call MPAS_pool_get_config(domain % configs, "config_temperature_growth_small_plankton", & - config_temperature_growth_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_temperature_growth_phaeocystis", config_temperature_growth_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_grazed_fraction_diatoms", config_grazed_fraction_diatoms) - call MPAS_pool_get_config(domain % configs, "config_grazed_fraction_small_plankton", config_grazed_fraction_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_grazed_fraction_phaeocystis", config_grazed_fraction_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_mortality_diatoms", config_mortality_diatoms) - call MPAS_pool_get_config(domain % configs, "config_mortality_small_plankton", config_mortality_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_mortality_phaeocystis", config_mortality_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_temperature_mortality_diatoms", config_temperature_mortality_diatoms) - call MPAS_pool_get_config(domain % configs, "config_temperature_mortality_small_plankton", & - config_temperature_mortality_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_temperature_mortality_phaeocystis", & - config_temperature_mortality_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_exudation_diatoms", config_exudation_diatoms) - call MPAS_pool_get_config(domain % configs, "config_exudation_small_plankton", config_exudation_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_exudation_phaeocystis", config_exudation_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_nitrate_saturation_diatoms", config_nitrate_saturation_diatoms) - call MPAS_pool_get_config(domain % configs, "config_nitrate_saturation_small_plankton", & - config_nitrate_saturation_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_nitrate_saturation_phaeocystis", config_nitrate_saturation_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ammonium_saturation_diatoms", config_ammonium_saturation_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ammonium_saturation_small_plankton", & - config_ammonium_saturation_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ammonium_saturation_phaeocystis", & - config_ammonium_saturation_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_silicate_saturation_diatoms", config_silicate_saturation_diatoms) - call MPAS_pool_get_config(domain % configs, "config_silicate_saturation_small_plankton", & - config_silicate_saturation_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_silicate_saturation_phaeocystis", config_silicate_saturation_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_iron_saturation_diatoms", config_iron_saturation_diatoms) - call MPAS_pool_get_config(domain % configs, "config_iron_saturation_small_plankton", config_iron_saturation_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_iron_saturation_phaeocystis", config_iron_saturation_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_fraction_spilled_to_DON", config_fraction_spilled_to_DON) - call MPAS_pool_get_config(domain % configs, "config_degredation_of_DON", config_degredation_of_DON) - call MPAS_pool_get_config(domain % configs, "config_fraction_DON_ammonium", config_fraction_DON_ammonium) - call MPAS_pool_get_config(domain % configs, "config_fraction_loss_to_saccharids", config_fraction_loss_to_saccharids) - call MPAS_pool_get_config(domain % configs, "config_fraction_loss_to_lipids", config_fraction_loss_to_lipids) - call MPAS_pool_get_config(domain % configs, "config_fraction_exudation_to_saccharids", config_fraction_exudation_to_saccharids) - call MPAS_pool_get_config(domain % configs, "config_fraction_exudation_to_lipids", config_fraction_exudation_to_lipids) - call MPAS_pool_get_config(domain % configs, "config_remineralization_saccharids", config_remineralization_saccharids) - call MPAS_pool_get_config(domain % configs, "config_remineralization_lipids", config_remineralization_lipids) - call MPAS_pool_get_config(domain % configs, "config_maximum_brine_temperature", config_maximum_brine_temperature) - call MPAS_pool_get_config(domain % configs, "config_salinity_dependence_of_growth", config_salinity_dependence_of_growth) - call MPAS_pool_get_config(domain % configs, "config_minimum_optical_depth", config_minimum_optical_depth) - call MPAS_pool_get_config(domain % configs, "config_slopped_grazing_fraction", config_slopped_grazing_fraction) - call MPAS_pool_get_config(domain % configs, "config_excreted_fraction", config_excreted_fraction) - call MPAS_pool_get_config(domain % configs, "config_fraction_mortality_to_ammonium", config_fraction_mortality_to_ammonium) - call MPAS_pool_get_config(domain % configs, "config_fraction_iron_remineralized", config_fraction_iron_remineralized) - call MPAS_pool_get_config(domain % configs, "config_nitrification_rate", config_nitrification_rate) - call MPAS_pool_get_config(domain % configs, "config_desorption_loss_particulate_iron", config_desorption_loss_particulate_iron) - call MPAS_pool_get_config(domain % configs, "config_maximum_loss_fraction", config_maximum_loss_fraction) - call MPAS_pool_get_config(domain % configs, "config_maximum_ratio_iron_to_saccharids", config_maximum_ratio_iron_to_saccharids) - call MPAS_pool_get_config(domain % configs, "config_respiration_loss_to_DMSPd", config_respiration_loss_to_DMSPd) - call MPAS_pool_get_config(domain % configs, "config_DMSP_to_DMS_conversion_fraction", config_DMSP_to_DMS_conversion_fraction) - call MPAS_pool_get_config(domain % configs, "config_DMSP_to_DMS_conversion_time", config_DMSP_to_DMS_conversion_time) - call MPAS_pool_get_config(domain % configs, "config_DMS_oxidation_time", config_DMS_oxidation_time) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_diatoms", config_mobility_type_diatoms) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_small_plankton", config_mobility_type_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_phaeocystis", config_mobility_type_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_nitrate", config_mobility_type_nitrate) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_ammonium", config_mobility_type_ammonium) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_silicate", config_mobility_type_silicate) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_DMSPp", config_mobility_type_DMSPp) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_DMSPd", config_mobility_type_DMSPd) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_humics", config_mobility_type_humics) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_saccharids", config_mobility_type_saccharids) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_lipids", config_mobility_type_lipids) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_inorganic_carbon", config_mobility_type_inorganic_carbon) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_proteins", config_mobility_type_proteins) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dissolved_iron", config_mobility_type_dissolved_iron) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_particulate_iron", config_mobility_type_particulate_iron) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_black_carbon1", config_mobility_type_black_carbon1) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_black_carbon2", config_mobility_type_black_carbon2) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust1", config_mobility_type_dust1) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust2", config_mobility_type_dust2) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust3", config_mobility_type_dust3) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust4", config_mobility_type_dust4) - call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_diatoms", config_ratio_C_to_N_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_small_plankton", config_ratio_C_to_N_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_phaeocystis", config_ratio_C_to_N_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ratio_chla_to_N_diatoms", config_ratio_chla_to_N_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ratio_chla_to_N_small_plankton", config_ratio_chla_to_N_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ratio_chla_to_N_phaeocystis", config_ratio_chla_to_N_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_scales_absorption_diatoms", config_scales_absorption_diatoms) - call MPAS_pool_get_config(domain % configs, "config_scales_absorption_small_plankton", config_scales_absorption_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_scales_absorption_phaeocystis", config_scales_absorption_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_proteins", config_ratio_C_to_N_proteins) - call MPAS_pool_get_config(domain % configs, "config_snow_redistribution_scheme", config_snow_redistribution_scheme) - call MPAS_pool_get_config(domain % configs, "config_fallen_snow_radius", config_fallen_snow_radius) - call MPAS_pool_get_config(domain % configs, "config_use_snow_liquid_ponds", config_use_snow_liquid_ponds) - call MPAS_pool_get_config(domain % configs, "config_new_snow_density", config_new_snow_density) - call MPAS_pool_get_config(domain % configs, "config_max_snow_density", config_max_snow_density) - call MPAS_pool_get_config(domain % configs, "config_minimum_wind_compaction", config_minimum_wind_compaction) - call MPAS_pool_get_config(domain % configs, "config_wind_compaction_factor", config_wind_compaction_factor) - call MPAS_pool_get_config(domain % configs, "config_snow_redistribution_factor", config_snow_redistribution_factor) - call MPAS_pool_get_config(domain % configs, "config_max_dry_snow_radius", config_max_dry_snow_radius) - call MPAS_pool_get_config(domain % configs, "config_use_snow_grain_radius", config_use_snow_grain_radius) - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nGrainAgingTemperature", nGrainAgingTemperature) - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nGrainAgingTempGradient", nGrainAgingTempGradient) - call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nGrainAgingSnowDensity", nGrainAgingSnowDensity) - call MPAS_pool_get_subpool(domain % blocklist % structs, "snow", snow) - call MPAS_pool_get_array(snow, "snowEmpiricalGrowthParameterTau", snowEmpiricalGrowthParameterTau) - call MPAS_pool_get_array(snow, "snowEmpiricalGrowthParameterKappa", snowEmpiricalGrowthParameterKappa) - call MPAS_pool_get_array(snow, "snowPropertyRate", snowPropertyRate) + call MPAS_pool_get_config(domain % configs, "config_use_snow_grain_radius", config_use_snow_grain_radius) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nGrainAgingTemperature", nGrainAgingTemperature) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nGrainAgingTempGradient", nGrainAgingTempGradient) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nGrainAgingSnowDensity", nGrainAgingSnowDensity) + call MPAS_pool_get_subpool(domain % blocklist % structs, "snow", snow) + call MPAS_pool_get_array(snow, "snowEmpiricalGrowthParameterTau", snowEmpiricalGrowthParameterTau) + call MPAS_pool_get_array(snow, "snowEmpiricalGrowthParameterKappa", snowEmpiricalGrowthParameterKappa) + call MPAS_pool_get_array(snow, "snowPropertyRate", snowPropertyRate) config_thermodynamics_type_int = config_cice_int("config_thermodynamics_type", config_thermodynamics_type) config_ice_strength_formulation_int = config_cice_int("config_ice_strength_formulation", config_ice_strength_formulation) @@ -12157,6 +10752,7 @@ subroutine init_icepack_package_configs(domain) snowpatch_in = seaiceSnowPatchiness, & ! ccsm3 radiation scheme !rhosi_in = , & ! brine, zbgc, zsalinity sk_l_in = skeletalLayerThickness, & ! + R_gC2molC_in = gramsCarbonPerMolCarbon, & saltmax_in = seaiceMaximumSalinity, & phi_init_in = seaiceFrazilIcePorosity, & !min_salin_in = , & ! ktherm=1, brine, zsalinity @@ -12391,9 +10987,9 @@ subroutine init_icepack_package_configs(domain) ! - make Lfresh optional for E3SM? ! tcraig, this will write out icepack parameters to fort.101, need to uncomment 3 lines -! if (mpas_log_info % taskID == 0) then -! call icepack_write_parameters(101) -! endif + if (mpas_log_info % taskID == 0) then + call icepack_write_parameters(101) + endif ! call seaice_icepack_write_warnings(icepack_warnings_aborted()) call mpas_log_write(" ----- compare values after icepack init -----") @@ -15726,15 +14322,6 @@ subroutine seaice_icepack_reinitialize_diagnostics_bgc(domain) end if -! if (config_use_vertical_zsalinity) then !echmod deprecate -! call MPAS_pool_get_array(biogeochemistryPool, "zSalinityFlux", zSalinityFlux) -! call MPAS_pool_get_array(biogeochemistryPool, "zSalinityGDFlux", zSalinityGDFlux) - -! zSalinityFlux = 0.0_RKIND -! zSalinityGDFlux = 0.0_RKIND - -! end if - call MPAS_pool_get_array(biogeochemistryPool, "netBrineHeight", netBrineHeight) call MPAS_pool_get_array(biogeochemistryPool, "oceanBioFluxes", oceanBioFluxes) call MPAS_pool_get_array(biogeochemistryPool, "atmosIceBioFluxes", atmosIceBioFluxes) @@ -16745,7 +15332,7 @@ end subroutine seaice_ocean_carbon_flux ! !----------------------------------------------------------------------- - subroutine seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux,oceanBioFluxes,iCell) + subroutine seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux,oceanBioFluxes) real(kind=RKIND), intent(out) :: & oceanCarbonFlux @@ -16753,9 +15340,6 @@ subroutine seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux,oceanBioFluxes,iC real(kind=RKIND), dimension(:), intent(in) :: & oceanBioFluxes - integer, intent(in) :: & - iCell - type(block_type), intent(in) :: & block From dc672a666686f36032e244e33e16c5b8ae16858b Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Thu, 28 Mar 2024 16:54:47 -0500 Subject: [PATCH 09/24] Avoids division by small number in update vertical bio tracers -Cleans up some missing bgc info in Registry (more to do) -Adds some additional info to carbon conservation analysis member -Saves bgc ocean fluxes weighted by ice area (for carbon conservation) -Comments out $omp statements around step therm1 (code was crashing -with seg fault) -Removes and cleans up unnecessary write statements for carbon debugging Tested with E3SM-Project/Icepack.git branch njeffery/merge-fixes-to-bgc commit c090b4b20e4ec0317d2c7d742c5ab291ec7a2240 BFB except correcting a seg fault --- components/mpas-seaice/src/Registry.xml | 163 ++++++++- .../Registry_seaice_conservation_check.xml | 6 + .../mpas_seaice_conservation_check.F | 77 ++--- .../mpas-seaice/src/column/ice_algae.F90 | 33 +- .../mpas-seaice/src/column/ice_colpkg.F90 | 2 +- .../mpas-seaice/src/column/ice_therm_itd.F90 | 2 +- .../mpas-seaice/src/column/ice_zbgc.F90 | 8 +- .../src/shared/mpas_seaice_column.F | 60 +++- .../src/shared/mpas_seaice_icepack.F | 314 +++++------------- 9 files changed, 376 insertions(+), 289 deletions(-) diff --git a/components/mpas-seaice/src/Registry.xml b/components/mpas-seaice/src/Registry.xml index ed39007ef723..6eb70ead768b 100644 --- a/components/mpas-seaice/src/Registry.xml +++ b/components/mpas-seaice/src/Registry.xml @@ -5312,7 +5312,9 @@ type="real" dimensions="nCells Time" units="mmol m-2 s-1" - description="Total ocean carbon flux (positive into the ocean)" + description="Total ocean carbon flux (positive + into the ocean) weighted bysea ice + area fraction" packages="pkgColumnBiogeochemistry;pkgColumnPackage" /> + + + + + + + + + + + + + + + + puny) then ! loop over new grid cells do k2 = 1, nbiolyr @@ -840,7 +842,9 @@ subroutine update_vertical_bio_tracers(nbiolyr, trc, h1, h2, trc0, zspace) trc2(k2) = trc2(k2)/zspace(k2)/h2 !(rnilyr * trc2(k2)) / h2 enddo ! k2 - + else + trc2 = trc + endif ! h2 > 0 ! update vertical tracer array with the adjusted tracer trc = trc2 diff --git a/components/mpas-seaice/src/shared/mpas_seaice_column.F b/components/mpas-seaice/src/shared/mpas_seaice_column.F index 1b736c4b0ccb..80a00a154d99 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_column.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_column.F @@ -4922,7 +4922,17 @@ subroutine seaice_column_coupling_prep(domain) oceanDMSPdFlux, & oceanHumicsFlux, & oceanDustIronFlux, & - totalOceanCarbonFlux + oceanBlackCarbonFlux, & + totalOceanCarbonFlux, & + oceanNitrateFluxArea, & + oceanSilicateFluxArea, & + oceanAmmoniumFluxArea, & + oceanDMSFluxArea, & + oceanDMSPpFluxArea, & + oceanDMSPdFluxArea, & + oceanHumicsFluxArea, & + oceanDustIronFluxArea, & + oceanBlackCarbonFluxArea real(kind=RKIND), dimension(:,:), pointer :: & albedoVisibleDirectCategory, & @@ -4939,7 +4949,13 @@ subroutine seaice_column_coupling_prep(domain) oceanDICFlux, & oceanDONFlux, & oceanParticulateIronFlux, & - oceanDissolvedIronFlux + oceanDissolvedIronFlux, & + oceanAlgaeFluxArea, & + oceanDOCFluxArea, & + oceanDICFluxArea, & + oceanDONFluxArea, & + oceanParticulateIronFluxArea, & + oceanDissolvedIronFluxArea real(kind=RKIND), dimension(:,:,:), pointer :: & iceAreaCategory @@ -5062,6 +5078,7 @@ subroutine seaice_column_coupling_prep(domain) call MPAS_pool_get_array(biogeochemistry, "oceanDMSPdFlux", oceanDMSPdFlux) call MPAS_pool_get_array(biogeochemistry, "oceanHumicsFlux", oceanHumicsFlux) call MPAS_pool_get_array(biogeochemistry, "oceanDustIronFlux", oceanDustIronFlux) + call MPAS_pool_get_array(biogeochemistry, "oceanBlackCarbonFlux", oceanBlackCarbonFlux) call MPAS_pool_get_array(biogeochemistry, "oceanBioFluxes", oceanBioFluxes) call MPAS_pool_get_array(biogeochemistry, "oceanAlgaeFlux", oceanAlgaeFlux) call MPAS_pool_get_array(biogeochemistry, "oceanDOCFlux", oceanDOCFlux) @@ -5071,6 +5088,22 @@ subroutine seaice_column_coupling_prep(domain) call MPAS_pool_get_array(biogeochemistry, "oceanDissolvedIronFlux", oceanDissolvedIronFlux) call MPAS_pool_get_array(biogeochemistry, "totalOceanCarbonFlux", totalOceanCarbonFlux) + call MPAS_pool_get_array(biogeochemistry, "oceanNitrateFluxArea", oceanNitrateFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanSilicateFluxArea", oceanSilicateFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanAmmoniumFluxArea", oceanAmmoniumFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDMSFluxArea", oceanDMSFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDMSPpFluxArea", oceanDMSPpFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDMSPdFluxArea", oceanDMSPdFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanHumicsFluxArea", oceanHumicsFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDustIronFluxArea", oceanDustIronFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanBlackCarbonFluxArea", oceanBlackCarbonFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanAlgaeFluxArea", oceanAlgaeFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDOCFluxArea", oceanDOCFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDICFluxArea", oceanDICFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDONFluxArea", oceanDONFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanParticulateIronFluxArea", oceanParticulateIronFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDissolvedIronFluxArea", oceanDissolvedIronFluxArea) + call MPAS_pool_get_dimension(mesh, "nZBGCTracers", nZBGCTracers) call MPAS_pool_get_dimension(mesh, "maxAlgaeType", maxAlgaeType) call MPAS_pool_get_dimension(mesh, "maxDOCType", maxDOCType) @@ -5194,6 +5227,7 @@ subroutine seaice_column_coupling_prep(domain) oceanDMSPdFlux(iCell) = 0.0_RKIND oceanDMSFlux(iCell) = 0.0_RKIND oceanDustIronFlux(iCell) = 0.0_RKIND + oceanBlackCarbonFlux(iCell) = 0.0_RKIND oceanHumicsFlux(iCell) = 0.0_RKIND do iBioTracers = 1, ciceTracerObject % nBioTracers @@ -5206,6 +5240,7 @@ subroutine seaice_column_coupling_prep(domain) do iBioTracers = 1, maxAlgaeType iBioData = iBioData+1 oceanAlgaeFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanAlgaeFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanAlgaeFlux(iBioTracers,iCell) * ratio_C_to_N(iBioTracers) enddo @@ -5213,11 +5248,13 @@ subroutine seaice_column_coupling_prep(domain) ! Nitrate iBioData = iBioData+1 oceanNitrateFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanNitrateFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! Polysaccharids and Lipids do iBioTracers = 1, maxDOCType iBioData = iBioData+1 oceanDOCFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanDOCFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanDOCFlux(iBioTracers,iCell) enddo @@ -5226,6 +5263,7 @@ subroutine seaice_column_coupling_prep(domain) do iBioTracers = 1, maxDICType iBioData = iBioData+1 oceanDICFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanDICFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanDICFlux(iBioTracers,iCell) enddo @@ -5236,22 +5274,27 @@ subroutine seaice_column_coupling_prep(domain) ! Ammonium iBioData = iBioData+1 oceanAmmoniumFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanAmmoniumFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! Silicate iBioData = iBioData+1 oceanSilicateFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanSilicateFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! DMSPp iBioData = iBioData+1 oceanDMSPpFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanDMSPpFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! DMSPd iBioData = iBioData+1 oceanDMSPdFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanDMSPdFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! DMS iBioData = iBioData+1 oceanDMSFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanDMSFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! PON iBioData = iBioData+1 @@ -5260,6 +5303,7 @@ subroutine seaice_column_coupling_prep(domain) do iBioTracers = 1, maxDONType iBioData = iBioData+1 oceanDONFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanDONFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanDONFlux(iBioTracers,iCell) * config_ratio_C_to_N_proteins enddo @@ -5268,26 +5312,34 @@ subroutine seaice_column_coupling_prep(domain) do iBioTracers = 1, maxIronType iBioData = iBioData+1 oceanDissolvedIronFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanDissolvedIronFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) enddo ! Particulate Iron do iBioTracers = 1, maxIronType iBioData = iBioData+1 oceanParticulateIronFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanParticulateIronFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) enddo - ! Black Carbon (not saved) - iBioData = iBioData + maxBCType + ! Black Carbon (combined; saved for conservation) + do iBioTracers = 1, maxBCType + iBioData = iBioData + 1 + oceanBlackCarbonFlux(iCell) = oceanBlackCarbonFlux(iCell) + oceanBioFluxesAll(iBioData) + enddo + oceanBlackCarbonFluxArea(iCell) = oceanBlackCarbonFlux(iCell) ! Dust (combined) do iBioTracers = 1, maxDustType iBioData = iBioData+1 oceanDustIronFlux(iCell) = oceanDustIronFlux(iCell) + oceanBioFluxesAll(iBioData) enddo + oceanDustIronFluxArea(iCell) = oceanDustIronFlux(iCell) ! Humics iBioData = iBioData+1 oceanHumicsFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanHumicsFluxArea(iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanHumicsFlux(iCell) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 05e6f98f3375..8255e731586f 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -1256,7 +1256,8 @@ end subroutine seaice_icepack_postdynamics_time_integration subroutine column_vertical_thermodynamics(domain, clock) use icepack_intfc, only: & - icepack_step_therm1 + icepack_step_therm1, & + icepack_warnings_clear use seaice_constants, only: & seaicePuny @@ -1690,14 +1691,18 @@ subroutine column_vertical_thermodynamics(domain, clock) endif ! code abort - abortFlag = .false. - abortMessage = "" + !abortFlag = .false. + !abortMessage = "" - !$omp parallel do default(shared) private(iCategory,iAerosol,northernHemisphereMask,& - !$omp& abortMessage) firstprivate(specificSnowAerosol,specificIceAerosol) & - !$omp& reduction(.or.:abortFlag) + !$offomp parallel do default(shared) private(iCategory,iAerosol,northernHemisphereMask,& + !$offomp& abortMessage) firstprivate(specificSnowAerosol,specificIceAerosol) + !$offomp& reduction(.or.:abortFlag) do iCell = 1, nCellsSolve + ! code abort + abortFlag = .false. + abortMessage = "" + ! initial state values iceAreaCellInitial(iCell) = iceAreaCell(iCell) @@ -1737,6 +1742,7 @@ subroutine column_vertical_thermodynamics(domain, clock) northernHemisphereMask = .false. endif + call icepack_warnings_clear() call icepack_step_therm1(& dt=config_dt, & ncat=nCategories, & @@ -1871,6 +1877,7 @@ subroutine column_vertical_thermodynamics(domain, clock) frz_onset=freezeOnset(iCell), & yday=dayOfYear, & prescribed_ice=config_use_prescribed_ice) + abortFlag = icepack_warnings_aborted() call seaice_icepack_write_warnings(abortFlag) @@ -2059,7 +2066,6 @@ subroutine column_vertical_thermodynamics(domain, clock) enddo ! iCategory endif - enddo ! iCell ! error-checking @@ -2203,27 +2209,16 @@ subroutine column_itd_thermodynamics(domain, clock) iBioData, & iBioLayers - ! test carbon conservation real(kind=RKIND), dimension(:,:), allocatable :: & - totalCarbonCatFinal, & - totalCarbonCatInitial, & oceanBioFluxesTemp - real(kind=RKIND), dimension(:), allocatable :: & - verticalGridSpace, & - totalCarbonFinal, & - totalCarbonInitial, & - oceanCarbonFlux, & - carbonError - logical, dimension(:), allocatable :: & newlyFormedIceLogical logical :: & abortFlag, & setGetPhysicsTracers, & - setGetBGCTracers, & - checkCarbon + setGetBGCTracers character(len=strKIND) :: & abortMessage, & @@ -2235,8 +2230,6 @@ subroutine column_itd_thermodynamics(domain, clock) ! day of year call get_day_of_year(clock, dayOfYear) - checkCarbon = .false. - block => domain % blocklist do while (associated(block)) @@ -2333,27 +2326,6 @@ subroutine column_itd_thermodynamics(domain, clock) ! newly formed ice allocate(newlyFormedIceLogical(nCategories)) allocate(oceanBioFluxesTemp(ciceTracerObject % nBioTracers,nCellsSolve)) - allocate(verticalGridSpace(nBioLayersP1)) - if (checkCarbon) then - allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) - allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) - allocate(totalCarbonInitial(nCellsSolve)) - allocate(totalCarbonFinal(nCellsSolve)) - allocate(oceanCarbonFlux(nCellsSolve)) - allocate(carbonError(nCellsSolve)) - else - allocate(totalCarbonCatFinal(1,1)) - allocate(totalCarbonCatInitial(1,1)) - allocate(totalCarbonInitial(1)) - allocate(totalCarbonFinal(1)) - allocate(oceanCarbonFlux(1)) - allocate(carbonError(1)) - endif - - verticalGridSpace(:) = 1.0_RKIND/real(nBioLayers,kind=RKIND) - verticalGridSpace(1) = verticalGridSpace(1)/2.0_RKIND - verticalGridSpace(nBioLayersP1) = verticalGridSpace(1) - setGetPhysicsTracers = .true. setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) @@ -2385,14 +2357,6 @@ subroutine column_itd_thermodynamics(domain, clock) call set_cice_tracer_array_category(block, ciceTracerObject,& tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - if (checkCarbon) then - totalCarbonInitial(iCell) = 0.0_RKIND - call seaice_total_carbon_content_category(block,totalCarbonCatInitial(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) - do iCategory = 1,nCategories - totalCarbonInitial(iCell) = totalCarbonInitial(iCell) + totalCarbonCatInitial(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) - enddo - endif - oceanBioFluxesTemp(:,iCell) = 0.0_RKIND ! CICE calculates the Sig Wave Height from the wave spectrum as follows before step therm2: @@ -2464,9 +2428,6 @@ subroutine column_itd_thermodynamics(domain, clock) oceanBioFluxes(iBioTracers,iCell) = oceanBioFluxes(iBioTracers,iCell) + oceanBioFluxesTemp(iBioTracers,iCell) enddo - abortFlag = icepack_warnings_aborted() - call seaice_icepack_write_warnings(abortFlag) - ! update do iCategory = 1, nCategories newlyFormedIce(iCategory,iCell) = 0 @@ -2477,41 +2438,13 @@ subroutine column_itd_thermodynamics(domain, clock) call get_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - if (checkCarbon) then - totalCarbonFinal(iCell) = 0.0_RKIND - call seaice_total_carbon_content_category(block,totalCarbonCatFinal(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) - call seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux(iCell),oceanBioFluxesTemp(:,iCell)) - do iCategory = 1,nCategories - totalCarbonFinal(iCell) = totalCarbonFinal(iCell) + totalCarbonCatFinal(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) - enddo - carbonError(iCell) = (totalCarbonFinal(iCell) - totalCarbonInitial(iCell))/config_dt + oceanCarbonFlux(iCell) - - if (abs(carbonError(iCell)) > max(seaicePuny,1.0e-14_RKIND*abs(oceanCarbonFlux(iCell)))) then - call mpas_log_write("column_step_therm2, carbon conservation error", messageType=MPAS_LOG_ERR) - call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)/)) - call mpas_log_write("totalCarbonInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonInitial(iCell)/)) - call mpas_log_write("totalCarbonFinal: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonFinal(iCell)/)) - call mpas_log_write("oceanCarbonFlux: $r", messageType=MPAS_LOG_ERR, realArgs=(/oceanCarbonFlux(iCell)/)) - call mpas_log_write("config_dt: $r", messageType=MPAS_LOG_ERR, realArgs=(/config_dt/)) - - do iCategory = 1, nCategories - call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) - call mpas_log_write("totalCarbonCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) - call mpas_log_write("totalCarbonCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatInitial(iCategory,iCell)/)) - call mpas_log_write("iceAreaCategoryInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategoryInitial(iCategory,iCell)/)) - call mpas_log_write("iceVolumeCategoryInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceVolumeCategoryInitial(iCategory,iCell)/)) - call mpas_log_write("iceAreaCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategory(1,iCategory,iCell)/)) - call mpas_log_write("iceVolumeCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceVolumeCategory(1,iCategory,iCell)/)) - enddo - endif - endif - + abortFlag = icepack_warnings_aborted() ! cell-specific abort message if (abortFlag) then call mpas_log_write("column_itd_thermodynamics: "//trim(abortMessage) , messageType=MPAS_LOG_ERR) call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) endif + call seaice_icepack_write_warnings(abortFlag) enddo ! iCell @@ -2519,17 +2452,9 @@ subroutine column_itd_thermodynamics(domain, clock) call seaice_critical_error_write_block(domain, block, abortFlag) call seaice_check_critical_error(domain, abortFlag) - deallocate(totalCarbonCatFinal) - deallocate(totalCarbonCatInitial) - deallocate(totalCarbonInitial) - deallocate(totalCarbonFinal) - deallocate(oceanCarbonFlux) - deallocate(carbonError) - ! newly formed ice deallocate(newlyFormedIceLogical) deallocate(oceanBioFluxesTemp) - deallocate(verticalGridSpace) block => block % next end do @@ -3041,11 +2966,6 @@ subroutine column_radiation(domain, clock, lInitialization) iAerosol, & iBioTracers - integer, dimension(:), allocatable :: & - index_shortwaveAerosol, & - index_verticalAerosolsConc, & - index_algaeConc - real(kind=RKIND) :: & dayOfYear, & lonCellColumn @@ -3163,28 +3083,6 @@ subroutine column_radiation(domain, clock, lInitialization) ! aerosols array allocate(aerosolsArray(4*nAerosols,nCategories)) - allocate(index_shortwaveAerosol(maxAerosolType)) - allocate(index_verticalAerosolsConc(maxAerosolType)) - allocate(index_algaeConc(nAlgae)) - - if (.not. config_use_zaerosols) then - index_shortwaveAerosol(1:maxAerosolType) = 1 - index_verticalAerosolsConc(1:maxAerosolType) = 1 - else - do iAerosol = 1, maxAerosolType - index_shortwaveAerosol(iAerosol) = ciceTracerObject % index_verticalAerosolsConcShortwave(iAerosol) - index_verticalAerosolsConc(iAerosol) = ciceTracerObject % index_verticalAerosolsConc(iAerosol) - enddo - endif - - if (.not. config_use_column_biogeochemistry) then - index_algaeConc(1:nAlgae) = 1 - else - do iBioTracers = 1, nAlgae - index_algaeConc(iBioTracers) = ciceTracerObject % index_algaeConc(iBioTracers) - enddo - endif - setGetPhysicsTracers = .true. setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) @@ -3192,7 +3090,7 @@ subroutine column_radiation(domain, clock, lInitialization) allocate(snow_grain_radius(nSnowLayers,nCategories)) !$omp parallel do default(shared) & - !$omp& firstprivate(aerosolsArray,index_shortwaveAerosol,snow_grain_radius) & + !$omp& firstprivate(aerosolsArray,snow_grain_radius) & !$omp& private(iCategory,iAerosol,lonCellColumn,iSnowLayer) do iCell = 1, nCellsSolve @@ -3282,9 +3180,6 @@ subroutine column_radiation(domain, clock, lInitialization) ! aerosols array deallocate(aerosolsArray) - deallocate(index_shortwaveAerosol) - deallocate(index_verticalAerosolsConc) - deallocate(index_algaeConc) block => block % next end do @@ -3404,29 +3299,15 @@ subroutine column_ridging(domain) iBioData, & iBioLayers - ! test carbon conservation real(kind=RKIND), dimension(:,:), allocatable :: & - totalCarbonCatFinal, & - totalCarbonCatInitial, & oceanBioFluxesTemp - real(kind=RKIND), dimension(:), allocatable :: & - verticalGridSpace, & - totalCarbonFinal, & - totalCarbonInitial, & - oceanCarbonFlux, & - carbonError, & - iceAreaCategoryInitial - logical, dimension(:), allocatable :: & newlyFormedIceLogical logical :: & setGetPhysicsTracers, & - setGetBGCTracers, & - checkCarbon - - checkCarbon = .false. + setGetBGCTracers block => domain % blocklist do while (associated(block)) @@ -3507,28 +3388,6 @@ subroutine column_ridging(domain) setGetBGCTracers = (config_use_column_biogeochemistry .or. config_use_zaerosols) allocate(oceanBioFluxesTemp(ciceTracerObject % nBioTracers,nCellsSolve)) - allocate(verticalGridSpace(nBioLayersP1)) - if (checkCarbon) then - allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) - allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) - allocate(totalCarbonInitial(nCellsSolve)) - allocate(totalCarbonFinal(nCellsSolve)) - allocate(oceanCarbonFlux(nCellsSolve)) - allocate(carbonError(nCellsSolve)) - allocate(iceAreaCategoryInitial(nCategories)) - else - allocate(totalCarbonCatFinal(1,1)) - allocate(totalCarbonCatInitial(1,1)) - allocate(totalCarbonInitial(1)) - allocate(totalCarbonFinal(1)) - allocate(oceanCarbonFlux(1)) - allocate(carbonError(1)) - allocate(iceAreaCategoryInitial(1)) - endif - - verticalGridSpace(:) = 1.0_RKIND/real(nBioLayers,kind=RKIND) - verticalGridSpace(1) = verticalGridSpace(1)/2.0_RKIND - verticalGridSpace(nBioLayersP1) = verticalGridSpace(1) do iCell = 1, nCellsSolve @@ -3541,15 +3400,6 @@ subroutine column_ridging(domain) call set_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - if (checkCarbon) then - totalCarbonInitial(iCell) = 0.0_RKIND - call seaice_total_carbon_content_category(block,totalCarbonCatInitial(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) - do iCategory = 1,nCategories - iceAreaCategoryInitial(iCategory) = iceAreaCategory(1,iCategory,iCell) - totalCarbonInitial(iCell) = totalCarbonInitial(iCell) + totalCarbonCatInitial(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) - enddo - endif - oceanBioFluxesTemp(:,iCell) = 0.0_RKIND call icepack_step_ridge(& @@ -3609,53 +3459,12 @@ subroutine column_ridging(domain) call get_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) - if (checkCarbon) then - totalCarbonFinal(iCell) = 0.0_RKIND - call seaice_total_carbon_content_category(block,totalCarbonCatFinal(:,iCell),iceAreaCategory(1,:,:),iceVolumeCategory(1,:,:),iCell) - call seaice_ocean_carbon_flux_cell(block,oceanCarbonFlux(iCell),oceanBioFluxesTemp(:,iCell)) - do iCategory = 1,nCategories - totalCarbonFinal(iCell) = totalCarbonFinal(iCell) + totalCarbonCatFinal(iCategory,iCell)*iceAreaCategory(1,iCategory,iCell) - enddo - carbonError(iCell) = (totalCarbonFinal(iCell) - totalCarbonInitial(iCell))/config_dt + oceanCarbonFlux(iCell) - - if (abs(carbonError(iCell)) > max(10.0_RKIND*seaicePuny,1.0e-14_RKIND*abs(oceanCarbonFlux(iCell))) .and. & - MAXVAL(iceAreaCategory(1,:,iCell)) > seaicePuny .and. & - MAXVAL(iceAreaCategoryInitial(:)) > seaicePuny) then - call mpas_log_write("icepack_step_ridge, carbon conservation error", messageType=MPAS_LOG_ERR) - call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - call mpas_log_write("carbonError: $r", messageType=MPAS_LOG_ERR, realArgs=(/carbonError(iCell)/)) - call mpas_log_write("totalCarbonInitial: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonInitial(iCell)/)) - call mpas_log_write("totalCarbonFinal: $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonFinal(iCell)/)) - call mpas_log_write("oceanCarbonFlux: $r", messageType=MPAS_LOG_ERR, realArgs=(/oceanCarbonFlux(iCell)/)) - call mpas_log_write("config_dt: $r", messageType=MPAS_LOG_ERR, realArgs=(/config_dt/)) - - do iCategory = 1, nCategories - call mpas_log_write("iCategory: $i", messageType=MPAS_LOG_ERR, intArgs=(/iCategory/)) - call mpas_log_write("totalCarbonCatFinal(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatFinal(iCategory,iCell)/)) - call mpas_log_write("totalCarbonCatInitial(iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/totalCarbonCatInitial(iCategory,iCell)/)) - call mpas_log_write("iceAreaCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategory(1,iCategory,iCell)/)) - call mpas_log_write("iceAreaCategoryInitial(iCategory): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceAreaCategoryInitial(iCategory)/)) - call mpas_log_write("iceVolumeCategory(1,iCategory,iCell): $r", messageType=MPAS_LOG_ERR, realArgs=(/iceVolumeCategory(1,iCategory,iCell)/)) - enddo - endif - endif - + call seaice_icepack_write_warnings(icepack_warnings_aborted()) enddo ! iCell - call seaice_icepack_write_warnings(icepack_warnings_aborted()) -! check carbon - deallocate(oceanBioFluxesTemp) - deallocate(verticalGridSpace) - deallocate(totalCarbonCatFinal) - deallocate(totalCarbonCatInitial) - deallocate(totalCarbonInitial) - deallocate(totalCarbonFinal) - deallocate(oceanCarbonFlux) - deallocate(carbonError) - deallocate(iceAreaCategoryInitial) - ! newly formed ice deallocate(newlyFormedIceLogical) + deallocate(oceanBioFluxesTemp) block => block % next end do @@ -3984,9 +3793,9 @@ subroutine column_biogeochemistry(domain) ! newly formed ice allocate(newlyFormedIceLogical(nCategories)) allocate(brineHeightCatInitial(nCategories,nCellsSolve)) - allocate(carbonError(nCellsSolve)) if (checkCarbon) then + allocate(carbonError(nCellsSolve)) allocate(totalCarbonCatFinal(nCategories,nCellsSolve)) allocate(totalCarbonCatInitial(nCategories,nCellsSolve)) allocate(totalCarbonCatFlux(nCategories,nCellsSolve)) @@ -3995,6 +3804,7 @@ subroutine column_biogeochemistry(domain) allocate(totalCarbonInitial(nCellsSolve)) allocate(totalCarbonFlux(nCellsSolve)) else + allocate(carbonError(1)) allocate(totalCarbonCatFinal(1,1)) allocate(totalCarbonCatInitial(1,1)) allocate(totalCarbonCatFlux(1,1)) @@ -4153,7 +3963,6 @@ subroutine column_biogeochemistry(domain) bioTemperatureIceCell=bgridTemperatureIceCell(:,iCell)) abortFlag = icepack_warnings_aborted() - call seaice_icepack_write_warnings(abortFlag) call get_cice_tracer_array_category(block, ciceTracerObject, & tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) @@ -4215,13 +4024,16 @@ subroutine column_biogeochemistry(domain) if (newlyFormedIceLogical(iCategory)) newlyFormedIce(iCategory,iCell) = 1 enddo ! iCategory + ! code abort + if (abortFlag) then + call mpas_log_write("column_biogeochemistry: "//trim(abortMessage) , messageType=MPAS_LOG_ERR) + call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) + endif + + call seaice_icepack_write_warnings(abortFlag) + enddo ! iCell - ! code abort - if (abortFlag) then - call mpas_log_write("column_biogeochemistry: "//trim(abortMessage) , messageType=MPAS_LOG_ERR) - call mpas_log_write("iCell: $i", messageType=MPAS_LOG_ERR, intArgs=(/indexToCellID(iCell)/)) - endif call seaice_critical_error_write_block(domain, block, abortFlag) call seaice_check_critical_error(domain, abortFlag) @@ -4232,10 +4044,10 @@ subroutine column_biogeochemistry(domain) deallocate(totalCarbonFinal) deallocate(totalCarbonInitial) deallocate(totalCarbonFlux) + deallocate(carbonError) deallocate(brineHeightCatInitial) deallocate(newlyFormedIceLogical) - deallocate(carbonError) block => block % next end do @@ -4531,6 +4343,9 @@ subroutine seaice_icepack_aggregate(domain) nCellsSolve, & nCategories + integer, dimension(:), pointer :: & + indexToCellID + logical :: & setGetPhysicsTracers, & setGetBGCTracers @@ -4549,6 +4364,7 @@ subroutine seaice_icepack_aggregate(domain) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) + call MPAS_pool_get_array(mesh, "indexToCellID", indexToCellID) call MPAS_pool_get_array(tracers, "iceAreaCategory", iceAreaCategory, 1) call MPAS_pool_get_array(tracers, "iceVolumeCategory", iceVolumeCategory, 1) @@ -4765,7 +4581,16 @@ subroutine seaice_icepack_coupling_prep(domain) oceanHumicsFlux, & oceanDustIronFlux, & oceanBlackCarbonFlux, & - totalOceanCarbonFlux + totalOceanCarbonFlux, & + oceanNitrateFluxArea, & + oceanSilicateFluxArea, & + oceanAmmoniumFluxArea, & + oceanDMSFluxArea, & + oceanDMSPpFluxArea, & + oceanDMSPdFluxArea, & + oceanHumicsFluxArea, & + oceanDustIronFluxArea, & + oceanBlackCarbonFluxArea real(kind=RKIND), dimension(:,:), pointer :: & albedoVisibleDirectCategory, & @@ -4782,7 +4607,13 @@ subroutine seaice_icepack_coupling_prep(domain) oceanDICFlux, & oceanDONFlux, & oceanParticulateIronFlux, & - oceanDissolvedIronFlux + oceanDissolvedIronFlux, & + oceanAlgaeFluxArea, & + oceanDOCFluxArea, & + oceanDICFluxArea, & + oceanDONFluxArea, & + oceanParticulateIronFluxArea, & + oceanDissolvedIronFluxArea real(kind=RKIND), dimension(:,:,:), pointer :: & iceAreaCategory @@ -4915,6 +4746,22 @@ subroutine seaice_icepack_coupling_prep(domain) call MPAS_pool_get_array(biogeochemistry, "oceanDissolvedIronFlux", oceanDissolvedIronFlux) call MPAS_pool_get_array(biogeochemistry, "totalOceanCarbonFlux", totalOceanCarbonFlux) + call MPAS_pool_get_array(biogeochemistry, "oceanNitrateFluxArea", oceanNitrateFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanSilicateFluxArea", oceanSilicateFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanAmmoniumFluxArea", oceanAmmoniumFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDMSFluxArea", oceanDMSFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDMSPpFluxArea", oceanDMSPpFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDMSPdFluxArea", oceanDMSPdFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanHumicsFluxArea", oceanHumicsFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDustIronFluxArea", oceanDustIronFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanBlackCarbonFluxArea", oceanBlackCarbonFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanAlgaeFluxArea", oceanAlgaeFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDOCFluxArea", oceanDOCFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDICFluxArea", oceanDICFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDONFluxArea", oceanDONFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanParticulateIronFluxArea", oceanParticulateIronFluxArea) + call MPAS_pool_get_array(biogeochemistry, "oceanDissolvedIronFluxArea", oceanDissolvedIronFluxArea) + call MPAS_pool_get_dimension(mesh, "nZBGCTracers", nZBGCTracers) call MPAS_pool_get_dimension(mesh, "maxAlgaeType", maxAlgaeType) call MPAS_pool_get_dimension(mesh, "maxDOCType", maxDOCType) @@ -5051,6 +4898,7 @@ subroutine seaice_icepack_coupling_prep(domain) do iBioTracers = 1, maxAlgaeType iBioData = iBioData+1 oceanAlgaeFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanAlgaeFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanAlgaeFlux(iBioTracers,iCell) * ratio_C_to_N(iBioTracers) enddo @@ -5058,11 +4906,13 @@ subroutine seaice_icepack_coupling_prep(domain) ! Nitrate iBioData = iBioData+1 oceanNitrateFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanNitrateFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! Polysaccharids and Lipids do iBioTracers = 1, maxDOCType iBioData = iBioData+1 oceanDOCFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanDOCFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanDOCFlux(iBioTracers,iCell) enddo @@ -5071,6 +4921,7 @@ subroutine seaice_icepack_coupling_prep(domain) do iBioTracers = 1, maxDICType iBioData = iBioData+1 oceanDICFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanDICFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanDICFlux(iBioTracers,iCell) enddo @@ -5081,22 +4932,27 @@ subroutine seaice_icepack_coupling_prep(domain) ! Ammonium iBioData = iBioData+1 oceanAmmoniumFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanAmmoniumFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! Silicate iBioData = iBioData+1 oceanSilicateFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanSilicateFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! DMSPp iBioData = iBioData+1 oceanDMSPpFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanDMSPpFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! DMSPd iBioData = iBioData+1 oceanDMSPdFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanDMSPdFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! DMS iBioData = iBioData+1 oceanDMSFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanDMSFluxArea(iCell) = oceanBioFluxesAll(iBioData) ! PON iBioData = iBioData+1 @@ -5105,6 +4961,7 @@ subroutine seaice_icepack_coupling_prep(domain) do iBioTracers = 1, maxDONType iBioData = iBioData+1 oceanDONFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanDONFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & oceanDONFlux(iBioTracers,iCell) * config_ratio_C_to_N_proteins enddo @@ -5113,31 +4970,36 @@ subroutine seaice_icepack_coupling_prep(domain) do iBioTracers = 1, maxIronType iBioData = iBioData+1 oceanDissolvedIronFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanDissolvedIronFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) enddo ! Particulate Iron do iBioTracers = 1, maxIronType iBioData = iBioData+1 oceanParticulateIronFlux(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) + oceanParticulateIronFluxArea(iBioTracers,iCell) = oceanBioFluxesAll(iBioData) enddo ! Black Carbon (combined; saved for conservation) do iBioTracers = 1, maxBCType iBioData = iBioData + 1 oceanBlackCarbonFlux(iCell) = oceanBlackCarbonFlux(iCell) + oceanBioFluxesAll(iBioData) - enddo + enddo + oceanBlackCarbonFluxArea(iCell) = oceanBlackCarbonFlux(iCell) ! Dust (combined) do iBioTracers = 1, maxDustType iBioData = iBioData+1 oceanDustIronFlux(iCell) = oceanDustIronFlux(iCell) + oceanBioFluxesAll(iBioData) - enddo + enddo + oceanDustIronFluxArea(iCell) = oceanDustIronFlux(iCell) ! Humics iBioData = iBioData+1 oceanHumicsFlux(iCell) = oceanBioFluxesAll(iBioData) + oceanHumicsFluxArea(iCell) = oceanBioFluxesAll(iBioData) totalOceanCarbonFlux(iCell) = totalOceanCarbonFlux(iCell) + & - oceanHumicsFlux(iCell) + oceanHumicsFlux(iCell) endif ! config_use_column_biogeochemistry .or. config_use_zaerosols @@ -15759,12 +15621,12 @@ subroutine seaice_icepack_write_warnings(logAsErrors) if (logAsErrors) then do iWarning = 1, size(warnings) call mpas_log_write(trim(warnings(iWarning)), messageType=MPAS_LOG_ERR) - enddo ! iWarning + enddo ! iWarning call mpas_log_write("icepack aborted", MPAS_LOG_CRIT) else do iWarning = 1, size(warnings) call mpas_log_write(trim(warnings(iWarning)), messageType=MPAS_LOG_WARN) - enddo ! iWarning + enddo ! iWarning endif call icepack_warnings_clear() From 2305a7dbfd1923929289274a7b9ceb5a582c89c5 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Fri, 29 Mar 2024 14:29:01 -0500 Subject: [PATCH 10/24] Changed Icepack submodule url Now consistent with E3SM master BFB --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 84c10e97a8c1..69d56e140361 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,7 +76,6 @@ [submodule "components/mpas-seaice/src/icepack"] path = components/mpas-seaice/src/icepack url = git@github.com:E3SM-Project/Icepack.git - branch = njeffery/merge-fixes-to-bgc [submodule "externals/haero"] path = externals/haero url = git@github.com:eagles-project/haero.git From 63570638abe7c46aa3b74e81dfc0dfb06cdf83a3 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Sat, 30 Mar 2024 10:22:04 -0500 Subject: [PATCH 11/24] Corrects error in black carbon conservation member Small error introduced in last commit - broke compile BFB --- .../src/analysis_members/mpas_seaice_conservation_check.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mpas-seaice/src/analysis_members/mpas_seaice_conservation_check.F b/components/mpas-seaice/src/analysis_members/mpas_seaice_conservation_check.F index ca7811a09679..0dac34ca2407 100644 --- a/components/mpas-seaice/src/analysis_members/mpas_seaice_conservation_check.F +++ b/components/mpas-seaice/src/analysis_members/mpas_seaice_conservation_check.F @@ -2391,7 +2391,7 @@ subroutine black_carbon_conservation(domain, err) nZBGC = nZBGC+1 totalAtmBC2Cell = atmosBlackCarbonFlux(nZBGC,iCell) * areaCell(iCell)* & iceAreaCellInitial(iCell) - totalOceanBlackCarbonCell = oceanBlackCarbonFlux(iCell) * areaCell(iCell) + totalOceanBlackCarbonCell = oceanBlackCarbonFluxArea(iCell) * areaCell(iCell) totalAtmBlackCarbonCell = totalAtmBC1Cell + totalAtmBC2Cell do iHemisphere = 1, nHemispheres From d6411d8d61d5171f14b977e75f12fa0aae94a83c Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Sat, 4 May 2024 11:05:52 -0500 Subject: [PATCH 12/24] Adds ^xpmem and grid TL319_r05_IcoswISC30E3r5 bfb --- cime_config/config_grids.xml | 10 ++++++++++ cime_config/machines/config_machines.xml | 1 + 2 files changed, 11 insertions(+) diff --git a/cime_config/config_grids.xml b/cime_config/config_grids.xml index b9ae00da0195..56a183886769 100755 --- a/cime_config/config_grids.xml +++ b/cime_config/config_grids.xml @@ -599,6 +599,16 @@ IcoswISC30E3r5 + + TL319 + r05 + IcoswISC30E3r5 + r05 + null + null + IcoswISC30E3r5 + + TL319 TL319 diff --git a/cime_config/machines/config_machines.xml b/cime_config/machines/config_machines.xml index 486948892aaf..00087a00a7da 100644 --- a/cime_config/machines/config_machines.xml +++ b/cime_config/machines/config_machines.xml @@ -2622,6 +2622,7 @@ $SHELL{dirname $(dirname $(which nf-config))} $SHELL{dirname $(dirname $(which pnetcdf_version))} ^lockedfile,individual + ^xpmem 128M From 2272b67514332b2ec98f413c4d8614d766c66df2 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Mon, 6 May 2024 13:27:37 -0500 Subject: [PATCH 13/24] Split init_zbgc into three calls -First uses init_parameters to initialize bgc namelist parameters -Second (icepack_init_zbgc_tracer_indices) calls bgc indexing and array definitions. -Third defines parameter arrays for bgc (init_zbgc) bfb (round-off level in bgc) --- .../src/shared/mpas_seaice_icepack.F | 168 +++++++++--------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index b08ed7c863c6..6c787048ad1d 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -12908,6 +12908,8 @@ end subroutine seaice_column_reinitialize_oceanic_fluxes subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) use icepack_intfc, only: icepack_init_zbgc + use icepack_intfc, only: icepack_init_zbgc_tracer_indices + use icepack_intfc, only: icepack_init_parameters use icepack_intfc, only: icepack_query_parameters type(domain_type), intent(in) :: & @@ -13252,90 +13254,7 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) allocate(tracerObject % index_dissolvedIronConcLayer(maxIronType)) tracerObject % nDissolvedIronIndex = nDissolvedIron - call icepack_init_zbgc(& - nblyr=nBioLayers, & - nilyr=nIceLayers, & - nslyr=nSnowLayers, & - n_algae_in=nAlgae, & - n_zaero_in=nzAerosols, & - n_doc_in=nDOC, & - n_dic_in=nDIC, & - n_don_in=nDON, & - n_fed_in=nDissolvedIron, & - n_fep_in=nParticulateIron, & - trcr_base=tracerObject % firstAncestorMask, & - trcr_depend=tracerObject % parentIndex, & - n_trcr_strata=tracerObject % ancestorNumber, & - nt_strata=tracerObject % ancestorIndices, & - nbtrcr_sw_out=tracerObject % nBioTracersShortwave, & - tr_brine_in=config_use_brine, & - nt_fbri_out=tracerObject % index_brineFraction,& - ntrcr_out=tracerObject % nTracers, & - nbtrcr_out=tracerObject % nBioTracers, & - ntrcr_o_out=tracerObject % nTracersNotBio, & - nt_bgc_Nit_out=tracerObject % index_nitrateConc, & - nt_bgc_Am_out=tracerObject % index_ammoniumConc, & - nt_bgc_Sil_out=tracerObject % index_silicateConc, & - nt_bgc_DMS_out=tracerObject % index_DMSConc, & - nt_bgc_PON_out=tracerObject % index_nonreactiveConc, & - nt_bgc_N_out=tracerObject % index_algaeConc, & - nt_bgc_C_out=tracerObject % index_algalCarbon, & - nt_bgc_chl_out=tracerObject % index_algalChlorophyll, & - nt_bgc_DOC_out=tracerObject % index_DOCConc, & - nt_bgc_DON_out=tracerObject % index_DONConc, & - nt_bgc_DIC_out=tracerObject % index_DICConc, & - nt_zaero_out=tracerObject % index_verticalAerosolsConc, & - nt_bgc_DMSPp_out=tracerObject % index_DMSPpConc, & - nt_bgc_DMSPd_out=tracerObject % index_DMSPdConc, & - nt_bgc_Fed_out=tracerObject % index_dissolvedIronConc, & - nt_bgc_Fep_out=tracerObject % index_particulateIronConc, & - nt_zbgc_frac_out=tracerObject % index_mobileFraction, & - tr_bgc_Nit_in=config_use_nitrate, & - tr_bgc_Am_in=config_use_ammonium, & - tr_bgc_Sil_in=config_use_silicate, & - tr_bgc_DMS_in=config_use_DMS, & - tr_bgc_PON_in=config_use_nonreactive, & - tr_bgc_N_in=use_nitrogen, & - tr_bgc_C_in=config_use_carbon, & - tr_bgc_chl_in=config_use_chlorophyll, & - tr_bgc_DON_in=config_use_DON, & - tr_bgc_Fe_in=config_use_iron,& - tr_zaero_in=config_use_zaerosols, & - nlt_zaero_sw_out=tracerObject % index_verticalAerosolsConcShortwave, & - nlt_chl_sw_out=tracerObject % index_chlorophyllShortwave, & - nlt_bgc_N_out=tracerObject % index_algaeConcLayer, & - nlt_bgc_Nit_out=tracerObject % index_nitrateConcLayer, & - nlt_bgc_Am_out=tracerObject % index_ammoniumConcLayer, & - nlt_bgc_Sil_out=tracerObject % index_silicateConcLayer, & - nlt_bgc_DMS_out=tracerObject % index_DMSConcLayer, & - nlt_bgc_DMSPp_out=tracerObject % index_DMSPpConcLayer, & - nlt_bgc_DMSPd_out=tracerObject % index_DMSPdConcLayer, & - nlt_bgc_C_out=tracerObject % index_algalCarbonLayer, & - nlt_bgc_chl_out=tracerObject % index_algalChlorophyllLayer, & - nlt_bgc_DIC_out=tracerObject % index_DICConcLayer, & - nlt_bgc_DOC_out=tracerObject % index_DOCConcLayer, & - nlt_bgc_PON_out=tracerObject % index_nonreactiveConcLayer, & - nlt_bgc_DON_out=tracerObject % index_DONConcLayer, & - nlt_bgc_Fed_out=tracerObject % index_dissolvedIronConcLayer, & - nlt_bgc_Fep_out=tracerObject % index_particulateIronConcLayer, & - nlt_zaero_out=tracerObject % index_verticalAerosolsConcLayer, & - nt_bgc_hum_out=tracerObject % index_humicsConc, & - nlt_bgc_hum_out=tracerObject % index_humicsConcLayer, & - tr_bgc_hum_in=config_use_humics, & - skl_bgc_in=config_use_skeletal_biochemistry, & - z_tracers_in=config_use_vertical_tracers, & - dEdd_algae_in=config_use_shortwave_bioabsorption, & - solve_zbgc_in=config_use_vertical_biochemistry, & - bio_index_o_out=tracerObject % index_LayerIndexToDataArray, & - bio_index_out=tracerObject % index_LayerIndexToBioIndex, & - frazil_scav_in=config_fraction_biotracer_in_frazil, & - initbio_frac_in=config_new_ice_fraction_biotracer, & - max_algae_in=maxAlgaeType, & - max_doc_in=maxDOCType, & - max_dic_in=maxDICType, & - max_don_in=maxDONType, & - max_fe_in=maxIronType, & - max_aero_in=maxAerosolType, & + call icepack_init_parameters(& ratio_Si2N_diatoms_in=config_ratio_Si_to_N_diatoms, & ratio_Si2N_sp_in=config_ratio_Si_to_N_small_plankton, & ratio_Si2N_phaeo_in=config_ratio_Si_to_N_phaeocystis, & @@ -13430,9 +13349,90 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) dmspdtype_in=config_mobility_type_DMSPd, & silicatetype_in=config_mobility_type_silicate, & humtype_in=config_mobility_type_humics, & + frazil_scav_in=config_fraction_biotracer_in_frazil, & + initbio_frac_in=config_new_ice_fraction_biotracer, & tau_min_in=config_rapid_mobile_to_stationary_time, & tau_max_in=config_long_mobile_to_stationary_time) + call icepack_init_zbgc_tracer_indices(& + nilyr_in=nIceLayers, & + nslyr_in=nSnowLayers, & + nblyr_in=nBioLayers, & + n_algae_in=nAlgae, & + n_zaero_in=nzAerosols, & + n_doc_in=nDOC, & + n_dic_in=nDIC, & + n_don_in=nDON, & + n_fed_in=nDissolvedIron, & + n_fep_in=nParticulateIron, & + trcr_base=tracerObject % firstAncestorMask, & + trcr_depend=tracerObject % parentIndex, & + n_trcr_strata=tracerObject % ancestorNumber, & + nt_strata=tracerObject % ancestorIndices, & + nbtrcr_sw_out=tracerObject % nBioTracersShortwave, & + tr_brine_in=config_use_brine, & + nt_fbri_out=tracerObject % index_brineFraction,& + ntrcr_out=tracerObject % nTracers, & + nbtrcr_out=tracerObject % nBioTracers, & + ntrcr_o_out=tracerObject % nTracersNotBio, & + nt_bgc_Nit_out=tracerObject % index_nitrateConc, & + nt_bgc_Am_out=tracerObject % index_ammoniumConc, & + nt_bgc_Sil_out=tracerObject % index_silicateConc, & + nt_bgc_DMS_out=tracerObject % index_DMSConc, & + nt_bgc_PON_out=tracerObject % index_nonreactiveConc, & + nt_bgc_N_out=tracerObject % index_algaeConc, & + nt_bgc_C_out=tracerObject % index_algalCarbon, & + nt_bgc_chl_out=tracerObject % index_algalChlorophyll, & + nt_bgc_DOC_out=tracerObject % index_DOCConc, & + nt_bgc_DON_out=tracerObject % index_DONConc, & + nt_bgc_DIC_out=tracerObject % index_DICConc, & + nt_zaero_out=tracerObject % index_verticalAerosolsConc, & + nt_bgc_DMSPp_out=tracerObject % index_DMSPpConc, & + nt_bgc_DMSPd_out=tracerObject % index_DMSPdConc, & + nt_bgc_Fed_out=tracerObject % index_dissolvedIronConc, & + nt_bgc_Fep_out=tracerObject % index_particulateIronConc, & + nt_zbgc_frac_out=tracerObject % index_mobileFraction, & + tr_bgc_Nit_in=config_use_nitrate, & + tr_bgc_Am_in=config_use_ammonium, & + tr_bgc_Sil_in=config_use_silicate, & + tr_bgc_DMS_in=config_use_DMS, & + tr_bgc_PON_in=config_use_nonreactive, & + tr_bgc_N_in=use_nitrogen, & + tr_bgc_C_in=config_use_carbon, & + tr_bgc_chl_in=config_use_chlorophyll, & + tr_bgc_DON_in=config_use_DON, & + tr_bgc_Fe_in=config_use_iron,& + tr_zaero_in=config_use_zaerosols, & + nlt_zaero_sw_out=tracerObject % index_verticalAerosolsConcShortwave, & + nlt_chl_sw_out=tracerObject % index_chlorophyllShortwave, & + nlt_bgc_N_out=tracerObject % index_algaeConcLayer, & + nlt_bgc_Nit_out=tracerObject % index_nitrateConcLayer, & + nlt_bgc_Am_out=tracerObject % index_ammoniumConcLayer, & + nlt_bgc_Sil_out=tracerObject % index_silicateConcLayer, & + nlt_bgc_DMS_out=tracerObject % index_DMSConcLayer, & + nlt_bgc_DMSPp_out=tracerObject % index_DMSPpConcLayer, & + nlt_bgc_DMSPd_out=tracerObject % index_DMSPdConcLayer, & + nlt_bgc_C_out=tracerObject % index_algalCarbonLayer, & + nlt_bgc_chl_out=tracerObject % index_algalChlorophyllLayer, & + nlt_bgc_DIC_out=tracerObject % index_DICConcLayer, & + nlt_bgc_DOC_out=tracerObject % index_DOCConcLayer, & + nlt_bgc_PON_out=tracerObject % index_nonreactiveConcLayer, & + nlt_bgc_DON_out=tracerObject % index_DONConcLayer, & + nlt_bgc_Fed_out=tracerObject % index_dissolvedIronConcLayer, & + nlt_bgc_Fep_out=tracerObject % index_particulateIronConcLayer, & + nlt_zaero_out=tracerObject % index_verticalAerosolsConcLayer, & + nt_bgc_hum_out=tracerObject % index_humicsConc, & + nlt_bgc_hum_out=tracerObject % index_humicsConcLayer, & + tr_bgc_hum_in=config_use_humics, & + skl_bgc_in=config_use_skeletal_biochemistry, & + z_tracers_in=config_use_vertical_tracers, & + dEdd_algae_in=config_use_shortwave_bioabsorption, & + solve_zbgc_in=config_use_vertical_biochemistry, & + bio_index_o_out=tracerObject % index_LayerIndexToDataArray, & + bio_index_out=tracerObject % index_LayerIndexToBioIndex) + + call icepack_init_zbgc() + ! check calculated tracer array size if (nTracers_temp /= tracerObject % nTracers) then call mpas_log_write(& From 455ed3946fa6394b2fc92e8490342a9bff129d6b Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Thu, 23 May 2024 14:49:34 -0500 Subject: [PATCH 14/24] Add atm dust forcing and iron solubility map Adds 2 namelist fields: config_use_atm_dust_file - true, use monthly dust climatology config_use_iron_solubility_file -- true, use dust-iron solubility map from file (in icepack: use_atm_dust_sol = .not.config_use_iron_solubility_file) New fields track atmospheric wet and dry dust separately from the coupler to compute the iron contribution. Fraction of iron in dust is also generalized and read from a file. Dust/iron file is identical to the one used by mpas-o. Corrects some units in Registry. BFB with new namelist parameters = false and for all runs without zaerosols or without iron. --- components/mpas-seaice/bld/build-namelist | 2 + .../mpas-seaice/bld/build-namelist-section | 2 + .../namelist_defaults_mpassi.xml | 2 + .../namelist_definition_mpassi.xml | 16 + components/mpas-seaice/cime_config/buildnml | 9 +- components/mpas-seaice/driver/ice_comp_mct.F | 83 ++++- components/mpas-seaice/src/Registry.xml | 102 ++++-- .../mpas_seaice_core_interface.F | 16 +- .../src/shared/mpas_seaice_constants.F | 6 +- .../src/shared/mpas_seaice_forcing.F | 295 +++++++++++++++++- .../src/shared/mpas_seaice_icepack.F | 54 +++- 11 files changed, 537 insertions(+), 50 deletions(-) diff --git a/components/mpas-seaice/bld/build-namelist b/components/mpas-seaice/bld/build-namelist index d8bfcaa68c05..b5faa4ceeb2d 100755 --- a/components/mpas-seaice/bld/build-namelist +++ b/components/mpas-seaice/bld/build-namelist @@ -696,6 +696,8 @@ add_default($nl, 'config_use_chlorophyll'); add_default($nl, 'config_use_macromolecules'); add_default($nl, 'config_use_modal_aerosols'); add_default($nl, 'config_use_zaerosols'); +add_default($nl, 'config_use_atm_dust_file'); +add_default($nl, 'config_use_iron_solubility_file'); add_default($nl, 'config_skeletal_bgc_flux_type'); add_default($nl, 'config_scale_initial_vertical_bgc'); add_default($nl, 'config_biogrid_bottom_molecular_sublayer'); diff --git a/components/mpas-seaice/bld/build-namelist-section b/components/mpas-seaice/bld/build-namelist-section index 8b6a06dd6740..d2866ee4c813 100644 --- a/components/mpas-seaice/bld/build-namelist-section +++ b/components/mpas-seaice/bld/build-namelist-section @@ -213,6 +213,8 @@ add_default($nl, 'config_use_DON'); add_default($nl, 'config_use_iron'); add_default($nl, 'config_use_modal_aerosols'); add_default($nl, 'config_use_zaerosols'); +add_default($nl, 'config_use_atm_dust_file'); +add_default($nl, 'config_use_iron_solubility_file'); add_default($nl, 'config_skeletal_bgc_flux_type'); add_default($nl, 'config_scale_initial_vertical_bgc'); add_default($nl, 'config_biogrid_bottom_molecular_sublayer'); diff --git a/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml b/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml index f4f9bfa1ec3d..1ac5bfe8a04b 100644 --- a/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml +++ b/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml @@ -239,6 +239,8 @@ false false false +false +false 'Jin2006' false 0.006 diff --git a/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml b/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml index 5f56625f8d97..548004a78dcf 100644 --- a/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml +++ b/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml @@ -1115,6 +1115,22 @@ Valid values: true or false Default: Defined in namelist_defaults.xml + +Read atmospheric dust fluxes from a file + +Valid values: true or false +Default: Defined in namelist_defaults.xml + + + +Read atmospheric dust-iron solubility from a file + +Valid values: true or false +Default: Defined in namelist_defaults.xml + + Determines the ocean-ice fluxes of biogeochemistry for the bottom1-layer model: in Jin2006, the piston velocity is a function of ice growth/melt rate, in default, the piston velocity is constant diff --git a/components/mpas-seaice/cime_config/buildnml b/components/mpas-seaice/cime_config/buildnml index e29def8a31f8..5aa44cf06b9b 100755 --- a/components/mpas-seaice/cime_config/buildnml +++ b/components/mpas-seaice/cime_config/buildnml @@ -587,7 +587,14 @@ def buildnml(case, caseroot, compname): lines.append('') + lines.append('') + lines.append('') lines.append('') diff --git a/components/mpas-seaice/driver/ice_comp_mct.F b/components/mpas-seaice/driver/ice_comp_mct.F index 1dac3749056d..5c1bc715518e 100644 --- a/components/mpas-seaice/driver/ice_comp_mct.F +++ b/components/mpas-seaice/driver/ice_comp_mct.F @@ -1222,7 +1222,6 @@ subroutine ice_run_mct( EClock, cdata_i, x2i_i, i2x_i)!{{{ #endif call ice_import_moab(Eclock) #endif - ! Post coupling calls block => domain % blocklist @@ -1999,7 +1998,9 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ oceanZAerosolConcField, & atmosAerosolFluxField, & atmosBlackCarbonFluxField, & - atmosDustFluxField + atmosDustFluxField, & + atmosWetDustFluxField, & + atmosDryDustFluxField real (kind=RKIND), dimension(:), pointer :: & seaSurfaceTemperature, & @@ -2045,7 +2046,9 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ oceanZAerosolConc, & atmosAerosolFlux, & atmosBlackCarbonFlux, & - atmosDustFlux + atmosDustFlux, & + atmosWetDustFlux, & + atmosDryDustFlux !----------------------------------------------------------------------- ! @@ -2116,6 +2119,8 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_pool_get_array(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConc) call mpas_pool_get_array(biogeochemistry, 'atmosBlackCarbonFlux', atmosBlackCarbonFlux) call mpas_pool_get_array(biogeochemistry, 'atmosDustFlux', atmosDustFlux) + call mpas_pool_get_array(biogeochemistry, "atmosWetDustFlux", atmosWetDustFlux) + call mpas_pool_get_array(biogeochemistry, "atmosDryDustFlux", atmosDryDustFlux) endif if (config_use_column_biogeochemistry .and. config_couple_biogeochemistry_fields) then @@ -2247,6 +2252,16 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ + x2i_i % rAttr(index_x2i_Faxa_dstdry3, n) atmosDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet4, n) & + x2i_i % rAttr(index_x2i_Faxa_dstdry4, n) + + atmosWetDustFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet1, n) + atmosWetDustFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet2, n) + atmosWetDustFlux(3,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet3, n) + atmosWetDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet4, n) + + atmosDryDustFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_dstdry1, n) + atmosDryDustFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_dstdry2, n) + atmosDryDustFlux(3,i) = x2i_i % rAttr(index_x2i_Faxa_dstdry3, n) + atmosDryDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstdry4, n) else atmosBlackCarbonFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_bcphodry, n) atmosBlackCarbonFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_bcphidry, n) & @@ -2260,6 +2275,16 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ + x2i_i % rAttr(index_x2i_Faxa_dstdry3, n) atmosDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet4, n) & + x2i_i % rAttr(index_x2i_Faxa_dstdry4, n) + + atmosDryDustFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_dstdry1, n) + atmosDryDustFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_dstdry2, n) + atmosDryDustFlux(3,i) = x2i_i % rAttr(index_x2i_Faxa_dstdry3, n) + atmosDryDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstdry4, n) + + atmosWetDustFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet1, n) + atmosWetDustFlux(2,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet2, n) + atmosWetDustFlux(3,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet3, n) + atmosWetDustFlux(4,i) = x2i_i % rAttr(index_x2i_Faxa_dstwet4, n) endif endif ! import biogeochemistry fields, if configured @@ -2348,6 +2373,8 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ if (config_use_zaerosols) then call mpas_pool_get_field(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFluxField) call mpas_pool_get_field(biogeochemistry, "atmosDustFlux", atmosDustFluxField) + call mpas_pool_get_field(biogeochemistry, "atmosWetDustFlux", atmosWetDustFluxField) + call mpas_pool_get_field(biogeochemistry, "atmosDryDustFlux", atmosDryDustFluxField) call mpas_pool_get_field(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConcField) endif if (config_use_column_biogeochemistry .and. config_couple_biogeochemistry_fields) then @@ -2398,6 +2425,8 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ if (config_use_zaerosols) then call mpas_dmpar_exch_halo_field(atmosBlackCarbonFluxField) call mpas_dmpar_exch_halo_field(atmosDustFluxField) + call mpas_dmpar_exch_halo_field(atmosDryDustFluxField) + call mpas_dmpar_exch_halo_field(atmosWetDustFluxField) call mpas_dmpar_exch_halo_field(oceanZAerosolConcField) endif if (config_use_column_biogeochemistry .and. config_couple_biogeochemistry_fields) then @@ -3567,7 +3596,9 @@ subroutine ice_import_moab(Eclock)!{{{ oceanZAerosolConcField, & atmosAerosolFluxField, & atmosBlackCarbonFluxField, & - atmosDustFluxField + atmosDustFluxField, & + atmosWetDustFluxField, & + atmosDryDustFluxField real (kind=RKIND), dimension(:), pointer :: & seaSurfaceTemperature, & @@ -3612,7 +3643,9 @@ subroutine ice_import_moab(Eclock)!{{{ oceanZAerosolConc, & atmosAerosolFlux, & atmosBlackCarbonFlux, & - atmosDustFlux + atmosDustFlux, & + atmosWetDustFlux, & + atmosDryDustFlux character(CXX) :: tagname integer :: ierr, ent_type integer :: cur_ice_stepno @@ -3721,6 +3754,8 @@ subroutine ice_import_moab(Eclock)!{{{ if (config_use_zaerosols) then call mpas_pool_get_array(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFlux) call mpas_pool_get_array(biogeochemistry, "atmosDustFlux", atmosDustFlux) + call mpas_pool_get_array(biogeochemistry, "atmosWetDustFlux", atmosWetDustFlux) + call mpas_pool_get_array(biogeochemistry, "atmosDryDustFlux", atmosDryDustFlux) endif endif @@ -3737,8 +3772,8 @@ subroutine ice_import_moab(Eclock)!{{{ seaSurfaceTiltV(i) = x2i_im(n,index_x2i_So_dhdy) if (trim(config_ocean_surface_type) == "free") then ! free surface (MPAS-O) - - ! freezingMeltingPotential(i) is the ocean energy associated with frazil formation + + ! freezingMeltingPotential(i) is the ocean energy associated with frazil formation ! when it is positive and frazilMassFlux is positive. Conversely, freezingMeltingPotential(i) ! is negative when there is the melting potential in which case frazilMassFlux is zero. @@ -3747,7 +3782,7 @@ subroutine ice_import_moab(Eclock)!{{{ frazilMassFlux = x2i_im(n,index_x2i_Fioo_frazil) ! Now determine the sea ice mass associated with the frazil heat flux given when - ! freezingMeltingPotential(i) is positive. This produces a revised mass flux, given + ! freezingMeltingPotential(i) is positive. This produces a revised mass flux, given ! in frazilMassFluxRev for the given sea surface salinity. The resulting difference ! is assigned to frazilMassAdjust(i) which is exported to the ocean in the subsequent ! coupling step as a freshwater and salt flux. This step is required to balance mass @@ -3755,7 +3790,7 @@ subroutine ice_import_moab(Eclock)!{{{ call frazil_mass(freezingMeltingPotential(i), frazilMassFluxRev, seaSurfaceSalinity(i)) - frazilMassAdjust(i) = frazilMassFlux-frazilMassFluxRev + frazilMassAdjust(i) = frazilMassFlux-frazilMassFluxRev else ! non-free surface (SOM) @@ -3850,6 +3885,18 @@ subroutine ice_import_moab(Eclock)!{{{ + x2i_im(n,index_x2i_Faxa_dstdry3) atmosDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) & + x2i_im(n,index_x2i_Faxa_dstdry4) + + ! wet dust + atmosWetDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) + atmosWetDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) + atmosWetDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) + atmosWetDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) + + ! dry dust + atmosDryDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstdry1) + atmosDryDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstdry2) + atmosDryDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstdry3) + atmosDryDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstdry4) else atmosBlackCarbonFlux(1,i) = x2i_im(n,index_x2i_Faxa_bcphodry) atmosBlackCarbonFlux(2,i) = x2i_im(n,index_x2i_Faxa_bcphidry) & @@ -3863,12 +3910,24 @@ subroutine ice_import_moab(Eclock)!{{{ + x2i_im(n,index_x2i_Faxa_dstdry3) atmosDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) & + x2i_im(n,index_x2i_Faxa_dstdry4) + + ! wet dust + atmosWetDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) + atmosWetDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) + atmosWetDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) + atmosWetDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) + + ! dry dust + atmosDryDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstdry1) + atmosDryDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstdry2) + atmosDryDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstdry3) + atmosDryDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstdry4) endif endif endif end do -!----------------------------------------------------------------------- +!----------------------------------------------------------------------- ! ! unit conversions and any manipulation of coupled fields ! @@ -3946,6 +4005,8 @@ subroutine ice_import_moab(Eclock)!{{{ if (config_use_zaerosols) then call mpas_pool_get_field(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFluxField) call mpas_pool_get_field(biogeochemistry, "atmosDustFlux", atmosDustFluxField) + call mpas_pool_get_field(biogeochemistry, "atmosWetDustFlux", atmosWetDustFluxField) + call mpas_pool_get_field(biogeochemistry, "atmosDryDustFlux", atmosDryDustFluxField) endif endif @@ -3995,6 +4056,8 @@ subroutine ice_import_moab(Eclock)!{{{ if (config_use_zaerosols) then call mpas_dmpar_exch_halo_field(atmosBlackCarbonFluxField) call mpas_dmpar_exch_halo_field(atmosDustFluxField) + call mpas_dmpar_exch_halo_field(atmosWetDustFluxField) + call mpas_dmpar_exch_halo_field(atmosDryDustFluxField) endif endif diff --git a/components/mpas-seaice/src/Registry.xml b/components/mpas-seaice/src/Registry.xml index 7a5d18c3dc5f..b4ffd634bd28 100644 --- a/components/mpas-seaice/src/Registry.xml +++ b/components/mpas-seaice/src/Registry.xml @@ -889,6 +889,14 @@ description="Aerosols in the ice use the z-aerosol scheme" possible_values="true or false" icepack_name="tr_zaero" + /> + + + + + + + + + + + + + + @@ -5278,7 +5328,21 @@ /> + + @@ -5330,7 +5394,7 @@ type="real" dimensions="nZBGCTracers nCategories nCells Time" units="mmol m-2 s-1" - description="Only bio tracers used in the order: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon, dissolved inorganic carbon,ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m2/s, particulate iron in umol/m2/s, humic carbon, black carbon1 in mg/m2/s, black carbon2 in mg/m2/s, dust1 in mg/m2/s, dust2 in mg/m2/s, dust3 in mg/m2/s, dust4 in mg/m2/s" + description="Only bio tracers used in the order: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon, dissolved inorganic carbon,ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m2/s, particulate iron in umol/m2/s, humic carbon, black carbon1 in kg/m2/s, black carbon2 in kg/m2/s, dust1 in kg/m2/s, dust2 in kg/m2/s, dust3 in kg/m2/s, dust4 in kg/m2/s" icepack_name="flux_bion" packages="pkgColumnBiogeochemistry;pkgColumnPackage" /> @@ -5518,104 +5582,104 @@ \brief +!> \author Nicole Jeffery, LANL +!> \date +!> \details: reads data file for dust fluxes and dust-iron solubility +!> +! +!----------------------------------------------------------------------- + + subroutine atmospheric_aerosols_forcing(& + streamManager, & + domain, & + simulationClock, & + firstTimeStep) + + type (MPAS_streamManager_type), intent(inout) :: streamManager + + type (domain_type) :: domain + + type (MPAS_clock_type) :: simulationClock + + logical, intent(in) :: & + firstTimeStep + + type (block_type), pointer :: block + + real(kind=RKIND), pointer :: & + config_dt + + ! configurations + call mpas_pool_get_config(domain % configs, 'config_dt', config_dt) + + call MPAS_forcing_get_forcing(seaiceForcingGroups, & + 'seaice_atm_bgc_forcing_monthly', streamManager, config_dt) + + block => domain % blocklist + do while (associated(block)) + + ! convert the input forcing variables to the coupling variables + call prepare_atmospheric_dust_coupling_variables(block) + + block => block % next + end do + + end subroutine atmospheric_aerosols_forcing + !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! prepare_atmospheric_coupling_variables_CORE @@ -1044,6 +1117,74 @@ subroutine prepare_atmospheric_coupling_variables_ISPOL(block) end subroutine prepare_atmospheric_coupling_variables_ISPOL +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! prepare_atmospheric_dust_coupling_variables +! +!> \brief +!> \author Nicole Jeffery, LANL +!> \date +!> \details +!> Defines the atm flux fields for dust if reading from a file +! +!----------------------------------------------------------------------- + + subroutine prepare_atmospheric_dust_coupling_variables(block) + + type (block_type), pointer :: block + + type (mpas_pool_type), pointer :: & + mesh, & + atmosCoupling, & + atmosForcing, & + biogeochemistry + + real(kind=RKIND), dimension(:,:), pointer :: & + atmosDustFlux, & + atmosWetDustFlux, & + atmosDryDustFlux + + real(kind=RKIND), dimension(:), pointer :: & + dust_FLUZ_WET, & + dust_FLUZ_DRY + + integer, pointer :: & + nCellsSolve, & + maxBCType, & + nzAerosols + + integer :: & + iCell, & + iBioTracers, & + nDust + + call MPAS_pool_get_subpool(block % structs, "mesh", mesh) + call MPAS_pool_get_subpool(block % structs, "atmos_forcing", atmosForcing) + + call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) + + ! zaerosols + + call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistry) + call MPAS_pool_get_dimension(mesh, "maxBCType", maxBCType) + call MPAS_pool_get_dimension(mesh, "nzAerosols", nzAerosols) + call MPAS_pool_get_array(biogeochemistry, "atmosDustFlux", atmosDustFlux) + call MPAS_pool_get_array(biogeochemistry, "atmosWetDustFlux", atmosWetDustFlux) + call MPAS_pool_get_array(biogeochemistry, "atmosDryDustFlux", atmosDryDustFlux) + call MPAS_pool_get_array(atmosForcing, "dust_FLUZ_WET", dust_FLUZ_WET) + call MPAS_pool_get_array(atmosForcing, "dust_FLUZ_DRY", dust_FLUZ_DRY) + + nDust = MAX(1,nzAerosols - maxBCType) + do iCell = 1, nCellsSolve + do iBioTracers = maxBCType + 1, nzAerosols + atmosDustFlux(iBioTracers,iCell) = (dust_FLUZ_WET(iCell) + dust_FLUZ_DRY(iCell))/nDust + atmosWetDustFlux(iBioTracers,iCell) = dust_FLUZ_WET(iCell)/nDust + atmosDryDustFlux(iBiotracers,iCell) = dust_FLUZ_DRY(iCell)/nDust + enddo + end do + + end subroutine prepare_atmospheric_dust_coupling_variables + !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! post_atmospheric_coupling @@ -1675,6 +1816,129 @@ subroutine init_oceanic_bgc_forcing(domain) end subroutine init_oceanic_bgc_forcing +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! init_atm_iron_bgc_forcing +! +!> \brief +!> \author Nicole Jeffery, LANL +!> \date 5th April 2024 +!> \details +!> Uses monthly iron solubility maps from CAM6-MIMI (Yan Feng) +! to convert dust to dissolved iron for bgc. +!----------------------------------------------------------------------- + + subroutine init_atm_iron_bgc_forcing(domain, clock) + + type (domain_type) :: domain + + type (MPAS_Clock_type) :: clock + + logical, pointer :: & + config_do_restart + + character(len=strKIND) :: & + forcingIntervalMonthly, & + forcingReferenceTimeMonthly + + type (MPAS_Time_Type) :: currTime + character(len=strKIND) :: timeStamp + integer :: ierr + ! get forcing configuration options + call MPAS_pool_get_config(domain % configs, "config_do_restart", config_do_restart) + + ! create the dust iron solubility forcing group + + currTime = mpas_get_clock_time(clock, MPAS_NOW, ierr) + call mpas_get_time(curr_time=currTime, dateTimeString=timeStamp, ierr=ierr) + timeStamp = '0000'//trim(timeStamp(5:)) + + call MPAS_forcing_init_group(& + seaiceForcingGroups, & + "seaice_atm_bgc_forcing_monthly", & + domain, & + '0000-01-01_00:00:00', & + '0000-01-01_00:00:00', & + '0001-00-00_00:00:00', & + config_do_restart) + + forcingIntervalMonthly = "00-01-00_00:00:00" + forcingReferenceTimeMonthly = "0001-01-15_00:00:00" + + ! iron solubility fraction of wet dust iron + call MPAS_forcing_init_field(& + domain % streamManager, & + seaiceForcingGroups, & + 'seaice_atm_bgc_forcing_monthly', & + 'IRON_Zolubility_wet', & + 'DustIronMonthlyForcing', & + 'atmos_forcing', & + 'IRON_Zolubility_wet', & + 'linear', & + forcingReferenceTimeMonthly, & + forcingIntervalMonthly) + + ! iron solubility fraction of dry dust iron + call MPAS_forcing_init_field(& + domain % streamManager, & + seaiceForcingGroups, & + 'seaice_atm_bgc_forcing_monthly', & + 'IRON_Zolubility_dry', & + 'DustIronMonthlyForcing', & + 'atmos_forcing', & + 'IRON_Zolubility_dry', & + 'linear', & + forcingReferenceTimeMonthly, & + forcingIntervalMonthly) + + ! atmospheric wet dust flux + call MPAS_forcing_init_field(& + domain % streamManager, & + seaiceForcingGroups, & + 'seaice_atm_bgc_forcing_monthly', & + 'dust_FLUZ_WET', & + 'DustIronMonthlyForcing', & + 'atmos_forcing', & + 'dust_FLUZ_WET', & + 'linear', & + forcingReferenceTimeMonthly, & + forcingIntervalMonthly) + + ! atmospheric dry dust flux + call MPAS_forcing_init_field(& + domain % streamManager, & + seaiceForcingGroups, & + 'seaice_atm_bgc_forcing_monthly', & + 'dust_FLUZ_DRY', & + 'DustIronMonthlyForcing', & + 'atmos_forcing', & + 'dust_FLUZ_DRY', & + 'linear', & + forcingReferenceTimeMonthly, & + forcingIntervalMonthly) + + ! iron fraction in dust + call MPAS_forcing_init_field(& + domain % streamManager, & + seaiceForcingGroups, & + 'seaice_atm_bgc_forcing_monthly', & + 'IRON_in_duzt_fraction', & + 'DustIronMonthlyForcing', & + 'atmos_forcing', & + 'IRON_in_duzt_fraction', & + 'linear', & + forcingReferenceTimeMonthly, & + forcingIntervalMonthly) + + call MPAS_forcing_init_field_data(& + seaiceForcingGroups, & + 'seaice_atm_bgc_forcing_monthly', & + domain % streamManager, & + config_do_restart, & + .false.) + + end subroutine init_atm_iron_bgc_forcing + !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! init_oceanic_forcing_ncar @@ -3177,10 +3441,12 @@ subroutine reset_atmospheric_coupler_fluxes(domain) real(kind=RKIND), dimension(:,:), pointer :: & atmosBioFluxes, & atmosBlackCarbonFlux, & - atmosDustFlux + atmosDustFlux, & + atmosWetDustFlux, & + atmosDryDustFlux logical, pointer :: & - config_use_column_biogeochemistry + config_use_zaerosols block => domain % blocklist do while (associated(block)) @@ -3219,20 +3485,24 @@ subroutine reset_atmospheric_coupler_fluxes(domain) atmosReferenceTemperature2m = 0.0_RKIND atmosReferenceHumidity2m = 0.0_RKIND - ! biogeochemistry - call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + ! zaerosols + call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) - if (config_use_column_biogeochemistry) then + if (config_use_zaerosols) then call MPAS_pool_get_subpool(block % structs, "biogeochemistry", biogeochemistry) call MPAS_pool_get_array(biogeochemistry, "atmosBioFluxes", atmosBioFluxes) call MPAS_pool_get_array(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFlux) call MPAS_pool_get_array(biogeochemistry, "atmosDustFlux", atmosDustFlux) + call MPAS_pool_get_array(biogeochemistry, "atmosWetDustFlux", atmosWetDustFlux) + call MPAS_pool_get_array(biogeochemistry, "atmosDryDustFlux", atmosDryDustFlux) atmosBioFluxes = 0.0_RKIND atmosBlackCarbonFlux = 0.0_RKIND atmosDustFlux = 0.0_RKIND + atmosWetDustFlux = 0.0_RKIND + atmosDryDustFlux = 0.0_RKIND endif @@ -3396,16 +3666,21 @@ subroutine seaice_forcing_write_restart_times(domain) config_use_forcing, & config_use_prescribed_ice, & config_use_prescribed_ice_forcing, & - config_use_data_icebergs + config_use_data_icebergs, & + config_use_atm_dust_file, & + config_use_iron_solubility_file call MPAS_pool_get_config(domain % configs, "config_use_forcing", config_use_forcing) call MPAS_pool_get_config(domain % configs, "config_use_prescribed_ice", config_use_prescribed_ice) call MPAS_pool_get_config(domain % configs, "config_use_prescribed_ice_forcing", config_use_prescribed_ice_forcing) call MPAS_pool_get_config(domain % configs, "config_use_data_icebergs", config_use_data_icebergs) + call MPAS_pool_get_config(domain % configs, "config_use_atm_dust_file", config_use_atm_dust_file) + call MPAS_pool_get_config(domain % configs, "config_use_iron_solubility_file", config_use_iron_solubility_file) if (config_use_forcing .or. & (config_use_prescribed_ice .and. config_use_prescribed_ice_forcing) .or. & - config_use_data_icebergs) then + config_use_data_icebergs .or. & + config_use_atm_dust_file .or. config_use_iron_solubility_file) then call MPAS_forcing_write_restart_times(seaiceForcingGroups) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 6c787048ad1d..f32d8e1d1dd8 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -3487,7 +3487,9 @@ subroutine column_biogeochemistry(domain) icepack_warnings_clear use seaice_constants, only: & - seaicePuny + seaicePuny, & + kilogramsToMicrograms, & + gramsIronPerMolIron type(domain_type), intent(inout) :: domain @@ -3503,6 +3505,7 @@ subroutine column_biogeochemistry(domain) melt_growth_rates, & ocean_coupling, & atmos_coupling, & + atmos_forcing, & initial ! configs @@ -3514,7 +3517,9 @@ subroutine column_biogeochemistry(domain) config_use_skeletal_biochemistry, & config_use_column_biogeochemistry, & config_use_zaerosols, & - config_use_vertical_tracers + config_use_vertical_tracers, & + config_use_atm_dust_file, & + config_use_iron_solubility_file ! dimensions integer, pointer :: & @@ -3554,7 +3559,10 @@ subroutine column_biogeochemistry(domain) oceanDMSPConc, & oceanHumicsConc, & openWaterArea, & - totalChlorophyll + totalChlorophyll, & + IRON_Zolubility_wet, & + IRON_Zolubility_dry, & + IRON_in_duzt_fraction real(kind=RKIND), dimension(:,:), pointer :: & iceAreaCategoryInitial, & @@ -3581,6 +3589,8 @@ subroutine column_biogeochemistry(domain) atmosBioFluxes, & atmosBlackCarbonFlux, & atmosDustFlux, & + atmosWetDustFlux, & + atmosDryDustFlux, & oceanBioFluxes, & oceanAlgaeConc, & oceanDOCConc, & @@ -3681,6 +3691,7 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_subpool(block % structs, "diagnostics_biogeochemistry", diagnostics_biogeochemistry) call MPAS_pool_get_subpool(block % structs, "shortwave", shortwave) call MPAS_pool_get_subpool(block % structs, "atmos_coupling", atmos_coupling) + call MPAS_pool_get_subpool(block % structs, "atmos_forcing", atmos_forcing) call MPAS_pool_get_subpool(block % structs, "melt_growth_rates", melt_growth_rates) call MPAS_pool_get_subpool(block % structs, "ocean_coupling", ocean_coupling) call MPAS_pool_get_subpool(block % structs, "initial", initial) @@ -3704,6 +3715,8 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_config(block % configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) call MPAS_pool_get_config(block % configs, "config_use_zaerosols",config_use_zaerosols) call MPAS_pool_get_config(block % configs, "config_use_vertical_tracers",config_use_vertical_tracers) + call MPAS_pool_get_config(block % configs, "config_use_atm_dust_file", config_use_atm_dust_file) + call MPAS_pool_get_config(block % configs, "config_use_iron_solubility_file", config_use_iron_solubility_file) call MPAS_pool_get_array(biogeochemistry, "newlyFormedIce", newlyFormedIce) call MPAS_pool_get_array(biogeochemistry, "netNitrateUptake", netNitrateUptake) @@ -3734,6 +3747,8 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(biogeochemistry, "atmosBioFluxes", atmosBioFluxes) call MPAS_pool_get_array(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFlux) call MPAS_pool_get_array(biogeochemistry, "atmosDustFlux", atmosDustFlux) + call MPAS_pool_get_array(biogeochemistry, "atmosWetDustFlux", atmosWetDustFlux) + call MPAS_pool_get_array(biogeochemistry, "atmosDryDustFlux", atmosDryDustFlux) call MPAS_pool_get_array(biogeochemistry, "oceanBioFluxes", oceanBioFluxes) call MPAS_pool_get_array(biogeochemistry, "oceanBioFluxesCategory", oceanBioFluxesCategory) call MPAS_pool_get_array(biogeochemistry, "verticalNitrogenLosses", verticalNitrogenLosses) @@ -3763,6 +3778,10 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(atmos_coupling, "snowfallRate", snowfallRate) + call MPAS_pool_get_array(atmos_forcing, "IRON_Zolubility_wet", IRON_Zolubility_wet) + call MPAS_pool_get_array(atmos_forcing, "IRON_Zolubility_dry", IRON_Zolubility_dry) + call MPAS_pool_get_array(atmos_forcing, "IRON_in_duzt_fraction", IRON_in_duzt_fraction) + call MPAS_pool_get_array(icestate, "iceAreaCategoryInitial", iceAreaCategoryInitial) call MPAS_pool_get_array(icestate, "iceVolumeCategoryInitial", iceVolumeCategoryInitial) call MPAS_pool_get_array(icestate, "snowVolumeCategoryInitial", snowVolumeCategoryInitial) @@ -3863,9 +3882,13 @@ subroutine column_biogeochemistry(domain) do iBioTracers = 1, maxBCType atmosBlackCarbonFlux(iBioTracers,iCell) = 1.e-12_RKIND enddo - do iBioTracers = 1, maxDustType - atmosDustFlux(iBioTracers,iCell) = 1.e-13_RKIND - enddo + if (.not. config_use_atm_dust_file) then + do iBioTracers = 1, maxDustType + atmosDustFlux(iBioTracers,iCell) = 1.e-13_RKIND + atmosWetDustFlux(iBioTracers,iCell) = 1.e-13_RKIND * 0.5_RKIND + atmosDryDustFlux(iBioTracers,iCell) = 1.e-13_RKIND * 0.5_RKIND + enddo + endif #endif if (config_use_zaerosols) then indexj = ciceTracerObject % index_verticalAerosolsConcLayer(1) @@ -3875,6 +3898,16 @@ subroutine column_biogeochemistry(domain) do iBioTracers = maxBCType + 1, nzAerosols atmosBioFluxes(indexj -1 + iBioTracers, iCell) = atmosDustFlux(iBioTracers-maxBCType,iCell) enddo + indexj = ciceTracerObject % index_dissolvedIronConcLayer(1) + if (config_use_iron_solubility_file) then + atmosBioFluxes(indexj,iCell) = 0.0_RKIND + do iBioTracers = maxBCType + 1, nzAerosols + atmosBioFluxes(indexj,iCell) = atmosBioFluxes(indexj,iCell) + & + (atmosWetDustFlux(iBioTracers-maxBCType,iCell) * IRON_Zolubility_wet(iCell) + & + atmosDryDustFlux(iBioTracers-maxBCType,iCell) * IRON_Zolubility_dry(iCell) ) * & + IRON_in_duzt_fraction(iCell) * kilogramsToMicrograms * gramsIronPerMolIron + end do + end if endif do iBioTracers = 1, ciceTracerObject % nBioTracers @@ -10028,7 +10061,8 @@ subroutine init_icepack_package_configs(domain) config_do_restart_bgc, & config_use_snow_liquid_ponds, & config_use_snow_grain_radius, & - config_use_shortwave_redistribution + config_use_shortwave_redistribution, & + config_use_iron_solubility_file real(kind=RKIND), pointer :: & config_min_friction_velocity, & @@ -10293,6 +10327,7 @@ subroutine init_icepack_package_configs(domain) call MPAS_pool_get_config(domain % configs, "config_use_shortwave_bioabsorption", config_use_shortwave_bioabsorption) call MPAS_pool_get_config(domain % configs, "config_use_modal_aerosols", config_use_modal_aerosols) call MPAS_pool_get_config(domain % configs, "config_use_macromolecules", config_use_macromolecules) + call MPAS_pool_get_config(domain % configs, "config_use_iron_solubility_file", config_use_iron_solubility_file) call MPAS_pool_get_config(domain % configs, "config_do_restart_bgc", config_do_restart_bgc) call MPAS_pool_get_config(domain % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) call MPAS_pool_get_config(domain % configs, "config_biogrid_bottom_molecular_sublayer", & @@ -10754,6 +10789,7 @@ subroutine init_icepack_package_configs(domain) algal_vel_in = config_algal_maximum_velocity, & R_dFe2dust_in = config_ratio_Fe_to_dust, & dustFe_sol_in = config_solubility_of_Fe_in_dust, & + use_atm_dust_iron_in = .not.config_use_iron_solubility_file, & !chlabs_diatoms_in = config_chla_absorptivity_of_diatoms, & !chlabs_sp_in = config_chla_absorptivity_of_small_plankton, & !chlabs_phaeo_in = config_chla_absorptivity_of_phaeocystis, & @@ -11369,6 +11405,10 @@ subroutine init_icepack_package_configs(domain) ! solubility fraction ! dustFe_sol = config_solubility_of_Fe_in_dust + ! use_atm_dust_sol; + ! compute dust iron contribution in icepack + ! use_atm_dust_sol = .not.config_use_iron_solubility_file + ! chlabs_diatoms: ! chl absorption (1/m/(mg/m^3)) ! chlabs_diatoms = config_chla_absorptivity_of_diatoms From 8659988a4f6dd3abc95da8f9a0789b34cc2ca3bc Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Fri, 24 May 2024 15:56:59 -0500 Subject: [PATCH 15/24] Adds the sea ice-ocean dust flux field for coupling This field oceanDustIronFlux will be used by the ocean for dust-iron consistency across the coupled system Also corrects a bug in the calculation of iron from dust introduced in the last commit Works with E3SM-Project/Icepack.git origin/fixes-to-zaerosols-take3 BFB with zaerosols off --- components/mpas-seaice/driver/ice_comp_mct.F | 99 +++++++++++-------- .../src/shared/mpas_seaice_icepack.F | 2 +- 2 files changed, 60 insertions(+), 41 deletions(-) diff --git a/components/mpas-seaice/driver/ice_comp_mct.F b/components/mpas-seaice/driver/ice_comp_mct.F index 5c1bc715518e..50bf12ece375 100644 --- a/components/mpas-seaice/driver/ice_comp_mct.F +++ b/components/mpas-seaice/driver/ice_comp_mct.F @@ -2516,6 +2516,7 @@ subroutine ice_export_mct(i2x_i, errorCode) !{{{ config_rotate_cartesian_grid, & config_use_topo_meltponds, & config_use_column_biogeochemistry, & + config_use_zaerosols, & config_couple_biogeochemistry_fields, & config_use_column_shortwave, & config_use_data_icebergs @@ -2566,6 +2567,7 @@ subroutine ice_export_mct(i2x_i, errorCode) !{{{ oceanDMSPpFlux, & oceanDMSPdFlux, & oceanHumicsFlux, & + oceanDustIronFlux, & carbonToNitrogenRatioAlgae, & carbonToNitrogenRatioDON @@ -2588,6 +2590,7 @@ subroutine ice_export_mct(i2x_i, errorCode) !{{{ configs => block_ptr % configs call MPAS_pool_get_config(configs, "config_rotate_cartesian_grid", config_rotate_cartesian_grid) call MPAS_pool_get_config(configs, "config_use_topo_meltponds", config_use_topo_meltponds) + call MPAS_pool_get_config(configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_config(configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) call mpas_pool_get_config(configs, "config_couple_biogeochemistry_fields", config_couple_biogeochemistry_fields) call MPAS_pool_get_config(configs, "config_use_column_shortwave", config_use_column_shortwave) @@ -2672,6 +2675,9 @@ subroutine ice_export_mct(i2x_i, errorCode) !{{{ call mpas_pool_get_array(biogeochemistry, 'carbonToNitrogenRatioDON', carbonToNitrogenRatioDON) endif + if (config_use_zaerosols .and. config_couple_biogeochemistry_fields) & + call mpas_pool_get_array(biogeochemistry, 'oceanDustIronFlux', oceanDustIronFlux) + do i = 1, nCellsSolve n = n + 1 @@ -2796,6 +2802,9 @@ subroutine ice_export_mct(i2x_i, errorCode) !{{{ i2x_i % rAttr(index_i2x_Fioi_fed1 ,n) = oceanDissolvedIronFlux(1,i) / 1000._RKIND i2x_i % rAttr(index_i2x_Fioi_fed2 ,n) = oceanDissolvedIronFlux(2,i) / 1000._RKIND endif + ! export dust, if configured kg/m2/s of dust + if (config_use_zaerosols .and. config_couple_biogeochemistry_fields) & + i2x_i % rAttr(index_i2x_Fioi_dust1 ,n) = oceanDustIronFlux(i) endif enddo @@ -3124,8 +3133,10 @@ subroutine ice_export_moab(EClock) config_rotate_cartesian_grid, & config_use_topo_meltponds, & config_use_column_biogeochemistry, & + config_use_zaerosols, & config_use_column_shortwave, & - config_use_data_icebergs + config_use_data_icebergs, & + config_couple_biogeochemistry_fields real(kind=RKIND), pointer :: & sphere_radius @@ -3173,6 +3184,7 @@ subroutine ice_export_moab(EClock) oceanDMSPpFlux, & oceanDMSPdFlux, & oceanHumicsFlux, & + oceanDustIronFlux, & carbonToNitrogenRatioAlgae, & carbonToNitrogenRatioDON @@ -3186,23 +3198,25 @@ subroutine ice_export_moab(EClock) integer :: ent_type, ierr, cur_ice_stepno character(len=32), parameter :: sub = 'ice_export_moab' - + character(len=100) :: outfile, wopts, localmeshfile, lnum character(CXX) :: tagname - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- call shr_file_setLogUnit (iceLogUnit) n = 0 i2x_im(: ,:) = 0.0_RKIND block_ptr => domain % blocklist do while(associated(block_ptr)) - + configs => block_ptr % configs call MPAS_pool_get_config(configs, "config_rotate_cartesian_grid", config_rotate_cartesian_grid) call MPAS_pool_get_config(configs, "config_use_topo_meltponds", config_use_topo_meltponds) + call MPAS_pool_get_config(configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_config(configs, "config_use_column_biogeochemistry", config_use_column_biogeochemistry) + call mpas_pool_get_config(configs, "config_couple_biogeochemistry_fields", config_couple_biogeochemistry_fields) call MPAS_pool_get_config(configs, "config_use_column_shortwave", config_use_column_shortwave) call MPAS_pool_get_config(configs, "config_use_data_icebergs", config_use_data_icebergs) - + call MPAS_pool_get_subpool(block_ptr % structs, 'mesh', meshPool) call MPAS_pool_get_subpool(block_ptr % structs, "tracers_aggregate", tracersAggregate) call MPAS_pool_get_subpool(block_ptr % structs, "velocity_solver", velocitySolver) @@ -3211,7 +3225,7 @@ subroutine ice_export_moab(EClock) call MPAS_pool_get_subpool(block_ptr % structs, 'ocean_coupling', oceanCoupling) call MPAS_pool_get_subpool(block_ptr % structs, "atmos_fluxes", atmosFluxes) call MPAS_pool_get_subpool(block_ptr % structs, "ocean_fluxes", oceanFluxes) - + call MPAS_pool_get_dimension(meshPool, 'nCellsSolve', nCellsSolve) call MPAS_pool_get_config(meshPool, "sphere_radius", sphere_radius) call MPAS_pool_get_array(meshPool, "latCell", latCell) @@ -3219,7 +3233,7 @@ subroutine ice_export_moab(EClock) call MPAS_pool_get_array(meshPool, "xCell", xCell) call MPAS_pool_get_array(meshPool, "yCell", yCell) call MPAS_pool_get_array(meshPool, "zCell", zCell) - + call MPAS_pool_get_array(tracersAggregate, 'iceAreaCell', iceAreaCell) call MPAS_pool_get_array(tracersAggregate, 'iceVolumeCell', iceVolumeCell) call MPAS_pool_get_array(tracersAggregate, 'snowVolumeCell', snowVolumeCell) @@ -3227,44 +3241,44 @@ subroutine ice_export_moab(EClock) call MPAS_pool_get_array(tracersAggregate, 'pondLidThicknessCell', pondLidThicknessCell) call MPAS_pool_get_array(tracersAggregate, 'pondAreaCell', pondAreaCell) call MPAS_pool_get_array(tracersAggregate, 'surfaceTemperatureCell', surfaceTemperatureCell) - + call MPAS_pool_get_array(velocitySolver, 'airStressCellU', airStressCellU) call MPAS_pool_get_array(velocitySolver, 'airStressCellV', airStressCellV) call MPAS_pool_get_array(velocitySolver, 'oceanStressCellU', oceanStressCellU) call MPAS_pool_get_array(velocitySolver, 'oceanStressCellV', oceanStressCellV) - + call MPAS_pool_get_array(shortwave, 'albedoVisibleDirectCell', albedoVisibleDirectCell) call MPAS_pool_get_array(shortwave, 'albedoIRDirectCell', albedoIRDirectCell) call MPAS_pool_get_array(shortwave, 'albedoVisibleDiffuseCell', albedoVisibleDiffuseCell) call MPAS_pool_get_array(shortwave, 'albedoIRDiffuseCell', albedoIRDiffuseCell) call MPAS_pool_get_array(shortwave, 'absorbedShortwaveFlux', absorbedShortwaveFlux) - + call MPAS_pool_get_array(atmosCoupling, 'atmosReferenceSpeed10m', atmosReferenceSpeed10m) call MPAS_pool_get_array(atmosCoupling, 'atmosReferenceTemperature2m', atmosReferenceTemperature2m) call MPAS_pool_get_array(atmosCoupling, 'atmosReferenceHumidity2m', atmosReferenceHumidity2m) - + call MPAS_pool_get_array(oceanCoupling, 'frazilMassAdjust', frazilMassAdjust) - + call MPAS_pool_get_array(atmosFluxes, 'latentHeatFlux', latentHeatFlux) call MPAS_pool_get_array(atmosFluxes, 'sensibleHeatFlux', sensibleHeatFlux) call MPAS_pool_get_array(atmosFluxes, 'longwaveUp', longwaveUp) call MPAS_pool_get_array(atmosFluxes, 'evaporativeWaterFlux', evaporativeWaterFlux) - + call MPAS_pool_get_array(oceanFluxes, 'oceanHeatFlux', oceanHeatFlux) call MPAS_pool_get_array(oceanFluxes, 'oceanShortwaveFlux', oceanShortwaveFlux) call MPAS_pool_get_array(oceanFluxes, 'oceanFreshWaterFlux', oceanFreshWaterFlux) call MPAS_pool_get_array(oceanFluxes, 'oceanSaltFlux', oceanSaltFlux) - + if (config_use_data_icebergs) then call MPAS_pool_get_subpool(block_ptr % structs, "berg_fluxes", icebergFluxes) - + call MPAS_pool_get_array(icebergFluxes, "bergFreshwaterFlux", bergFreshwaterFlux) call MPAS_pool_get_array(icebergFluxes, "bergLatentHeatFlux", bergLatentHeatFlux) endif - - if (config_use_column_biogeochemistry) then + + if (config_use_column_biogeochemistry .and. config_couple_biogeochemistry_fields) then call mpas_pool_get_subpool(block_ptr % structs, 'biogeochemistry', biogeochemistry) - + call mpas_pool_get_array(biogeochemistry, 'oceanAlgaeFlux', oceanAlgaeFlux) call mpas_pool_get_array(biogeochemistry, 'oceanDOCFlux', oceanDOCFlux) call mpas_pool_get_array(biogeochemistry, 'oceanDICFlux', oceanDICFlux) @@ -3281,18 +3295,20 @@ subroutine ice_export_moab(EClock) call mpas_pool_get_array(biogeochemistry, 'carbonToNitrogenRatioAlgae', carbonToNitrogenRatioAlgae) call mpas_pool_get_array(biogeochemistry, 'carbonToNitrogenRatioDON', carbonToNitrogenRatioDON) endif - + if (config_use_zaerosols .and. config_couple_biogeochemistry_fields) & + call mpas_pool_get_array(biogeochemistry, 'oceanDustIronFlux', oceanDustIronFlux) + do i = 1, nCellsSolve n = n + 1 - + ! ice fraction ailohi = min(iceAreaCell(i), 1.0_RKIND) - + !TODO: CICE has a check for ailohi < 0 - + ! surface temperature Tsrf = seaiceFreshWaterFreezingPoint + surfaceTemperatureCell(i) - + ! basal pressure if ( ailohi > 0.0_RKIND ) then call basal_pressure(& @@ -3304,7 +3320,7 @@ subroutine ice_export_moab(EClock) pondAreaCell(i), & config_use_topo_meltponds) endif - + ! wind stress (on T-grid: convert to lat-lon) call seaice_latlon_vector_rotation_backward(& tauxa, & @@ -3318,7 +3334,7 @@ subroutine ice_export_moab(EClock) zCell(i), & sphere_radius, & config_rotate_cartesian_grid) - + ! ice/ocean stress (on POP T-grid: convert to lat-lon) call seaice_latlon_vector_rotation_backward(& tauxo, & @@ -3332,25 +3348,25 @@ subroutine ice_export_moab(EClock) zCell(i), & sphere_radius, & config_rotate_cartesian_grid) - - !-------states-------------------- + + !-------states-------------------- i2x_im(n, index_i2x_Si_ifrac) = ailohi - + if (config_use_data_icebergs) then i2x_im(n, index_i2x_Fioi_bergw) = bergFreshwaterFlux(i) i2x_im(n, index_i2x_Fioi_bergh) = bergLatentHeatFlux(i) endif - + if ( ailohi > 0.0_RKIND ) then - - !-------states-------------------- + + !-------states-------------------- i2x_im(n, index_i2x_Si_t) = Tsrf i2x_im(n, index_i2x_Si_bpress) = basalPressure i2x_im(n, index_i2x_Si_u10) = atmosReferenceSpeed10m(i) i2x_im(n, index_i2x_Si_tref) = atmosReferenceTemperature2m(i) i2x_im(n, index_i2x_Si_qref) = atmosReferenceHumidity2m(i) i2x_im(n, index_i2x_Si_snowh) = snowVolumeCell(i) / ailohi - + !--- a/i fluxes computed by ice i2x_im(n, index_i2x_Faii_taux) = tauxa i2x_im(n, index_i2x_Faii_tauy) = tauya @@ -3360,17 +3376,17 @@ subroutine ice_export_moab(EClock) i2x_im(n, index_i2x_Faii_evap) = evaporativeWaterFlux(i) i2x_im(n, index_i2x_Faii_swnet) = absorbedShortwaveFlux(i) i2x_im(n, index_i2x_Faii_evap) = evaporativeWaterFlux(i) - + if (config_use_column_shortwave) then i2x_im(n, index_i2x_Si_avsdr) = albedoVisibleDirectCell(i) i2x_im(n, index_i2x_Si_anidr) = albedoIRDirectCell(i) i2x_im(n, index_i2x_Si_avsdf) = albedoVisibleDiffuseCell(i) i2x_im(n, index_i2x_Si_anidf) = albedoIRDiffuseCell(i) - + i2x_im(n, index_i2x_Faii_swnet) = absorbedShortwaveFlux(i) endif - - ! i/o fluxes computed by ice, as well as additional freshwater and salt calculated at the last + + ! i/o fluxes computed by ice, as well as additional freshwater and salt calculated at the last ! coupling import and needed to grow sea ice from frazil passed from the ocean model in the ! field frazilMassAdjust. i2x_im(n, index_i2x_Fioi_melth) = oceanHeatFlux(i) @@ -3379,9 +3395,9 @@ subroutine ice_export_moab(EClock) i2x_im(n, index_i2x_Fioi_salt ) = oceanSaltFlux(i) + seaiceReferenceSalinity*0.001_RKIND*frazilMassAdjust(i)/ailohi i2x_im(n, index_i2x_Fioi_taux ) = tauxo i2x_im(n, index_i2x_Fioi_tauy ) = tauyo - + ! export biogeochemistry fields, if configured - if (config_use_column_biogeochemistry) then + if (config_use_column_biogeochemistry .and. config_couple_biogeochemistry_fields) then ! convert from mmol N/m^3 to mmol C/m^3 i2x_im(n, index_i2x_Fioi_algae1) = oceanAlgaeFlux(1,i) * carbonToNitrogenRatioAlgae(1) i2x_im(n, index_i2x_Fioi_algae2) = oceanAlgaeFlux(2,i) * carbonToNitrogenRatioAlgae(2) @@ -3404,9 +3420,12 @@ subroutine ice_export_moab(EClock) i2x_im(n, index_i2x_Fioi_fed1 ) = oceanDissolvedIronFlux(1,i) / 1000._RKIND i2x_im(n, index_i2x_Fioi_fed2 ) = oceanDissolvedIronFlux(2,i) / 1000._RKIND endif + ! export dust, kg/m2/s + if (config_use_zaerosols .and. config_couple_biogeochemistry_fields) & + i2x_im(n, index_i2x_Fioi_dust1 ) = oceanDustIronFlux(i) endif enddo - + block_ptr => block_ptr % next enddo @@ -3417,7 +3436,7 @@ subroutine ice_export_moab(EClock) if ( ierr /= 0 ) then write(iceLogUnit,*) 'Fail to set MOAB fields ' endif - + call seq_timemgr_EClockGetData( EClock, stepno=cur_ice_stepno ) #ifdef MOABDEBUG write(lnum,"(I0.2)")cur_ice_stepno diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index f32d8e1d1dd8..adee0c072b42 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -3905,7 +3905,7 @@ subroutine column_biogeochemistry(domain) atmosBioFluxes(indexj,iCell) = atmosBioFluxes(indexj,iCell) + & (atmosWetDustFlux(iBioTracers-maxBCType,iCell) * IRON_Zolubility_wet(iCell) + & atmosDryDustFlux(iBioTracers-maxBCType,iCell) * IRON_Zolubility_dry(iCell) ) * & - IRON_in_duzt_fraction(iCell) * kilogramsToMicrograms * gramsIronPerMolIron + IRON_in_duzt_fraction(iCell) * kilogramsToMicrograms / gramsIronPerMolIron end do end if endif From 9535815fa5419e726d90c0fe1c7af27ce789ec4a Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Mon, 27 May 2024 15:20:59 -0500 Subject: [PATCH 16/24] Move bgc indexing definitions to the interface -adds subroutine in the icepack interface, init_zbgc_tracer_indices, to replace icepack_init_zbgc_tracer_indices. -moves icepack_init_bgc_trcr from icepack to init_bgc_tracer_indices in mpas_seaice_icepack Tested in GCASE with ice-ocean bgc and aerosols active works with njeffery/Icepack.git branch: fixes-to-bgc-indices --- components/mpas-seaice/cime_config/buildnml | 2 +- .../src/shared/mpas_seaice_forcing.F | 7 - .../src/shared/mpas_seaice_icepack.F | 935 ++++++++++++++++-- 3 files changed, 853 insertions(+), 91 deletions(-) diff --git a/components/mpas-seaice/cime_config/buildnml b/components/mpas-seaice/cime_config/buildnml index 5aa44cf06b9b..c79de6314b06 100755 --- a/components/mpas-seaice/cime_config/buildnml +++ b/components/mpas-seaice/cime_config/buildnml @@ -594,7 +594,7 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append('') diff --git a/components/mpas-seaice/src/shared/mpas_seaice_forcing.F b/components/mpas-seaice/src/shared/mpas_seaice_forcing.F index 5fba5fa7d5ec..ca0c4c5a962f 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_forcing.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_forcing.F @@ -1841,18 +1841,11 @@ subroutine init_atm_iron_bgc_forcing(domain, clock) forcingIntervalMonthly, & forcingReferenceTimeMonthly - type (MPAS_Time_Type) :: currTime - character(len=strKIND) :: timeStamp - integer :: ierr ! get forcing configuration options call MPAS_pool_get_config(domain % configs, "config_do_restart", config_do_restart) ! create the dust iron solubility forcing group - currTime = mpas_get_clock_time(clock, MPAS_NOW, ierr) - call mpas_get_time(curr_time=currTime, dateTimeString=timeStamp, ierr=ierr) - timeStamp = '0000'//trim(timeStamp(5:)) - call MPAS_forcing_init_group(& seaiceForcingGroups, & "seaice_atm_bgc_forcing_monthly", & diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index adee0c072b42..fd49a8c383a9 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -12948,7 +12948,6 @@ end subroutine seaice_column_reinitialize_oceanic_fluxes subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) use icepack_intfc, only: icepack_init_zbgc - use icepack_intfc, only: icepack_init_zbgc_tracer_indices use icepack_intfc, only: icepack_init_parameters use icepack_intfc, only: icepack_query_parameters @@ -13089,6 +13088,7 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) nParticulateIron, & nDissolvedIron, & nzAerosols, & + nZBGCTracers, & maxAerosolType, & maxAlgaeType, & maxDOCType, & @@ -13106,6 +13106,12 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) real(kind=RKIND) :: & rtmp1, & rtmp2 + real (kind=RKIND), dimension (:), allocatable :: & + BGCTracerType, & + initialMobileFraction, & + retentionTime, & + releaseTime, & + newIceBGCFraction ! save tracer array size nTracers_temp = tracerObject % nTracers @@ -13246,6 +13252,7 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nParticulateIron", nParticulateIron) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDissolvedIron", nDissolvedIron) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nzAerosols", nzAerosols) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nZBGCTracers", nZBGCTracers) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxAerosolType", maxAerosolType) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxAlgaeType", maxAlgaeType) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxDOCType", maxDOCType) @@ -13253,6 +13260,18 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxDONType", maxDONType) call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxIronType", maxIronType) + allocate(BGCTracerType(nZBGCTracers)) + allocate(initialMobileFraction(nZBGCTracers)) + allocate(retentionTime(nZBGCTracers)) + allocate(releaseTime(nZBGCTracers)) + allocate(newIceBGCFraction(nZBGCTracers)) + + retentionTime(:) = 0.0_RKIND + releaseTime(:) = 0.0_RKIND + initialMobileFraction(:) = 0.0_RKIND + BGCTracerType(:) = 0.0_RKIND + newIceBGCFraction(:) = 0.0_RKIND + use_nitrogen = .false. if (config_use_skeletal_biochemistry .or. config_use_vertical_biochemistry) & use_nitrogen = .true. @@ -13394,84 +13413,15 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) tau_min_in=config_rapid_mobile_to_stationary_time, & tau_max_in=config_long_mobile_to_stationary_time) - call icepack_init_zbgc_tracer_indices(& - nilyr_in=nIceLayers, & - nslyr_in=nSnowLayers, & - nblyr_in=nBioLayers, & - n_algae_in=nAlgae, & - n_zaero_in=nzAerosols, & - n_doc_in=nDOC, & - n_dic_in=nDIC, & - n_don_in=nDON, & - n_fed_in=nDissolvedIron, & - n_fep_in=nParticulateIron, & - trcr_base=tracerObject % firstAncestorMask, & - trcr_depend=tracerObject % parentIndex, & - n_trcr_strata=tracerObject % ancestorNumber, & - nt_strata=tracerObject % ancestorIndices, & - nbtrcr_sw_out=tracerObject % nBioTracersShortwave, & - tr_brine_in=config_use_brine, & - nt_fbri_out=tracerObject % index_brineFraction,& - ntrcr_out=tracerObject % nTracers, & - nbtrcr_out=tracerObject % nBioTracers, & - ntrcr_o_out=tracerObject % nTracersNotBio, & - nt_bgc_Nit_out=tracerObject % index_nitrateConc, & - nt_bgc_Am_out=tracerObject % index_ammoniumConc, & - nt_bgc_Sil_out=tracerObject % index_silicateConc, & - nt_bgc_DMS_out=tracerObject % index_DMSConc, & - nt_bgc_PON_out=tracerObject % index_nonreactiveConc, & - nt_bgc_N_out=tracerObject % index_algaeConc, & - nt_bgc_C_out=tracerObject % index_algalCarbon, & - nt_bgc_chl_out=tracerObject % index_algalChlorophyll, & - nt_bgc_DOC_out=tracerObject % index_DOCConc, & - nt_bgc_DON_out=tracerObject % index_DONConc, & - nt_bgc_DIC_out=tracerObject % index_DICConc, & - nt_zaero_out=tracerObject % index_verticalAerosolsConc, & - nt_bgc_DMSPp_out=tracerObject % index_DMSPpConc, & - nt_bgc_DMSPd_out=tracerObject % index_DMSPdConc, & - nt_bgc_Fed_out=tracerObject % index_dissolvedIronConc, & - nt_bgc_Fep_out=tracerObject % index_particulateIronConc, & - nt_zbgc_frac_out=tracerObject % index_mobileFraction, & - tr_bgc_Nit_in=config_use_nitrate, & - tr_bgc_Am_in=config_use_ammonium, & - tr_bgc_Sil_in=config_use_silicate, & - tr_bgc_DMS_in=config_use_DMS, & - tr_bgc_PON_in=config_use_nonreactive, & - tr_bgc_N_in=use_nitrogen, & - tr_bgc_C_in=config_use_carbon, & - tr_bgc_chl_in=config_use_chlorophyll, & - tr_bgc_DON_in=config_use_DON, & - tr_bgc_Fe_in=config_use_iron,& - tr_zaero_in=config_use_zaerosols, & - nlt_zaero_sw_out=tracerObject % index_verticalAerosolsConcShortwave, & - nlt_chl_sw_out=tracerObject % index_chlorophyllShortwave, & - nlt_bgc_N_out=tracerObject % index_algaeConcLayer, & - nlt_bgc_Nit_out=tracerObject % index_nitrateConcLayer, & - nlt_bgc_Am_out=tracerObject % index_ammoniumConcLayer, & - nlt_bgc_Sil_out=tracerObject % index_silicateConcLayer, & - nlt_bgc_DMS_out=tracerObject % index_DMSConcLayer, & - nlt_bgc_DMSPp_out=tracerObject % index_DMSPpConcLayer, & - nlt_bgc_DMSPd_out=tracerObject % index_DMSPdConcLayer, & - nlt_bgc_C_out=tracerObject % index_algalCarbonLayer, & - nlt_bgc_chl_out=tracerObject % index_algalChlorophyllLayer, & - nlt_bgc_DIC_out=tracerObject % index_DICConcLayer, & - nlt_bgc_DOC_out=tracerObject % index_DOCConcLayer, & - nlt_bgc_PON_out=tracerObject % index_nonreactiveConcLayer, & - nlt_bgc_DON_out=tracerObject % index_DONConcLayer, & - nlt_bgc_Fed_out=tracerObject % index_dissolvedIronConcLayer, & - nlt_bgc_Fep_out=tracerObject % index_particulateIronConcLayer, & - nlt_zaero_out=tracerObject % index_verticalAerosolsConcLayer, & - nt_bgc_hum_out=tracerObject % index_humicsConc, & - nlt_bgc_hum_out=tracerObject % index_humicsConcLayer, & - tr_bgc_hum_in=config_use_humics, & - skl_bgc_in=config_use_skeletal_biochemistry, & - z_tracers_in=config_use_vertical_tracers, & - dEdd_algae_in=config_use_shortwave_bioabsorption, & - solve_zbgc_in=config_use_vertical_biochemistry, & - bio_index_o_out=tracerObject % index_LayerIndexToDataArray, & - bio_index_out=tracerObject % index_LayerIndexToBioIndex) - - call icepack_init_zbgc() + call init_zbgc_tracer_indices(domain, tracerObject, use_nitrogen, nTracers_temp, & + BGCTracerType, initialMobileFraction, retentionTime, & + releaseTime, newIceBGCFraction) + + call icepack_init_zbgc(bgc_tracer_type_in=BGCTracerType, & + zbgc_frac_init_in=initialMobileFraction, & + tau_ret_in=retentionTime, & + tau_rel_in=releaseTime, & + zbgc_init_frac_in=newIceBGCFraction) ! check calculated tracer array size if (nTracers_temp /= tracerObject % nTracers) then @@ -13494,8 +13444,827 @@ subroutine init_column_tracer_object_for_biogeochemistry(domain, tracerObject) call icepack_query_parameters(tau_max_out=rtmp2) if (rtmp1 /= rtmp2) call mpas_log_write('tau_max differs $r $r',realArgs=(/rtmp1,rtmp2/)) + deallocate(BGCTracerType) + deallocate(initialMobileFraction) + deallocate(retentionTime) + deallocate(releaseTime) + deallocate(newIceBGCFraction) + end subroutine init_column_tracer_object_for_biogeochemistry +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! init_zbgc_tracer_indices +! +!> \brief +!> \author Nicole Jeffery, LANL +!> \date 24 May 2024 +!> \details +!> Moves icepack_init_zbgc_tracer_indices to the interface +! +!----------------------------------------------------------------------- + + subroutine init_zbgc_tracer_indices(domain, tracerObject, use_nitrogen, nTracersTemp, & + BGCTracerType, initialMobileFraction, retentionTime, & + releaseTime, newIceBGCFraction) + + type(domain_type), intent(in) :: & + domain + + type(ciceTracerObjectType), intent(inout) :: & + tracerObject + + real(kind=RKIND), dimension(:), intent(inout) :: & + BGCTracerType, & + initialMobileFraction, & + retentionTime, & + releaseTime, & + newIceBGCFraction + + integer, intent(in) :: & + nTracersTemp + + logical, intent(in) :: & + use_nitrogen + + logical, pointer :: & + config_use_brine, & + config_use_vertical_zsalinity, & !echmod deprecate + config_use_vertical_biochemistry, & + config_use_vertical_tracers, & + config_use_skeletal_biochemistry, & + config_use_shortwave_bioabsorption, & + config_use_nitrate, & + config_use_carbon, & + config_use_chlorophyll, & + config_use_ammonium, & + config_use_silicate, & + config_use_DMS, & + config_use_nonreactive, & + config_use_humics, & + config_use_DON, & + config_use_iron, & + config_use_zaerosols + + real(kind=RKIND), pointer :: & + config_mobility_type_diatoms, & + config_mobility_type_small_plankton, & + config_mobility_type_phaeocystis, & + config_mobility_type_nitrate, & + config_mobility_type_ammonium, & + config_mobility_type_silicate, & + config_mobility_type_DMSPp, & + config_mobility_type_DMSPd, & + config_mobility_type_humics, & + config_mobility_type_saccharids, & + config_mobility_type_lipids, & + config_mobility_type_inorganic_carbon, & + config_mobility_type_proteins, & + config_mobility_type_dissolved_iron, & + config_mobility_type_particulate_iron, & + config_mobility_type_black_carbon1, & + config_mobility_type_black_carbon2, & + config_mobility_type_dust1, & + config_mobility_type_dust2, & + config_mobility_type_dust3, & + config_mobility_type_dust4, & + config_rapid_mobile_to_stationary_time, & + config_long_mobile_to_stationary_time, & + config_fraction_biotracer_in_frazil, & + config_new_ice_fraction_biotracer + + integer, pointer :: & + nIceLayers, & + nSnowLayers, & + nBioLayers, & + nAlgae, & + nDOC, & + nDIC, & + nDON, & + nParticulateIron, & + nDissolvedIron, & + nzAerosols, & + nZBGCTracers, & + maxAerosolType, & + maxAlgaeType, & + maxDOCType, & + maxDICType, & + maxDONType, & + maxIronType + + integer :: & + iAerosols, & + nTracerDependOption, & + nCount, & + nTracerDepend, & + iBioLayer, & + iBioTracer + + real(kind=RKIND) :: & + rtmp1, & + rtmp2 + + real (kind=RKIND), dimension (:), allocatable :: & + algalType, & + docType, & + dicType, & + donType, & + fedType, & + fepType, & + zAeroType + + call MPAS_pool_get_config(domain % configs, "config_use_brine", config_use_brine) + call MPAS_pool_get_config(domain % configs, "config_use_vertical_zsalinity", config_use_vertical_zsalinity) !echmod deprecate + call MPAS_pool_get_config(domain % configs, "config_use_shortwave_bioabsorption", config_use_shortwave_bioabsorption) + call MPAS_pool_get_config(domain % configs, "config_use_vertical_tracers", config_use_vertical_tracers) + call MPAS_pool_get_config(domain % configs, "config_use_skeletal_biochemistry", config_use_skeletal_biochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_vertical_biochemistry", config_use_vertical_biochemistry) + call MPAS_pool_get_config(domain % configs, "config_use_nitrate", config_use_nitrate) + call MPAS_pool_get_config(domain % configs, "config_use_carbon", config_use_carbon) + call MPAS_pool_get_config(domain % configs, "config_use_chlorophyll", config_use_chlorophyll) + call MPAS_pool_get_config(domain % configs, "config_use_ammonium", config_use_ammonium) + call MPAS_pool_get_config(domain % configs, "config_use_silicate", config_use_silicate) + call MPAS_pool_get_config(domain % configs, "config_use_DMS", config_use_DMS) + call MPAS_pool_get_config(domain % configs, "config_use_nonreactive", config_use_nonreactive) + call MPAS_pool_get_config(domain % configs, "config_use_humics", config_use_humics) + call MPAS_pool_get_config(domain % configs, "config_use_DON", config_use_DON) + call MPAS_pool_get_config(domain % configs, "config_use_iron", config_use_iron) + call MPAS_pool_get_config(domain % configs, "config_use_zaerosols", config_use_zaerosols) + + call MPAS_pool_get_config(domain % configs, "config_mobility_type_diatoms", config_mobility_type_diatoms) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_small_plankton", config_mobility_type_small_plankton) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_phaeocystis", config_mobility_type_phaeocystis) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_nitrate", config_mobility_type_nitrate) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_ammonium", config_mobility_type_ammonium) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_silicate", config_mobility_type_silicate) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_DMSPp", config_mobility_type_DMSPp) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_DMSPd", config_mobility_type_DMSPd) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_humics", config_mobility_type_humics) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_saccharids", config_mobility_type_saccharids) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_lipids", config_mobility_type_lipids) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_inorganic_carbon", config_mobility_type_inorganic_carbon) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_proteins", config_mobility_type_proteins) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_dissolved_iron", config_mobility_type_dissolved_iron) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_particulate_iron", config_mobility_type_particulate_iron) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_black_carbon1", config_mobility_type_black_carbon1) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_black_carbon2", config_mobility_type_black_carbon2) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust1", config_mobility_type_dust1) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust2", config_mobility_type_dust2) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust3", config_mobility_type_dust3) + call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust4", config_mobility_type_dust4) + call MPAS_pool_get_config(domain % configs, "config_rapid_mobile_to_stationary_time", & + config_rapid_mobile_to_stationary_time) + call MPAS_pool_get_config(domain % configs, "config_long_mobile_to_stationary_time", & + config_long_mobile_to_stationary_time) + call MPAS_pool_get_config(domain % configs, "config_fraction_biotracer_in_frazil", & + config_fraction_biotracer_in_frazil) + call MPAS_pool_get_config(domain % configs, "config_new_ice_fraction_biotracer", & + config_new_ice_fraction_biotracer) + + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nIceLayers", nIceLayers) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nSnowLayers", nSnowLayers) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nBioLayers",nBioLayers) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nAlgae", nAlgae) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDOC", nDOC) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDIC", nDIC) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDON", nDON) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nParticulateIron", nParticulateIron) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nDissolvedIron", nDissolvedIron) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nzAerosols", nzAerosols) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "nZBGCTracers", nZBGCTracers) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxAerosolType", maxAerosolType) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxAlgaeType", maxAlgaeType) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxDOCType", maxDOCType) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxDICType", maxDICType) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxDONType", maxDONType) + call MPAS_pool_get_dimension(domain % blocklist % dimensions, "maxIronType", maxIronType) + + tracerObject % nTracersNotBio = tracerObject % nTracers + tracerObject % index_brineFraction = 0 + if (config_use_brine) then + tracerObject % index_brineFraction = tracerObject % nTracers + 1 ! ice volume fraction with salt + tracerObject % nTracers = tracerObject % nTracers + 1 + tracerObject % parentIndex(tracerObject % index_brineFraction) = 1 ! volume-weighted + tracerObject % firstAncestorMask (tracerObject % index_brineFraction,1) = 0.0_RKIND ! volume-weighted + tracerObject % firstAncestorMask (tracerObject % index_brineFraction,2) = 1.0_RKIND ! volume-weighted + tracerObject % firstAncestorMask (tracerObject % index_brineFraction,3) = 0.0_RKIND ! volume-weighted + tracerObject % ancestorNumber(tracerObject % index_brineFraction) = 0 + tracerObject % ancestorIndices (tracerObject % index_brineFraction,1) = 0 + tracerObject % ancestorIndices (tracerObject % index_brineFraction,2) = 0 + endif + + nTracerDependOption = 0 ! if tracerObject % index_brineFraction /= 0 then use fbri dependency + if (tracerObject % index_brineFraction == 0) nTracerDependOption = -1 ! otherwise make tracers depend on ice volume + + !----------------------------------------------------------------- + ! biogeochemistry + !----------------------------------------------------------------- + + tracerObject % nBioTracers = 0 + tracerObject % nBioTracersShortwave = 0 + + ! vectors of size maxAlgaeType + tracerObject % index_algaeConcLayer(:) = 0 + tracerObject % index_algalCarbonLayer(:) = 0 + tracerObject % index_algalChlorophyllLayer(:) = 0 + tracerObject % index_algaeConc(:) = 0 + tracerObject % index_algalCarbon(:) = 0 + tracerObject % index_algalChlorophyll(:) = 0 + + ! vectors of size maxDICType + tracerObject % index_DICConcLayer(:) = 0 + tracerObject % index_DICConc(:) = 0 + + ! vectors of size maxDOCType + tracerObject % index_DOCConcLayer(:) = 0 + tracerObject % index_DOCConc(:) = 0 + + ! vectors of size maxDONType + tracerObject % index_DONConcLayer(:) = 0 + tracerObject % index_DONConc(:) = 0 + + ! vectors of size maxIronType + tracerObject % index_dissolvedIronConcLayer(:) = 0 + tracerObject % index_particulateIronConcLayer(:) = 0 + tracerObject % index_dissolvedIronConc(:) = 0 + tracerObject % index_particulateIronConc(:) = 0 + + ! vectors of size maxAerosolType + tracerObject % index_verticalAerosolsConcLayer(:) = 0 + tracerObject % index_verticalAerosolsConcShortwave(:) = 0 + tracerObject % index_verticalAerosolsConc(:) = 0 + + tracerObject % index_nitrateConcLayer = 0 + tracerObject % index_ammoniumConcLayer = 0 + tracerObject % index_silicateConcLayer = 0 + tracerObject % index_DMSPpConcLayer = 0 + tracerObject % index_DMSPdConcLayer = 0 + tracerObject % index_DMSConcLayer = 0 + tracerObject % index_nonreactiveConcLayer = 0 + tracerObject % index_humicsConcLayer = 0 + tracerObject % index_chlorophyllShortwave = 0 + tracerObject % index_LayerIndexToBioIndex(:) = 0 + tracerObject % index_LayerIndexToDataArray(:) = 0 + + tracerObject % index_nitrateConc = 0 + tracerObject % index_ammoniumConc = 0 + tracerObject % index_silicateConc = 0 + tracerObject % index_DMSPpConc = 0 + tracerObject % index_DMSPdConc = 0 + tracerObject % index_DMSConc = 0 + tracerObject % index_nonreactiveConc = 0 + tracerObject % index_humicsConc = 0 + + allocate(algalType(maxAlgaeType)) + allocate(docType(maxDOCType)) + allocate(dicType(maxDICType)) + allocate(donType(maxDONType)) + allocate(fedType(maxIronType)) + allocate(fepType(maxIronType)) + allocate(zAeroType(maxAerosolType)) + + algalType(1) = config_mobility_type_diatoms + algalType(2) = config_mobility_type_small_plankton + algalType(3) = config_mobility_type_phaeocystis + + docType(1) = config_mobility_type_saccharids + docType(2) = config_mobility_type_lipids + + dicType(1) = config_mobility_type_inorganic_carbon + + donType(1) = config_mobility_type_proteins + + fedType(1) = config_mobility_type_dissolved_iron + fepType(1) = config_mobility_type_particulate_iron + + zAeroType(1) = config_mobility_type_black_carbon1 + zAeroType(2) = config_mobility_type_black_carbon2 + zAeroType(3) = config_mobility_type_dust1 + zAeroType(4) = config_mobility_type_dust2 + zAeroType(5) = config_mobility_type_dust3 + zAeroType(6) = config_mobility_type_dust4 + + if (config_use_skeletal_biochemistry) then + + nCount = 1 + nTracerDepend = 0 + + if (config_use_shortwave_bioabsorption) then + tracerObject % index_chlorophyllShortwave = 1 + tracerObject % nBioTracersShortwave = nIceLayers+nSnowLayers+2 ! only the bottom layer + ! will be nonzero + endif + elseif (config_use_vertical_tracers) then ! defined on nBioLayers+1 in ice + ! and 2 snow layers (snow surface + interior) + nCount = nBioLayers + 1 + nTracerDepend = 2 + tracerObject % index_brineFraction + nTracerDependOption + + if (use_nitrogen) then + if (config_use_shortwave_bioabsorption) then + tracerObject % index_chlorophyllShortwave = 1 + tracerObject % nBioTracersShortwave = nIceLayers+nSnowLayers+2 + endif + endif ! use_nitrogen + + endif ! config_use_skeletal_biochemistry or config_use_vertical_tracers + + if (config_use_skeletal_biochemistry .or. config_use_vertical_tracers) then + + !----------------------------------------------------------------- + ! assign tracer indices and dependencies + ! BGCTracerType: < 0 purely mobile , >= 0 stationary + !------------------------------------------------------------------ + + if (use_nitrogen) then + do iBioTracer = 1, nAlgae + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_algaeConc(iBioTracer), & + tracerObject % index_algaeConcLayer(iBioTracer),& + algalType(iBioTracer), nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_algaeConcLayer(iBioTracer)) & + = iBioTracer + enddo ! iBioTracer + endif ! use_nitrogen + + if (config_use_nitrate) then + call init_bgc_tracer_indices(& + nCount, tracerObject % index_brineFraction, & + tracerObject % index_nitrateConc, & + tracerObject % index_nitrateConcLayer, & + config_mobility_type_nitrate, nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_nitrateConcLayer) & + = maxAlgaeType + 1 + endif ! config_use_nitrate + + if (config_use_carbon) then + ! + ! Algal C is not yet distinct from algal N + ! * Reqires exudation and/or changing C:N ratios + ! for implementation + ! + ! do iBioTracer = 1,nAlgae + ! call init_bgc_tracer_indices(nCount,tracerObject % index_brineFraction, & + ! tracerObject % index_algalCarbon(iBioTracer), & + ! tracerObject % index_algalCarbonLayer(iBioTracer), & + ! algalType(iBioTracer), nTracerDepend, & + ! tracerObject % nTracers, & + ! tracerObject % nBioTracers, & + ! BGCTracerType, & + ! tracerObject % parentIndex, & + ! tracerObject % firstAncestorMask, & + ! tracerObject % ancestorNumber, & + ! tracerObject % ancestorIndices, & + ! tracerObject % index_LayerIndexToBioIndex) + ! tracerObject % index_LayerIndexToDataArray(tracerObject % index_algalCarbonLayer(iBioTracer)) & + ! = maxAlgaeType + 1 + iBioTracer + ! enddo ! iBioTracer + + do iBioTracer = 1, nDOC + call init_bgc_tracer_indices(& + nCount, tracerObject % index_brineFraction, & + tracerObject % index_DOCConc(iBioTracer), & + tracerObject % index_DOCConcLayer(iBioTracer), & + docType(iBioTracer), nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_DOCConcLayer(iBioTracer)) & + = maxAlgaeType + 1 + iBioTracer + enddo ! iBioTracer + do iBioTracer = 1, nDIC + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_DICConc(iBioTracer), & + tracerObject % index_DICConcLayer(iBioTracer), & + dicType(iBioTracer), nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_DICConcLayer(iBioTracer)) & + = maxAlgaeType + maxDOCType + 1 + iBioTracer + enddo ! iBioTracer + endif ! config_use_carbon + + if (config_use_chlorophyll) then + do iBioTracer = 1, nAlgae + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_algalChlorophyll(iBioTracer), & + tracerObject % index_algalChlorophyllLayer(iBioTracer), & + algalType(iBioTracer), nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_algalChlorophyllLayer(iBioTracer)) & + = maxAlgaeType + 1 + maxDOCType + maxDICType + iBioTracer + enddo ! iBioTracer + endif ! config_use_chlorophyll + + if (config_use_ammonium) then + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_ammoniumConc, & + tracerObject % index_ammoniumConcLayer, & + config_mobility_type_ammonium, & + nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_ammoniumConcLayer) & + = 2*maxAlgaeType + maxDOCType + maxDICType + 2 + endif + if (config_use_silicate) then + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_silicateConc, & + tracerObject % index_silicateConcLayer, & + config_mobility_type_silicate, & + nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_silicateConcLayer) & + = 2*maxAlgaeType + maxDOCType + maxDICType + 3 + endif + if (config_use_DMS) then ! all together + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_DMSPpConc, & + tracerObject % index_DMSPpConcLayer, & + config_mobility_type_DMSPp, nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_DMSPpConcLayer) & + = 2*maxAlgaeType + maxDOCType + maxDICType + 4 + + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_DMSPdConc, & + tracerObject % index_DMSPdConcLayer, & + config_mobility_type_DMSPd, nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_DMSPdConcLayer) & + = 2*maxAlgaeType + maxDOCType + maxDICType + 5 + + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_DMSConc, & + tracerObject % index_DMSConcLayer, & + config_mobility_type_DMSPd, nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_DMSConcLayer) & + = 2*maxAlgaeType + maxDOCType + maxDICType + 6 + endif + if (config_use_nonreactive) then + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_nonreactiveConc, & + tracerObject % index_nonreactiveConcLayer, & + config_mobility_type_nitrate, nTracerDepend,& + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_nonreactiveConcLayer) & + = 2*maxAlgaeType + maxDOCType + maxDICType + 7 + endif + if (config_use_DON) then + do iBioTracer = 1, nDON + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_DONConc(iBioTracer), & + tracerObject % index_DONConcLayer(iBioTracer), & + donType(iBioTracer), nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_DONConcLayer(iBioTracer)) & + = 2*maxAlgaeType + maxDOCType + maxDICType + 7 + iBioTracer + enddo ! iBioTracer + endif ! config_use_DON + if (config_use_iron) then + do iBioTracer = 1, nDissolvedIron + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_dissolvedIronConc(iBioTracer), & + tracerObject % index_dissolvedIronConcLayer(iBioTracer),& + fedType(iBioTracer), nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_dissolvedIronConcLayer(iBioTracer)) & + = 2*maxAlgaeType + maxDOCType + maxDICType + maxDONType + 7 + iBioTracer + enddo ! iBioTracer + do iBioTracer = 1, nParticulateIron + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_particulateIronConc(iBioTracer), & + tracerObject % index_particulateIronConcLayer(iBioTracer), & + fepType(iBioTracer), nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_particulateIronConcLayer(iBioTracer)) & + = 2*maxAlgaeType + maxDOCType + maxDICType + maxDONType + maxIronType + 7 + iBioTracer + enddo ! iBioTracer + endif ! config_use_iron + + if (config_use_humics) then + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_humicsConc, & + tracerObject % index_humicsConcLayer, & + config_mobility_type_humics, nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, & + tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_humicsConcLayer) & + = 2*maxAlgaeType + maxDOCType + 8 + maxDICType + maxDONType + 2*maxIronType + maxAerosolType + endif + endif ! config_use_skeletal_biochemistry or config_use_vertical_tracers + + if (config_use_vertical_tracers) then ! defined on nBioLayers+1 in ice + ! and 2 snow layers (snow surface + interior) + nCount = nBioLayers + 1 + nTracerDepend = 2 + tracerObject % index_brineFraction + nTracerDependOption + + ! z layer aerosols + if (config_use_zaerosols) then + do iBioTracer = 1, nzAerosols + if (config_use_shortwave_bioabsorption) then + tracerObject % index_verticalAerosolsConcShortwave(iBioTracer) = & + tracerObject % nBioTracersShortwave + 1 + tracerObject % nBioTracersShortwave = & + tracerObject % nBioTracersShortwave + nIceLayers + nSnowLayers+2 + endif + call init_bgc_tracer_indices(nCount, tracerObject % index_brineFraction, & + tracerObject % index_verticalAerosolsConc(iBioTracer), & + tracerObject % index_verticalAerosolsConcLayer(iBioTracer), & + zAeroType(iBioTracer), nTracerDepend, & + tracerObject % nTracers, & + tracerObject % nBioTracers, & + BGCTracerType, tracerObject % parentIndex, & + tracerObject % firstAncestorMask, & + tracerObject % ancestorNumber, & + tracerObject % ancestorIndices, & + tracerObject % index_LayerIndexToBioIndex) + tracerObject % index_LayerIndexToDataArray(tracerObject % index_verticalAerosolsConcLayer(iBioTracer)) & + = 2*maxAlgaeType + maxDOCType + maxDICType + maxDONType + 2*maxIronType + 7 + iBioTracer + enddo ! iBioTracer + endif ! config_use_zaerosols + + tracerObject % index_mobileFraction = 0 + if (tracerObject % nBioTracers > 0) then + tracerObject % index_mobileFraction = tracerObject % nTracers + 1 + tracerObject % nTracers = tracerObject % nTracers + tracerObject % nBioTracers + do iBioLayer = 1,tracerObject % nBioTracers + initialMobileFraction(iBioLayer) = 1.0_RKIND + tracerObject % parentIndex(tracerObject % index_mobileFraction+iBioLayer-1) & + = 2+tracerObject % index_brineFraction + tracerObject % firstAncestorMask(tracerObject % index_mobileFraction+ iBioLayer - 1,1) = 0.0_RKIND + tracerObject % firstAncestorMask(tracerObject % index_mobileFraction+ iBioLayer - 1,2) = 1.0_RKIND + tracerObject % firstAncestorMask(tracerObject % index_mobileFraction+ iBioLayer - 1,3) = 0.0_RKIND + tracerObject % ancestorNumber(tracerObject % index_mobileFraction+ iBioLayer - 1) = 1 + tracerObject % ancestorIndices(tracerObject % index_mobileFraction+ iBioLayer - 1,1) & + = tracerObject % index_brineFraction + tracerObject % ancestorIndices(tracerObject % index_mobileFraction+ iBioLayer - 1,2) = 0 + retentionTime(iBioLayer) = 1.0_RKIND + releaseTime(iBioLayer) = 1.0_RKIND + + if (BGCTracerType(iBioLayer) >= 0.0_RKIND .and. BGCTracerType(iBioLayer) < 0.5_RKIND) then + retentionTime(iBioLayer) = config_rapid_mobile_to_stationary_time + releaseTime(iBioLayer) = config_long_mobile_to_stationary_time + initialMobileFraction(iBioLayer) = 1.0_RKIND + elseif (BGCTracerType(iBioLayer) >= 0.5_RKIND .and. BGCTracerType(iBioLayer) < 1.0_RKIND) then + retentionTime(iBioLayer) = config_rapid_mobile_to_stationary_time + releaseTime(iBioLayer) = config_rapid_mobile_to_stationary_time + initialMobileFraction(iBioLayer) = 1.0_RKIND + elseif (BGCTracerType(iBioLayer) >= 1.0_RKIND .and. BGCTracerType(iBioLayer) < 2.0_RKIND) then + retentionTime(iBioLayer) = config_long_mobile_to_stationary_time + releaseTime(iBioLayer) = config_rapid_mobile_to_stationary_time + initialMobileFraction(iBioLayer) = 1.0_RKIND + elseif (BGCTracerType(iBioLayer) >= 2.0_RKIND ) then + retentionTime(iBioLayer) = config_long_mobile_to_stationary_time + releaseTime(iBioLayer) = config_long_mobile_to_stationary_time + initialMobileFraction(iBioLayer) = 1.0_RKIND + endif + enddo + endif + + endif ! config_use_vertical_tracers + + do iBioLayer = 1, tracerObject % nBioTracers + newIceBGCFraction(iBioLayer) = config_fraction_biotracer_in_frazil + if (BGCTracerType(iBioLayer) < 0.0_RKIND) & + newIceBGCFraction(iBioLayer) = config_new_ice_fraction_biotracer + enddo + + if (.NOT.config_use_shortwave_bioabsorption) tracerObject % nBioTracersShortwave = 1 + + !----------------------------------------------------------------- + ! final consistency checks + !----------------------------------------------------------------- + + if (tracerObject % nBioTracers > nZBGCTracers) then + call mpas_log_write(& + "init_zbgc_tracer_indices: nBioTracers $i, greater than max nZBGCTracers: $i", & + messageType=MPAS_LOG_CRIT, intArgs=(/tracerObject % nBioTracers, nZBGCTracers/)) + endif + + deallocate(algalType) + deallocate(docType) + deallocate(dicType) + deallocate(donType) + deallocate(fedType) + deallocate(fepType) + deallocate(zAeroType) + + end subroutine init_zbgc_tracer_indices + +!||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +! +! init_bgc_tracer_indices +! +!> \brief +!> \author Nicole Jeffery, LANL +!> \date 24 May 2024 +!> \details +!> +!> Moves icepack_init_bgc_trcr to the interface +! +!----------------------------------------------------------------------- + + subroutine init_bgc_tracer_indices( nCount, iBrineFraction, & + iBGCConc, iBGCConcLayer, & + BGCType, nTracerDepend, & + nTracers, nBioTracers, & + BGCTracerType, parentIndexBGC, & + firstAncestorMaskBGC, & + ancestorNumberBGC, & + ancestorIndicesBGC, & + layerIndexToBioIndex) + + integer, intent(in) :: & + nCount , & ! counter + nTracerDepend , & ! tracer dependency index + iBrineFraction + + integer, intent(inout) :: & + nTracers , & ! number of tracers + nBioTracers , & ! number of bio tracers + iBGCConc , & ! tracer index + iBGCConcLayer ! bio tracer index + + integer, dimension(:), intent(inout) :: & + parentIndexBGC , & ! tracer dependencies + ancestorNumberBGC, & ! number of underlying tracer layers + layerIndexToBioIndex + + integer, dimension(:,:), intent(inout) :: & + ancestorIndicesBGC ! indices of underlying tracer layers + + real (kind=RKIND), dimension(:,:), intent(inout) :: & + firstAncestorMaskBGC ! = 0 or 1 depending on tracer dependency + ! argument 2: (1) aice, (2) vice, (3) vsno + + real (kind=RKIND), intent(in) :: & + BGCType ! bio tracer transport type (mobile vs stationary) + + real (kind=RKIND), dimension(:), intent(inout) :: & + BGCTracerType ! bio tracer transport type array + + ! local variables + + integer :: & + iCount , & ! loop index + nTemp , & ! temporary values + ancestorIndicesBGC1, & ! temporary values + ancestorIndicesBGC2 + + real (kind=RKIND) :: & + firstAncestorMaskBGC1, & ! temporary values + firstAncestorMaskBGC2, & + firstAncestorMaskBGC3 + + iBGCConc = nTracers + 1 + nBioTracers = nBioTracers + 1 + iBGCConcLayer = nBioTracers + BGCTracerType(nBioTracers) = BGCType + + if (nCount > 1) then + ! include vertical bgc in snow + do iCount = nCount, nCount+1 + nTracers = nTracers + 1 + parentIndexBGC (iBGCConc + iCount ) = 2 ! snow volume + firstAncestorMaskBGC (iBGCConc + iCount,1) = 0.0_RKIND + firstAncestorMaskBGC (iBGCConc + iCount,2) = 0.0_RKIND + firstAncestorMaskBGC (iBGCConc + iCount,3) = 1.0_RKIND + ancestorNumberBGC(iBGCConc + iCount ) = 0 + ancestorIndicesBGC (iBGCConc + iCount,1) = 0 + ancestorIndicesBGC (iBGCConc + iCount,2) = 0 + enddo + + firstAncestorMaskBGC1 = 0.0_RKIND + firstAncestorMaskBGC2 = 1.0_RKIND + firstAncestorMaskBGC3 = 0.0_RKIND + nTemp = 1 + ancestorIndicesBGC1 = iBrineFraction + ancestorIndicesBGC2 = 0 + else ! nCount = 1 + firstAncestorMaskBGC1 = 1.0_RKIND + firstAncestorMaskBGC2 = 0.0_RKIND + firstAncestorMaskBGC3 = 0.0_RKIND + nTemp = 0 + ancestorIndicesBGC1 = 0 + ancestorIndicesBGC2 = 0 + endif ! nCount + + do iCount = 1, nCount !in ice + nTracers = nTracers + 1 + parentIndexBGC (iBGCConc + iCount - 1 ) = nTracerDepend + firstAncestorMaskBGC (iBGCConc + iCount - 1,1) = firstAncestorMaskBGC1 + firstAncestorMaskBGC (iBGCConc + iCount - 1,2) = firstAncestorMaskBGC2 + firstAncestorMaskBGC (iBGCConc + iCount - 1,3) = firstAncestorMaskBGC3 + ancestorNumberBGC(iBGCConc + iCount - 1 ) = nTemp + ancestorIndicesBGC (iBGCConc + iCount - 1,1) = ancestorIndicesBGC1 + ancestorIndicesBGC (iBGCConc + iCount - 1,2) = ancestorIndicesBGC2 + enddo + + layerIndexToBioIndex (iBGCConcLayer) = iBGCConc + + end subroutine init_bgc_tracer_indices + !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ! ! init_column_biogeochemistry @@ -13917,10 +14686,10 @@ subroutine seaice_icepack_reinitialize_diagnostics_thermodynamics(domain) pondFreshWaterFlux(:) = 0.0_RKIND - !fresh_ai (:,:,:) = c0 - !fsalt_ai (:,:,:) = c0 - !fhocn_ai (:,:,:) = c0 - !fswthru_ai(:,:,:) = c0 + !fresh_ai (:,:,:) = 0.0_RKIND + !fsalt_ai (:,:,:) = 0.0_RKIND + !fhocn_ai (:,:,:) = 0.0_RKIND + !fswthru_ai(:,:,:) = 0.0_RKIND ! shortwave call MPAS_pool_get_subpool(block % structs, "shortwave", shortwavePool) From 73788b9a9d07a6758eb2307ba007ed6f93b07981 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Fri, 31 May 2024 10:48:15 -0500 Subject: [PATCH 17/24] Updates .gitmodules to zbgc-enabled icepack submodule branch --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 69d56e140361..c9d0b3dbad9f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,6 +76,7 @@ [submodule "components/mpas-seaice/src/icepack"] path = components/mpas-seaice/src/icepack url = git@github.com:E3SM-Project/Icepack.git + branch = fixes-to-bgc-indices [submodule "externals/haero"] path = externals/haero url = git@github.com:eagles-project/haero.git From 393d0ed31f0ee64074949f47a137a03d88d510e4 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Fri, 31 May 2024 11:09:38 -0500 Subject: [PATCH 18/24] Reverts the previous commit --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index c9d0b3dbad9f..69d56e140361 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,7 +76,6 @@ [submodule "components/mpas-seaice/src/icepack"] path = components/mpas-seaice/src/icepack url = git@github.com:E3SM-Project/Icepack.git - branch = fixes-to-bgc-indices [submodule "externals/haero"] path = externals/haero url = git@github.com:eagles-project/haero.git From 4873471b6aba3aceff6c808433a5e0d72b71486b Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Fri, 31 May 2024 12:08:35 -0500 Subject: [PATCH 19/24] Updating Icepack to hash #2e5d5a27 For BGC --- components/mpas-seaice/src/icepack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mpas-seaice/src/icepack b/components/mpas-seaice/src/icepack index abdd3d4bbc06..2e5d5a271baf 160000 --- a/components/mpas-seaice/src/icepack +++ b/components/mpas-seaice/src/icepack @@ -1 +1 @@ -Subproject commit abdd3d4bbc06255a3cdcff2d5c04ede90050eb51 +Subproject commit 2e5d5a271baf5d0705be76ac56fa588c9d7e252c From 2bd7c2af49666895bef1cb804ea54d30c5c02c47 Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Mon, 10 Jun 2024 13:55:01 -0500 Subject: [PATCH 20/24] Fix to using zaerosols without bgc -Shortened registry description for ocean bgc concentrations -Corrected some unit descriptions -Clean-up in mpas_seaice_icepack bugfix (BFB without bgc/zaerosols) --- components/mpas-seaice/driver/ice_comp_mct.F | 150 ++++++++++-------- components/mpas-seaice/src/Registry.xml | 16 +- components/mpas-seaice/src/icepack | 2 +- .../src/shared/mpas_seaice_constants.F | 2 +- .../src/shared/mpas_seaice_icepack.F | 113 +++---------- .../src/shared/mpas_seaice_initialize.F | 8 +- 6 files changed, 117 insertions(+), 174 deletions(-) diff --git a/components/mpas-seaice/driver/ice_comp_mct.F b/components/mpas-seaice/driver/ice_comp_mct.F index 50bf12ece375..3c579aee77af 100644 --- a/components/mpas-seaice/driver/ice_comp_mct.F +++ b/components/mpas-seaice/driver/ice_comp_mct.F @@ -2116,7 +2116,6 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_pool_get_subpool(block_ptr % structs, 'biogeochemistry', biogeochemistry) if (config_use_zaerosols) then - call mpas_pool_get_array(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConc) call mpas_pool_get_array(biogeochemistry, 'atmosBlackCarbonFlux', atmosBlackCarbonFlux) call mpas_pool_get_array(biogeochemistry, 'atmosDustFlux', atmosDustFlux) call mpas_pool_get_array(biogeochemistry, "atmosWetDustFlux", atmosWetDustFlux) @@ -2232,13 +2231,16 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ endif ! set aerosols, if configured - if (config_use_zaerosols) then + if (config_use_zaerosols .or. config_use_column_biogeochemistry) then + call mpas_pool_get_array(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConc) oceanZAerosolConc(1,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer1, n) oceanZAerosolConc(2,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer2, n) oceanZAerosolConc(3,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer3, n) oceanZAerosolConc(4,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer4, n) oceanZAerosolConc(5,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer5, n) oceanZAerosolConc(6,i) = 0.0_RKIND !x2i_i % rAttr(index_x2i_So_zaer6, n) + end if + if (config_use_zaerosols) then if (config_use_modal_aerosols) then atmosBlackCarbonFlux(1,i) = x2i_i % rAttr(index_x2i_Faxa_bcphodry, n) & + x2i_i % rAttr(index_x2i_Faxa_bcphidry, n) @@ -2370,12 +2372,14 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ call mpas_pool_get_field(aerosols, "atmosAerosolFlux", atmosAerosolFluxField) endif + if (config_use_zaerosols .or. config_use_column_biogeochemistry) & + call mpas_pool_get_field(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConcField) + if (config_use_zaerosols) then call mpas_pool_get_field(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFluxField) call mpas_pool_get_field(biogeochemistry, "atmosDustFlux", atmosDustFluxField) call mpas_pool_get_field(biogeochemistry, "atmosWetDustFlux", atmosWetDustFluxField) call mpas_pool_get_field(biogeochemistry, "atmosDryDustFlux", atmosDryDustFluxField) - call mpas_pool_get_field(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConcField) endif if (config_use_column_biogeochemistry .and. config_couple_biogeochemistry_fields) then call mpas_pool_get_subpool(domain % blocklist % structs, 'biogeochemistry', biogeochemistry) @@ -2422,12 +2426,14 @@ subroutine ice_import_mct(x2i_i, errorCode)!{{{ if (config_use_aerosols) then call mpas_dmpar_exch_halo_field(atmosAerosolFluxField) endif + if (config_use_zaerosols .or. config_use_column_biogeochemistry) & + call mpas_dmpar_exch_halo_field(oceanZAerosolConcField) + if (config_use_zaerosols) then call mpas_dmpar_exch_halo_field(atmosBlackCarbonFluxField) call mpas_dmpar_exch_halo_field(atmosDustFluxField) call mpas_dmpar_exch_halo_field(atmosDryDustFluxField) call mpas_dmpar_exch_halo_field(atmosWetDustFluxField) - call mpas_dmpar_exch_halo_field(oceanZAerosolConcField) endif if (config_use_column_biogeochemistry .and. config_couple_biogeochemistry_fields) then call mpas_dmpar_exch_halo_field(oceanAlgaeConcField) @@ -3752,9 +3758,7 @@ subroutine ice_import_moab(Eclock)!{{{ endif if (config_use_column_biogeochemistry) then - call mpas_pool_get_config(configs, "config_use_zaerosols", config_use_zaerosols) call mpas_pool_get_subpool(block_ptr % structs, 'biogeochemistry', biogeochemistry) - call mpas_pool_get_array(biogeochemistry, 'oceanAlgaeConc', oceanAlgaeConc) call mpas_pool_get_array(biogeochemistry, 'oceanDOCConc', oceanDOCConc) call mpas_pool_get_array(biogeochemistry, 'oceanDICConc', oceanDICConc) @@ -3767,16 +3771,19 @@ subroutine ice_import_moab(Eclock)!{{{ call mpas_pool_get_array(biogeochemistry, 'oceanHumicsConc', oceanHumicsConc) call mpas_pool_get_array(biogeochemistry, 'oceanParticulateIronConc', oceanParticulateIronConc) call mpas_pool_get_array(biogeochemistry, 'oceanDissolvedIronConc', oceanDissolvedIronConc) - call mpas_pool_get_array(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConc) call mpas_pool_get_array(biogeochemistry, 'carbonToNitrogenRatioAlgae', carbonToNitrogenRatioAlgae) call mpas_pool_get_array(biogeochemistry, 'carbonToNitrogenRatioDON', carbonToNitrogenRatioDON) + endif + + call mpas_pool_get_config(configs, "config_use_zaerosols", config_use_zaerosols) if (config_use_zaerosols) then call mpas_pool_get_array(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFlux) call mpas_pool_get_array(biogeochemistry, "atmosDustFlux", atmosDustFlux) call mpas_pool_get_array(biogeochemistry, "atmosWetDustFlux", atmosWetDustFlux) call mpas_pool_get_array(biogeochemistry, "atmosDryDustFlux", atmosDryDustFlux) endif - endif + if (config_use_column_biogeochemistry .or. config_use_zaerosols) & + call mpas_pool_get_array(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConc) do i = 1, nCellsSolve n = n + 1 @@ -3883,65 +3890,67 @@ subroutine ice_import_moab(Eclock)!{{{ oceanParticulateIronConc(2,i) = x2i_im(n,index_x2i_So_fep2) oceanDissolvedIronConc(1,i) = x2i_im(n,index_x2i_So_fed1) oceanDissolvedIronConc(2,i) = x2i_im(n,index_x2i_So_fed2) + endif + if (config_use_zaerosols .or. config_use_column_biogeochemistry) then oceanZAerosolConc(1,i) = 0.0_RKIND oceanZAerosolConc(2,i) = 0.0_RKIND oceanZAerosolConc(3,i) = 0.0_RKIND oceanZAerosolConc(4,i) = 0.0_RKIND oceanZAerosolConc(5,i) = 0.0_RKIND oceanZAerosolConc(6,i) = 0.0_RKIND - ! set aerosols, if configured - if (config_use_zaerosols) then - if (config_use_modal_aerosols) then - atmosBlackCarbonFlux(1,i) = x2i_im(n,index_x2i_Faxa_bcphodry) & - + x2i_im(n,index_x2i_Faxa_bcphidry) - atmosBlackCarbonFlux(2,i) = x2i_im(n,index_x2i_Faxa_bcphiwet) - ! combine wet and dry dust - atmosDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) & - + x2i_im(n,index_x2i_Faxa_dstdry1) - atmosDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) & - + x2i_im(n,index_x2i_Faxa_dstdry2) - atmosDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) & - + x2i_im(n,index_x2i_Faxa_dstdry3) - atmosDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) & - + x2i_im(n,index_x2i_Faxa_dstdry4) - - ! wet dust - atmosWetDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) - atmosWetDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) - atmosWetDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) - atmosWetDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) - - ! dry dust - atmosDryDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstdry1) - atmosDryDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstdry2) - atmosDryDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstdry3) - atmosDryDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstdry4) - else - atmosBlackCarbonFlux(1,i) = x2i_im(n,index_x2i_Faxa_bcphodry) - atmosBlackCarbonFlux(2,i) = x2i_im(n,index_x2i_Faxa_bcphidry) & - + x2i_im(n,index_x2i_Faxa_bcphiwet) - ! combine wet and dry dust - atmosDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) & - + x2i_im(n,index_x2i_Faxa_dstdry1) - atmosDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) & - + x2i_im(n,index_x2i_Faxa_dstdry2) - atmosDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) & - + x2i_im(n,index_x2i_Faxa_dstdry3) - atmosDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) & - + x2i_im(n,index_x2i_Faxa_dstdry4) - - ! wet dust - atmosWetDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) - atmosWetDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) - atmosWetDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) - atmosWetDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) - - ! dry dust - atmosDryDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstdry1) - atmosDryDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstdry2) - atmosDryDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstdry3) - atmosDryDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstdry4) - endif + end if + ! set zaerosols, if configured + if (config_use_zaerosols) then + if (config_use_modal_aerosols) then + atmosBlackCarbonFlux(1,i) = x2i_im(n,index_x2i_Faxa_bcphodry) & + + x2i_im(n,index_x2i_Faxa_bcphidry) + atmosBlackCarbonFlux(2,i) = x2i_im(n,index_x2i_Faxa_bcphiwet) + ! combine wet and dry dust + atmosDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) & + + x2i_im(n,index_x2i_Faxa_dstdry1) + atmosDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) & + + x2i_im(n,index_x2i_Faxa_dstdry2) + atmosDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) & + + x2i_im(n,index_x2i_Faxa_dstdry3) + atmosDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) & + + x2i_im(n,index_x2i_Faxa_dstdry4) + + ! wet dust + atmosWetDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) + atmosWetDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) + atmosWetDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) + atmosWetDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) + + ! dry dust + atmosDryDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstdry1) + atmosDryDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstdry2) + atmosDryDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstdry3) + atmosDryDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstdry4) + else + atmosBlackCarbonFlux(1,i) = x2i_im(n,index_x2i_Faxa_bcphodry) + atmosBlackCarbonFlux(2,i) = x2i_im(n,index_x2i_Faxa_bcphidry) & + + x2i_im(n,index_x2i_Faxa_bcphiwet) + ! combine wet and dry dust + atmosDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) & + + x2i_im(n,index_x2i_Faxa_dstdry1) + atmosDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) & + + x2i_im(n,index_x2i_Faxa_dstdry2) + atmosDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) & + + x2i_im(n,index_x2i_Faxa_dstdry3) + atmosDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) & + + x2i_im(n,index_x2i_Faxa_dstdry4) + + ! wet dust + atmosWetDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstwet1) + atmosWetDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstwet2) + atmosWetDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstwet3) + atmosWetDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstwet4) + + ! dry dust + atmosDryDustFlux(1,i) = x2i_im(n,index_x2i_Faxa_dstdry1) + atmosDryDustFlux(2,i) = x2i_im(n,index_x2i_Faxa_dstdry2) + atmosDryDustFlux(3,i) = x2i_im(n,index_x2i_Faxa_dstdry3) + atmosDryDustFlux(4,i) = x2i_im(n,index_x2i_Faxa_dstdry4) endif endif end do @@ -4020,15 +4029,15 @@ subroutine ice_import_moab(Eclock)!{{{ call mpas_pool_get_field(biogeochemistry, 'oceanHumicsConc', oceanHumicsConcField) call mpas_pool_get_field(biogeochemistry, 'oceanParticulateIronConc', oceanParticulateIronConcField) call mpas_pool_get_field(biogeochemistry, 'oceanDissolvedIronConc', oceanDissolvedIronConcField) + endif + if (config_use_zaerosols .or. config_use_column_biogeochemistry) & call mpas_pool_get_field(biogeochemistry, 'oceanZAerosolConc', oceanZAerosolConcField) - if (config_use_zaerosols) then - call mpas_pool_get_field(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFluxField) - call mpas_pool_get_field(biogeochemistry, "atmosDustFlux", atmosDustFluxField) - call mpas_pool_get_field(biogeochemistry, "atmosWetDustFlux", atmosWetDustFluxField) - call mpas_pool_get_field(biogeochemistry, "atmosDryDustFlux", atmosDryDustFluxField) - endif + if (config_use_zaerosols) then + call mpas_pool_get_field(biogeochemistry, "atmosBlackCarbonFlux", atmosBlackCarbonFluxField) + call mpas_pool_get_field(biogeochemistry, "atmosDustFlux", atmosDustFluxField) + call mpas_pool_get_field(biogeochemistry, "atmosWetDustFlux", atmosWetDustFluxField) + call mpas_pool_get_field(biogeochemistry, "atmosDryDustFlux", atmosDryDustFluxField) endif - call mpas_dmpar_exch_halo_field(seaSurfaceTemperatureField) call mpas_dmpar_exch_halo_field(seaSurfaceSalinityField) call mpas_dmpar_exch_halo_field(seaFreezingTemperatureField) @@ -4071,13 +4080,14 @@ subroutine ice_import_moab(Eclock)!{{{ call mpas_dmpar_exch_halo_field(oceanHumicsConcField) call mpas_dmpar_exch_halo_field(oceanParticulateIronConcField) call mpas_dmpar_exch_halo_field(oceanDissolvedIronConcField) + endif + if (config_use_zaerosols .or. config_use_column_biogeochemistry) & call mpas_dmpar_exch_halo_field(oceanZAerosolConcField) - if (config_use_zaerosols) then + if (config_use_zaerosols) then call mpas_dmpar_exch_halo_field(atmosBlackCarbonFluxField) call mpas_dmpar_exch_halo_field(atmosDustFluxField) call mpas_dmpar_exch_halo_field(atmosWetDustFluxField) call mpas_dmpar_exch_halo_field(atmosDryDustFluxField) - endif endif ! REVISION HISTORY: diff --git a/components/mpas-seaice/src/Registry.xml b/components/mpas-seaice/src/Registry.xml index b4ffd634bd28..22c11fe28f27 100644 --- a/components/mpas-seaice/src/Registry.xml +++ b/components/mpas-seaice/src/Registry.xml @@ -5402,7 +5402,7 @@ type="real" dimensions="nZBGCTracers nCells Time" units="mmol m-3" - description="All bio tracers including those not used in the order: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon, dissolved inorganic carbon,ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m3, particulate iron in umol/m3, humic carbon, black carbon1 in mg/m3, black carbon2 in mg/m3,dust1 in mg/m3, dust2 in mg/m3, dust3 in mg/m3, dust4 in mg/m3" + description="All possible bio tracers in order: maxAlgaeType, nitrate, maxDOCType, maxDICType, chl (maxAlgaeType), ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, maxDONType, dFe (maxFeType, umol/m3), pFe (maxFeType, umol/m3), maxBCType (kg/m3), maxDustType (kg/m3), humic carbon" icepack_name="ocean_bio" packages="pkgColumnBiogeochemistry;pkgColumnPackage" /> @@ -5410,7 +5410,7 @@ type="real" dimensions="nZBGCTracers nCells Time" units="mmol m-3" - description="Only bio tracers used in the order: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon,dissolved inorganic carbon, ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m3, particulate iron in umol/m3, humic carbon, black carbon1 in mg/m3, black carbon2 in mg/m3,dust1 in mg/m3, dust2 in mg/m3, dust3 in mg/m3, dust4 in mg/m3" + description="Bio tracers used in the order of oceanBioConcentrations" icepack_name="ocean_bio" packages="pkgColumnBiogeochemistry;pkgColumnPackage" /> @@ -5418,7 +5418,7 @@ type="real" dimensions="nZBGCTracers nCells Time" units="mmol m-2" - description="Only bio tracers used and added to sea ice bottom in the order: diatom nitrogen, smallPlankton nitrogen, phaeocystis nitrogen, nitrate, polysaccarid carbon, lipid carbon, dissolved inorganic carbon,ammonium, silicate, DMSPp, DMSPd, DMS, Nonreactive nitrate, Protein nitrogen, dissolved iron in umol/m2, particulate iron in umol/m2, humic carbon, black carbon1 in mg/m2, black carbon2 in mg/m2,dust1 in mg/m2, dust2 in mg/m2, dust3 in mg/m2, dust4 in mg/m2" + description="Bio tracers used and added to sea ice bottom in the order of oceanBioConcentrations" icepack_name="ocean_bio" packages="pkgColumnBiogeochemistry;pkgColumnPackage" /> @@ -5498,7 +5498,7 @@ Date: Wed, 12 Jun 2024 16:47:00 -0500 Subject: [PATCH 21/24] Cleans redundant parameters in second call to parameter_init Also updates icepack hash to #c63f9e5 --- components/mpas-seaice/src/icepack | 2 +- .../src/shared/mpas_seaice_icepack.F | 105 ------------------ 2 files changed, 1 insertion(+), 106 deletions(-) diff --git a/components/mpas-seaice/src/icepack b/components/mpas-seaice/src/icepack index f459b0c5de3d..c63f9e5b710f 160000 --- a/components/mpas-seaice/src/icepack +++ b/components/mpas-seaice/src/icepack @@ -1 +1 @@ -Subproject commit f459b0c5de3d39b40e181ea2641ce4ac3039d329 +Subproject commit c63f9e5b710f87fd915ad0b77da19bd0a5ab6d12 diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 9addef183781..933b669766c0 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -10103,8 +10103,6 @@ subroutine init_icepack_package_configs(domain) config_biogrid_bottom_molecular_sublayer, & config_bio_gravity_drainage_length_scale, & config_biogrid_top_molecular_sublayer, & - config_new_ice_fraction_biotracer, & - config_fraction_biotracer_in_frazil, & config_snow_porosity_at_ice_surface, & config_ratio_Si_to_N_diatoms, & config_ratio_Si_to_N_small_plankton, & @@ -10122,8 +10120,6 @@ subroutine init_icepack_package_configs(domain) config_ratio_Fe_to_DOC_saccharids, & config_ratio_Fe_to_DOC_lipids, & config_respiration_fraction_of_growth, & - config_rapid_mobile_to_stationary_time, & - config_long_mobile_to_stationary_time, & config_algal_maximum_velocity, & config_ratio_Fe_to_dust, & config_solubility_of_Fe_in_dust, & @@ -10190,37 +10186,6 @@ subroutine init_icepack_package_configs(domain) config_DMSP_to_DMS_conversion_fraction, & config_DMSP_to_DMS_conversion_time, & config_DMS_oxidation_time, & - config_mobility_type_diatoms, & - config_mobility_type_small_plankton, & - config_mobility_type_phaeocystis, & - config_mobility_type_nitrate, & - config_mobility_type_ammonium, & - config_mobility_type_silicate, & - config_mobility_type_DMSPp, & - config_mobility_type_DMSPd, & - config_mobility_type_humics, & - config_mobility_type_saccharids, & - config_mobility_type_lipids, & - config_mobility_type_inorganic_carbon, & - config_mobility_type_proteins, & - config_mobility_type_dissolved_iron, & - config_mobility_type_particulate_iron, & - config_mobility_type_black_carbon1, & - config_mobility_type_black_carbon2, & - config_mobility_type_dust1, & - config_mobility_type_dust2, & - config_mobility_type_dust3, & - config_mobility_type_dust4, & - config_ratio_C_to_N_diatoms, & - config_ratio_C_to_N_small_plankton, & - config_ratio_C_to_N_phaeocystis, & - config_ratio_chla_to_N_diatoms, & - config_ratio_chla_to_N_small_plankton, & - config_ratio_chla_to_N_phaeocystis, & - config_scales_absorption_diatoms, & - config_scales_absorption_small_plankton, & - config_scales_absorption_phaeocystis, & - config_ratio_C_to_N_proteins, & config_fallen_snow_radius, & config_new_snow_density, & config_max_snow_density, & @@ -10335,8 +10300,6 @@ subroutine init_icepack_package_configs(domain) call MPAS_pool_get_config(domain % configs, "config_bio_gravity_drainage_length_scale", & config_bio_gravity_drainage_length_scale) call MPAS_pool_get_config(domain % configs, "config_biogrid_top_molecular_sublayer", config_biogrid_top_molecular_sublayer) - call MPAS_pool_get_config(domain % configs, "config_new_ice_fraction_biotracer", config_new_ice_fraction_biotracer) - call MPAS_pool_get_config(domain % configs, "config_fraction_biotracer_in_frazil", config_fraction_biotracer_in_frazil) call MPAS_pool_get_config(domain % configs, "config_snow_porosity_at_ice_surface", config_snow_porosity_at_ice_surface) call MPAS_pool_get_config(domain % configs, "config_ratio_Si_to_N_diatoms", config_ratio_Si_to_N_diatoms) call MPAS_pool_get_config(domain % configs, "config_ratio_Si_to_N_small_plankton", config_ratio_Si_to_N_small_plankton) @@ -10354,8 +10317,6 @@ subroutine init_icepack_package_configs(domain) call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_DOC_saccharids", config_ratio_Fe_to_DOC_saccharids) call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_DOC_lipids", config_ratio_Fe_to_DOC_lipids) call MPAS_pool_get_config(domain % configs, "config_respiration_fraction_of_growth", config_respiration_fraction_of_growth) - call MPAS_pool_get_config(domain % configs, "config_rapid_mobile_to_stationary_time", config_rapid_mobile_to_stationary_time) - call MPAS_pool_get_config(domain % configs, "config_long_mobile_to_stationary_time", config_long_mobile_to_stationary_time) call MPAS_pool_get_config(domain % configs, "config_algal_maximum_velocity", config_algal_maximum_velocity) call MPAS_pool_get_config(domain % configs, "config_ratio_Fe_to_dust", config_ratio_Fe_to_dust) call MPAS_pool_get_config(domain % configs, "config_solubility_of_Fe_in_dust", config_solubility_of_Fe_in_dust) @@ -10431,37 +10392,6 @@ subroutine init_icepack_package_configs(domain) call MPAS_pool_get_config(domain % configs, "config_DMSP_to_DMS_conversion_fraction", config_DMSP_to_DMS_conversion_fraction) call MPAS_pool_get_config(domain % configs, "config_DMSP_to_DMS_conversion_time", config_DMSP_to_DMS_conversion_time) call MPAS_pool_get_config(domain % configs, "config_DMS_oxidation_time", config_DMS_oxidation_time) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_diatoms", config_mobility_type_diatoms) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_small_plankton", config_mobility_type_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_phaeocystis", config_mobility_type_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_nitrate", config_mobility_type_nitrate) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_ammonium", config_mobility_type_ammonium) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_silicate", config_mobility_type_silicate) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_DMSPp", config_mobility_type_DMSPp) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_DMSPd", config_mobility_type_DMSPd) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_humics", config_mobility_type_humics) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_saccharids", config_mobility_type_saccharids) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_lipids", config_mobility_type_lipids) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_inorganic_carbon", config_mobility_type_inorganic_carbon) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_proteins", config_mobility_type_proteins) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dissolved_iron", config_mobility_type_dissolved_iron) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_particulate_iron", config_mobility_type_particulate_iron) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_black_carbon1", config_mobility_type_black_carbon1) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_black_carbon2", config_mobility_type_black_carbon2) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust1", config_mobility_type_dust1) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust2", config_mobility_type_dust2) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust3", config_mobility_type_dust3) - call MPAS_pool_get_config(domain % configs, "config_mobility_type_dust4", config_mobility_type_dust4) - call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_diatoms", config_ratio_C_to_N_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_small_plankton", config_ratio_C_to_N_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_phaeocystis", config_ratio_C_to_N_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ratio_chla_to_N_diatoms", config_ratio_chla_to_N_diatoms) - call MPAS_pool_get_config(domain % configs, "config_ratio_chla_to_N_small_plankton", config_ratio_chla_to_N_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_ratio_chla_to_N_phaeocystis", config_ratio_chla_to_N_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_scales_absorption_diatoms", config_scales_absorption_diatoms) - call MPAS_pool_get_config(domain % configs, "config_scales_absorption_small_plankton", config_scales_absorption_small_plankton) - call MPAS_pool_get_config(domain % configs, "config_scales_absorption_phaeocystis", config_scales_absorption_phaeocystis) - call MPAS_pool_get_config(domain % configs, "config_ratio_C_to_N_proteins", config_ratio_C_to_N_proteins) call MPAS_pool_get_config(domain % configs, "config_snow_redistribution_scheme", config_snow_redistribution_scheme) call MPAS_pool_get_config(domain % configs, "config_fallen_snow_radius", config_fallen_snow_radius) call MPAS_pool_get_config(domain % configs, "config_use_snow_liquid_ponds", config_use_snow_liquid_ponds) @@ -10763,14 +10693,10 @@ subroutine init_icepack_package_configs(domain) grid_o_in = config_biogrid_bottom_molecular_sublayer, & l_sk_in = config_bio_gravity_drainage_length_scale, & grid_o_t_in = config_biogrid_top_molecular_sublayer, & - !initbio_frac_in = config_new_ice_fraction_biotracer, & - !frazil_scav_in = config_fraction_biotracer_in_frazil, & !grid_oS_in = config_zsalinity_molecular_sublayer, & !l_skS_in = config_zsalinity_gravity_drainage_scale, & phi_snow_in = config_snow_porosity_at_ice_surface, & fr_resp_in = config_respiration_fraction_of_growth, & - tau_min_in = config_rapid_mobile_to_stationary_time, & - tau_max_in = config_long_mobile_to_stationary_time, & algal_vel_in = config_algal_maximum_velocity, & R_dFe2dust_in = config_ratio_Fe_to_dust, & dustFe_sol_in = config_solubility_of_Fe_in_dust, & @@ -10790,37 +10716,6 @@ subroutine init_icepack_package_configs(domain) y_sk_DMS_in = config_DMSP_to_DMS_conversion_fraction, & t_sk_conv_in = config_DMSP_to_DMS_conversion_time, & t_sk_ox_in = config_DMS_oxidation_time, & - algaltype_diatoms_in = config_mobility_type_diatoms, & - algaltype_sp_in = config_mobility_type_small_plankton, & - algaltype_phaeo_in = config_mobility_type_phaeocystis, & - nitratetype_in = config_mobility_type_nitrate, & - ammoniumtype_in = config_mobility_type_ammonium, & - silicatetype_in = config_mobility_type_silicate, & - dmspptype_in = config_mobility_type_DMSPp, & - dmspdtype_in = config_mobility_type_DMSPd, & - humtype_in = config_mobility_type_humics, & - doctype_s_in = config_mobility_type_saccharids, & - doctype_l_in = config_mobility_type_lipids, & - dictype_1_in = config_mobility_type_inorganic_carbon, & - dontype_protein_in = config_mobility_type_proteins, & - fedtype_1_in = config_mobility_type_dissolved_iron, & - feptype_1_in = config_mobility_type_particulate_iron, & - zaerotype_bc1_in = config_mobility_type_black_carbon1, & - zaerotype_bc2_in = config_mobility_type_black_carbon2, & - zaerotype_dust1_in = config_mobility_type_dust1, & - zaerotype_dust2_in = config_mobility_type_dust2, & - zaerotype_dust3_in = config_mobility_type_dust3, & - zaerotype_dust4_in = config_mobility_type_dust4, & - ratio_C2N_diatoms_in = config_ratio_C_to_N_diatoms, & - ratio_C2N_sp_in = config_ratio_C_to_N_small_plankton, & - ratio_C2N_phaeo_in = config_ratio_C_to_N_phaeocystis, & - ratio_chl2N_diatoms_in = config_ratio_chla_to_N_diatoms, & - ratio_chl2N_sp_in = config_ratio_chla_to_N_small_plankton, & - ratio_chl2N_phaeo_in = config_ratio_chla_to_N_phaeocystis, & - F_abs_chl_diatoms_in = config_scales_absorption_diatoms, & - F_abs_chl_sp_in = config_scales_absorption_small_plankton, & - F_abs_chl_phaeo_in = config_scales_absorption_phaeocystis, & - ratio_C2N_proteins_in = config_ratio_C_to_N_proteins, & !conserv_check_in = , & snwgrain_in = config_use_snow_grain_radius, & snwredist_in = config_snow_redistribution_scheme, & From 6853aee04a467f67d00985c506ed01771aebcf1f Mon Sep 17 00:00:00 2001 From: Nicole Jeffery Date: Sat, 22 Jun 2024 12:32:38 -0500 Subject: [PATCH 22/24] Removes redundant parameter and dimension passes to icepack More cleanup of the mpas-seaice icepack interface. Updates icepack hash #31ce4221 BFB --- components/mpas-seaice/src/icepack | 2 +- .../src/shared/mpas_seaice_icepack.F | 120 ++---------------- .../src/shared/mpas_seaice_initialize.F | 9 -- .../src/shared/mpas_seaice_velocity_solver.F | 1 - 4 files changed, 10 insertions(+), 122 deletions(-) diff --git a/components/mpas-seaice/src/icepack b/components/mpas-seaice/src/icepack index c63f9e5b710f..31ce42217717 160000 --- a/components/mpas-seaice/src/icepack +++ b/components/mpas-seaice/src/icepack @@ -1 +1 @@ -Subproject commit c63f9e5b710f87fd915ad0b77da19bd0a5ab6d12 +Subproject commit 31ce42217717dbbde87b73129d7a4ff3d052455d diff --git a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F index 933b669766c0..c6386f2c1aa4 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_icepack.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_icepack.F @@ -340,7 +340,6 @@ subroutine init_column_itd(domain) call MPAS_pool_get_array(initial, "categoryThicknessLimits", categoryThicknessLimits) call icepack_init_itd(& - nCategories, & categoryThicknessLimits) call seaice_icepack_write_warnings(icepack_warnings_aborted()) @@ -400,7 +399,6 @@ subroutine init_column_thermodynamic_profiles(domain) allocate(initialSalinityProfileVertical(1:nIceLayers+1)) call icepack_init_thermo(& - nIceLayers, & initialSalinityProfileVertical) call seaice_icepack_write_warnings(icepack_warnings_aborted()) @@ -864,8 +862,6 @@ subroutine init_column_thermodynamic_tracers(domain) integer, pointer :: & nCellsSolve, & - nIceLayers, & - nSnowLayers, & nCategories integer :: & @@ -883,8 +879,6 @@ subroutine init_column_thermodynamic_tracers(domain) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) - call MPAS_pool_get_dimension(mesh, "nIceLayers", nIceLayers) - call MPAS_pool_get_dimension(mesh, "nSnowLayers", nSnowLayers) call MPAS_pool_get_array(atmos_coupling, "airTemperature", airTemperature) @@ -906,8 +900,6 @@ subroutine init_column_thermodynamic_tracers(domain) initialSalinityProfile(:,iCell), & initialMeltingTemperatureProfile(:,iCell), & surfaceTemperature(1,iCategory,iCell), & - nIceLayers, & - nSnowLayers, & iceEnthalpy(:,iCategory,iCell), & snowEnthalpy(:,iCategory,iCell)) @@ -1745,9 +1737,6 @@ subroutine column_vertical_thermodynamics(domain, clock) call icepack_warnings_clear() call icepack_step_therm1(& dt=config_dt, & - ncat=nCategories, & - nilyr=nIceLayers, & - nslyr=nSnowLayers, & aicen_init=iceAreaCategoryInitial(:,iCell), & vicen_init=iceVolumeCategoryInitial(:,iCell), & vsnon_init=snowVolumeCategoryInitial(:,iCell), & @@ -2163,9 +2152,6 @@ subroutine column_itd_thermodynamics(domain, clock) oceanHeatFlux, & freezeOnset, & categoryThicknessLimits, & - biologyGrid, & - verticalGrid, & - interfaceBiologyGrid, & frazilGrowthDiagnostic ! frazilGrowthDiagnostic, & ! WaveFrequency, & @@ -2314,9 +2300,6 @@ subroutine column_itd_thermodynamics(domain, clock) call MPAS_pool_get_array(biogeochemistry, "oceanBioFluxes", oceanBioFluxes) call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrations", oceanBioConcentrations) call MPAS_pool_get_array(biogeochemistry, "oceanBioConcentrationsInUse", oceanBioConcentrationsInUse) - call MPAS_pool_get_array(biogeochemistry, "biologyGrid", biologyGrid) - call MPAS_pool_get_array(biogeochemistry, "verticalGrid", verticalGrid) - call MPAS_pool_get_array(biogeochemistry, "interfaceBiologyGrid", interfaceBiologyGrid) call MPAS_pool_get_array(initial, "initialSalinityProfile", initialSalinityProfile) call MPAS_pool_get_array(initial, "categoryThicknessLimits", categoryThicknessLimits) @@ -2365,12 +2348,7 @@ subroutine column_itd_thermodynamics(domain, clock) call icepack_step_therm2(& dt=config_dt, & - ncat=nCategories, & - nilyr=nIcelayers, & - nslyr=nSnowLayers, & hin_max=categoryThicknessLimits(:), & - nbtrcr=ciceTracerObject % nBioTracers, & - nblyr=nBioLayers, & aicen=iceAreaCategory(1,:,iCell), & vicen=iceVolumeCategory(1,:,iCell), & vsnon=snowVolumeCategory(1,:,iCell), & @@ -2397,9 +2375,6 @@ subroutine column_itd_thermodynamics(domain, clock) fresh=oceanFreshWaterFlux(iCell), & fsalt=oceanSaltFlux(iCell), & fhocn=oceanHeatFlux(iCell), & - bgrid=biologyGrid(:), & - cgrid=verticalGrid(:), & - igrid=interfaceBiologyGrid(:), & faero_ocn=oceanAerosolFlux(:,iCell), & first_ice=newlyFormedIceLogical(:), & flux_bio=oceanBioFluxesTemp(:,iCell), & @@ -2772,9 +2747,6 @@ subroutine column_snow(domain) call icepack_step_snow (& dt=config_dt, & wind=windSpeed(iCell), & - nilyr=nIceLayers, & - nslyr=nSnowLayers, & - ncat=nCategories, & aice=iceAreaCell(iCell), & aicen=iceAreaCategory(1,:,iCell), & vicen=iceVolumeCategory(1,:,iCell), & @@ -2895,9 +2867,7 @@ subroutine column_radiation(domain, clock, lInitialization) shortwaveIRDirectDown, & shortwaveIRDiffuseDown, & solarZenithAngleCosine, & - snowfallRate, & - verticalShortwaveGrid, & - verticalGrid + snowfallRate real(kind=RKIND), dimension(:,:), pointer :: & surfaceShortwaveFlux, & @@ -3065,8 +3035,6 @@ subroutine column_radiation(domain, clock, lInitialization) call MPAS_pool_get_array(ponds, "pondLidMeltFluxFraction", pondLidMeltFluxFraction) call MPAS_pool_get_array(biogeochemistry, "bioTracerShortwave", bioTracerShortwave) - call MPAS_pool_get_array(biogeochemistry, "verticalShortwaveGrid", verticalShortwaveGrid) - call MPAS_pool_get_array(biogeochemistry, "verticalGrid", verticalGrid) ! calendar type call MPAS_pool_get_config(block % configs, "config_calendar_type", config_calendar_type) @@ -3117,8 +3085,6 @@ subroutine column_radiation(domain, clock, lInitialization) call icepack_step_radiation(& dt=config_dt, & - swgrid=verticalShortwaveGrid(:), & - igrid=verticalGrid(:), & fbri=brineFraction(1,:,iCell), & aicen=iceAreaCategory(1,:,iCell), & vicen=iceVolumeCategory(1,:,iCell), & @@ -3236,12 +3202,7 @@ subroutine column_ridging(domain) ! dimensions integer, pointer :: & nCellsSolve, & - nCategories, & - nIceLayers, & - nSnowLayers, & - nAerosols, & - nBioLayers, & - nBioLayersP1 + nCategories ! variables real(kind=RKIND), dimension(:), pointer :: & @@ -3330,11 +3291,6 @@ subroutine column_ridging(domain) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) - call MPAS_pool_get_dimension(mesh, "nIceLayers", nIceLayers) - call MPAS_pool_get_dimension(mesh, "nSnowLayers", nSnowLayers) - call MPAS_pool_get_dimension(mesh, "nAerosols", nAerosols) - call MPAS_pool_get_dimension(block % dimensions, "nBioLayers", nBioLayers) - call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP1", nBioLayersP1) call MPAS_pool_get_array(mesh, "indexToCellID", indexToCellID) @@ -3401,10 +3357,6 @@ subroutine column_ridging(domain) call icepack_step_ridge(& dt=dynamicsTimeStep, & ndtd=config_dynamics_subcycle_number, & - nilyr=nIceLayers, & - nslyr=nSnowLayers, & - nblyr=nBioLayers, & - ncat=nCategories, & hin_max=categoryThicknessLimits, & ! hin_max, dimension(0:ncat), intent(inout) rdg_conv=ridgeConvergence(iCell), & rdg_shear=ridgeShear(iCell), & @@ -3424,7 +3376,6 @@ subroutine column_ridging(domain) fpond=pondFreshWaterFlux(iCell), & fresh=oceanFreshWaterFlux(iCell), & fhocn=oceanHeatFlux(iCell), & - n_aero=nAerosols, & faero_ocn=oceanAerosolFlux(:,iCell), & ! DC no fiso_ocn argument aparticn=ridgeParticipationFunction(:,iCell), & krdgn=ratioRidgeThicknessToIce(:,iCell), & @@ -3525,10 +3476,7 @@ subroutine column_biogeochemistry(domain) integer, pointer :: & nCellsSolve, & nCategories, & - nIceLayers, & - nSnowLayers, & nzAerosols, & - nBioLayers, & nBioLayersP1, & nAlgae, & maxBCType, & @@ -3543,10 +3491,6 @@ subroutine column_biogeochemistry(domain) netSpecificAlgalGrowthRate, & primaryProduction, & netBrineHeight, & - biologyGrid, & - interfaceBiologyGrid, & - interfaceGrid, & - verticalGrid, & seaSurfaceTemperature, & seaSurfaceSalinity, & seaFreezingTemperature, & @@ -3698,10 +3642,7 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) - call MPAS_pool_get_dimension(mesh, "nIceLayers", nIceLayers) - call MPAS_pool_get_dimension(mesh, "nSnowLayers", nSnowLayers) call MPAS_pool_get_dimension(mesh, "nzAerosols", nzAerosols) - call MPAS_pool_get_dimension(mesh, "nBioLayers", nBioLayers) call MPAS_pool_get_dimension(mesh, "nBioLayersP1", nBioLayersP1) call MPAS_pool_get_dimension(mesh, "nAlgae", nAlgae) call MPAS_pool_get_dimension(mesh, "maxBCType", maxBCType) @@ -3728,10 +3669,6 @@ subroutine column_biogeochemistry(domain) call MPAS_pool_get_array(biogeochemistry, "brineBottomChange", brineBottomChange) call MPAS_pool_get_array(biogeochemistry, "brineTopChange", brineTopChange) call MPAS_pool_get_array(biogeochemistry, "bioPorosity", bioPorosity) - call MPAS_pool_get_array(biogeochemistry, "biologyGrid", biologyGrid) - call MPAS_pool_get_array(biogeochemistry, "interfaceBiologyGrid", interfaceBiologyGrid) - call MPAS_pool_get_array(biogeochemistry, "interfaceGrid", interfaceGrid) - call MPAS_pool_get_array(biogeochemistry, "verticalGrid", verticalGrid) call MPAS_pool_get_array(biogeochemistry, "bioDiffusivity", bioDiffusivity) call MPAS_pool_get_array(biogeochemistry, "bioPermeability", bioPermeability) call MPAS_pool_get_array(biogeochemistry, "bioShortwaveFlux", bioShortwaveFlux) @@ -3958,14 +3895,6 @@ subroutine column_biogeochemistry(domain) snow_bio_net=totalVerticalBiologySnow(:,iCell), & totalChla=totalChlorophyll(iCell), & fswthrun=penetratingShortwaveFlux(:,iCell), & - bgrid=biologyGrid, & - igrid=interfaceBiologyGrid, & - icgrid=interfaceGrid, & - cgrid=verticalGrid, & - nblyr=nBioLayers, & - nilyr=nIceLayers, & - nslyr=nSnowLayers, & - ncat=nCategories, & meltbn=basalIceMeltCategory(:,iCell), & melttn=surfaceIceMeltCategory(:,iCell), & congeln=congelationCategory(:,iCell), & @@ -4369,8 +4298,7 @@ subroutine seaice_icepack_aggregate(domain) iCell integer, pointer :: & - nCellsSolve, & - nCategories + nCellsSolve integer, dimension(:), pointer :: & indexToCellID @@ -4392,7 +4320,6 @@ subroutine seaice_icepack_aggregate(domain) call MPAS_pool_get_config(block % configs, "config_use_zaerosols", config_use_zaerosols) call MPAS_pool_get_dimension(mesh, "nCellsSolve", nCellsSolve) - call MPAS_pool_get_dimension(mesh, "nCategories", nCategories) call MPAS_pool_get_array(mesh, "indexToCellID", indexToCellID) call MPAS_pool_get_array(tracers, "iceAreaCategory", iceAreaCategory, 1) @@ -4417,7 +4344,6 @@ subroutine seaice_icepack_aggregate(domain) tracerArrayCategory, iCell, setGetPhysicsTracers, setGetBGCTracers) call icepack_aggregate( & - nCategories, & iceAreaCategory(1,:,iCell), & tracerArrayCategory, & ! trcrn iceVolumeCategory(1,:,iCell), & @@ -4427,7 +4353,6 @@ subroutine seaice_icepack_aggregate(domain) iceVolumeCell(iCell), & snowVolumeCell(iCell), & openWaterArea(iCell), & - ciceTracerObject % nTracers, & ciceTracerObject % parentIndex, & ! trcr_depend ciceTracerObject % firstAncestorMask, & ! trcr_base ciceTracerObject % ancestorNumber, & ! n_trcr_strata @@ -5570,18 +5495,12 @@ subroutine seaice_icepack_init_trcr(& initialSalinityProfile, & initialMeltingTemperatureProfile, & surfaceTemperature, & - nIceLayers, & - nSnowLayers, & iceEnthalpy, & snowEnthalpy) use icepack_intfc, only: & icepack_init_trcr - integer, intent(in) :: & - nIceLayers, & ! number of ice layers - nSnowLayers ! number of snow layers - real(kind=RKIND), intent(in) :: & airTemperature, & ! air temperature (C) seaFreezingTemperature ! freezing temperature (C) @@ -5602,8 +5521,6 @@ subroutine seaice_icepack_init_trcr(& initialSalinityProfile, & initialMeltingTemperatureProfile, & surfaceTemperature, & - nIceLayers, & - nSnowLayers, & iceEnthalpy, & snowEnthalpy) @@ -14177,13 +14094,7 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) brineFraction integer, pointer :: & - nCellsSolve, & - nIceLayers, & - nBioLayers, & - nBioLayersP1, & - nBioLayersP2, & - nCategories, & - nShortwaveBio + nCellsSolve integer :: & iCell @@ -14253,21 +14164,13 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) call MPAS_pool_get_array(tracers, "brineFraction", brineFraction, 1) call MPAS_pool_get_dimension(block % dimensions, "nCellsSolve", nCellsSolve) - call MPAS_pool_get_dimension(block % dimensions, "nCategories", nCategories) - call MPAS_pool_get_dimension(block % dimensions, "nIceLayers", nIceLayers) - call MPAS_pool_get_dimension(block % dimensions, "nBioLayers", nBioLayers) - call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP1", nBioLayersP1) - call MPAS_pool_get_dimension(block % dimensions, "nBioLayersP2", nBioLayersP2) - call MPAS_pool_get_dimension(block % dimensions, "nShortwaveBio", nShortwaveBio) call icepack_init_hbrine(& - bgrid=biologyGrid, & - igrid=interfaceBiologyGrid, & - cgrid=verticalGrid, & - icgrid=interfaceGrid, & - swgrid=verticalShortwaveGrid, & - nblyr=nBioLayers, & - nilyr=nIceLayers, & + bgrid_out=biologyGrid, & + igrid_out=interfaceBiologyGrid, & + cgrid_out=verticalGrid, & + icgrid_out=interfaceGrid, & + swgrid_out=verticalShortwaveGrid, & phi_snow=config_snow_porosity_at_ice_surface) do iCell = 1, nCellsSolve @@ -14302,11 +14205,6 @@ subroutine init_column_biogeochemistry_profiles(domain, tracerObject) hum=oceanHumicsConc(iCell)) call icepack_init_bgc(& - ncat=nCategories, & - nblyr=nBioLayers, & - nilyr=nIceLayers, & - cgrid=verticalGrid, & - igrid=interfaceBiologyGrid, & sicen=iceSalinity(:,:,iCell), & trcrn=tracerArrayCategory(tracerObject % nTracersNotBio+1:tracerObject % nTracers,:), & sss=seaSurfaceSalinity(iCell), & diff --git a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F index 12a843a5040c..69f145881758 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_initialize.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_initialize.F @@ -784,8 +784,6 @@ subroutine init_ice_state_uniform_1D(& initialSalinityProfile(:,iCell), & initialMeltingTemperatureProfile(:,iCell), & surfaceTemperature(1,1,iCell), & - nIceLayers, & - nSnowLayers, & iceEnthalpy(:,1,iCell), & snowEnthalpy(:,1,iCell)) call seaice_icepack_write_warnings(icepack_warnings_aborted()) @@ -990,8 +988,6 @@ subroutine init_ice_cice_default(& initialSalinityProfile(:,iCell), & initialMeltingTemperatureProfile(:,iCell), & surfaceTemperature(1,iCategory,iCell), & - nIceLayers, & - nSnowLayers, & iceEnthalpy(:,iCategory,iCell), & snowEnthalpy(:,iCategory,iCell)) call seaice_icepack_write_warnings(icepack_warnings_aborted()) @@ -1148,7 +1144,6 @@ subroutine initial_category_areas_and_volumes(& if (trim(config_column_physics_type) == "icepack") then call icepack_init_itd(& - nCategories, & categoryThicknessLimits) call seaice_icepack_write_warnings(icepack_warnings_aborted()) else if (trim(config_column_physics_type) == "column_package") then @@ -1341,8 +1336,6 @@ subroutine init_ice_single_cell(& initialSalinityProfile(:,iCell), & initialMeltingTemperatureProfile(:,iCell), & surfaceTemperature(1,iCategory,iCell), & - nIceLayers, & - nSnowLayers, & iceEnthalpy(:,iCategory,iCell), & snowEnthalpy(:,iCategory,iCell)) call seaice_icepack_write_warnings(icepack_warnings_aborted()) @@ -1562,8 +1555,6 @@ subroutine init_ice_ridging(& initialSalinityProfile(:,iCell), & initialMeltingTemperatureProfile(:,iCell), & surfaceTemperature(1,iCategory,iCell), & - nIceLayers, & - nSnowLayers, & iceEnthalpy(:,iCategory,iCell), & snowEnthalpy(:,iCategory,iCell)) call seaice_icepack_write_warnings(icepack_warnings_aborted()) diff --git a/components/mpas-seaice/src/shared/mpas_seaice_velocity_solver.F b/components/mpas-seaice/src/shared/mpas_seaice_velocity_solver.F index f49ac45a9360..3009b618161b 100644 --- a/components/mpas-seaice/src/shared/mpas_seaice_velocity_solver.F +++ b/components/mpas-seaice/src/shared/mpas_seaice_velocity_solver.F @@ -1431,7 +1431,6 @@ subroutine ice_strength(domain) ! this routine doesnt reset icePressure call icepack_ice_strength(& - nCategories, & iceAreaCell(iCell), & iceVolumeCell(iCell), & openWaterArea(iCell), & From 3f69824119af0dad0a12d8c9541430a20449b7d2 Mon Sep 17 00:00:00 2001 From: Jon Wolfe Date: Wed, 10 Jul 2024 13:25:22 -0500 Subject: [PATCH 23/24] Update bld files to match Registry --- components/mpas-seaice/bld/build-namelist | 7 ++++++- .../bld/namelist_files/namelist_defaults_mpassi.xml | 2 -- .../bld/namelist_files/namelist_definition_mpassi.xml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/mpas-seaice/bld/build-namelist b/components/mpas-seaice/bld/build-namelist index b5faa4ceeb2d..3d7ce2c619f8 100755 --- a/components/mpas-seaice/bld/build-namelist +++ b/components/mpas-seaice/bld/build-namelist @@ -628,7 +628,12 @@ add_default($nl, 'config_recover_tracer_means_check'); ################################## # Namelist group: column_package # ################################## -add_default($nl, 'config_column_physics_type'); + +if ($ice_bgc eq 'ice_bgc') { + add_default($nl, 'config_column_physics_type', 'val'=>"column_package"); +} else { + add_default($nl, 'config_column_physics_type'); +} add_default($nl, 'config_use_column_shortwave'); add_default($nl, 'config_use_column_vertical_thermodynamics'); if ($ice_bgc eq 'ice_bgc') { diff --git a/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml b/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml index 1ac5bfe8a04b..d840b317785e 100644 --- a/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml +++ b/components/mpas-seaice/bld/namelist_files/namelist_defaults_mpassi.xml @@ -80,7 +80,6 @@ 75.0 85.0 75.0 - 70.0 70.0 85.0 @@ -95,7 +94,6 @@ -75.0 -85.0 -75.0 - -60.0 -60.0 -85.0 diff --git a/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml b/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml index 548004a78dcf..efbaef07cb9d 100644 --- a/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml +++ b/components/mpas-seaice/bld/namelist_files/namelist_definition_mpassi.xml @@ -333,7 +333,7 @@ Default: Defined in namelist_defaults.xml -Sea ice concentration at initialization. +Sea ice fraction at initialization. Valid values: A real number between 0.0 and 1.0 inclusive. Default: Defined in namelist_defaults.xml From 4c94ac4cfb67e41c217c457c5de9c09363aba9a0 Mon Sep 17 00:00:00 2001 From: Jon Wolfe Date: Wed, 10 Jul 2024 14:47:02 -0500 Subject: [PATCH 24/24] Add mesh-dependent dust_iron_file to streams --- components/mpas-seaice/cime_config/buildnml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/components/mpas-seaice/cime_config/buildnml b/components/mpas-seaice/cime_config/buildnml index c79de6314b06..2b7ca33eba21 100755 --- a/components/mpas-seaice/cime_config/buildnml +++ b/components/mpas-seaice/cime_config/buildnml @@ -72,6 +72,7 @@ def buildnml(case, caseroot, compname): decomp_prefix = '' data_iceberg_file = '' points_file = '' + dust_iron_file = '' if ice_grid == 'oEC60to30v3': decomp_date = '230424' @@ -299,6 +300,7 @@ def buildnml(case, caseroot, compname): decomp_date = '20231120' decomp_prefix = 'partitions/mpas-seaice.graph.info.' data_iceberg_file = 'Iceberg_Climatology_Merino.IcoswISC30E3r5.20231120.nc' + dust_iron_file = 'ecoForcingSurfaceMonthly+WetDryDustSolFrac.IcoswISC30E3r5.20240511.nc' if ice_ic_mode == 'spunup': if iceberg_mode == 'data': grid_date = '20240207' @@ -346,6 +348,8 @@ def buildnml(case, caseroot, compname): input_list.write("points = {}/ice/mpas-seaice/{}/{}\n".format(din_loc_root, ice_mask, points_file)) if iceberg_mode == 'data': input_list.write("data_iceberg = {}/ice/mpas-seaice/{}/{}\n".format(din_loc_root, ice_mask, data_iceberg_file)) + if dust_iron_file != '': + input_list.write("dust_iron = {}/ocn/mpas-o/{}/{}\n".format(din_loc_root, ice_mask, dust_iron_file)) #-------------------------------------------------------------------- # Invoke mpas build-namelist - output will go in $CASEBUILD/mpassiconf @@ -591,13 +595,15 @@ def buildnml(case, caseroot, compname): lines.append(' filename_interval="none"') lines.append(' input_interval="none" />') lines.append('') - lines.append('') - lines.append('') + if dust_iron_file != '': + lines.append('') + lines.append('') + lines.append('')