From df081576de23a529d173af05f29194972311ba8f Mon Sep 17 00:00:00 2001 From: Andrew Brooks Date: Mon, 20 Nov 2023 13:39:09 -0500 Subject: [PATCH 1/2] Subroutines fms_xgrid_stock_move() and fms_xgrid_stock_move_ug() have had their internal variable DATA changed to stock_data3d, stock_data2d, or stock_ug_data3d depending on which variant of the stock_move subroutine is used (stock_move_3d, stock_move_2d, stock_move_ug_3d, respectively). When calling these subroutines, the internal variable is referenced accordingly, reflecting these changes FMS xgrid_mod. --- full/atm_land_ice_flux_exchange.F90 | 24 ++++++++++++------------ full/land_ice_flux_exchange.F90 | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/full/atm_land_ice_flux_exchange.F90 b/full/atm_land_ice_flux_exchange.F90 index 521c0b30..3ce54939 100644 --- a/full/atm_land_ice_flux_exchange.F90 +++ b/full/atm_land_ice_flux_exchange.F90 @@ -2577,7 +2577,7 @@ subroutine flux_down_from_atmos (Time, Atm, Land, Ice, Atmos_boundary, Land_boun call fms_xgrid_stock_move_ug( & & FROM = fms_stock_constants_atm_stock(ISTOCK_WATER), & & TO = fms_stock_constants_lnd_stock(ISTOCK_WATER), & - & DATA = (Land_boundary%lprec + Land_boundary%fprec), & + & stock_ug_data3d = (Land_boundary%lprec + Land_boundary%fprec), & & grid_index=X1_GRID_LND, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -2588,7 +2588,7 @@ subroutine flux_down_from_atmos (Time, Atm, Land, Ice, Atmos_boundary, Land_boun call fms_xgrid_stock_move_ug( & & FROM = fms_stock_constants_atm_stock(ISTOCK_HEAT), & & TO = fms_stock_constants_lnd_stock(ISTOCK_HEAT), & - & DATA = (-Land_boundary%t_flux + Land_boundary%lw_flux + Land_boundary%sw_flux - Land_boundary%fprec*HLF), & + & stock_ug_data3d = (-Land_boundary%t_flux + Land_boundary%lw_flux + Land_boundary%sw_flux - Land_boundary%fprec*HLF), & & grid_index=X1_GRID_LND, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -2598,7 +2598,7 @@ subroutine flux_down_from_atmos (Time, Atm, Land, Ice, Atmos_boundary, Land_boun call fms_xgrid_stock_move( & & FROM = fms_stock_constants_atm_stock(ISTOCK_WATER), & & TO = fms_stock_constants_lnd_stock(ISTOCK_WATER), & - & DATA = (Land_boundary%lprec + Land_boundary%fprec), & + & stock_data3d = (Land_boundary%lprec + Land_boundary%fprec), & & grid_index=X1_GRID_LND, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -2609,7 +2609,7 @@ subroutine flux_down_from_atmos (Time, Atm, Land, Ice, Atmos_boundary, Land_boun call fms_xgrid_stock_move( & & FROM = fms_stock_constants_atm_stock(ISTOCK_HEAT), & & TO = fms_stock_constants_lnd_stock(ISTOCK_HEAT), & - & DATA = (-Land_boundary%t_flux + Land_boundary%lw_flux + Land_boundary%sw_flux - Land_boundary%fprec*HLF), & + & stock_data3d = (-Land_boundary%t_flux + Land_boundary%lw_flux + Land_boundary%sw_flux - Land_boundary%fprec*HLF), & & grid_index=X1_GRID_LND, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -2621,7 +2621,7 @@ subroutine flux_down_from_atmos (Time, Atm, Land, Ice, Atmos_boundary, Land_boun call fms_xgrid_stock_move( & & FROM = fms_stock_constants_atm_stock(ISTOCK_WATER), & & TO = fms_stock_constants_ice_stock(ISTOCK_WATER), & - & DATA = (Ice_boundary%lprec + Ice_boundary%fprec), & + & stock_data2d = (Ice_boundary%lprec + Ice_boundary%fprec), & & grid_index=X1_GRID_ICE, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -2632,7 +2632,7 @@ subroutine flux_down_from_atmos (Time, Atm, Land, Ice, Atmos_boundary, Land_boun call fms_xgrid_stock_move( & & FROM = fms_stock_constants_atm_stock(ISTOCK_HEAT), & & TO = fms_stock_constants_ice_stock(ISTOCK_HEAT), & - & DATA = (-Ice_boundary%t_flux + Ice_boundary%lw_flux - Ice_boundary%fprec*HLF + Ice_boundary%sw_flux_vis_dir + & + & stock_data2d = (-Ice_boundary%t_flux + Ice_boundary%lw_flux - Ice_boundary%fprec*HLF + Ice_boundary%sw_flux_vis_dir + & Ice_boundary%sw_flux_vis_dif + Ice_boundary%sw_flux_nir_dir + Ice_boundary%sw_flux_nir_dif), & & grid_index=X1_GRID_ICE, & & xmap=xmap_sfc, & @@ -3097,7 +3097,7 @@ subroutine flux_up_to_atmos ( Time, Land, Ice, Land_Ice_Atmos_Boundary, Land_bou call fms_xgrid_stock_move_ug( & & TO = fms_stock_constants_atm_stock(ISTOCK_WATER), & & FROM = fms_stock_constants_lnd_stock(ISTOCK_WATER), & - & DATA = data_lnd, & + & stock_ug_data3d = data_lnd, & & grid_index=X1_GRID_LND, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -3108,7 +3108,7 @@ subroutine flux_up_to_atmos ( Time, Land, Ice, Land_Ice_Atmos_Boundary, Land_bou call fms_xgrid_stock_move_ug( & & TO = fms_stock_constants_atm_stock(ISTOCK_HEAT), & & FROM = fms_stock_constants_lnd_stock(ISTOCK_HEAT), & - & DATA = data_lnd * HLV, & + & stock_ug_data3d = data_lnd * HLV, & & grid_index=X1_GRID_LND, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -3123,7 +3123,7 @@ subroutine flux_up_to_atmos ( Time, Land, Ice, Land_Ice_Atmos_Boundary, Land_bou call fms_xgrid_stock_move( & & TO = fms_stock_constants_atm_stock(ISTOCK_WATER), & & FROM = fms_stock_constants_lnd_stock(ISTOCK_WATER), & - & DATA = data_lnd, & + & stock_data3d = data_lnd, & & grid_index=X1_GRID_LND, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -3134,7 +3134,7 @@ subroutine flux_up_to_atmos ( Time, Land, Ice, Land_Ice_Atmos_Boundary, Land_bou call fms_xgrid_stock_move( & & TO = fms_stock_constants_atm_stock(ISTOCK_HEAT), & & FROM = fms_stock_constants_lnd_stock(ISTOCK_HEAT), & - & DATA = data_lnd * HLV, & + & stock_data3d = data_lnd * HLV, & & grid_index=X1_GRID_LND, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -3148,7 +3148,7 @@ subroutine flux_up_to_atmos ( Time, Land, Ice, Land_Ice_Atmos_Boundary, Land_bou call fms_xgrid_stock_move( & & TO = fms_stock_constants_atm_stock(ISTOCK_WATER), & & FROM = fms_stock_constants_ice_stock(ISTOCK_WATER), & - & DATA = data_ice, & + & stock_data3d = data_ice, & & grid_index=X1_GRID_ICE, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -3159,7 +3159,7 @@ subroutine flux_up_to_atmos ( Time, Land, Ice, Land_Ice_Atmos_Boundary, Land_bou call fms_xgrid_stock_move( & & TO = fms_stock_constants_atm_stock(ISTOCK_HEAT), & & FROM = fms_stock_constants_ice_stock(ISTOCK_HEAT), & - & DATA = data_ice * HLV, & + & stock_data3d = data_ice * HLV, & & grid_index=X1_GRID_ICE, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & diff --git a/full/land_ice_flux_exchange.F90 b/full/land_ice_flux_exchange.F90 index 295148e0..7a6e6312 100644 --- a/full/land_ice_flux_exchange.F90 +++ b/full/land_ice_flux_exchange.F90 @@ -142,7 +142,7 @@ subroutine flux_land_to_ice( Time, Land, Ice, Land_Ice_Boundary ) ice_buf(:,:,1) = Land_Ice_Boundary%runoff + Land_Ice_Boundary%calving call fms_xgrid_stock_move(from=fms_stock_constants_lnd_stock(ISTOCK_WATER), to=fms_stock_constants_ice_stock(ISTOCK_WATER), & & grid_index=X2_GRID_ICE, & - & data=ice_buf, & + & stock_data3d=ice_buf, & & xmap=xmap_runoff, & & delta_t=Dt_cpl, & & from_side=ISTOCK_SIDE, to_side=ISTOCK_SIDE, & From 79c34dff9c56aea76c2aa371b3d7a1d341e707c9 Mon Sep 17 00:00:00 2001 From: Andrew Brooks Date: Tue, 21 Nov 2023 14:20:43 -0500 Subject: [PATCH 2/2] Ice_boundary arrays have 3d not 2d --- full/atm_land_ice_flux_exchange.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/full/atm_land_ice_flux_exchange.F90 b/full/atm_land_ice_flux_exchange.F90 index 3ce54939..4f32b508 100644 --- a/full/atm_land_ice_flux_exchange.F90 +++ b/full/atm_land_ice_flux_exchange.F90 @@ -2621,7 +2621,7 @@ subroutine flux_down_from_atmos (Time, Atm, Land, Ice, Atmos_boundary, Land_boun call fms_xgrid_stock_move( & & FROM = fms_stock_constants_atm_stock(ISTOCK_WATER), & & TO = fms_stock_constants_ice_stock(ISTOCK_WATER), & - & stock_data2d = (Ice_boundary%lprec + Ice_boundary%fprec), & + & stock_data3d = (Ice_boundary%lprec + Ice_boundary%fprec), & & grid_index=X1_GRID_ICE, & & xmap=xmap_sfc, & & delta_t=Dt_atm, & @@ -2632,7 +2632,7 @@ subroutine flux_down_from_atmos (Time, Atm, Land, Ice, Atmos_boundary, Land_boun call fms_xgrid_stock_move( & & FROM = fms_stock_constants_atm_stock(ISTOCK_HEAT), & & TO = fms_stock_constants_ice_stock(ISTOCK_HEAT), & - & stock_data2d = (-Ice_boundary%t_flux + Ice_boundary%lw_flux - Ice_boundary%fprec*HLF + Ice_boundary%sw_flux_vis_dir + & + & stock_data3d = (-Ice_boundary%t_flux + Ice_boundary%lw_flux - Ice_boundary%fprec*HLF + Ice_boundary%sw_flux_vis_dir + & Ice_boundary%sw_flux_vis_dif + Ice_boundary%sw_flux_nir_dir + Ice_boundary%sw_flux_nir_dif), & & grid_index=X1_GRID_ICE, & & xmap=xmap_sfc, &