From daa7392d5a28f6b462fabf2755fcbaa35404d609 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Fri, 9 Feb 2024 13:46:19 -0600 Subject: [PATCH 01/15] Adding cryo fields to coupler budget accounting --- .../mpas-ocean/driver/mpaso_cpl_indices.F | 13 ++- components/mpas-ocean/driver/ocn_comp_mct.F | 63 ++++++++++- components/mpas-ocean/src/Registry.xml | 16 +++ .../Registry_conservation_check.xml | 24 ++--- .../mpas_ocn_conservation_check.F | 3 +- .../shared/mpas_ocn_time_average_coupled.F | 88 ++++++++++++++- driver-mct/main/seq_diag_mct.F90 | 100 +++++++++++------- driver-mct/shr/seq_flds_mod.F90 | 40 +++++++ 8 files changed, 290 insertions(+), 57 deletions(-) diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index 968a4090fe4a..10cbfe80e968 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -22,7 +22,11 @@ module mpaso_cpl_indices integer :: index_o2x_Faoo_fco2_ocn integer :: index_o2x_Faoo_fdms_ocn integer :: index_o2x_So_ssh - + integer :: index_o2x_Foxo_ismw + integer :: index_o2x_Foxo_rrofl + integer :: index_o2x_Foxo_rrofi + integer :: index_o2x_Foxo_ismh + integer :: index_o2x_Foxo_rrofih ! ocn -> drv for calculation of ocean-ice sheet interactions @@ -188,6 +192,13 @@ subroutine mpaso_cpl_indices_set( ) index_o2x_Faoo_fdms_ocn = mct_avect_indexra(o2x,'Faoo_fdms_ocn',perrWith='quiet') index_o2x_So_ssh = mct_avect_indexra(o2x,'So_ssh') + index_o2x_Foxo_ismw = mct_avect_indexra(o2x,'Foxo_ismw') + index_o2x_Foxo_rrofl = mct_avect_indexra(o2x,'Foxo_rrofl') + index_o2x_Foxo_rrofi = mct_avect_indexra(o2x,'Foxo_rrofi') + + index_o2x_Foxo_ismh = mct_avect_indexra(o2x,'Foxo_ismh') + index_o2x_Foxo_rrofih = mct_avect_indexra(o2x,'Foxo_rrofih') + index_o2x_So_blt = mct_avect_indexra(o2x,'So_blt') index_o2x_So_bls = mct_avect_indexra(o2x,'So_bls') index_o2x_So_htv = mct_avect_indexra(o2x,'So_htv') diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index ec02127f7cab..67f465b9332b 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -689,6 +689,7 @@ end subroutine xml_stream_get_attributes if ( ierr /= 0 ) then write(ocnLogUnit,*) 'Fail to set define dom fields ' endif + ent_type = 1 ! cells @@ -2700,7 +2701,12 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ avgOceanSurfaceDOCSemiLabile, & avgOceanSurfaceFeParticulate, & avgOceanSurfaceFeDissolved, & - ssh + ssh, & + avgLandIceFreshwaterFlux, & + avgRemovedRiverRunoffFlux, & + avgRemovedIceRunoffFlux, & + avgLandIceHeatFlux, & + avgRemovedIceRunoffHeatFlux real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, & avgSSHGradient, avgOceanSurfacePhytoC, & @@ -2709,6 +2715,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ real (kind=RKIND) :: surfaceFreezingTemp logical, pointer :: frazilIceActive, & + config_remove_AIS_coupler_runoff, & config_use_ecosysTracers, & config_use_DMSTracers, & config_use_MacroMoleculesTracers, & @@ -2725,6 +2732,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ call mpas_pool_get_package(domain % packages, 'frazilIceActive', frazilIceActive) call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers', config_use_ecosysTracers) call mpas_pool_get_config(domain % configs, 'config_land_ice_flux_mode', config_land_ice_flux_mode) + call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff) call mpas_pool_get_config(domain % configs, 'config_use_DMSTracers', config_use_DMSTracers) call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers', config_use_MacroMoleculesTracers) call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers_sea_ice_coupling', & @@ -2767,6 +2775,17 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1) end if + ! Cryo fields + if (trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then + call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) + call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux) + endif + if (config_remove_AIS_coupler_runoff) then + call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffHeatFlux', avgRemovedIceRunoffHeatFlux) + endif + ! BGC fields if (config_use_ecosysTracers) then @@ -2818,6 +2837,17 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ o2x_o % rAttr(index_o2x_Faoo_h2otemp, n) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw + ! Cryo fields + if (trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then + o2x_o % rAttr(index_o2x_Foxo_ismw, n) = avgLandIceFreshwaterFlux(i) + o2x_o % rAttr(index_o2x_Foxo_ismh, n) = avgLandIceHeatFlux(i) + endif + if (config_remove_AIS_coupler_runoff) then + o2x_o % rAttr(index_o2x_Foxo_rrofl, n) = avgRemovedRiverRunoffFlux(i) + o2x_o % rAttr(index_o2x_Foxo_rrofi, n) = avgRemovedIceRunoffFlux(i) + o2x_o % rAttr(index_o2x_Foxo_rrofih, n) = avgRemovedIceRunoffHeatFlux(i) + endif + if ( frazilIceActive ) then ! negative when frazil ice can be melted keepFrazil = .true. @@ -3981,7 +4011,12 @@ subroutine ocn_export_moab(EClock) !{{{ avgOceanSurfaceDOCSemiLabile, & avgOceanSurfaceFeParticulate, & avgOceanSurfaceFeDissolved, & - ssh + ssh, & + avgLandIceFreshwaterFlux, & + avgRemovedRiverRunoffFlux, & + avgRemovedIceRunoffFlux, & + avgLandIceHeatFlux, & + avgRemovedIceRunoffHeatFlux real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, & avgSSHGradient, avgOceanSurfacePhytoC, & @@ -3990,6 +4025,7 @@ subroutine ocn_export_moab(EClock) !{{{ real (kind=RKIND) :: surfaceFreezingTemp logical, pointer :: frazilIceActive, & + config_remove_AIS_coupler_runoff, & config_use_ecosysTracers, & config_use_DMSTracers, & config_use_MacroMoleculesTracers, & @@ -4006,6 +4042,7 @@ subroutine ocn_export_moab(EClock) !{{{ call mpas_pool_get_package(domain % packages, 'frazilIceActive', frazilIceActive) call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers', config_use_ecosysTracers) call mpas_pool_get_config(domain % configs, 'config_land_ice_flux_mode', config_land_ice_flux_mode) + call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff) call mpas_pool_get_config(domain % configs, 'config_use_DMSTracers', config_use_DMSTracers) call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers', config_use_MacroMoleculesTracers) call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers_sea_ice_coupling', & @@ -4047,6 +4084,16 @@ subroutine ocn_export_moab(EClock) !{{{ call mpas_pool_get_array(forcingPool, 'frazilSurfacePressure', frazilSurfacePressure) call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1) end if + + if (trim(config_land_ice_flux_mode == 'standalone') .or. trim(config_land_ice_flux_mode) == 'data') then + call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) + call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux) + endif + if (config_remove_AIS_coupler_runoff) then + call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffHeatFlux', avgRemovedIceRunoffHeatFlux) + endif ! BGC fields if (config_use_ecosysTracers) then @@ -4098,7 +4145,17 @@ subroutine ocn_export_moab(EClock) !{{{ o2x_om(n, index_o2x_So_dhdy) = avgSSHGradient(index_avgMeridionalSSHGradient, i) o2x_om(n, index_o2x_Faoo_h2otemp) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw - + + if (trim(config_land_ice_flux_mode == 'standalone') .or. trim(config_land_ice_flux_mode) == 'data') then + o2x_om(n, index_o2x_Foxo_ismw) = avgLandIceFreshwaterFlux(i) + o2x_om(n, index_o2x_Foxo_ismh) = avgLandIceHeatFlux(i) + endif + if (config_remove_AIS_coupler_runoff) then + o2x_om(n, index_o2x_Foxo_rrofl) = avgRemovedRiverRunoffFlux(i) + o2x_om(n, index_o2x_Foxo_rrofi) = avgRemovedIceRunoffFlux(i) + o2x_om(n, index_o2x_Foxo_rrofih) = avgRemovedIceRunoffHeatFlux(i) + endif + if ( frazilIceActive ) then ! negative when frazil ice can be melted keepFrazil = .true. diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index f8b56c083d44..a953b64d8f8e 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -3608,6 +3608,7 @@ packages="activeTracersBulkRestoringPKG;thicknessBulkPKG" /> + + + + + + - - - - - - - - - - - - diff --git a/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F b/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F index a4f2a0b7ab5d..01f2b5345468 100644 --- a/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F +++ b/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F @@ -2432,7 +2432,8 @@ subroutine ocn_restart_conservation_check(domain, err)!{{{ err = 0 if ( trim(config_land_ice_flux_mode) == 'standalone' .or. & - trim(config_land_ice_flux_mode) == 'coupled' ) then + trim(config_land_ice_flux_mode) == 'coupled' .or. & + trim(config_land_ice_flux_mode) == 'data' ) then landIceFreshwaterFluxesOn = .true. end if diff --git a/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F b/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F index b796c56fa1a6..751c547d95bd 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F @@ -53,7 +53,10 @@ subroutine ocn_time_average_coupled_init(forcingPool)!{{{ real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, avgSSHGradient, & avgLandIceBoundaryLayerTracers, avgLandIceTracerTransferVelocities - real (kind=RKIND), dimension(:), pointer :: avgEffectiveDensityInLandIce, avgTotalFreshWaterTemperatureFlux + real (kind=RKIND), dimension(:), pointer :: avgEffectiveDensityInLandIce, avgTotalFreshWaterTemperatureFlux, & + avgLandIceFreshwaterFlux, & + avgRemovedRiverRunoffFlux, avgRemovedIceRunoffFlux, & + avgLandIceHeatFlux, avgRemovedIceRunoffHeatFlux integer :: iCell integer, pointer :: nAccumulatedCoupled, nCells @@ -116,6 +119,37 @@ subroutine ocn_time_average_coupled_init(forcingPool)!{{{ !$omp end parallel end if + ! Set up polar fields if necessary + if(trim(config_land_ice_flux_mode)=='standalone' .or. trim(config_land_ice_flux_mode) == 'data') then + call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) + call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux) + + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgLandIceFreshwaterFlux(iCell) = 0.0_RKIND + avgLandIceHeatFlux(iCell) = 0.0_RKIND + end do + !$omp end do + !$omp end parallel + end if + + if(config_remove_AIS_coupler_runoff) then + call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffHeatFlux', avgRemovedIceRunoffHeatFlux) + + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgRemovedRiverRunoffFlux(iCell) = 0.0_RKIND + avgRemovedIceRunoffFlux(iCell) = 0.0_RKIND + avgRemovedIceRunoffHeatFlux(iCell) = 0.0_RKIND + end do + !$omp end do + !$omp end parallel + end if + ! set up BGC coupling fields if necessary if (config_use_ecosysTracers) then @@ -201,6 +235,9 @@ end subroutine ocn_time_average_coupled_init!}}} ! !----------------------------------------------------------------------- subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel)!{{{ + use ocn_constants, only: & + latent_heat_fusion_mks + type (mpas_pool_type), intent(in) :: statePool type (mpas_pool_type), intent(inout) :: forcingPool integer, intent(in) :: timeLevel @@ -215,7 +252,12 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel real (kind=RKIND), dimension(:,:), pointer :: & avgLandIceBoundaryLayerTracers, avgLandIceTracerTransferVelocities real (kind=RKIND), dimension(:), pointer :: effectiveDensityInLandIce, avgEffectiveDensityInLandIce, & - totalFreshWaterTemperatureFlux, avgTotalFreshWaterTemperatureFlux + totalFreshWaterTemperatureFlux, avgTotalFreshWaterTemperatureFlux, & + landIceFreshwaterFlux, avgLandIceFreshwaterFlux, & + landIceHeatFlux, avgLandIceHeatFlux, & + removedRiverRunoffFlux, avgRemovedRiverRunoffFlux, & + removedIceRunoffFlux, avgRemovedIceRunoffFlux, & + avgRemovedIceRunoffHeatFlux type (mpas_pool_type), pointer :: tracersPool @@ -311,6 +353,48 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel !$omp end parallel end if + ! Accumulate polar fields if necessary + if(trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then + call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) + call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) + call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux) + call mpas_pool_get_array(forcingPool, 'landIceHeatFlux', landIceHeatFlux) + + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & + + landIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) + avgLandIceHeatFlux(iCell) = ( avgLandIceHeatFlux(iCell) * nAccumulatedCoupled & + + landIceHeatFlux(iCell) ) / ( nAccumulatedCoupled + 1) + end do + !$omp end do + !$omp end parallel + + end if + + if (config_remove_AIS_coupler_runoff) then + call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffHeatFlux', avgRemovedIceRunoffHeatFlux) + call mpas_pool_get_array(forcingPool, 'removedRiverRunoffFlux', removedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'removedIceRunoffFlux', removedIceRunoffFlux) + + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgRemovedRiverRunoffFlux(iCell) = ( avgRemovedRiverRunoffFlux(iCell) * nAccumulatedCoupled & + + removedRiverRunoffFlux(iCell) ) / ( nAccumulatedCoupled + 1) + avgRemovedIceRunoffFlux(iCell) = ( avgRemovedIceRunoffFlux(iCell) * nAccumulatedCoupled & + + removedIceRunoffFlux(iCell) ) / ( nAccumulatedCoupled + 1) + avgRemovedIceRunoffHeatFlux(iCell) = ( avgRemovedIceRunoffHeatFlux(iCell) * nAccumulatedCoupled & + + removedIceRunoffFlux(iCell)*latent_heat_fusion_mks ) / ( nAccumulatedCoupled + 1) + end do + !$omp end do + !$omp end parallel + + end if + ! accumulate BGC coupling fields if necessary if (config_use_ecosysTracers) then diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index 2a7d999ccc5e..f3c466f15e9b 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -139,37 +139,42 @@ module seq_diag_mct integer(in),parameter :: f_hioff = 9 ! heat : latent, fusion, frozen runoff integer(in),parameter :: f_hsen =10 ! heat : sensible integer(in),parameter :: f_hberg =11 ! heat : data icebergs - integer(in),parameter :: f_hh2ot =12 ! heat : water temperature - integer(in),parameter :: f_wfrz =13 ! water: freezing - integer(in),parameter :: f_wmelt =14 ! water: melting - integer(in),parameter :: f_wrain =15 ! water: precip, liquid - integer(in),parameter :: f_wsnow =16 ! water: precip, frozen - integer(in),parameter :: f_wberg =17 ! water: data icebergs - integer(in),parameter :: f_wevap =18 ! water: evaporation - integer(in),parameter :: f_wroff =19 ! water: runoff/flood - integer(in),parameter :: f_wioff =20 ! water: frozen runoff - integer(in),parameter :: f_wirrig =21 ! water: irrigation - integer(in),parameter :: f_wfrz_16O =22 ! water: freezing - integer(in),parameter :: f_wmelt_16O =23 ! water: melting - integer(in),parameter :: f_wrain_16O =24 ! water: precip, liquid - integer(in),parameter :: f_wsnow_16O =25 ! water: precip, frozen - integer(in),parameter :: f_wevap_16O =26 ! water: evaporation - integer(in),parameter :: f_wroff_16O =27 ! water: runoff/flood - integer(in),parameter :: f_wioff_16O =28 ! water: frozen runoff - integer(in),parameter :: f_wfrz_18O =29 ! water: freezing - integer(in),parameter :: f_wmelt_18O =30 ! water: melting - integer(in),parameter :: f_wrain_18O =31 ! water: precip, liquid - integer(in),parameter :: f_wsnow_18O =32 ! water: precip, frozen - integer(in),parameter :: f_wevap_18O =33 ! water: evaporation - integer(in),parameter :: f_wroff_18O =34 ! water: runoff/flood - integer(in),parameter :: f_wioff_18O =35 ! water: frozen runoff - integer(in),parameter :: f_wfrz_HDO =36 ! water: freezing - integer(in),parameter :: f_wmelt_HDO =37 ! water: melting - integer(in),parameter :: f_wrain_HDO =38 ! water: precip, liquid - integer(in),parameter :: f_wsnow_HDO =39 ! water: precip, frozen - integer(in),parameter :: f_wevap_HDO =40 ! water: evaporation - integer(in),parameter :: f_wroff_HDO =41 ! water: runoff/flood - integer(in),parameter :: f_wioff_HDO =42 ! water: frozen runoff + integer(in),parameter :: f_hism =12 ! heat : ice shelf melt + integer(in),parameter :: f_hriof =13 ! heat : data icebergs + integer(in),parameter :: f_hh2ot =14 ! heat : water temperature + integer(in),parameter :: f_wfrz =15 ! water: freezing + integer(in),parameter :: f_wmelt =16 ! water: melting + integer(in),parameter :: f_wrain =17 ! water: precip, liquid + integer(in),parameter :: f_wsnow =18 ! water: precip, frozen + integer(in),parameter :: f_wevap =19 ! water: evaporation + integer(in),parameter :: f_wroff =20 ! water: runoff/flood + integer(in),parameter :: f_wioff =21 ! water: frozen runoff + integer(in),parameter :: f_wberg =22 ! water: data icebergs + integer(in),parameter :: f_wism =23 ! water: ice-shelf melt + integer(in),parameter :: f_wrrof =24 ! water: removed liquid runoff + integer(in),parameter :: f_wriof =25 ! water: removed ice runoff + integer(in),parameter :: f_wirrig =26 ! water: irrigation + integer(in),parameter :: f_wfrz_16O =27 ! water: freezing + integer(in),parameter :: f_wmelt_16O =28 ! water: melting + integer(in),parameter :: f_wrain_16O =29 ! water: precip, liquid + integer(in),parameter :: f_wsnow_16O =30 ! water: precip, frozen + integer(in),parameter :: f_wevap_16O =31 ! water: evaporation + integer(in),parameter :: f_wroff_16O =32 ! water: runoff/flood + integer(in),parameter :: f_wioff_16O =33 ! water: frozen runoff + integer(in),parameter :: f_wfrz_18O =34 ! water: freezing + integer(in),parameter :: f_wmelt_18O =35 ! water: melting + integer(in),parameter :: f_wrain_18O =36 ! water: precip, liquid + integer(in),parameter :: f_wsnow_18O =37 ! water: precip, frozen + integer(in),parameter :: f_wevap_18O =38 ! water: evaporation + integer(in),parameter :: f_wroff_18O =39 ! water: runoff/flood + integer(in),parameter :: f_wioff_18O =40 ! water: frozen runoff + integer(in),parameter :: f_wfrz_HDO =41 ! water: freezing + integer(in),parameter :: f_wmelt_HDO =42 ! water: melting + integer(in),parameter :: f_wrain_HDO =43 ! water: precip, liquid + integer(in),parameter :: f_wsnow_HDO =44 ! water: precip, frozen + integer(in),parameter :: f_wevap_HDO =45 ! water: evaporation + integer(in),parameter :: f_wroff_HDO =46 ! water: runoff/flood + integer(in),parameter :: f_wioff_HDO =47 ! water: frozen runoff integer(in),parameter :: f_size = f_wioff_HDO ! Total array size of all elements integer(in),parameter :: f_a = f_area ! 1st index for area @@ -189,8 +194,10 @@ module seq_diag_mct (/' area',' hfreeze',' hmelt',' hnetsw',' hlwdn', & ' hlwup',' hlatvap',' hlatfus',' hiroff',' hsen', & - ' hberg',' hh2otemp',' wfreeze',' wmelt',' wrain', & - ' wsnow',' wberg',' wevap',' wrunoff',' wfrzrof', & + ' hberg',' hism',' hriof', & + ' hh2otemp',' wfreeze',' wmelt',' wrain', & + ' wsnow',' wevap',' wrunoff',' wfrzrof', & + ' wberg',' wism',' wrrof',' wriof', & ' wirrig', & ' wfreeze_16O',' wmelt_16O',' wrain_16O',' wsnow_16O', & ' wevap_16O',' wrunoff_16O',' wfrzrof_16O', & @@ -288,6 +295,12 @@ module seq_diag_mct integer :: index_o2x_Fioo_frazil integer :: index_o2x_Fioo_q + integer :: index_o2x_Foxo_ismw + integer :: index_o2x_Foxo_rrofl + integer :: index_o2x_Foxo_rrofi + integer :: index_o2x_Foxo_ismh + integer :: index_o2x_Foxo_rrofih + integer :: index_xao_Faox_lwup integer :: index_xao_Faox_lat integer :: index_xao_Faox_sen @@ -1337,7 +1350,7 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa integer(in) :: kArea ! index of area field in aVect integer(in) :: ko,ki ! fraction indices integer(in) :: lSize ! size of aVect - real(r8) :: ca_i,ca_o ! area of a grid cell + real(r8) :: ca_i,ca_o,ca_c ! area of a grid cell logical,save :: first_time = .true. logical,save :: flds_wiso_ocn = .false. @@ -1373,6 +1386,11 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') index_o2x_Faoo_h2otemp = mct_aVect_indexRA(o2x_o,'Faoo_h2otemp') + index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw') + index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl') + index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi') + index_o2x_Foxo_ismh = mct_aVect_indexRA(o2x_o,'Foxo_ismh') + index_o2x_Foxo_rrofih = mct_aVect_indexRA(o2x_o,'Foxo_rrofih') end if lSize = mct_avect_lSize(o2x_o) @@ -1380,10 +1398,16 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa do n=1,lSize ca_o = dom_o%data%rAttr(kArea,n) * frac_o%rAttr(ko,n) ca_i = dom_o%data%rAttr(kArea,n) * frac_o%rAttr(ki,n) + ca_c = dom_o%data%rAttr(kArea,n) nf = f_area; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_o nf = f_wfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_frazil,n)) nf = f_hfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_q,n)) nf = f_hh2ot; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Faoo_h2otemp,n) + nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) + nf = f_wrrof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) + nf = f_wriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) + nf = f_hism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) + nf = f_hriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) end do end if @@ -1613,8 +1637,8 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) if (present(do_i2x)) then index_i2x_Fioi_melth = mct_aVect_indexRA(i2x_i,'Fioi_melth') index_i2x_Fioi_meltw = mct_aVect_indexRA(i2x_i,'Fioi_meltw') - index_i2x_Fioi_bergh = mct_aVect_indexRA(i2x_i,'PFioi_bergh') - index_i2x_Fioi_bergw = mct_aVect_indexRA(i2x_i,'PFioi_bergw') +! index_i2x_Fioi_bergh = mct_aVect_indexRA(i2x_i,'PFioi_bergh') +! index_i2x_Fioi_bergw = mct_aVect_indexRA(i2x_i,'PFioi_bergw') index_i2x_Fioi_swpen = mct_aVect_indexRA(i2x_i,'Fioi_swpen') index_i2x_Faii_swnet = mct_aVect_indexRA(i2x_i,'Faii_swnet') index_i2x_Faii_lwup = mct_aVect_indexRA(i2x_i,'Faii_lwup') @@ -1650,9 +1674,9 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) nf = f_hlwup ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_lwup,n) nf = f_hlatv ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_lat,n) nf = f_hsen ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_sen,n) - nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergh,n) +! nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergh,n) nf = f_wmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_i*i2x_i%rAttr(index_i2x_Fioi_meltw,n) - nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergw,n) +! nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergw,n) nf = f_wevap ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_evap,n) if ( flds_wiso_ice )then diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index 4b37e40b7b3e..cb41fa6439f2 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -1583,6 +1583,46 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'PFioi_bergw' call metadata_set(attname, longname, stdname, units) + ! Water flux from ice shelf melt + call seq_flds_add(o2x_fluxes,"Foxo_ismw") + longname = 'Water flux due to basal melting of ice shelves' + stdname = 'basal_iceshelf_melt_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_ismw' + call metadata_set(attname, longname, stdname, units) + + ! Heat flux from ice shelf melt + call seq_flds_add(o2x_fluxes,"Foxo_ismh") + longname = 'Heat flux due to basal melting of ice shelves' + stdname = 'basal_iceshelf_heat_flux' + units = 'W m-2' + attname = 'Foxo_ismh' + call metadata_set(attname, longname, stdname, units) + + ! Water flux from removed liquid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofl") + longname = 'Water flux due to removed liqiud runoff' + stdname = 'removed_liquid_runoff_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_rrofl' + call metadata_set(attname, longname, stdname, units) + + ! Water flux from removed solid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofi") + longname = 'Water flux due to removed solid runoff' + stdname = 'removed_solid_runoff_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_rrofi' + call metadata_set(attname, longname, stdname, units) + + ! Heat flux from removed solid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofih") + longname = 'Heat flux due to removed solid runoff' + stdname = 'removed_solid_runoff_heat_flux' + units = 'W m-2' + attname = 'Foxo_rrofih' + call metadata_set(attname, longname, stdname, units) + ! Salt flux call seq_flds_add(i2x_fluxes,"Fioi_salt") call seq_flds_add(x2o_fluxes,"Fioi_salt") From b505550e8b776dbba982f8b613733a2b21b63b27 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Thu, 15 Feb 2024 16:07:09 -0600 Subject: [PATCH 02/15] Combining polar terms into single row entry --- .../mpas-ocean/driver/mpaso_cpl_indices.F | 10 +- driver-mct/main/seq_diag_mct.F90 | 104 +++++++++--------- 2 files changed, 56 insertions(+), 58 deletions(-) diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index 10cbfe80e968..5fd341993c53 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -192,12 +192,12 @@ subroutine mpaso_cpl_indices_set( ) index_o2x_Faoo_fdms_ocn = mct_avect_indexra(o2x,'Faoo_fdms_ocn',perrWith='quiet') index_o2x_So_ssh = mct_avect_indexra(o2x,'So_ssh') - index_o2x_Foxo_ismw = mct_avect_indexra(o2x,'Foxo_ismw') - index_o2x_Foxo_rrofl = mct_avect_indexra(o2x,'Foxo_rrofl') - index_o2x_Foxo_rrofi = mct_avect_indexra(o2x,'Foxo_rrofi') + index_o2x_Foxo_ismw = mct_avect_indexra(o2x,'Foxo_ismw',perrWith='quiet') + index_o2x_Foxo_rrofl = mct_avect_indexra(o2x,'Foxo_rrofl',perrWith='quiet') + index_o2x_Foxo_rrofi = mct_avect_indexra(o2x,'Foxo_rrofi',perrWith='quiet') - index_o2x_Foxo_ismh = mct_avect_indexra(o2x,'Foxo_ismh') - index_o2x_Foxo_rrofih = mct_avect_indexra(o2x,'Foxo_rrofih') + index_o2x_Foxo_ismh = mct_avect_indexra(o2x,'Foxo_ismh',perrWith='quiet') + index_o2x_Foxo_rrofih = mct_avect_indexra(o2x,'Foxo_rrofih',perrWith='quiet') index_o2x_So_blt = mct_avect_indexra(o2x,'So_blt') index_o2x_So_bls = mct_avect_indexra(o2x,'So_bls') diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index f3c466f15e9b..9d9df6fd3ab4 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -138,43 +138,38 @@ module seq_diag_mct integer(in),parameter :: f_hlatf = 8 ! heat : latent, fusion, snow integer(in),parameter :: f_hioff = 9 ! heat : latent, fusion, frozen runoff integer(in),parameter :: f_hsen =10 ! heat : sensible - integer(in),parameter :: f_hberg =11 ! heat : data icebergs - integer(in),parameter :: f_hism =12 ! heat : ice shelf melt - integer(in),parameter :: f_hriof =13 ! heat : data icebergs - integer(in),parameter :: f_hh2ot =14 ! heat : water temperature - integer(in),parameter :: f_wfrz =15 ! water: freezing - integer(in),parameter :: f_wmelt =16 ! water: melting - integer(in),parameter :: f_wrain =17 ! water: precip, liquid - integer(in),parameter :: f_wsnow =18 ! water: precip, frozen - integer(in),parameter :: f_wevap =19 ! water: evaporation - integer(in),parameter :: f_wroff =20 ! water: runoff/flood - integer(in),parameter :: f_wioff =21 ! water: frozen runoff - integer(in),parameter :: f_wberg =22 ! water: data icebergs - integer(in),parameter :: f_wism =23 ! water: ice-shelf melt - integer(in),parameter :: f_wrrof =24 ! water: removed liquid runoff - integer(in),parameter :: f_wriof =25 ! water: removed ice runoff - integer(in),parameter :: f_wirrig =26 ! water: irrigation - integer(in),parameter :: f_wfrz_16O =27 ! water: freezing - integer(in),parameter :: f_wmelt_16O =28 ! water: melting - integer(in),parameter :: f_wrain_16O =29 ! water: precip, liquid - integer(in),parameter :: f_wsnow_16O =30 ! water: precip, frozen - integer(in),parameter :: f_wevap_16O =31 ! water: evaporation - integer(in),parameter :: f_wroff_16O =32 ! water: runoff/flood - integer(in),parameter :: f_wioff_16O =33 ! water: frozen runoff - integer(in),parameter :: f_wfrz_18O =34 ! water: freezing - integer(in),parameter :: f_wmelt_18O =35 ! water: melting - integer(in),parameter :: f_wrain_18O =36 ! water: precip, liquid - integer(in),parameter :: f_wsnow_18O =37 ! water: precip, frozen - integer(in),parameter :: f_wevap_18O =38 ! water: evaporation - integer(in),parameter :: f_wroff_18O =39 ! water: runoff/flood - integer(in),parameter :: f_wioff_18O =40 ! water: frozen runoff - integer(in),parameter :: f_wfrz_HDO =41 ! water: freezing - integer(in),parameter :: f_wmelt_HDO =42 ! water: melting - integer(in),parameter :: f_wrain_HDO =43 ! water: precip, liquid - integer(in),parameter :: f_wsnow_HDO =44 ! water: precip, frozen - integer(in),parameter :: f_wevap_HDO =45 ! water: evaporation - integer(in),parameter :: f_wroff_HDO =46 ! water: runoff/flood - integer(in),parameter :: f_wioff_HDO =47 ! water: frozen runoff + integer(in),parameter :: f_hpolar =11 ! heat : AIS imbalance + integer(in),parameter :: f_hh2ot =12 ! heat : water temperature + integer(in),parameter :: f_wfrz =13 ! water: freezing + integer(in),parameter :: f_wmelt =14 ! water: melting + integer(in),parameter :: f_wrain =15 ! water: precip, liquid + integer(in),parameter :: f_wsnow =16 ! water: precip, frozen + integer(in),parameter :: f_wpolar =17 ! water: AIS imbalance + integer(in),parameter :: f_wevap =18 ! water: evaporation + integer(in),parameter :: f_wroff =19 ! water: runoff/flood + integer(in),parameter :: f_wioff =20 ! water: frozen runoff + integer(in),parameter :: f_wirrig =21 ! water: irrigation + integer(in),parameter :: f_wfrz_16O =22 ! water: freezing + integer(in),parameter :: f_wmelt_16O =23 ! water: melting + integer(in),parameter :: f_wrain_16O =24 ! water: precip, liquid + integer(in),parameter :: f_wsnow_16O =25 ! water: precip, frozen + integer(in),parameter :: f_wevap_16O =26 ! water: evaporation + integer(in),parameter :: f_wroff_16O =27 ! water: runoff/flood + integer(in),parameter :: f_wioff_16O =28 ! water: frozen runoff + integer(in),parameter :: f_wfrz_18O =29 ! water: freezing + integer(in),parameter :: f_wmelt_18O =30 ! water: melting + integer(in),parameter :: f_wrain_18O =31 ! water: precip, liquid + integer(in),parameter :: f_wsnow_18O =32 ! water: precip, frozen + integer(in),parameter :: f_wevap_18O =33 ! water: evaporation + integer(in),parameter :: f_wroff_18O =34 ! water: runoff/flood + integer(in),parameter :: f_wioff_18O =35 ! water: frozen runoff + integer(in),parameter :: f_wfrz_HDO =36 ! water: freezing + integer(in),parameter :: f_wmelt_HDO =37 ! water: melting + integer(in),parameter :: f_wrain_HDO =38 ! water: precip, liquid + integer(in),parameter :: f_wsnow_HDO =39 ! water: precip, frozen + integer(in),parameter :: f_wevap_HDO =40 ! water: evaporation + integer(in),parameter :: f_wroff_HDO =41 ! water: runoff/flood + integer(in),parameter :: f_wioff_HDO =42 ! water: frozen runoff integer(in),parameter :: f_size = f_wioff_HDO ! Total array size of all elements integer(in),parameter :: f_a = f_area ! 1st index for area @@ -194,10 +189,8 @@ module seq_diag_mct (/' area',' hfreeze',' hmelt',' hnetsw',' hlwdn', & ' hlwup',' hlatvap',' hlatfus',' hiroff',' hsen', & - ' hberg',' hism',' hriof', & - ' hh2otemp',' wfreeze',' wmelt',' wrain', & - ' wsnow',' wevap',' wrunoff',' wfrzrof', & - ' wberg',' wism',' wrrof',' wriof', & + ' hpolar',' hh2otemp',' wfreeze',' wmelt',' wrain', & + ' wsnow',' wpolar',' wevap',' wrunoff',' wfrzrof', & ' wirrig', & ' wfreeze_16O',' wmelt_16O',' wrain_16O',' wsnow_16O', & ' wevap_16O',' wrunoff_16O',' wfrzrof_16O', & @@ -1386,11 +1379,11 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') index_o2x_Faoo_h2otemp = mct_aVect_indexRA(o2x_o,'Faoo_h2otemp') - index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw') - index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl') - index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi') - index_o2x_Foxo_ismh = mct_aVect_indexRA(o2x_o,'Foxo_ismh') - index_o2x_Foxo_rrofih = mct_aVect_indexRA(o2x_o,'Foxo_rrofih') + index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw',perrWith='quiet') + index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl',perrWith='quiet') + index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi',perrWith='quiet') + index_o2x_Foxo_ismh = mct_aVect_indexRA(o2x_o,'Foxo_ismh',perrWith='quiet') + index_o2x_Foxo_rrofih = mct_aVect_indexRA(o2x_o,'Foxo_rrofih',perrWith='quiet') end if lSize = mct_avect_lSize(o2x_o) @@ -1403,11 +1396,16 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_wfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_frazil,n)) nf = f_hfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_q,n)) nf = f_hh2ot; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Faoo_h2otemp,n) - nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) - nf = f_wrrof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) - nf = f_wriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) - nf = f_hism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) - nf = f_hriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) +! nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) +! nf = f_wrrof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) +! nf = f_wriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) +! nf = f_hism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) +! nf = f_hriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) end do end if @@ -1514,11 +1512,11 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_hmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_melth,n) nf = f_hswnet; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_swnet,n) nf = f_hlwdn ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_lwdn,n) - nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergh,n) + nf = f_hpolar; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergh,n) nf = f_wmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_meltw,n) nf = f_wrain ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_rain,n) nf = f_wsnow ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_snow,n) - nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) + nf = f_wpolar; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) nf = f_wroff ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_rofl,n) nf = f_wioff ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_rofi,n) From 2f4d71369e33b94a1e821901155d9281962b4b87 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Thu, 22 Feb 2024 12:18:15 -0600 Subject: [PATCH 03/15] Only send new coupling fields in polar configurations --- components/mpas-ocean/driver/ocn_comp_mct.F | 1 - driver-mct/cime_config/buildnml | 1 + .../cime_config/config_component_e3sm.xml | 12 +++ .../cime_config/namelist_definition_drv.xml | 12 +++ driver-mct/main/seq_diag_mct.F90 | 37 ++++----- driver-mct/shr/seq_flds_mod.F90 | 83 +++++++++++-------- 6 files changed, 88 insertions(+), 58 deletions(-) diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 67f465b9332b..86ea9290c01c 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -689,7 +689,6 @@ end subroutine xml_stream_get_attributes if ( ierr /= 0 ) then write(ocnLogUnit,*) 'Fail to set define dom fields ' endif - ent_type = 1 ! cells diff --git a/driver-mct/cime_config/buildnml b/driver-mct/cime_config/buildnml index 426995b8ffb6..4938e9da0b18 100755 --- a/driver-mct/cime_config/buildnml +++ b/driver-mct/cime_config/buildnml @@ -40,6 +40,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config['CPL_ALBAV'] = case.get_value('CPL_ALBAV') config['CPL_EPBAL'] = case.get_value('CPL_EPBAL') config['FLDS_WISO'] = case.get_value('FLDS_WISO') + config['FLDS_POLAR'] = case.get_value('FLDS_POLAR') config['BUDGETS'] = case.get_value('BUDGETS') config['MACH'] = case.get_value('MACH') config['MPILIB'] = case.get_value('MPILIB') diff --git a/driver-mct/cime_config/config_component_e3sm.xml b/driver-mct/cime_config/config_component_e3sm.xml index 5d582b41b438..a6f756b24b2e 100755 --- a/driver-mct/cime_config/config_component_e3sm.xml +++ b/driver-mct/cime_config/config_component_e3sm.xml @@ -172,6 +172,18 @@ Turn on the passing of water isotope fields through the coupler + + logical + TRUE,FALSE + FALSE + + TRUE + + run_flags + env_run.xml + Turn on the passing of polar fields through the coupler + + char minus1p8,linear_salt,mushy diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index 038444efa94e..40c912b33eaf 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -137,6 +137,18 @@ + + logical + seq_flds + seq_cplflds_inparm + + If set to .true. Polar fields will be passed from the ocean to the coupler. + + + $FLDS_POLAR + + + logical seq_flds diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index 9d9df6fd3ab4..627cbcc001e6 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -317,8 +317,6 @@ module seq_diag_mct integer :: index_i2x_Fioi_melth integer :: index_i2x_Fioi_meltw - integer :: index_i2x_Fioi_bergh - integer :: index_i2x_Fioi_bergw integer :: index_i2x_Fioi_salt integer :: index_i2x_Faii_swnet integer :: index_i2x_Fioi_swpen @@ -1346,6 +1344,7 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa real(r8) :: ca_i,ca_o,ca_c ! area of a grid cell logical,save :: first_time = .true. logical,save :: flds_wiso_ocn = .false. + logical,save :: flds_polar = .false. !----- formats ----- character(*),parameter :: subName = '(seq_diag_ocn_mct) ' @@ -1379,11 +1378,14 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') index_o2x_Faoo_h2otemp = mct_aVect_indexRA(o2x_o,'Faoo_h2otemp') - index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw',perrWith='quiet') - index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl',perrWith='quiet') - index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi',perrWith='quiet') - index_o2x_Foxo_ismh = mct_aVect_indexRA(o2x_o,'Foxo_ismh',perrWith='quiet') - index_o2x_Foxo_rrofih = mct_aVect_indexRA(o2x_o,'Foxo_rrofih',perrWith='quiet') + index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw',perrWith='quiet') + if ( index_o2x_Foxo_ismw /= 0 ) flds_polar = .true. + if ( flds_polar ) then + index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl',perrWith='quiet') + index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi',perrWith='quiet') + index_o2x_Foxo_ismh = mct_aVect_indexRA(o2x_o,'Foxo_ismh',perrWith='quiet') + index_o2x_Foxo_rrofih = mct_aVect_indexRA(o2x_o,'Foxo_rrofih',perrWith='quiet') + end if end if lSize = mct_avect_lSize(o2x_o) @@ -1396,16 +1398,13 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_wfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_frazil,n)) nf = f_hfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_q,n)) nf = f_hh2ot; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Faoo_h2otemp,n) - nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) - nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) - nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) -! nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) -! nf = f_wrrof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) -! nf = f_wriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) - nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) - nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) -! nf = f_hism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) -! nf = f_hriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) + if (flds_polar) then + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) + end if end do end if @@ -1635,8 +1634,6 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) if (present(do_i2x)) then index_i2x_Fioi_melth = mct_aVect_indexRA(i2x_i,'Fioi_melth') index_i2x_Fioi_meltw = mct_aVect_indexRA(i2x_i,'Fioi_meltw') -! index_i2x_Fioi_bergh = mct_aVect_indexRA(i2x_i,'PFioi_bergh') -! index_i2x_Fioi_bergw = mct_aVect_indexRA(i2x_i,'PFioi_bergw') index_i2x_Fioi_swpen = mct_aVect_indexRA(i2x_i,'Fioi_swpen') index_i2x_Faii_swnet = mct_aVect_indexRA(i2x_i,'Faii_swnet') index_i2x_Faii_lwup = mct_aVect_indexRA(i2x_i,'Faii_lwup') @@ -1672,9 +1669,7 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) nf = f_hlwup ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_lwup,n) nf = f_hlatv ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_lat,n) nf = f_hsen ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_sen,n) -! nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergh,n) nf = f_wmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_i*i2x_i%rAttr(index_i2x_Fioi_meltw,n) -! nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergw,n) nf = f_wevap ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_evap,n) if ( flds_wiso_ice )then diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index cb41fa6439f2..bbc7795442d0 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -379,10 +379,11 @@ subroutine seq_flds_set(nmlfile, ID, infodata) logical :: flds_co2_dmsa logical :: flds_bgc_oi logical :: flds_wiso + logical :: flds_polar integer :: glc_nec namelist /seq_cplflds_inparm/ & - flds_co2a, flds_co2b, flds_co2c, flds_co2_dmsa, flds_wiso, glc_nec, & + flds_co2a, flds_co2b, flds_co2c, flds_co2_dmsa, flds_wiso, flds_polar, glc_nec, & ice_ncat, seq_flds_i2o_per_cat, flds_bgc_oi, & nan_check_component_fields, rof_heat, atm_flux_method, atm_gustiness, & rof2ocn_nutrients, lnd_rof_two_way, ocn_rof_two_way, rof_sed @@ -416,6 +417,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) flds_co2_dmsa = .false. flds_bgc_oi = .false. flds_wiso = .false. + flds_polar = .false. glc_nec = 0 ice_ncat = 1 seq_flds_i2o_per_cat = .false. @@ -449,6 +451,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call shr_mpi_bcast(flds_co2_dmsa, mpicom) call shr_mpi_bcast(flds_bgc_oi , mpicom) call shr_mpi_bcast(flds_wiso , mpicom) + call shr_mpi_bcast(flds_polar , mpicom) call shr_mpi_bcast(glc_nec , mpicom) call shr_mpi_bcast(ice_ncat , mpicom) call shr_mpi_bcast(seq_flds_i2o_per_cat, mpicom) @@ -1583,45 +1586,53 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'PFioi_bergw' call metadata_set(attname, longname, stdname, units) - ! Water flux from ice shelf melt - call seq_flds_add(o2x_fluxes,"Foxo_ismw") - longname = 'Water flux due to basal melting of ice shelves' - stdname = 'basal_iceshelf_melt_flux' - units = 'kg m-2 s-1' - attname = 'Foxo_ismw' - call metadata_set(attname, longname, stdname, units) + !-------------------------------- + ! ocn<->cpl only exchange - Polar + !-------------------------------- - ! Heat flux from ice shelf melt - call seq_flds_add(o2x_fluxes,"Foxo_ismh") - longname = 'Heat flux due to basal melting of ice shelves' - stdname = 'basal_iceshelf_heat_flux' - units = 'W m-2' - attname = 'Foxo_ismh' - call metadata_set(attname, longname, stdname, units) + if (flds_polar) then - ! Water flux from removed liquid runoff - call seq_flds_add(o2x_fluxes,"Foxo_rrofl") - longname = 'Water flux due to removed liqiud runoff' - stdname = 'removed_liquid_runoff_flux' - units = 'kg m-2 s-1' - attname = 'Foxo_rrofl' - call metadata_set(attname, longname, stdname, units) + ! Water flux from ice shelf melt + call seq_flds_add(o2x_fluxes,"Foxo_ismw") + longname = 'Water flux due to basal melting of ice shelves' + stdname = 'basal_iceshelf_melt_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_ismw' + call metadata_set(attname, longname, stdname, units) - ! Water flux from removed solid runoff - call seq_flds_add(o2x_fluxes,"Foxo_rrofi") - longname = 'Water flux due to removed solid runoff' - stdname = 'removed_solid_runoff_flux' - units = 'kg m-2 s-1' - attname = 'Foxo_rrofi' - call metadata_set(attname, longname, stdname, units) + ! Heat flux from ice shelf melt + call seq_flds_add(o2x_fluxes,"Foxo_ismh") + longname = 'Heat flux due to basal melting of ice shelves' + stdname = 'basal_iceshelf_heat_flux' + units = 'W m-2' + attname = 'Foxo_ismh' + call metadata_set(attname, longname, stdname, units) - ! Heat flux from removed solid runoff - call seq_flds_add(o2x_fluxes,"Foxo_rrofih") - longname = 'Heat flux due to removed solid runoff' - stdname = 'removed_solid_runoff_heat_flux' - units = 'W m-2' - attname = 'Foxo_rrofih' - call metadata_set(attname, longname, stdname, units) + ! Water flux from removed liquid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofl") + longname = 'Water flux due to removed liqiud runoff' + stdname = 'removed_liquid_runoff_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_rrofl' + call metadata_set(attname, longname, stdname, units) + + ! Water flux from removed solid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofi") + longname = 'Water flux due to removed solid runoff' + stdname = 'removed_solid_runoff_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_rrofi' + call metadata_set(attname, longname, stdname, units) + + ! Heat flux from removed solid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofih") + longname = 'Heat flux due to removed solid runoff' + stdname = 'removed_solid_runoff_heat_flux' + units = 'W m-2' + attname = 'Foxo_rrofih' + call metadata_set(attname, longname, stdname, units) + + end if ! Salt flux call seq_flds_add(i2x_fluxes,"Fioi_salt") From d7adcea88af839c46c1f0137bad102a77fc38ecc Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Thu, 22 Feb 2024 12:20:04 -0600 Subject: [PATCH 04/15] Adding analogs to driver-moab --- driver-moab/cime_config/buildnml | 1 + .../cime_config/config_component_e3sm.xml | 12 +++++ .../cime_config/namelist_definition_drv.xml | 12 +++++ driver-moab/main/seq_diag_mct.F90 | 37 ++++++++++++---- driver-moab/shr/seq_flds_mod.F90 | 44 ++++++++++++++++++- 5 files changed, 96 insertions(+), 10 deletions(-) diff --git a/driver-moab/cime_config/buildnml b/driver-moab/cime_config/buildnml index 0d282d402159..cfaa3c63f8bc 100755 --- a/driver-moab/cime_config/buildnml +++ b/driver-moab/cime_config/buildnml @@ -40,6 +40,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config['CPL_ALBAV'] = case.get_value('CPL_ALBAV') config['CPL_EPBAL'] = case.get_value('CPL_EPBAL') config['FLDS_WISO'] = case.get_value('FLDS_WISO') + config['FLDS_POLAR'] = case.get_value('FLDS_POLAR') config['BUDGETS'] = case.get_value('BUDGETS') config['MACH'] = case.get_value('MACH') config['MPILIB'] = case.get_value('MPILIB') diff --git a/driver-moab/cime_config/config_component_e3sm.xml b/driver-moab/cime_config/config_component_e3sm.xml index dd7a5ddb6c15..708823bc0700 100644 --- a/driver-moab/cime_config/config_component_e3sm.xml +++ b/driver-moab/cime_config/config_component_e3sm.xml @@ -172,6 +172,18 @@ Turn on the passing of water isotope fields through the coupler + + logical + TRUE,FALSE + FALSE + + TRUE + + run_flags + env_run.xml + Turn on the passing of polar fields through the coupler + + char minus1p8,linear_salt,mushy diff --git a/driver-moab/cime_config/namelist_definition_drv.xml b/driver-moab/cime_config/namelist_definition_drv.xml index 203c6cf5f075..49c77d853c55 100644 --- a/driver-moab/cime_config/namelist_definition_drv.xml +++ b/driver-moab/cime_config/namelist_definition_drv.xml @@ -149,6 +149,18 @@ + + logical + seq_flds + seq_cplflds_inparm + + If set to .true. Polar fields will be passed from the ocean to the coupler. + + + $FLDS_POLAR + + + char seq_flds diff --git a/driver-moab/main/seq_diag_mct.F90 b/driver-moab/main/seq_diag_mct.F90 index 2a7d999ccc5e..34f97cb78ffa 100644 --- a/driver-moab/main/seq_diag_mct.F90 +++ b/driver-moab/main/seq_diag_mct.F90 @@ -138,13 +138,13 @@ module seq_diag_mct integer(in),parameter :: f_hlatf = 8 ! heat : latent, fusion, snow integer(in),parameter :: f_hioff = 9 ! heat : latent, fusion, frozen runoff integer(in),parameter :: f_hsen =10 ! heat : sensible - integer(in),parameter :: f_hberg =11 ! heat : data icebergs + integer(in),parameter :: f_hpolar =11 ! heat : AIS imbalance integer(in),parameter :: f_hh2ot =12 ! heat : water temperature integer(in),parameter :: f_wfrz =13 ! water: freezing integer(in),parameter :: f_wmelt =14 ! water: melting integer(in),parameter :: f_wrain =15 ! water: precip, liquid integer(in),parameter :: f_wsnow =16 ! water: precip, frozen - integer(in),parameter :: f_wberg =17 ! water: data icebergs + integer(in),parameter :: f_wpolar =17 ! water: AIS imbalance integer(in),parameter :: f_wevap =18 ! water: evaporation integer(in),parameter :: f_wroff =19 ! water: runoff/flood integer(in),parameter :: f_wioff =20 ! water: frozen runoff @@ -189,8 +189,8 @@ module seq_diag_mct (/' area',' hfreeze',' hmelt',' hnetsw',' hlwdn', & ' hlwup',' hlatvap',' hlatfus',' hiroff',' hsen', & - ' hberg',' hh2otemp',' wfreeze',' wmelt',' wrain', & - ' wsnow',' wberg',' wevap',' wrunoff',' wfrzrof', & + ' hpolar',' hh2otemp',' wfreeze',' wmelt',' wrain', & + ' wsnow',' wpolar',' wevap',' wrunoff',' wfrzrof', & ' wirrig', & ' wfreeze_16O',' wmelt_16O',' wrain_16O',' wsnow_16O', & ' wevap_16O',' wrunoff_16O',' wfrzrof_16O', & @@ -288,6 +288,12 @@ module seq_diag_mct integer :: index_o2x_Fioo_frazil integer :: index_o2x_Fioo_q + integer :: index_o2x_Foxo_ismw + integer :: index_o2x_Foxo_rrofl + integer :: index_o2x_Foxo_rrofi + integer :: index_o2x_Foxo_ismh + integer :: index_o2x_Foxo_rrofih + integer :: index_xao_Faox_lwup integer :: index_xao_Faox_lat integer :: index_xao_Faox_sen @@ -1337,9 +1343,10 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa integer(in) :: kArea ! index of area field in aVect integer(in) :: ko,ki ! fraction indices integer(in) :: lSize ! size of aVect - real(r8) :: ca_i,ca_o ! area of a grid cell + real(r8) :: ca_i,ca_o,ca_c ! area of a grid cell logical,save :: first_time = .true. logical,save :: flds_wiso_ocn = .false. + logical,save :: flds_polar = .false. !----- formats ----- character(*),parameter :: subName = '(seq_diag_ocn_mct) ' @@ -1373,6 +1380,14 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') index_o2x_Faoo_h2otemp = mct_aVect_indexRA(o2x_o,'Faoo_h2otemp') + index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw',perrWith='quiet') + if ( index_o2x_Foxo_ismw /= 0 ) flds_polar = .true. + if ( flds_polar ) then + index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl',perrWith='quiet') + index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi',perrWith='quiet') + index_o2x_Foxo_ismh = mct_aVect_indexRA(o2x_o,'Foxo_ismh',perrWith='quiet') + index_o2x_Foxo_rrofih = mct_aVect_indexRA(o2x_o,'Foxo_rrofih',perrWith='quiet') + end if end if lSize = mct_avect_lSize(o2x_o) @@ -1380,10 +1395,18 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa do n=1,lSize ca_o = dom_o%data%rAttr(kArea,n) * frac_o%rAttr(ko,n) ca_i = dom_o%data%rAttr(kArea,n) * frac_o%rAttr(ki,n) + ca_c = dom_o%data%rAttr(kArea,n) nf = f_area; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_o nf = f_wfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_frazil,n)) nf = f_hfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_q,n)) nf = f_hh2ot; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Faoo_h2otemp,n) + if (flds_polar) then + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) + end if end do end if @@ -1613,8 +1636,6 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) if (present(do_i2x)) then index_i2x_Fioi_melth = mct_aVect_indexRA(i2x_i,'Fioi_melth') index_i2x_Fioi_meltw = mct_aVect_indexRA(i2x_i,'Fioi_meltw') - index_i2x_Fioi_bergh = mct_aVect_indexRA(i2x_i,'PFioi_bergh') - index_i2x_Fioi_bergw = mct_aVect_indexRA(i2x_i,'PFioi_bergw') index_i2x_Fioi_swpen = mct_aVect_indexRA(i2x_i,'Fioi_swpen') index_i2x_Faii_swnet = mct_aVect_indexRA(i2x_i,'Faii_swnet') index_i2x_Faii_lwup = mct_aVect_indexRA(i2x_i,'Faii_lwup') @@ -1650,9 +1671,7 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) nf = f_hlwup ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_lwup,n) nf = f_hlatv ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_lat,n) nf = f_hsen ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_sen,n) - nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergh,n) nf = f_wmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_i*i2x_i%rAttr(index_i2x_Fioi_meltw,n) - nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergw,n) nf = f_wevap ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_evap,n) if ( flds_wiso_ice )then diff --git a/driver-moab/shr/seq_flds_mod.F90 b/driver-moab/shr/seq_flds_mod.F90 index e03771a7a9c6..3fafa8cd9785 100644 --- a/driver-moab/shr/seq_flds_mod.F90 +++ b/driver-moab/shr/seq_flds_mod.F90 @@ -395,10 +395,11 @@ subroutine seq_flds_set(nmlfile, ID, infodata) logical :: flds_co2_dmsa logical :: flds_bgc_oi logical :: flds_wiso + logical :: flds_polar integer :: glc_nec namelist /seq_cplflds_inparm/ & - flds_co2a, flds_co2b, flds_co2c, flds_co2_dmsa, flds_wiso, glc_nec, & + flds_co2a, flds_co2b, flds_co2c, flds_co2_dmsa, flds_wiso, flds_polar, glc_nec, & ice_ncat, seq_flds_i2o_per_cat, flds_bgc_oi, & nan_check_component_fields, rof_heat, atm_flux_method, atm_gustiness, & rof2ocn_nutrients, lnd_rof_two_way, ocn_rof_two_way, rof_sed @@ -435,6 +436,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) flds_co2_dmsa = .false. flds_bgc_oi = .false. flds_wiso = .false. + flds_polar = .false. glc_nec = 0 ice_ncat = 1 seq_flds_i2o_per_cat = .false. @@ -468,6 +470,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call shr_mpi_bcast(flds_co2_dmsa, mpicom) call shr_mpi_bcast(flds_bgc_oi , mpicom) call shr_mpi_bcast(flds_wiso , mpicom) + call shr_mpi_bcast(flds_polar , mpicom) call shr_mpi_bcast(glc_nec , mpicom) call shr_mpi_bcast(ice_ncat , mpicom) call shr_mpi_bcast(seq_flds_i2o_per_cat, mpicom) @@ -1602,6 +1605,45 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'PFioi_bergw' call metadata_set(attname, longname, stdname, units) + !-------------------------------- + ! ocn<->cpl only exchange - Polar + !-------------------------------- + if (flds_polar) then + + ! Water flux from ice shelf melt + call seq_flds_add(o2x_fluxes,"Foxo_ismw") + longname = 'Water flux due to basal melting of ice shelves' + stdname = 'basal_iceshelf_melt_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_ismw' + call metadata_set(attname, longname, stdname, units) + + ! Heat flux from ice shelf melt + call seq_flds_add(o2x_fluxes,"Foxo_ismh") + longname = 'Heat flux due to basal melting of ice shelves' + stdname = 'basal_iceshelf_heat_flux' + units = 'W m-2' + attname = 'Foxo_ismh' + call metadata_set(attname, longname, stdname, units) + + ! Water flux from removed solid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofi") + longname = 'Water flux due to removed solid runoff' + stdname = 'removed_solid_runoff_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_rrofi' + call metadata_set(attname, longname, stdname, units) + + ! Heat flux from removed solid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofih") + longname = 'Heat flux due to removed solid runoff' + stdname = 'removed_solid_runoff_heat_flux' + units = 'W m-2' + attname = 'Foxo_rrofih' + call metadata_set(attname, longname, stdname, units) + + end if + ! Salt flux call seq_flds_add(i2x_fluxes,"Fioi_salt") call seq_flds_add(x2o_fluxes,"Fioi_salt") From c762d3ea531e20682261ad179565ab3576a6a6e3 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Sun, 25 Feb 2024 13:11:18 -0600 Subject: [PATCH 05/15] Making conditional for flds_polar more verbose --- driver-mct/cime_config/config_component_e3sm.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver-mct/cime_config/config_component_e3sm.xml b/driver-mct/cime_config/config_component_e3sm.xml index a6f756b24b2e..b7a85c5e2cb7 100755 --- a/driver-mct/cime_config/config_component_e3sm.xml +++ b/driver-mct/cime_config/config_component_e3sm.xml @@ -177,7 +177,9 @@ TRUE,FALSE FALSE - TRUE + TRUE + TRUE + TRUE run_flags env_run.xml From 8d0942f8a4cb9ee2e639870ce86dbaabe28c2fd4 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Sun, 25 Feb 2024 13:12:11 -0600 Subject: [PATCH 06/15] Remove setting flds_polar by xml so it can be set in user_nl_cpl --- driver-mct/cime_config/namelist_definition_drv.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index 40c912b33eaf..7fbf83688c8a 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -137,7 +137,7 @@ - + logical seq_flds seq_cplflds_inparm From dc4b9c0ef5fc42f2523134a646f4fb8044dc2fd6 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Sun, 25 Feb 2024 13:15:39 -0600 Subject: [PATCH 07/15] Moving Registry unit changes out of this branch to its own --- .../Registry_conservation_check.xml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/components/mpas-ocean/src/analysis_members/Registry_conservation_check.xml b/components/mpas-ocean/src/analysis_members/Registry_conservation_check.xml index 295ad031930c..5c20fd0a5672 100644 --- a/components/mpas-ocean/src/analysis_members/Registry_conservation_check.xml +++ b/components/mpas-ocean/src/analysis_members/Registry_conservation_check.xml @@ -129,43 +129,43 @@ - - - - - - - - - - - - From 6d1b8a9201e681f0f35f32760ae25ef6a76ba548 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Sun, 25 Feb 2024 18:01:52 -0600 Subject: [PATCH 08/15] changes to driver-moab files to match driver-mct --- driver-moab/cime_config/config_component_e3sm.xml | 4 +++- driver-moab/cime_config/namelist_definition_drv.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/driver-moab/cime_config/config_component_e3sm.xml b/driver-moab/cime_config/config_component_e3sm.xml index 708823bc0700..1d2b6b2e61d6 100644 --- a/driver-moab/cime_config/config_component_e3sm.xml +++ b/driver-moab/cime_config/config_component_e3sm.xml @@ -177,7 +177,9 @@ TRUE,FALSE FALSE - TRUE + TRUE + TRUE + TRUE run_flags env_run.xml diff --git a/driver-moab/cime_config/namelist_definition_drv.xml b/driver-moab/cime_config/namelist_definition_drv.xml index 49c77d853c55..5510783582f9 100644 --- a/driver-moab/cime_config/namelist_definition_drv.xml +++ b/driver-moab/cime_config/namelist_definition_drv.xml @@ -149,7 +149,7 @@ - + logical seq_flds seq_cplflds_inparm From 5b24073c4dea30eb34e4905356ceed738e2896df Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Tue, 27 Feb 2024 12:22:56 -0600 Subject: [PATCH 09/15] Changing sign on ismh term in hpolar budget, correcting berg terms in polar sum in driver-moab --- driver-mct/main/seq_diag_mct.F90 | 2 +- driver-moab/main/seq_diag_mct.F90 | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index 627cbcc001e6..bb597fd9783d 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -1402,7 +1402,7 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) - nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) end if end do diff --git a/driver-moab/main/seq_diag_mct.F90 b/driver-moab/main/seq_diag_mct.F90 index 34f97cb78ffa..bb597fd9783d 100644 --- a/driver-moab/main/seq_diag_mct.F90 +++ b/driver-moab/main/seq_diag_mct.F90 @@ -317,8 +317,6 @@ module seq_diag_mct integer :: index_i2x_Fioi_melth integer :: index_i2x_Fioi_meltw - integer :: index_i2x_Fioi_bergh - integer :: index_i2x_Fioi_bergw integer :: index_i2x_Fioi_salt integer :: index_i2x_Faii_swnet integer :: index_i2x_Fioi_swpen @@ -1404,7 +1402,7 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) - nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) end if end do @@ -1513,11 +1511,11 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_hmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_melth,n) nf = f_hswnet; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_swnet,n) nf = f_hlwdn ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_lwdn,n) - nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergh,n) + nf = f_hpolar; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergh,n) nf = f_wmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_meltw,n) nf = f_wrain ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_rain,n) nf = f_wsnow ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_snow,n) - nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) + nf = f_wpolar; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) nf = f_wroff ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_rofl,n) nf = f_wioff ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_rofi,n) From 8ab1f4eae505ad9ff254217ac2452feb65cc0797 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Tue, 27 Feb 2024 19:02:26 -0600 Subject: [PATCH 10/15] Adding missing removed liquid runoff field to driver-moab --- driver-moab/shr/seq_flds_mod.F90 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/driver-moab/shr/seq_flds_mod.F90 b/driver-moab/shr/seq_flds_mod.F90 index 3fafa8cd9785..0f9feea18eae 100644 --- a/driver-moab/shr/seq_flds_mod.F90 +++ b/driver-moab/shr/seq_flds_mod.F90 @@ -1626,6 +1626,14 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'Foxo_ismh' call metadata_set(attname, longname, stdname, units) + ! Water flux from removed liquid runoff + call seq_flds_add(o2x_fluxes,"Foxo_rrofl") + longname = 'Water flux due to removed liqiud runoff' + stdname = 'removed_liquid_runoff_flux' + units = 'kg m-2 s-1' + attname = 'Foxo_rrofl' + call metadata_set(attname, longname, stdname, units) + ! Water flux from removed solid runoff call seq_flds_add(o2x_fluxes,"Foxo_rrofi") longname = 'Water flux due to removed solid runoff' From d92858a279672358454dec032fd540d7efb05c04 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Tue, 26 Mar 2024 13:22:23 -0500 Subject: [PATCH 11/15] Adding coupling fields for land ice frazil mass/heat --- .../mpas-ocean/driver/mpaso_cpl_indices.F | 4 ++++ components/mpas-ocean/driver/ocn_comp_mct.F | 13 ++++++++--- .../mpas_ocn_conservation_check.F | 22 +++++-------------- driver-mct/main/seq_diag_mct.F90 | 6 +++++ driver-mct/shr/seq_flds_mod.F90 | 16 ++++++++++++++ driver-moab/main/seq_diag_mct.F90 | 6 +++++ driver-moab/shr/seq_flds_mod.F90 | 16 ++++++++++++++ 7 files changed, 64 insertions(+), 19 deletions(-) diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index 5fd341993c53..f099cf8ea46a 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -17,7 +17,9 @@ module mpaso_cpl_indices integer :: index_o2x_So_dhdx integer :: index_o2x_So_dhdy integer :: index_o2x_Fioo_q + integer :: index_o2x_Foxo_q_li integer :: index_o2x_Fioo_frazil + integer :: index_o2x_Foxo_frazil_li integer :: index_o2x_Faoo_h2otemp integer :: index_o2x_Faoo_fco2_ocn integer :: index_o2x_Faoo_fdms_ocn @@ -186,7 +188,9 @@ subroutine mpaso_cpl_indices_set( ) index_o2x_So_dhdx = mct_avect_indexra(o2x,'So_dhdx') index_o2x_So_dhdy = mct_avect_indexra(o2x,'So_dhdy') index_o2x_Fioo_q = mct_avect_indexra(o2x,'Fioo_q',perrWith='quiet') + index_o2x_Foxo_q_li = mct_avect_indexra(o2x,'Foxo_q_li',perrWith='quiet') index_o2x_Fioo_frazil = mct_avect_indexra(o2x,'Fioo_frazil',perrWith='quiet') + index_o2x_Foxo_frazil_li= mct_avect_indexra(o2x,'Foxo_frazil_li',perrWith='quiet') index_o2x_Faoo_h2otemp = mct_avect_indexra(o2x,'Faoo_h2otemp',perrWith='quiet') index_o2x_Faoo_fco2_ocn = mct_avect_indexra(o2x,'Faoo_fco2_ocn',perrWith='quiet') index_o2x_Faoo_fdms_ocn = mct_avect_indexra(o2x,'Faoo_fdms_ocn',perrWith='quiet') diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 86ea9290c01c..0097ac3f302a 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2882,6 +2882,10 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ o2x_o % rAttr(index_o2x_Fioo_q, n) = 0.0_RKIND o2x_o % rAttr(index_o2x_Fioo_frazil, n) = 0.0_RKIND + if (trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then + o2x_o % rAttr(index_o2x_Foxo_q_li, n) = accumulatedFrazilIceMass(i) * config_frazil_heat_of_fusion / ocn_cpl_dt + o2x_o % rAttr(index_o2x_Foxo_frazil_li, n) = accumulatedFrazilIceMass(i) / ocn_cpl_dt + endif end if @@ -4084,7 +4088,7 @@ subroutine ocn_export_moab(EClock) !{{{ call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1) end if - if (trim(config_land_ice_flux_mode == 'standalone') .or. trim(config_land_ice_flux_mode) == 'data') then + if (trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux) endif @@ -4145,7 +4149,7 @@ subroutine ocn_export_moab(EClock) !{{{ o2x_om(n, index_o2x_Faoo_h2otemp) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw - if (trim(config_land_ice_flux_mode == 'standalone') .or. trim(config_land_ice_flux_mode) == 'data') then + if (trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then o2x_om(n, index_o2x_Foxo_ismw) = avgLandIceFreshwaterFlux(i) o2x_om(n, index_o2x_Foxo_ismh) = avgLandIceHeatFlux(i) endif @@ -4190,7 +4194,10 @@ subroutine ocn_export_moab(EClock) !{{{ o2x_om(n, index_o2x_Fioo_q) = 0.0_RKIND o2x_om(n, index_o2x_Fioo_frazil) = 0.0_RKIND - + if (trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then + o2x_om(n, index_o2x_Foxo_q_li) = accumulatedFrazilIceMass(i) * config_frazil_heat_of_fusion / ocn_cpl_dt + o2x_om(n, index_o2x_Foxo_frazil_li) = accumulatedFrazilIceMass(i) / ocn_cpl_dt + endif end if ! Reset SeaIce Energy and Accumulated Frazil Ice diff --git a/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F b/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F index 01f2b5345468..ad262579044e 100644 --- a/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F +++ b/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F @@ -598,16 +598,14 @@ subroutine energy_conservation(domain, err) enddo end if - if (landIceFreshwaterFluxesOn & - .and.config_use_frazil_ice_formation & - .and.config_frazil_under_land_ice) then + if (config_use_frazil_ice_formation .and. config_frazil_under_land_ice) then call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMassOld, 1) call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMassNew, 2) do iCell = 1, nCellsSolve ! Frazil ice mass is negative. Negative coefficient makes heat ! flux positive, because freezing ice releases heat. sumArray(18) = sumArray(18) - areaCell(iCell) * config_frazil_heat_of_fusion & - * (accumulatedLandIceFrazilMassNew(iCell) - accumulatedLandIceFrazilMassOld(iCell)) + * (accumulatedLandIceFrazilMassNew(iCell) - accumulatedLandIceFrazilMassOld(iCell))/dt enddo end if @@ -748,9 +746,7 @@ subroutine energy_conservation(domain, err) if (landIceFreshwaterFluxesOn) then v=accumulatedLandIceHeatFlux ; write(m,"('landIceHeatFlux ',es16.8,' ',f16.8)") v,v/A; call mpas_log_write(m); s=s+v end if - if (landIceFreshwaterFluxesOn & - .and.config_use_frazil_ice_formation & - .and.config_frazil_under_land_ice) then + if (config_use_frazil_ice_formation .and. config_frazil_under_land_ice) then v=accumulatedLandIceFrazilHeatFlux ; write(m,"(' landIceFrazilHeatFlux ',es16.8,' (already in hfreeze, do not sum )',f16.8)") v,v/A; call mpas_log_write(m); ! no sum: s=s+v end if write(m,"('SUM EXPLICIT HEAT FLUXES ',es16.8,' ',f16.8)") s, s/A; call mpas_log_write(m) @@ -976,9 +972,7 @@ subroutine mass_conservation(domain, err) enddo end if - if (landIceFreshwaterFluxesOn & - .and.config_use_frazil_ice_formation & - .and.config_frazil_under_land_ice) then + if (config_use_frazil_ice_formation .and. config_frazil_under_land_ice) then call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMassOld, 1) call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMassNew, 2) do iCell = 1, nCellsSolve @@ -1101,9 +1095,7 @@ subroutine mass_conservation(domain, err) write(m,"(' SUM: ice runoff ',es16.8,' x2o_Foxx_rofi wfrzrof SUM ',f16.8)") v,v*c; call mpas_log_write(m) v=accumulatedLandIceFlux ; write(m,"('landIceFreshwaterFlux ',es16.8,' ',f16.8)") v,v*c; call mpas_log_write(m); s=s+v endif - if (landIceFreshwaterFluxesOn & - .and.config_use_frazil_ice_formation & - .and.config_frazil_under_land_ice) then + if (config_use_frazil_ice_formation .and. config_frazil_under_land_ice) then v=accumulatedLandIceFrazilFlux ; write(m,"(' landIceFrazilFlux ',es16.8,' (already in wfreeze, do not sum )',f16.8)") v,v*c; call mpas_log_write(m); ! no sum: s=s+v endif write(m,"('SUM VOLUME FLUXES ',es16.8,' ',f16.8,es16.8)") s, s*c; call mpas_log_write(m) @@ -1258,9 +1250,7 @@ subroutine salt_conservation(domain, err) enddo end if - if (landIceFreshwaterFluxesOn & - .and.config_use_frazil_ice_formation & - .and.config_frazil_under_land_ice) then + if (config_use_frazil_ice_formation .and. config_frazil_under_land_ice) then call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMassOld, 1) call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMassNew, 2) do iCell = 1, nCellsSolve diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index bb597fd9783d..8534008f9be7 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -286,7 +286,9 @@ module seq_diag_mct integer :: index_o2x_Faoo_h2otemp integer :: index_o2x_Fioo_frazil + integer :: index_o2x_Foxo_frazil_li integer :: index_o2x_Fioo_q + integer :: index_o2x_Foxo_q_li integer :: index_o2x_Foxo_ismw integer :: index_o2x_Foxo_rrofl @@ -1376,7 +1378,9 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa if (present(do_o2x)) then if (first_time) then index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') + index_o2x_Foxo_frazil_li= mct_aVect_indexRA(o2x_o,'Foxo_frazil_li',perrWith='quiet') index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') + index_o2x_Foxo_q_li = mct_aVect_indexRA(o2x_o,'Foxo_q_li',perrWith='quiet') index_o2x_Faoo_h2otemp = mct_aVect_indexRA(o2x_o,'Faoo_h2otemp') index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw',perrWith='quiet') if ( index_o2x_Foxo_ismw /= 0 ) flds_polar = .true. @@ -1399,9 +1403,11 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_hfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_q,n)) nf = f_hh2ot; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Faoo_h2otemp,n) if (flds_polar) then + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_c*o2x_o%rAttr(index_o2x_Foxo_frazil_li,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_q_li,n) nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) end if diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index bbc7795442d0..dbfba0889d0c 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -1592,6 +1592,22 @@ subroutine seq_flds_set(nmlfile, ID, infodata) if (flds_polar) then + ! Ocean Land ice freeze potential + call seq_flds_add(o2x_fluxes,"Foxo_q_li") + longname = 'Ocean land ice freeze potential' + stdname = 'ice_shelf_cavity_ice_heat_flux' + units = 'W m-2' + attname = 'Foxo_q_li' + call metadata_set(attname, longname, stdname, units) + + ! Ocean land ice frazil production + call seq_flds_add(o2x_fluxes,"Foxo_frazil_li") + longname = 'Ocean land ice frazil production' + stdname = 'ocean_land_ice_frazil_ice_production' + units = 'kg m-2 s-1' + attname = 'Foxo_frazil_li' + call metadata_set(attname, longname, stdname, units) + ! Water flux from ice shelf melt call seq_flds_add(o2x_fluxes,"Foxo_ismw") longname = 'Water flux due to basal melting of ice shelves' diff --git a/driver-moab/main/seq_diag_mct.F90 b/driver-moab/main/seq_diag_mct.F90 index bb597fd9783d..8534008f9be7 100644 --- a/driver-moab/main/seq_diag_mct.F90 +++ b/driver-moab/main/seq_diag_mct.F90 @@ -286,7 +286,9 @@ module seq_diag_mct integer :: index_o2x_Faoo_h2otemp integer :: index_o2x_Fioo_frazil + integer :: index_o2x_Foxo_frazil_li integer :: index_o2x_Fioo_q + integer :: index_o2x_Foxo_q_li integer :: index_o2x_Foxo_ismw integer :: index_o2x_Foxo_rrofl @@ -1376,7 +1378,9 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa if (present(do_o2x)) then if (first_time) then index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') + index_o2x_Foxo_frazil_li= mct_aVect_indexRA(o2x_o,'Foxo_frazil_li',perrWith='quiet') index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') + index_o2x_Foxo_q_li = mct_aVect_indexRA(o2x_o,'Foxo_q_li',perrWith='quiet') index_o2x_Faoo_h2otemp = mct_aVect_indexRA(o2x_o,'Faoo_h2otemp') index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw',perrWith='quiet') if ( index_o2x_Foxo_ismw /= 0 ) flds_polar = .true. @@ -1399,9 +1403,11 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_hfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_q,n)) nf = f_hh2ot; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Faoo_h2otemp,n) if (flds_polar) then + nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_c*o2x_o%rAttr(index_o2x_Foxo_frazil_li,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) + nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_q_li,n) nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n) nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n) end if diff --git a/driver-moab/shr/seq_flds_mod.F90 b/driver-moab/shr/seq_flds_mod.F90 index 0f9feea18eae..7e8fb2282c80 100644 --- a/driver-moab/shr/seq_flds_mod.F90 +++ b/driver-moab/shr/seq_flds_mod.F90 @@ -1610,6 +1610,22 @@ subroutine seq_flds_set(nmlfile, ID, infodata) !-------------------------------- if (flds_polar) then + ! Ocean Land ice freeze potential + call seq_flds_add(o2x_fluxes,"Foxo_q_li") + longname = 'Ocean land ice freeze potential' + stdname = 'ice_shelf_cavity_ice_heat_flux' + units = 'W m-2' + attname = 'Foxo_q_li' + call metadata_set(attname, longname, stdname, units) + + ! Ocean land ice frazil production + call seq_flds_add(o2x_fluxes,"Foxo_frazil_li") + longname = 'Ocean land ice frazil production' + stdname = 'ocean_land_ice_frazil_ice_production' + units = 'kg m-2 s-1' + attname = 'Foxo_frazil_li' + call metadata_set(attname, longname, stdname, units) + ! Water flux from ice shelf melt call seq_flds_add(o2x_fluxes,"Foxo_ismw") longname = 'Water flux due to basal melting of ice shelves' From 16c9d583cd3c624a80c59d7dacd62029a6f8bd82 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Wed, 20 Mar 2024 16:40:03 -0500 Subject: [PATCH 12/15] Remove capability to have non-zero land ice frazil salinity --- components/mpas-ocean/src/Registry.xml | 6 +---- .../Registry_conservation_check.xml | 7 +----- .../mpas_ocn_conservation_check.F | 23 ++++++------------- .../src/shared/mpas_ocn_frazil_forcing.F | 3 ++- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index a953b64d8f8e..38cc06f5559a 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -954,13 +954,9 @@ possible_values="Any positive real number." /> - - @@ -305,7 +302,6 @@ - @@ -362,7 +358,6 @@ - diff --git a/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F b/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F index ad262579044e..bdd07e799b5d 100644 --- a/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F +++ b/components/mpas-ocean/src/analysis_members/mpas_ocn_conservation_check.F @@ -1162,8 +1162,8 @@ subroutine salt_conservation(domain, err) real(kind=RKIND), pointer :: & accumulatedSeaIceSalinityFlux, & - accumulatedFrazilSalinityFlux, & - accumulatedLandIceFrazilSalinityFlux + accumulatedFrazilSalinityFlux + ! accumulatedLandIceFrazilSalinityFlux is not present because it is always 0 real(kind=RKIND), dimension(:), allocatable :: & sumArray, & @@ -1209,7 +1209,6 @@ subroutine salt_conservation(domain, err) call MPAS_pool_get_array(conservationCheckSaltAMPool, "accumulatedSeaIceSalinityFlux", accumulatedSeaIceSalinityFlux) call MPAS_pool_get_array(conservationCheckSaltAMPool, "accumulatedFrazilSalinityFlux", accumulatedFrazilSalinityFlux) - call MPAS_pool_get_array(conservationCheckSaltAMPool, "accumulatedLandIceFrazilSalinityFlux", accumulatedLandIceFrazilSalinityFlux) !------------------------------------------------------------- ! Net salt flux to ice @@ -1251,11 +1250,9 @@ subroutine salt_conservation(domain, err) end if if (config_use_frazil_ice_formation .and. config_frazil_under_land_ice) then - call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMassOld, 1) - call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMassNew, 2) + ! Land ice frazil salinity is always 0 do iCell = 1, nCellsSolve - sumArray(3) = sumArray(3) + areaCell(iCell) & - * (accumulatedLandIceFrazilMassNew(iCell) - accumulatedLandIceFrazilMassOld(iCell))/dt + sumArray(3) = sumArray(3) + 0.0_RKIND enddo end if @@ -1268,7 +1265,6 @@ subroutine salt_conservation(domain, err) ! accumulate fluxes accumulatedSeaIceSalinityFlux = accumulatedSeaIceSalinityFlux + sumArrayOut(1) accumulatedFrazilSalinityFlux = accumulatedFrazilSalinityFlux + sumArrayOut(2) - accumulatedLandIceFrazilSalinityFlux = accumulatedLandIceFrazilSalinityFlux + sumArrayOut(3) ! cleanup deallocate(sumArray) @@ -1285,7 +1281,6 @@ subroutine salt_conservation(domain, err) ! Average the fluxes accumulatedSeaIceSalinityFlux = accumulatedSeaIceSalinityFlux /accumulatedFluxCounter accumulatedFrazilSalinityFlux = accumulatedFrazilSalinityFlux /accumulatedFluxCounter - accumulatedLandIceFrazilSalinityFlux = accumulatedLandIceFrazilSalinityFlux /accumulatedFluxCounter ! get initial salt content call MPAS_pool_get_array(conservationCheckSaltAMPool, "initialSalt", initialSalt) @@ -1302,8 +1297,7 @@ subroutine salt_conservation(domain, err) call MPAS_pool_get_array(conservationCheckSaltAMPool, "netSaltFlux", netSaltFlux) netSaltFlux = accumulatedSeaIceSalinityFlux & - + accumulatedFrazilSalinityFlux & - + accumulatedLandIceFrazilSalinityFlux + + accumulatedFrazilSalinityFlux ! compute the final salt error call MPAS_pool_get_array(conservationCheckSaltAMPool, "absoluteSaltError", absoluteSaltError) @@ -1331,7 +1325,7 @@ subroutine salt_conservation(domain, err) if (landIceFreshwaterFluxesOn & .and.config_use_frazil_ice_formation & .and.config_frazil_under_land_ice) then -v=accumulatedLandIceFrazilSalinityFlux; write(m,"('LandIceFrazilSalinityFlux',es16.8,' (already in wmelt, do not sum) ',f16.8)") v,v*c; call mpas_log_write(m); !no sum: s=s+v +v=0; write(m,"('LandIceFrazilSalinityFlux',es16.8,' (already in wmelt, do not sum) ',f16.8)") v,v*c; call mpas_log_write(m); !no sum: s=s+v end if write(m,"('SUM VOLUME FLUXES ',es16.8,' ',f16.8,es16.8)") s, s*c; call mpas_log_write(m) @@ -2256,8 +2250,7 @@ subroutine reset_accumulated_variables(domain) real(kind=RKIND), pointer :: & accumulatedSeaIceSalinityFlux, & - accumulatedFrazilSalinityFlux, & - accumulatedLandIceFrazilSalinityFlux + accumulatedFrazilSalinityFlux real(kind=RKIND), pointer :: & accumulatedCarbonSourceSink, & @@ -2343,11 +2336,9 @@ subroutine reset_accumulated_variables(domain) call MPAS_pool_get_array(conservationCheckSaltAMPool, "accumulatedSeaIceSalinityFlux", accumulatedSeaIceSalinityFlux) call MPAS_pool_get_array(conservationCheckSaltAMPool, "accumulatedFrazilSalinityFlux", accumulatedFrazilSalinityFlux) - call MPAS_pool_get_array(conservationCheckSaltAMPool, "accumulatedLandIceFrazilSalinityFlux", accumulatedLandIceFrazilSalinityFlux) accumulatedSeaIceSalinityFlux = 0.0_RKIND accumulatedFrazilSalinityFlux = 0.0_RKIND - accumulatedLandIceFrazilSalinityFlux = 0.0_RKIND call MPAS_pool_get_subpool(domain % blocklist % structs, "conservationCheckCarbonAM", conservationCheckCarbonAMPool) diff --git a/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F b/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F index 16c223986840..7a94095bc087 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F @@ -527,7 +527,7 @@ subroutine ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, stateP ! get frazil salinity if (underLandIce) then - frazilSalinity = config_frazil_land_ice_reference_salinity + frazilSalinity = 0.0_RKIND else frazilSalinity = config_frazil_sea_ice_reference_salinity end if @@ -618,6 +618,7 @@ subroutine ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, stateP ! for freshwater budgets accumulatedLandIceFrazilMassNew(iCell) = accumulatedLandIceFrazilMassOld(iCell) & + sumNewFrazilIceThickness * config_frazil_ice_density + ! There is no accumulatedLandIceFrazilSalinity because it is always 0 end if enddo ! do iCell = 1, nCells From 842522c9a410a1463c824bc9470a47d2533fd55b Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Tue, 26 Mar 2024 15:21:20 -0500 Subject: [PATCH 13/15] Adding back in removed land_ice_reference_salinity namelist --- components/mpas-ocean/src/Registry.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index 38cc06f5559a..a953b64d8f8e 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -954,9 +954,13 @@ possible_values="Any positive real number." /> + Date: Tue, 26 Mar 2024 15:34:39 -0500 Subject: [PATCH 14/15] Reverting hard-coded zero land ice frazil salinity --- components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F b/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F index 7a94095bc087..0f71ab176eb2 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F @@ -527,7 +527,7 @@ subroutine ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, stateP ! get frazil salinity if (underLandIce) then - frazilSalinity = 0.0_RKIND + frazilSalinity = config_frazil_land_ice_reference_salinity else frazilSalinity = config_frazil_sea_ice_reference_salinity end if From edf89d103bc9ed32d8172abba720eecabd28ec9b Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Tue, 26 Mar 2024 18:06:06 -0500 Subject: [PATCH 15/15] Removing comment from frazil_forcing.F --- components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F | 1 - 1 file changed, 1 deletion(-) diff --git a/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F b/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F index 0f71ab176eb2..16c223986840 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_frazil_forcing.F @@ -618,7 +618,6 @@ subroutine ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, stateP ! for freshwater budgets accumulatedLandIceFrazilMassNew(iCell) = accumulatedLandIceFrazilMassOld(iCell) & + sumNewFrazilIceThickness * config_frazil_ice_density - ! There is no accumulatedLandIceFrazilSalinity because it is always 0 end if enddo ! do iCell = 1, nCells