From efbd115493b892a6f2bf3a16ab32352899e45da1 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Fri, 26 Jan 2024 11:35:23 -0600 Subject: [PATCH 01/15] Adding cryo coupling fields and budget terms (ismw broken) --- .../mpas-ocean/driver/mpaso_cpl_indices.F | 8 +- components/mpas-ocean/driver/ocn_comp_mct.F | 47 +++++++++++- driver-mct/main/seq_diag_mct.F90 | 75 ++++++++++++------- driver-mct/shr/seq_flds_mod.F90 | 24 ++++++ 4 files changed, 124 insertions(+), 30 deletions(-) diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index 968a4090fe4a..3fc988b09b20 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -22,7 +22,9 @@ 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 ! ocn -> drv for calculation of ocean-ice sheet interactions @@ -187,6 +189,10 @@ subroutine mpaso_cpl_indices_set( ) 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') index_o2x_So_ssh = mct_avect_indexra(o2x,'So_ssh') +!DC P needed since in ice-shelf ocean domain? + index_o2x_Foxo_ismw = mct_avect_indexra(o2x,'PFoxo_ismw') + index_o2x_Foxo_rrofl = mct_avect_indexra(o2x,'Foxo_rrofl') + index_o2x_Foxo_rrofi = mct_avect_indexra(o2x,'Foxo_rrofi') index_o2x_So_blt = mct_avect_indexra(o2x,'So_blt') index_o2x_So_bls = mct_avect_indexra(o2x,'So_bls') diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index b8900a4f3e26..9c54a92099ed 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2694,7 +2694,10 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ avgOceanSurfaceDOCSemiLabile, & avgOceanSurfaceFeParticulate, & avgOceanSurfaceFeDissolved, & - ssh + ssh, & + landIceFreshwaterFlux, & + removedRiverRunoffFlux, & + removedIceRunoffFlux real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, & avgSSHGradient, avgOceanSurfacePhytoC, & @@ -2703,6 +2706,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, & @@ -2719,6 +2723,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', & @@ -2761,6 +2766,15 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1) end if + !DC Cryo fields , 0 when data + if (config_land_ice_flux_mode == 'standalone' .or. 'data') then + call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) + endif + if (config_remove_AIS_coupler_runoff) then + call mpas_pool_get_array(forcingPool, 'removedRiverRunoffFlux', removedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'removedIceRunoffFlux', removedIceRunoffFlux) + endif + ! BGC fields if (config_use_ecosysTracers) then @@ -2812,6 +2826,15 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ o2x_o % rAttr(index_o2x_Faoo_h2otemp, n) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw +!DC landIceFreshwaterFlux seems to be 0 when data + if (config_land_ice_flux_mode == 'standalone' .or. 'data') then + o2x_o % rAttr(index_o2x_Foxo_ismw, n) = landIceFreshwaterFlux(i) + endif + if (config_remove_AIS_coupler_runoff) then + o2x_o % rAttr(index_o2x_Foxo_rrofl, n) = removedRiverRunoffFlux(i) + o2x_o % rAttr(index_o2x_Foxo_rrofi, n) = removedIceRunoffFlux(i) + endif + if ( frazilIceActive ) then ! negative when frazil ice can be melted keepFrazil = .true. @@ -3590,6 +3613,7 @@ subroutine ocn_import_moab( Eclock, errorCode)!{{{ endif if ( landIceFreshwaterFluxField % isActive ) then +!DC is this ok with proposed implementation? think so since different coupling field !landIceFreshwaterFlux(i) = x2o_om(n, index_x2o_Fogx_qicelo) end if if ( landIceHeatFluxField % isActive ) then @@ -3984,6 +4008,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, & @@ -4000,6 +4025,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', & @@ -4041,6 +4067,14 @@ 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 (config_land_ice_flux_mode == 'standalone' .or. 'data') then + call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) + endif + if (config_remove_AIS_coupler_runoff) then + call mpas_pool_get_array(forcingPool, 'removedRiverRunoffFlux', removedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'removedIceRunoffFlux', removedIceRunoffFlux) + endif ! BGC fields if (config_use_ecosysTracers) then @@ -4092,7 +4126,16 @@ 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 - + +!DC, blindly following pattern + if (config_land_ice_flux_mode == 'standalone' .or. 'data') then + o2x_om(n, index_o2x_Foxo_ismw) = landIceFreshwaterFlux(i) + endif + if (config_remove_AIS_coupler_runoff) then + o2x_om(n, index_o2x_Foxo_rrofl) = removedRiverRunoffFlux(i) + o2x_om(n, index_o2x_Foxo_rrofi) = removedIceRunoffFlux(i) + endif + if ( frazilIceActive ) then ! negative when frazil ice can be melted keepFrazil = .true. diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index 2a7d999ccc5e..326d73a630d1 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -144,32 +144,35 @@ module seq_diag_mct 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_wevap =17 ! water: evaporation + integer(in),parameter :: f_wroff =18 ! water: runoff/flood + integer(in),parameter :: f_wioff =19 ! water: frozen runoff + integer(in),parameter :: f_wberg =20 ! water: data icebergs + integer(in),parameter :: f_wism =21 ! water: ice-shelf melt + integer(in),parameter :: f_wrrof =22 ! water: removed liquid runoff + integer(in),parameter :: f_wriof =23 ! water: removed ice runoff + integer(in),parameter :: f_wirrig =24 ! water: irrigation + integer(in),parameter :: f_wfrz_16O =25 ! water: freezing + integer(in),parameter :: f_wmelt_16O =26 ! water: melting + integer(in),parameter :: f_wrain_16O =27 ! water: precip, liquid + integer(in),parameter :: f_wsnow_16O =28 ! water: precip, frozen + integer(in),parameter :: f_wevap_16O =29 ! water: evaporation + integer(in),parameter :: f_wroff_16O =30 ! water: runoff/flood + integer(in),parameter :: f_wioff_16O =31 ! water: frozen runoff + integer(in),parameter :: f_wfrz_18O =32 ! water: freezing + integer(in),parameter :: f_wmelt_18O =33 ! water: melting + integer(in),parameter :: f_wrain_18O =34 ! water: precip, liquid + integer(in),parameter :: f_wsnow_18O =35 ! water: precip, frozen + integer(in),parameter :: f_wevap_18O =36 ! water: evaporation + integer(in),parameter :: f_wroff_18O =37 ! water: runoff/flood + integer(in),parameter :: f_wioff_18O =38 ! water: frozen runoff + integer(in),parameter :: f_wfrz_HDO =39 ! water: freezing + integer(in),parameter :: f_wmelt_HDO =40 ! water: melting + integer(in),parameter :: f_wrain_HDO =41 ! water: precip, liquid + integer(in),parameter :: f_wsnow_HDO =42 ! water: precip, frozen + integer(in),parameter :: f_wevap_HDO =43 ! water: evaporation + integer(in),parameter :: f_wroff_HDO =44 ! water: runoff/flood + integer(in),parameter :: f_wioff_HDO =45 ! 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 @@ -190,7 +193,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', & + ' wsnow',' wevap',' wrunoff',' wfrzrof', & + ' wberg',' wism',' wrrof',' wriof', & ' wirrig', & ' wfreeze_16O',' wmelt_16O',' wrain_16O',' wsnow_16O', & ' wevap_16O',' wrunoff_16O',' wfrzrof_16O', & @@ -287,6 +291,10 @@ module seq_diag_mct integer :: index_o2x_Faoo_h2otemp integer :: index_o2x_Fioo_frazil integer :: index_o2x_Fioo_q +!DC - do we want P in front of these fields? + integer :: index_o2x_Foxo_ismw + integer :: index_o2x_Foxo_rrofl + integer :: index_o2x_Foxo_rrofi integer :: index_xao_Faox_lwup integer :: index_xao_Faox_lat @@ -1373,6 +1381,9 @@ 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,'PFoxo_ismw') + index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl') + index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi') end if lSize = mct_avect_lSize(o2x_o) @@ -1384,6 +1395,11 @@ 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) +!DC do we need only ca_o, if use P above? +! nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! gives 0, different scaling? + nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! gives values orders of magnitude too high + 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) end do end if @@ -1495,6 +1511,10 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa 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) +!DC new entries should not be here, done above with o2x +! nf = f_wism ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) +! nf = f_wrrof ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) +! nf = f_wriof ; 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) @@ -1652,6 +1672,7 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) 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) +!DC propose removing wberg from ice entry 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) diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index 4b37e40b7b3e..0a3ae499276b 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -1582,6 +1582,30 @@ subroutine seq_flds_set(nmlfile, ID, infodata) units = 'kg m-2 s-1' attname = 'PFioi_bergw' call metadata_set(attname, longname, stdname, units) +!DC ismw needs P, removed runoff terms do not + ! Water flux from ice shelf melt + call seq_flds_add(o2x_fluxes,"PFoxo_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 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) ! Salt flux call seq_flds_add(i2x_fluxes,"Fioi_salt") From 10691dde9a2fa991238f95da46e2f0dc276d4f8f Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Fri, 26 Jan 2024 16:31:50 -0600 Subject: [PATCH 02/15] Changing scaling for ice-shelf cavities --- driver-mct/main/seq_diag_mct.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index 326d73a630d1..77010e9bd9fe 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -1345,7 +1345,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. @@ -1391,13 +1391,14 @@ 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) !DC area including ice-shelf cavities 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) !DC do we need only ca_o, if use P above? ! nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! gives 0, different scaling? - nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! gives values orders of magnitude too high + nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! think this is right scaling 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) end do From 4e16416942ec95bc6c320ed61dabe0ddafe2c853 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Fri, 26 Jan 2024 16:33:11 -0600 Subject: [PATCH 03/15] Calling in dataLandIceFreshwaterFlux also --- components/mpas-ocean/driver/ocn_comp_mct.F | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 9c54a92099ed..30fa82f99722 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2696,6 +2696,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ avgOceanSurfaceFeDissolved, & ssh, & landIceFreshwaterFlux, & + dataLandIceFreshwaterFlux, & removedRiverRunoffFlux, & removedIceRunoffFlux @@ -2766,10 +2767,13 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1) end if - !DC Cryo fields , 0 when data - if (config_land_ice_flux_mode == 'standalone' .or. 'data') then + !DC Cryo fields + if (config_land_ice_flux_mode == 'standalone') then call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) endif + if (config_land_ice_flux_mode == 'data') then + call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', dataLandIceFreshwaterFlux) + endif if (config_remove_AIS_coupler_runoff) then call mpas_pool_get_array(forcingPool, 'removedRiverRunoffFlux', removedRiverRunoffFlux) call mpas_pool_get_array(forcingPool, 'removedIceRunoffFlux', removedIceRunoffFlux) @@ -2826,10 +2830,13 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ o2x_o % rAttr(index_o2x_Faoo_h2otemp, n) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw -!DC landIceFreshwaterFlux seems to be 0 when data - if (config_land_ice_flux_mode == 'standalone' .or. 'data') then +!DC + if (config_land_ice_flux_mode == 'standalone') then o2x_o % rAttr(index_o2x_Foxo_ismw, n) = landIceFreshwaterFlux(i) endif + if (config_land_ice_flux_mode == 'data') then + o2x_o % rAttr(index_o2x_Foxo_ismw, n) = dataLandIceFreshwaterFlux(i) + endif if (config_remove_AIS_coupler_runoff) then o2x_o % rAttr(index_o2x_Foxo_rrofl, n) = removedRiverRunoffFlux(i) o2x_o % rAttr(index_o2x_Foxo_rrofi, n) = removedIceRunoffFlux(i) From 8295de2709cda72535ddf25983d33839b46c01e6 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Mon, 29 Jan 2024 10:42:14 -0600 Subject: [PATCH 04/15] Commenting out wberg calculation in ice column --- driver-mct/main/seq_diag_mct.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index 77010e9bd9fe..8decf8dc8736 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -1674,7 +1674,7 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) 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) !DC propose removing wberg from ice entry - 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 From d42b9cbf0b485f48d4ace0eec98f5488106e48a8 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Wed, 31 Jan 2024 18:28:42 -0600 Subject: [PATCH 05/15] Accumulate added fluxes over coupling interval --- components/mpas-ocean/driver/ocn_comp_mct.F | 50 ++++++------ components/mpas-ocean/src/Registry.xml | 10 +++ .../shared/mpas_ocn_time_average_coupled.F | 78 ++++++++++++++++++- 3 files changed, 109 insertions(+), 29 deletions(-) diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 30fa82f99722..8d1bdf514940 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2695,10 +2695,9 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ avgOceanSurfaceFeParticulate, & avgOceanSurfaceFeDissolved, & ssh, & - landIceFreshwaterFlux, & - dataLandIceFreshwaterFlux, & - removedRiverRunoffFlux, & - removedIceRunoffFlux + avgLandIceFreshwaterFlux, & + avgRemovedRiverRunoffFlux, & + avgRemovedIceRunoffFlux real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, & avgSSHGradient, avgOceanSurfacePhytoC, & @@ -2767,16 +2766,13 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1) end if - !DC Cryo fields - if (config_land_ice_flux_mode == 'standalone') then - call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) - endif - if (config_land_ice_flux_mode == 'data') then - call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', dataLandIceFreshwaterFlux) + ! Cryo fields + if (config_land_ice_flux_mode == 'standalone' .or. 'data') then + call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) endif if (config_remove_AIS_coupler_runoff) then - call mpas_pool_get_array(forcingPool, 'removedRiverRunoffFlux', removedRiverRunoffFlux) - call mpas_pool_get_array(forcingPool, 'removedIceRunoffFlux', removedIceRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux) endif ! BGC fields @@ -2830,16 +2826,13 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ o2x_o % rAttr(index_o2x_Faoo_h2otemp, n) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw -!DC - if (config_land_ice_flux_mode == 'standalone') then - o2x_o % rAttr(index_o2x_Foxo_ismw, n) = landIceFreshwaterFlux(i) - endif - if (config_land_ice_flux_mode == 'data') then - o2x_o % rAttr(index_o2x_Foxo_ismw, n) = dataLandIceFreshwaterFlux(i) + ! Cryo fields + if (config_land_ice_flux_mode == 'standalone' .or. 'data') then + o2x_o % rAttr(index_o2x_Foxo_ismw, n) = avgLandIceFreshwaterFlux(i) endif if (config_remove_AIS_coupler_runoff) then - o2x_o % rAttr(index_o2x_Foxo_rrofl, n) = removedRiverRunoffFlux(i) - o2x_o % rAttr(index_o2x_Foxo_rrofi, n) = removedIceRunoffFlux(i) + o2x_o % rAttr(index_o2x_Foxo_rrofl, n) = avgRemovedRiverRunoffFlux(i) + o2x_o % rAttr(index_o2x_Foxo_rrofi, n) = avgRemovedIceRunoffFlux(i) endif if ( frazilIceActive ) then @@ -4006,7 +3999,10 @@ subroutine ocn_export_moab(EClock) !{{{ avgOceanSurfaceDOCSemiLabile, & avgOceanSurfaceFeParticulate, & avgOceanSurfaceFeDissolved, & - ssh + ssh, & + avgLandIceFreshwaterFlux, & + avgRemovedRiverRunoffFlux, & + avgRemovedIceRunoffFlux real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, & avgSSHGradient, avgOceanSurfacePhytoC, & @@ -4076,11 +4072,11 @@ subroutine ocn_export_moab(EClock) !{{{ end if if (config_land_ice_flux_mode == 'standalone' .or. 'data') then - call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) + call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) endif if (config_remove_AIS_coupler_runoff) then - call mpas_pool_get_array(forcingPool, 'removedRiverRunoffFlux', removedRiverRunoffFlux) - call mpas_pool_get_array(forcingPool, 'removedIceRunoffFlux', removedIceRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux) + call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux) endif ! BGC fields @@ -4136,11 +4132,11 @@ subroutine ocn_export_moab(EClock) !{{{ !DC, blindly following pattern if (config_land_ice_flux_mode == 'standalone' .or. 'data') then - o2x_om(n, index_o2x_Foxo_ismw) = landIceFreshwaterFlux(i) + o2x_om(n, index_o2x_Foxo_ismw) = avgLandIceFreshwaterFlux(i) endif if (config_remove_AIS_coupler_runoff) then - o2x_om(n, index_o2x_Foxo_rrofl) = removedRiverRunoffFlux(i) - o2x_om(n, index_o2x_Foxo_rrofi) = removedIceRunoffFlux(i) + o2x_om(n, index_o2x_Foxo_rrofl) = avgRemovedRiverRunoffFlux(i) + o2x_om(n, index_o2x_Foxo_rrofi) = avgRemovedIceRunoffFlux(i) endif if ( frazilIceActive ) then diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index f8b56c083d44..811f6896b4ae 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -3608,6 +3608,7 @@ packages="activeTracersBulkRestoringPKG;thicknessBulkPKG" /> + + + + Date: Fri, 2 Feb 2024 11:25:29 -0600 Subject: [PATCH 06/15] Fixing errors in logicals --- .../mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 a5d15c51ac71..8840853196db 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 @@ -119,7 +119,7 @@ subroutine ocn_time_average_coupled_init(forcingPool)!{{{ end if ! Set up polar fields if necessary - if(trim(config_land_ice_flux_mode)=='standalone' .or. '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) !$omp parallel @@ -344,7 +344,7 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel end if ! Accumulate polar fields if necessary - if(trim(config_land_ice_flux_mode) == 'standalone' .or. '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) if(trim(config_land_ice_flux_mode) == 'standalone') then @@ -353,7 +353,8 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel ! load data melt rates if used if(trim(config_land_ice_flux_mode) == 'data') then - call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', landIceFreshwaterFlux) +! call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', landIceFreshwaterFlux) + call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) endif !$omp parallel From 947d2fbad46f175530965995d8e6b227297604ea Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Mon, 5 Feb 2024 17:54:26 -0600 Subject: [PATCH 07/15] Separate out prognostic and data ismf accumulation --- .../shared/mpas_ocn_time_average_coupled.F | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) 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 8840853196db..b714a6a2e091 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 @@ -245,7 +245,7 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel avgLandIceBoundaryLayerTracers, avgLandIceTracerTransferVelocities real (kind=RKIND), dimension(:), pointer :: effectiveDensityInLandIce, avgEffectiveDensityInLandIce, & totalFreshWaterTemperatureFlux, avgTotalFreshWaterTemperatureFlux, & - landIceFreshwaterFlux, avgLandIceFreshwaterFlux, & + landIceFreshwaterFlux, dataLandIceFreshwaterFlux, avgLandIceFreshwaterFlux, & removedRiverRunoffFlux, avgRemovedRiverRunoffFlux, & removedIceRunoffFlux, avgRemovedIceRunoffFlux @@ -347,24 +347,33 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel 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) + ! load prognostic melt rates if(trim(config_land_ice_flux_mode) == 'standalone') then call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) - endif - ! load data melt rates if used - if(trim(config_land_ice_flux_mode) == 'data') then -! call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', landIceFreshwaterFlux) - call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) - endif - - !$omp parallel - !$omp do schedule(runtime) - do iCell = 1, nCells - avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & - + landIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) - end do - !$omp end do - !$omp end parallel + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & + + landIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) + end do + !$omp end do + !$omp end parallel + end if + + ! load data melt rates if used + if(trim(config_land_ice_flux_mode) == 'data') then + call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', dataLandIceFreshwaterFlux) + + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & + + dataLandIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) + end do + !$omp end do + !$omp end parallel + end if end if if (config_remove_AIS_coupler_runoff) then From 23624db7300aa44e686942bee2dcc2b91a0513d3 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Wed, 7 Feb 2024 08:50:15 -0600 Subject: [PATCH 08/15] Adding data option for land ice fluxes in ocn conservation analysis member --- .../src/analysis_members/mpas_ocn_conservation_check.F | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 6ca4e6956309752b9c7839cac39998cd596dc0e6 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Thu, 8 Feb 2024 18:24:39 -0600 Subject: [PATCH 09/15] Fixing errors in logicals (again) --- components/mpas-ocean/driver/ocn_comp_mct.F | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 8d1bdf514940..6298c281a3ac 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2767,7 +2767,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ end if ! Cryo fields - if (config_land_ice_flux_mode == 'standalone' .or. '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) endif if (config_remove_AIS_coupler_runoff) then @@ -2827,7 +2827,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ o2x_o % rAttr(index_o2x_Faoo_h2otemp, n) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw ! Cryo fields - if (config_land_ice_flux_mode == 'standalone' .or. 'data') then + 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) endif if (config_remove_AIS_coupler_runoff) then @@ -4071,7 +4071,7 @@ subroutine ocn_export_moab(EClock) !{{{ call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1) end if - if (config_land_ice_flux_mode == 'standalone' .or. '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) endif if (config_remove_AIS_coupler_runoff) then @@ -4131,7 +4131,7 @@ subroutine ocn_export_moab(EClock) !{{{ o2x_om(n, index_o2x_Faoo_h2otemp) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw !DC, blindly following pattern - if (config_land_ice_flux_mode == 'standalone' .or. '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) endif if (config_remove_AIS_coupler_runoff) then From 842cc3783b83fd307b26b781ed949c73133c59fd Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Thu, 8 Feb 2024 19:01:03 -0600 Subject: [PATCH 10/15] Cleaning up after debugging --- .../shared/mpas_ocn_time_average_coupled.F | 39 ++++++------------- 1 file changed, 11 insertions(+), 28 deletions(-) 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 b714a6a2e091..d7865f0feffb 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 @@ -245,7 +245,7 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel avgLandIceBoundaryLayerTracers, avgLandIceTracerTransferVelocities real (kind=RKIND), dimension(:), pointer :: effectiveDensityInLandIce, avgEffectiveDensityInLandIce, & totalFreshWaterTemperatureFlux, avgTotalFreshWaterTemperatureFlux, & - landIceFreshwaterFlux, dataLandIceFreshwaterFlux, avgLandIceFreshwaterFlux, & + landIceFreshwaterFlux, avgLandIceFreshwaterFlux, & removedRiverRunoffFlux, avgRemovedRiverRunoffFlux, & removedIceRunoffFlux, avgRemovedIceRunoffFlux @@ -346,34 +346,17 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel ! 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) + + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & + + landIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) + end do + !$omp end do + !$omp end parallel - ! load prognostic melt rates - if(trim(config_land_ice_flux_mode) == 'standalone') then - call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) - - !$omp parallel - !$omp do schedule(runtime) - do iCell = 1, nCells - avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & - + landIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) - end do - !$omp end do - !$omp end parallel - end if - - ! load data melt rates if used - if(trim(config_land_ice_flux_mode) == 'data') then - call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', dataLandIceFreshwaterFlux) - - !$omp parallel - !$omp do schedule(runtime) - do iCell = 1, nCells - avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & - + dataLandIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) - end do - !$omp end do - !$omp end parallel - end if end if if (config_remove_AIS_coupler_runoff) then From d46f9b236b2e6c673ba3cf33399cb7eb6baabf27 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Thu, 8 Feb 2024 19:42:25 -0600 Subject: [PATCH 11/15] Removing 'P' from ismw coupler index --- components/mpas-ocean/driver/mpaso_cpl_indices.F | 2 +- driver-mct/main/seq_diag_mct.F90 | 2 +- driver-mct/shr/seq_flds_mod.F90 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index 3fc988b09b20..4f27ea2126d9 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -190,7 +190,7 @@ 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') !DC P needed since in ice-shelf ocean domain? - index_o2x_Foxo_ismw = mct_avect_indexra(o2x,'PFoxo_ismw') + 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') diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index 8decf8dc8736..c4945fb24d91 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -1381,7 +1381,7 @@ 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,'PFoxo_ismw') + 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') end if diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index 0a3ae499276b..d3ed51bc694e 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -1584,7 +1584,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) !DC ismw needs P, removed runoff terms do not ! Water flux from ice shelf melt - call seq_flds_add(o2x_fluxes,"PFoxo_ismw") + 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' From 4951935aee5c595aea06b9c2eea6de90cb76d6e2 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Thu, 8 Feb 2024 22:19:36 -0600 Subject: [PATCH 12/15] Bringing on the heat --- .../mpas-ocean/driver/mpaso_cpl_indices.F | 7 +- components/mpas-ocean/driver/ocn_comp_mct.F | 16 +++- components/mpas-ocean/src/Registry.xml | 8 +- .../shared/mpas_ocn_time_average_coupled.F | 21 ++++- driver-mct/main/seq_diag_mct.F90 | 87 ++++++++++--------- driver-mct/shr/seq_flds_mod.F90 | 18 +++- 6 files changed, 109 insertions(+), 48 deletions(-) diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index 4f27ea2126d9..10cbfe80e968 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -25,6 +25,8 @@ module mpaso_cpl_indices 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 @@ -189,11 +191,14 @@ subroutine mpaso_cpl_indices_set( ) 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') index_o2x_So_ssh = mct_avect_indexra(o2x,'So_ssh') -!DC P needed since in ice-shelf ocean domain? + 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 6298c281a3ac..acb66140b6bc 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2697,7 +2697,9 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ ssh, & avgLandIceFreshwaterFlux, & avgRemovedRiverRunoffFlux, & - avgRemovedIceRunoffFlux + avgRemovedIceRunoffFlux, & + avgLandIceHeatFlux, & + avgRemovedIceRunoffHeatFlux real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, & avgSSHGradient, avgOceanSurfacePhytoC, & @@ -2769,10 +2771,12 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ ! 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 @@ -2829,10 +2833,12 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{ ! 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 @@ -4002,7 +4008,9 @@ subroutine ocn_export_moab(EClock) !{{{ ssh, & avgLandIceFreshwaterFlux, & avgRemovedRiverRunoffFlux, & - avgRemovedIceRunoffFlux + avgRemovedIceRunoffFlux, & + avgLandIceHeatFlux, & + avgRemovedIceRunoffHeatFlux real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, & avgSSHGradient, avgOceanSurfacePhytoC, & @@ -4073,10 +4081,12 @@ subroutine ocn_export_moab(EClock) !{{{ 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 @@ -4133,10 +4143,12 @@ subroutine ocn_export_moab(EClock) !{{{ !DC, blindly following pattern 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 diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index 811f6896b4ae..e5f520609086 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -3691,13 +3691,19 @@ description="Sum of heat fluxes associated with water fluxes cell centers sent to coupler. Positive into the ocean." /> + + 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 d7865f0feffb..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 @@ -55,7 +55,8 @@ subroutine ocn_time_average_coupled_init(forcingPool)!{{{ real (kind=RKIND), dimension(:), pointer :: avgEffectiveDensityInLandIce, avgTotalFreshWaterTemperatureFlux, & avgLandIceFreshwaterFlux, & - avgRemovedRiverRunoffFlux, avgRemovedIceRunoffFlux + avgRemovedRiverRunoffFlux, avgRemovedIceRunoffFlux, & + avgLandIceHeatFlux, avgRemovedIceRunoffHeatFlux integer :: iCell integer, pointer :: nAccumulatedCoupled, nCells @@ -121,11 +122,13 @@ subroutine ocn_time_average_coupled_init(forcingPool)!{{{ ! 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 @@ -134,12 +137,14 @@ subroutine ocn_time_average_coupled_init(forcingPool)!{{{ 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 @@ -230,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 @@ -246,8 +254,10 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel real (kind=RKIND), dimension(:), pointer :: effectiveDensityInLandIce, avgEffectiveDensityInLandIce, & totalFreshWaterTemperatureFlux, avgTotalFreshWaterTemperatureFlux, & landIceFreshwaterFlux, avgLandIceFreshwaterFlux, & + landIceHeatFlux, avgLandIceHeatFlux, & removedRiverRunoffFlux, avgRemovedRiverRunoffFlux, & - removedIceRunoffFlux, avgRemovedIceRunoffFlux + removedIceRunoffFlux, avgRemovedIceRunoffFlux, & + avgRemovedIceRunoffHeatFlux type (mpas_pool_type), pointer :: tracersPool @@ -347,12 +357,16 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel 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 @@ -362,6 +376,7 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel 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) @@ -372,6 +387,8 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel + 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 diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index c4945fb24d91..5e089e279cf5 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -139,40 +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_wevap =17 ! water: evaporation - integer(in),parameter :: f_wroff =18 ! water: runoff/flood - integer(in),parameter :: f_wioff =19 ! water: frozen runoff - integer(in),parameter :: f_wberg =20 ! water: data icebergs - integer(in),parameter :: f_wism =21 ! water: ice-shelf melt - integer(in),parameter :: f_wrrof =22 ! water: removed liquid runoff - integer(in),parameter :: f_wriof =23 ! water: removed ice runoff - integer(in),parameter :: f_wirrig =24 ! water: irrigation - integer(in),parameter :: f_wfrz_16O =25 ! water: freezing - integer(in),parameter :: f_wmelt_16O =26 ! water: melting - integer(in),parameter :: f_wrain_16O =27 ! water: precip, liquid - integer(in),parameter :: f_wsnow_16O =28 ! water: precip, frozen - integer(in),parameter :: f_wevap_16O =29 ! water: evaporation - integer(in),parameter :: f_wroff_16O =30 ! water: runoff/flood - integer(in),parameter :: f_wioff_16O =31 ! water: frozen runoff - integer(in),parameter :: f_wfrz_18O =32 ! water: freezing - integer(in),parameter :: f_wmelt_18O =33 ! water: melting - integer(in),parameter :: f_wrain_18O =34 ! water: precip, liquid - integer(in),parameter :: f_wsnow_18O =35 ! water: precip, frozen - integer(in),parameter :: f_wevap_18O =36 ! water: evaporation - integer(in),parameter :: f_wroff_18O =37 ! water: runoff/flood - integer(in),parameter :: f_wioff_18O =38 ! water: frozen runoff - integer(in),parameter :: f_wfrz_HDO =39 ! water: freezing - integer(in),parameter :: f_wmelt_HDO =40 ! water: melting - integer(in),parameter :: f_wrain_HDO =41 ! water: precip, liquid - integer(in),parameter :: f_wsnow_HDO =42 ! water: precip, frozen - integer(in),parameter :: f_wevap_HDO =43 ! water: evaporation - integer(in),parameter :: f_wroff_HDO =44 ! water: runoff/flood - integer(in),parameter :: f_wioff_HDO =45 ! 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 @@ -192,7 +194,8 @@ module seq_diag_mct (/' area',' hfreeze',' hmelt',' hnetsw',' hlwdn', & ' hlwup',' hlatvap',' hlatfus',' hiroff',' hsen', & - ' hberg',' hh2otemp',' wfreeze',' wmelt',' wrain', & + ' hberg',' hism',' hriof', & + ' hh2otemp',' wfreeze',' wmelt',' wrain', & ' wsnow',' wevap',' wrunoff',' wfrzrof', & ' wberg',' wism',' wrrof',' wriof', & ' wirrig', & @@ -291,10 +294,12 @@ module seq_diag_mct integer :: index_o2x_Faoo_h2otemp integer :: index_o2x_Fioo_frazil integer :: index_o2x_Fioo_q -!DC - do we want P in front of these fields? + 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 @@ -1384,6 +1389,8 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa 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) @@ -1401,6 +1408,8 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! think this is right scaling 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) ! think this is right scaling + 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 @@ -1512,10 +1521,6 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa 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) -!DC new entries should not be here, done above with o2x -! nf = f_wism ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) -! nf = f_wrrof ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) -! nf = f_wriof ; 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) @@ -1671,7 +1676,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_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) !DC propose removing wberg from ice entry ! 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) diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index d3ed51bc694e..2d6f84ade096 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -1582,7 +1582,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) units = 'kg m-2 s-1' attname = 'PFioi_bergw' call metadata_set(attname, longname, stdname, units) -!DC ismw needs P, removed runoff terms do not + ! Water flux from ice shelf melt call seq_flds_add(o2x_fluxes,"Foxo_ismw") longname = 'Water flux due to basal melting of ice shelves' @@ -1591,6 +1591,14 @@ subroutine seq_flds_set(nmlfile, ID, infodata) 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 = 'J m-2 s-1' + 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' @@ -1607,6 +1615,14 @@ subroutine seq_flds_set(nmlfile, ID, infodata) 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 = 'J m-2 s-1' + 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 dbe3477f6c4a3914ffd377cd736fdcb056724481 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Fri, 9 Feb 2024 11:54:11 -0600 Subject: [PATCH 13/15] Changing units to W/m^2 --- components/mpas-ocean/src/Registry.xml | 4 ++-- driver-mct/shr/seq_flds_mod.F90 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index e5f520609086..a953b64d8f8e 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -3693,7 +3693,7 @@ - - diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index 2d6f84ade096..cb41fa6439f2 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -1595,7 +1595,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(o2x_fluxes,"Foxo_ismh") longname = 'Heat flux due to basal melting of ice shelves' stdname = 'basal_iceshelf_heat_flux' - units = 'J m-2 s-1' + units = 'W m-2' attname = 'Foxo_ismh' call metadata_set(attname, longname, stdname, units) @@ -1619,7 +1619,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(o2x_fluxes,"Foxo_rrofih") longname = 'Heat flux due to removed solid runoff' stdname = 'removed_solid_runoff_heat_flux' - units = 'J m-2 s-1' + units = 'W m-2' attname = 'Foxo_rrofih' call metadata_set(attname, longname, stdname, units) From e68e422df61dc60bc1f90e2f33d2049de03adf91 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Wed, 7 Feb 2024 17:13:50 -0600 Subject: [PATCH 14/15] Fixup units of accumulated mass fluxes in conservation AM --- .../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 5c20fd0a5672..295ad031930c 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 5d3f8c15fe8053b25fe2d067408b760427c3beb0 Mon Sep 17 00:00:00 2001 From: Darin Comeau Date: Fri, 9 Feb 2024 12:04:57 -0600 Subject: [PATCH 15/15] cleaning up comments --- components/mpas-ocean/driver/ocn_comp_mct.F | 2 -- driver-mct/main/seq_diag_mct.F90 | 13 +++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index acb66140b6bc..567c39e607c1 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -3619,7 +3619,6 @@ subroutine ocn_import_moab( Eclock, errorCode)!{{{ endif if ( landIceFreshwaterFluxField % isActive ) then -!DC is this ok with proposed implementation? think so since different coupling field !landIceFreshwaterFlux(i) = x2o_om(n, index_x2o_Fogx_qicelo) end if if ( landIceHeatFluxField % isActive ) then @@ -4140,7 +4139,6 @@ subroutine ocn_export_moab(EClock) !{{{ o2x_om(n, index_o2x_Faoo_h2otemp) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw -!DC, blindly following pattern 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) diff --git a/driver-mct/main/seq_diag_mct.F90 b/driver-mct/main/seq_diag_mct.F90 index 5e089e279cf5..f3c466f15e9b 100644 --- a/driver-mct/main/seq_diag_mct.F90 +++ b/driver-mct/main/seq_diag_mct.F90 @@ -1398,17 +1398,15 @@ 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) !DC area including ice-shelf cavities + 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) -!DC do we need only ca_o, if use P above? -! nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! gives 0, different scaling? - nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! think this is right scaling + 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) ! think this is right scaling + 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 @@ -1639,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') @@ -1678,7 +1676,6 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) 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) -!DC propose removing wberg from ice entry ! 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)