From e716d37a8168c8baebd256e5f1011282b3aa26a6 Mon Sep 17 00:00:00 2001 From: "Joseph.Mouallem" Date: Fri, 27 Mar 2026 14:33:35 -0400 Subject: [PATCH 1/3] call to populate surf_diff which is moved elsewhere --- SHiELD/atmos_model.F90 | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/SHiELD/atmos_model.F90 b/SHiELD/atmos_model.F90 index 9e65de3..03aced1 100644 --- a/SHiELD/atmos_model.F90 +++ b/SHiELD/atmos_model.F90 @@ -75,6 +75,7 @@ module atmos_model_mod use atmosphere_mod, only: atmosphere_coarse_diag_axes use atmosphere_mod, only: atmosphere_coarsening_strategy use atmosphere_mod, only: Atm, mygrid +use atmosphere_mod, only: populate_surf_diff, surf_diff_type use block_control_mod, only: block_control_type, define_blocks_packed use IPD_typedefs, only: IPD_init_type, IPD_control_type, & IPD_data_type, IPD_diag_type, & @@ -124,29 +125,6 @@ module atmos_model_mod public atm_stock_pe !----------------------------------------------------------------------- -! -! FROM AM4/src/atmos_phys/atmos_param/vert_diff/vert_diff.F90 -! Surface diffusion derived type data -type surf_diff_type - - real, pointer, dimension(:,:) :: dtmass => NULL(), & !dt / mass (mass of lower atmospheric layer) - dflux_t => NULL(), & ! temperature flux derivative at the top of the lowest atmospheric - ! layer with respect to the temperature of that layer (J/(m2 K)) - delta_t => NULL(), & ! the increment in temperature in the lowest atmospheric layer - delta_u => NULL(), & ! same for u - delta_v => NULL() ! same for v - real, pointer, dimension(:,:,:) :: tdt_dyn => NULL(), & ! no explanation found in the vert_diff.F90 - qdt_dyn => NULL(), &! no explanation found in the vert_diff.F90 - dgz_dyn => NULL(), &! no explanation found in the vert_diff.F90 - ddp_dyn => NULL(), &! no explanation found in the vert_diff.F90 - - tdt_rad => NULL() !miz - - real, pointer, dimension(:,:,:) :: dflux_tr => NULL(),& ! tracer flux tendency - delta_tr => NULL() ! tracer tendency -end type surf_diff_type -! - ! type atmos_data_type ! Atmosphere related variables @@ -372,7 +350,7 @@ subroutine update_atmos_model_down( Surface_boundary, Atmos ) ! !----------------------------------------------------------------------- -type(land_ice_atmos_boundary_type), intent(in) :: Surface_boundary +type(land_ice_atmos_boundary_type), intent(inout) :: Surface_boundary type (atmos_data_type), intent(inout) :: Atmos integer :: nb @@ -419,6 +397,13 @@ subroutine update_atmos_model_down( Surface_boundary, Atmos ) !-------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------- +! after the downward sweep, populate these quantities in atmos%surf_diff +! used in flux_down_from_atmos for implicit coupling ! Joseph +!-------------------------------------------------------------------------------------------- +if (mpp_pe() == mpp_root_pe() .and. debug) write(6,*) "Populate surf_diff for implicit coupling" +call populate_surf_diff ( Atmos%surf_diff, IPD_Data, IAU_Data, Atm_block) +!call update_surface_boundary_from_down (Surface_boundary, IPD_Data, IAU_Data, Atm_block) + call mpp_clock_end(shieldClock) call mpp_set_current_pelist() !should exit with global pelist to accomodate the full coupler atmos clock @@ -1306,6 +1291,7 @@ subroutine apply_fluxes_from_IPD_to_Atmos ( Atmos ) ! cosine of zenith angle Atmos%coszen(i,j) = IPD_Data(nb)%Coupling%coszena(ix) + !Atmos%coszen(i,j) = IPD_Data(nb)%Radtend%coszen(ix) ! use this for land coupling ! visible only Atmos%flux_sw_down_vis_dir(i,j) = visbmd ! downward visible sw flux at surface - direct From c5e8adba9e65e19a5393e5bb52cc08af6207a351 Mon Sep 17 00:00:00 2001 From: "Joseph.Mouallem" Date: Tue, 14 Apr 2026 17:12:10 -0400 Subject: [PATCH 2/3] re-enable land feedback --- SHiELD/atmos_model.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SHiELD/atmos_model.F90 b/SHiELD/atmos_model.F90 index 03aced1..babb12a 100644 --- a/SHiELD/atmos_model.F90 +++ b/SHiELD/atmos_model.F90 @@ -75,7 +75,7 @@ module atmos_model_mod use atmosphere_mod, only: atmosphere_coarse_diag_axes use atmosphere_mod, only: atmosphere_coarsening_strategy use atmosphere_mod, only: Atm, mygrid -use atmosphere_mod, only: populate_surf_diff, surf_diff_type +use atmosphere_mod, only: populate_surf_diff, land_feedback, surf_diff_type use block_control_mod, only: block_control_type, define_blocks_packed use IPD_typedefs, only: IPD_init_type, IPD_control_type, & IPD_data_type, IPD_diag_type, & @@ -458,9 +458,10 @@ subroutine update_atmos_model_up( Surface_boundary, Atmos ) call set_atmosphere_pelist() ! should be called before local clocks since they are defined on local atm(n)%pelist call mpp_clock_begin(shieldClock) - !Atmos%Surf_diff%delta_t = Surface_boundary%dt_t - !Atmos%Surf_diff%delta_tr = Surface_boundary%dt_tr + Atmos%Surf_diff%delta_t = Surface_boundary%dt_t + Atmos%Surf_diff%delta_tr = Surface_boundary%dt_tr + call land_feedback ( Atmos%surf_diff, IPD_Data, IAU_Data, Atm_block) !--- execute the IPD atmospheric physics step1 subcomponent (main physics driver) call mpp_clock_begin(physClock) !$OMP parallel do default (none) & From 268ca10c582b8d49d4539571f864f5500cfee3ae Mon Sep 17 00:00:00 2001 From: JosephMouallem <75327266+JosephMouallem@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:33:38 -0400 Subject: [PATCH 3/3] cosmetic --- SHiELD/atmos_model.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SHiELD/atmos_model.F90 b/SHiELD/atmos_model.F90 index babb12a..1dfccbf 100644 --- a/SHiELD/atmos_model.F90 +++ b/SHiELD/atmos_model.F90 @@ -397,9 +397,12 @@ subroutine update_atmos_model_down( Surface_boundary, Atmos ) !-------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------- ! after the downward sweep, populate these quantities in atmos%surf_diff ! used in flux_down_from_atmos for implicit coupling ! Joseph !-------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------- if (mpp_pe() == mpp_root_pe() .and. debug) write(6,*) "Populate surf_diff for implicit coupling" call populate_surf_diff ( Atmos%surf_diff, IPD_Data, IAU_Data, Atm_block) !call update_surface_boundary_from_down (Surface_boundary, IPD_Data, IAU_Data, Atm_block)