From f126b8f19831230f7176177b184c2b65099df673 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Thu, 14 Apr 2022 21:22:40 -0500 Subject: [PATCH 001/192] Update submodule atmos_cubed_sphere. --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6bb663df1a..6a5811ad90 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere + branch = feature/hafsv0.3_final [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework From ab314b45153ff0dc79b1ff1c2977b6c26bea5133 Mon Sep 17 00:00:00 2001 From: William Ramstrom Date: Fri, 15 Apr 2022 21:14:26 +0000 Subject: [PATCH 002/192] Performance optimization of moving nest. --- atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 799d9432b8..c5ddec2a68 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 799d9432b84370101feadb0df20c14a043ea11a8 +Subproject commit c5ddec2a68d95228cab8895b5dac1432db18d006 From bf80a9173f900246218952b9b34a5e0d03af6e28 Mon Sep 17 00:00:00 2001 From: William Ramstrom Date: Mon, 2 May 2022 02:35:57 +0000 Subject: [PATCH 003/192] Moving nest performance optimization stage 2. --- atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index c5ddec2a68..2b413b549d 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit c5ddec2a68d95228cab8895b5dac1432db18d006 +Subproject commit 2b413b549d344522cd6eb4db0c53d8d68081f1cd From b4e6b97f642483ab6a48c5f84cba6f95cecd368e Mon Sep 17 00:00:00 2001 From: "Rusty.Benson" Date: Tue, 3 May 2022 09:04:46 -0400 Subject: [PATCH 004/192] update gitmodules and hash for atmos_cubed_sphere --- .gitmodules | 4 ++-- atmos_cubed_sphere | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6bb663df1a..45779e2d1b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/bensonr/GFDL_atmos_cubed_sphere + branch = emc_io_fixes [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index fad4c9f1fc..b67bc5d154 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit fad4c9f1fc29c0cbb47df9a07a573249155a1c42 +Subproject commit b67bc5d154da2911d20b7a07716ec645eb2a1f0e From 01c494ab4122a6b136ede280b555da415cf9e718 Mon Sep 17 00:00:00 2001 From: "Rusty.Benson" Date: Tue, 3 May 2022 09:06:58 -0400 Subject: [PATCH 005/192] update atmos_model and FV3GFS_io read performance when io_layout=1,1 and allow one to override data integrity checks in FMS restart logic --- atmos_model.F90 | 13 +++++++++---- io/FV3GFS_io.F90 | 35 +++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index 35433c774a..e0604d688d 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -146,6 +146,7 @@ module atmos_model_mod real(kind=8), pointer, dimension(:,:) :: area real(kind=8), pointer, dimension(:,:,:) :: layer_hgt, level_hgt type(domain2d) :: domain ! domain decomposition + type(domain2d) :: domain_for_read ! domain decomposition type(time_type) :: Time ! current time type(time_type) :: Time_step ! atmospheric time step. type(time_type) :: Time_init ! reference time. @@ -173,7 +174,9 @@ module atmos_model_mod !logical :: debug = .true. logical :: sync = .false. real :: avg_max_length=3600. -namelist /atmos_model_nml/ blocksize, chksum_debug, dycore_only, debug, sync, ccpp_suite, avg_max_length +logical :: ignore_rst_cksum = .false. +namelist /atmos_model_nml/ blocksize, chksum_debug, dycore_only, debug, sync, ccpp_suite, avg_max_length, & + ignore_rst_cksum type (time_type) :: diag_time, diag_time_fhzero @@ -553,7 +556,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) !----------------------------------------------------------------------- call atmosphere_resolution (nlon, nlat, global=.false.) call atmosphere_resolution (mlon, mlat, global=.true.) - call atmosphere_domain (Atmos%domain, Atmos%layout, Atmos%regional, Atmos%nested, & + call atmosphere_domain (Atmos%domain, Atmos%domain_for_read, Atmos%layout, & + Atmos%regional, Atmos%nested, & Atmos%moving_nest_parent, Atmos%is_moving_nest, & Atmos%ngrids, Atmos%mygrid, Atmos%pelist) call atmosphere_diag_axes (Atmos%axes) @@ -718,7 +722,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) call GFS_restart_populate (GFS_restart_var, GFS_control, GFS_data%Statein, GFS_data%Stateout, GFS_data%Sfcprop, & GFS_data%Coupling, GFS_data%Grid, GFS_data%Tbd, GFS_data%Cldprop, GFS_data%Radtend, & GFS_data%IntDiag, Init_parm, GFS_Diag) - call FV3GFS_restart_read (GFS_data, GFS_restart_var, Atm_block, GFS_control, Atmos%domain, Atm(mygrid)%flagstruct%warm_start) + call FV3GFS_restart_read (GFS_data, GFS_restart_var, Atm_block, GFS_control, Atmos%domain_for_read, & + Atm(mygrid)%flagstruct%warm_start, ignore_rst_cksum) if(GFS_control%do_ca .and. Atm(mygrid)%flagstruct%warm_start)then call read_ca_restart (Atmos%domain,GFS_control%ncells,GFS_control%nca,GFS_control%ncells_g,GFS_control%nca_g) endif @@ -3091,7 +3096,7 @@ subroutine atmos_model_get_nth_domain_info(n, layout, nx, ny, pelist) integer, pointer, intent(out) :: pelist(:) call get_nth_domain_info(n, layout, nx, ny, pelist) - + end subroutine atmos_model_get_nth_domain_info end module atmos_model_mod diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index 041a2d46bc..6fc4c20a93 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -115,19 +115,20 @@ module FV3GFS_io_mod !-------------------- ! FV3GFS_restart_read !-------------------- - subroutine FV3GFS_restart_read (GFS_Data, GFS_Restart, Atm_block, Model, fv_domain, warm_start) + subroutine FV3GFS_restart_read (GFS_Data, GFS_Restart, Atm_block, Model, fv_domain, warm_start, ignore_rst_cksum) type(GFS_data_type), intent(inout) :: GFS_Data(:) type(GFS_restart_type), intent(inout) :: GFS_Restart type(block_control_type), intent(in) :: Atm_block type(GFS_control_type), intent(inout) :: Model type(domain2d), intent(in) :: fv_domain logical, intent(in) :: warm_start + logical, intent(in) :: ignore_rst_cksum !--- read in surface data from chgres - call sfc_prop_restart_read (GFS_Data%Sfcprop, Atm_block, Model, fv_domain, warm_start) + call sfc_prop_restart_read (GFS_Data%Sfcprop, Atm_block, Model, fv_domain, warm_start, ignore_rst_cksum) !--- read in physics restart data - call phys_restart_read (GFS_Restart, Atm_block, Model, fv_domain) + call phys_restart_read (GFS_Restart, Atm_block, Model, fv_domain, ignore_rst_cksum) end subroutine FV3GFS_restart_read @@ -501,13 +502,14 @@ end subroutine FV3GFS_GFS_checksum ! opens: oro_data.tile?.nc, sfc_data.tile?.nc ! !---------------------------------------------------------------------- - subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_start) + subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_start, ignore_rst_cksum) !--- interface variable definitions type(GFS_sfcprop_type), intent(inout) :: Sfcprop(:) type (block_control_type), intent(in) :: Atm_block type(GFS_control_type), intent(inout) :: Model type (domain2d), intent(in) :: fv_domain logical, intent(in) :: warm_start + logical, intent(in) :: ignore_rst_cksum !--- local variables integer :: i, j, k, ix, lsoil, num, nb, i_start, j_start, i_end, j_end integer :: isc, iec, jsc, jec, npz, nx, ny @@ -529,8 +531,8 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta character(37) :: infile !--- fms2_io file open logic logical :: amiopen - logical :: is_lsoil - + logical :: is_lsoil + nvar_o2 = 19 nvar_oro_ls_ss = 10 nvar_s2o = 18 @@ -618,7 +620,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta !--- read the orography restart/data call mpp_error(NOTE,'reading topographic/orographic information from INPUT/oro_data.tile*.nc') - call read_restart(Oro_restart) + call read_restart(Oro_restart, ignore_checksum=ignore_rst_cksum) call close_file(Oro_restart) @@ -726,11 +728,11 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta !--- read new GSL created orography restart/data call mpp_error(NOTE,'reading topographic/orographic information from & &INPUT/oro_data_ls.tile*.nc') - call read_restart(Oro_ls_restart) + call read_restart(Oro_ls_restart, ignore_checksum=ignore_rst_cksum) call close_file(Oro_ls_restart) call mpp_error(NOTE,'reading topographic/orographic information from & &INPUT/oro_data_ss.tile*.nc') - call read_restart(Oro_ss_restart) + call read_restart(Oro_ss_restart, ignore_checksum=ignore_rst_cksum) call close_file(Oro_ss_restart) @@ -960,7 +962,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta call register_axis(Sfc_restart, 'xaxis_1', 'X') call register_axis(Sfc_restart, 'yaxis_1', 'Y') call register_axis(Sfc_restart, 'zaxis_1', dimension_length=Model%kice) - + if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp) then call register_axis(Sfc_restart, 'zaxis_2', dimension_length=Model%lsoil) else if(Model%lsm == Model%lsm_ruc) then @@ -1086,7 +1088,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta end if end if enddo - + if (Model%lsm == Model%lsm_noahmp) then mand = .false. do num = nvar_s3+1,nvar_s3+3 @@ -1119,7 +1121,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta !--- read the surface restart/data call mpp_error(NOTE,'reading surface properties data from INPUT/sfc_data.tile*.nc') - call read_restart(Sfc_restart) + call read_restart(Sfc_restart, ignore_checksum=ignore_rst_cksum) call close_file(Sfc_restart) ! write(0,*)' stype read in min,max=',minval(sfc_var2(:,:,35)),maxval(sfc_var2(:,:,35)),' sfc_name2=',sfc_name2(35) @@ -2064,11 +2066,11 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta var3_p2 => sfc_var3eq(:,:,:,7) call register_restart_field(Sfc_restart, sfc_name3(7), var3_p2, dimensions=(/'xaxis_1', 'yaxis_1', 'zaxis_2', 'Time '/),& &is_optional=.not.mand) - + var3_p3 => sfc_var3zn(:,:,:,8) call register_restart_field(Sfc_restart, sfc_name3(8), var3_p3, dimensions=(/'xaxis_1', 'yaxis_1', 'zaxis_4', 'Time '/),& &is_optional=.not.mand) - + nullify(var3_p1) nullify(var3_p2) nullify(var3_p3) @@ -2274,12 +2276,13 @@ end subroutine sfc_prop_restart_write ! opens: phys_data.tile?.nc ! !---------------------------------------------------------------------- - subroutine phys_restart_read (GFS_Restart, Atm_block, Model, fv_domain) + subroutine phys_restart_read (GFS_Restart, Atm_block, Model, fv_domain, ignore_rst_cksum) !--- interface variable definitions type(GFS_restart_type), intent(in) :: GFS_Restart type(block_control_type), intent(in) :: Atm_block type(GFS_control_type), intent(in) :: Model type(domain2d), intent(in) :: fv_domain + logical, intent(in) :: ignore_rst_cksum !--- local variables integer :: i, j, k, nb, ix, num integer :: isc, iec, jsc, jec, npz, nx, ny @@ -2340,7 +2343,7 @@ subroutine phys_restart_read (GFS_Restart, Atm_block, Model, fv_domain) !--- read the surface restart/data call mpp_error(NOTE,'reading physics restart data from INPUT/phy_data.tile*.nc') - call read_restart(Phy_restart) + call read_restart(Phy_restart, ignore_checksum=ignore_rst_cksum) call close_file(Phy_restart) !--- place the data into the block GFS containers From 18fffe3f900c4c41ac0fb8f81f7e7764ae51a197 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Tue, 17 May 2022 09:15:51 -0500 Subject: [PATCH 006/192] Add the following HAFS ccpp physics suites (@ChunxiZhang-NOAA and @BinLiu-NOAA): suite_FV3_HAFS_v0_thompson.xml suite_FV3_HAFS_v0_thompson_nonsst.xml suite_FV3_HAFS_v0_thompson_noahmp.xml suite_FV3_HAFS_v0_thompson_noahmp_nonsst.xml --- ccpp/suites/suite_FV3_HAFS_v0_thompson.xml | 91 +++++++++++++++++++ .../suite_FV3_HAFS_v0_thompson_noahmp.xml | 91 +++++++++++++++++++ ...ite_FV3_HAFS_v0_thompson_noahmp_nonsst.xml | 89 ++++++++++++++++++ .../suite_FV3_HAFS_v0_thompson_nonsst.xml | 89 ++++++++++++++++++ 4 files changed, 360 insertions(+) create mode 100644 ccpp/suites/suite_FV3_HAFS_v0_thompson.xml create mode 100644 ccpp/suites/suite_FV3_HAFS_v0_thompson_noahmp.xml create mode 100644 ccpp/suites/suite_FV3_HAFS_v0_thompson_noahmp_nonsst.xml create mode 100644 ccpp/suites/suite_FV3_HAFS_v0_thompson_nonsst.xml diff --git a/ccpp/suites/suite_FV3_HAFS_v0_thompson.xml b/ccpp/suites/suite_FV3_HAFS_v0_thompson.xml new file mode 100644 index 0000000000..cabdf3d597 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v0_thompson.xml @@ -0,0 +1,91 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_FV3_HAFS_v0_thompson_noahmp.xml b/ccpp/suites/suite_FV3_HAFS_v0_thompson_noahmp.xml new file mode 100644 index 0000000000..8d9820b98b --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v0_thompson_noahmp.xml @@ -0,0 +1,91 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + noahmpdrv + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_FV3_HAFS_v0_thompson_noahmp_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v0_thompson_noahmp_nonsst.xml new file mode 100644 index 0000000000..2dd08712d8 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v0_thompson_noahmp_nonsst.xml @@ -0,0 +1,89 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_ocean + noahmpdrv + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_FV3_HAFS_v0_thompson_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v0_thompson_nonsst.xml new file mode 100644 index 0000000000..5e2f5cd905 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v0_thompson_nonsst.xml @@ -0,0 +1,89 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_ocean + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + From 725fe8eea543504bf19c54ec423a08cdd87a3826 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sat, 21 May 2022 10:53:25 +0000 Subject: [PATCH 007/192] Update submodule UPP to point its latest develop branch as of 05/18/2022. --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index dc8bc684a3..fbd41a58fa 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit dc8bc684a3e38eae5ff4431e24672b6382127d70 +Subproject commit fbd41a58fa301551fa3337be313abafec265374a From 63b3f23e200c8dc91c68de3261aff19b0760158e Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 10 Jun 2022 17:13:47 +0000 Subject: [PATCH 008/192] Update submodule upp, which has the fix for regional latlon grid crossing the prime meridian. --- .gitmodules | 4 ++-- upp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6a5811ad90..2bd156415d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,5 +12,5 @@ branch = main [submodule "upp"] path = upp - url = https://github.com/NOAA-EMC/UPP - branch = develop + url = https://github.com/hafs-community/UPP + branch = feature/hafsv0.3_final diff --git a/upp b/upp index fbd41a58fa..0884567468 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit fbd41a58fa301551fa3337be313abafec265374a +Subproject commit 08845674689e0195f9aaa11f5441aeaa761585e7 From 324924f89ae11bb477e98b8333301eafc4e733f4 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 17 Jun 2022 12:36:23 -0500 Subject: [PATCH 009/192] Only call atmosphere_fill_nest_cpl at the cap driver time steps (coupling time steps). This is to reduce the overhead introduced by downscaling the coupling variables from FV3ATM parent to nest. --- atmos_model.F90 | 4 +++- module_fcst_grid_comp.F90 | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index e0604d688d..99d40a0380 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -132,6 +132,7 @@ module atmos_model_mod logical :: nested ! true if there is a nest logical :: moving_nest_parent ! true if this grid has a moving nest child logical :: is_moving_nest ! true if this is a moving nest grid + logical :: isAtCapTime ! true if currTime is at the cap driverClock's currTime integer :: ngrids ! integer :: mygrid ! integer :: mlon, mlat @@ -296,7 +297,7 @@ subroutine update_atmos_radiation_physics (Atmos) ! receives coupled fields through the above assign_importdata step. Thus, ! an extra step is needed to fill the coupling variables in the nest, ! by downscaling the coupling variables from its parent. - if (Atmos%ngrids > 1) then + if (Atmos%isAtCapTime .and. Atmos%ngrids > 1) then if (GFS_control%cplocn2atm .or. GFS_control%cplwav2atm) then call atmosphere_fill_nest_cpl(Atm_block, GFS_control, GFS_data) endif @@ -540,6 +541,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) !---- set the atmospheric model time ------ + Atmos % isAtCapTime = .false. Atmos % Time_init = Time_init Atmos % Time = Time Atmos % Time_step = Time_step diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 886f23a233..5da54b2c03 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -1142,6 +1142,9 @@ subroutine fcst_run_phase_1(fcst_comp, importState, exportState,clock,rc) ! !*** local variables ! + logical,save :: first=.true. + integer,save :: dt_cap=0 + type(ESMF_Time) :: currTime,stopTime integer :: mype, seconds real(kind=8) :: mpi_wtime, tbeg1 ! @@ -1159,6 +1162,22 @@ subroutine fcst_run_phase_1(fcst_comp, importState, exportState,clock,rc) call get_time(Atmos%Time - Atmos%Time_init, seconds) n_atmsteps = seconds/dt_atmos + + if (first) then + call ESMF_ClockGet(clock, currTime=currTime, stopTime=stopTime, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + call ESMF_TimeIntervalGet(stopTime-currTime, s=dt_cap, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + first=.false. + endif + + if ( dt_cap > 0 .and. mod(seconds, dt_cap) == 0 ) then + Atmos%isAtCapTime = .true. + else + Atmos%isAtCapTime = .false. + endif ! !----------------------------------------------------------------------- ! *** call fcst integration subroutines From 7f7e9f58f39fd772b1874468b15a03d55f5487b4 Mon Sep 17 00:00:00 2001 From: William Ramstrom Date: Fri, 29 Jul 2022 18:39:15 +0000 Subject: [PATCH 010/192] Removed reference to unused variable parent_x. --- atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 0cd5847e4d..205d7752a5 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 0cd5847e4de0cb48b0ac27d450e7db4b14df62c5 +Subproject commit 205d7752a5e1785ae171716dda04c5374b42115a From 003b0f91057f7feae8ba9ce3fb3a1398da8c68c8 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 19 Aug 2022 14:35:56 -0500 Subject: [PATCH 011/192] Update to point submodule ccpp/physics to the feature/hafsv0.3_final branch of the hafs-community fork. --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 2bd156415d..c79071b816 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,8 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = main + url = https://github.com/hafs-community/ccpp-physics + branch = feature/hafsv0.3_final [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP From 9d6d138881e3fea19bd3ae9fb4eb1eebbdf9f7ee Mon Sep 17 00:00:00 2001 From: AndrewHazelton Date: Sat, 20 Aug 2022 00:45:14 +0000 Subject: [PATCH 012/192] FV3-related typedefs changes for the Hurricane PBL options --- ccpp/data/GFS_typedefs.F90 | 6 +++++- ccpp/data/GFS_typedefs.meta | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 9c8735b956..ceb222396b 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1162,6 +1162,7 @@ module GFS_typedefs real(kind=kind_phys) :: rlmx !< maximum allowed mixing length in boundary layer mass flux scheme real(kind=kind_phys) :: elmx !< maximum allowed dissipation mixing length in boundary layer mass flux scheme integer :: sfc_rlm !< choice of near surface mixing length in boundary layer mass flux scheme + integer :: tc_pbl !< option of tc application in boundary layer mass flux scheme !--- parameters for canopy heat storage (CHS) parameterization real(kind=kind_phys) :: h0facu !< CHS factor for sensible heat flux in unstable surface layer @@ -3288,6 +3289,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: rlmx = 300. !< maximum allowed mixing length in boundary layer mass flux scheme real(kind=kind_phys) :: elmx = 300. !< maximum allowed dissipation mixing length in boundary layer mass flux scheme integer :: sfc_rlm = 0 !< choice of near surface mixing length in boundary layer mass flux scheme + integer :: tc_pbl = 0 !< option of tc application in boundary layer mass flux scheme !--- parameters for canopy heat storage (CHS) parameterization real(kind=kind_phys) :: h0facu = 0.25 @@ -3486,7 +3488,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & thsfc_loc, & ! vertical diffusion xkzm_m, xkzm_h, xkzm_s, xkzminv, moninq_fac, dspfac, & - bl_upfr, bl_dnfr, rlmx, elmx, sfc_rlm, & + bl_upfr, bl_dnfr, rlmx, elmx, sfc_rlm, tc_pbl, & !--- canopy heat storage parameterization h0facu, h0facs, & !--- cellular automata @@ -4275,6 +4277,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%rlmx = rlmx Model%elmx = elmx Model%sfc_rlm = sfc_rlm + Model%tc_pbl = tc_pbl !--- canopy heat storage parametrization Model%h0facu = h0facu @@ -5923,6 +5926,7 @@ subroutine control_print(Model) print *, ' rlmx : ', Model%rlmx print *, ' elmx : ', Model%elmx print *, ' sfc_rlm : ', Model%sfc_rlm + print *, ' tc_pbl : ', Model%tc_pbl print *, ' ' print *, 'parameters for canopy heat storage parametrization' print *, ' h0facu : ', Model%h0facu diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 0c7cf73dd9..c3d0b3a7b0 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4882,6 +4882,12 @@ units = none dimensions = () type = integer +[tc_pbl] + standard_name = option_of_tc_application_in_boundary_layer_mass_flux_scheme + long_name = option of tc application in boundary layer mass flux scheme + units = none + dimensions = () + type = integer [h0facu] standard_name = multiplicative_tuning_parameter_for_reduced_surface_heat_fluxes_due_to_canopy_heat_storage long_name = canopy heat storage factor for sensible heat flux in unstable surface layer From 4c42e4a6734548cac686fc20dbd8b2fed2fae5f4 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Sat, 20 Aug 2022 12:13:58 -0500 Subject: [PATCH 013/192] Update submodule ccpp/physics, which added the tc_pbl option in the GFS sa-TKE EDMF PBL scheme for HAFS/hurricane modeling. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index f13ed4e801..61d6c900ff 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit f13ed4e8018859ec4e0aa5da3f36328b826d8b1f +Subproject commit 61d6c900ffe743e3809fc0bef7e7496f66a54340 From f7cd326fad55ee460401c52e988c02d86be89ebd Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Sun, 2 Oct 2022 16:03:37 -0500 Subject: [PATCH 014/192] Update to point the support/HAFS branch for upp, ccpp-physics and atmos_cubed_sphere. --- .gitmodules | 6 +++--- upp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index c79071b816..ce466d152a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere - branch = feature/hafsv0.3_final + branch = support/HAFS [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework @@ -9,8 +9,8 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics - branch = feature/hafsv0.3_final + branch = support/HAFS [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP - branch = feature/hafsv0.3_final + branch = support/HAFS diff --git a/upp b/upp index 0884567468..98836d133b 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 08845674689e0195f9aaa11f5441aeaa761585e7 +Subproject commit 98836d133bf107dee99648549ab8531e30a136a8 From 1121f5704f0305bb2dbe85b3554671a06239f600 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sun, 9 Oct 2022 11:49:24 +0000 Subject: [PATCH 015/192] Update submodules of atmos_cubed_sphere, ccpp/physics, upp. --- .gitmodules | 10 ++++++---- atmos_cubed_sphere | 2 +- ccpp/physics | 2 +- upp | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitmodules b/.gitmodules index ce466d152a..ae8c3c5701 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,8 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere - branch = support/HAFS +# branch = support/HAFS + branch = feature/hafs_sync_202210 [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework @@ -9,8 +10,9 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics - branch = support/HAFS +# branch = support/HAFS + branch = feature/hafs_sync_202210 [submodule "upp"] path = upp - url = https://github.com/hafs-community/UPP - branch = support/HAFS + url = https://github.com/NOAA-EMC/UPP + branch = develop diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 205d7752a5..54785db260 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 205d7752a5e1785ae171716dda04c5374b42115a +Subproject commit 54785db26086381565a0108c3a32c3f399e90a3c diff --git a/ccpp/physics b/ccpp/physics index 61d6c900ff..c7d7b2b94c 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 61d6c900ffe743e3809fc0bef7e7496f66a54340 +Subproject commit c7d7b2b94ca22683d54d89aa5bc0005291ff54c4 diff --git a/upp b/upp index 98836d133b..e22724738f 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 98836d133bf107dee99648549ab8531e30a136a8 +Subproject commit e22724738fd104327fee7c3c7ffc805ccabd619f From 3c270f882a584371a7cf14c4e3f69f4ab2b4e3c2 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Wed, 12 Oct 2022 13:39:43 +0000 Subject: [PATCH 016/192] Adding upoff as a namelist parameter --- atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 54785db260..af29d30627 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 54785db26086381565a0108c3a32c3f399e90a3c +Subproject commit af29d30627c49555199096c058914af1b83dacb3 From 7ec516cfd129dea34b364a05b7356493a816c562 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 28 Oct 2022 17:24:58 +0000 Subject: [PATCH 017/192] Update submodule atmos_cubed_sphere, which has updated the time string in internal tracker output (fort.602, phtcf file). --- atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 9e6cff176c..9b56598dc1 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 9e6cff176c29eb4c11d07ab5c7ade00093af3df1 +Subproject commit 9b56598dc1f3a50a42eca32268b2e7cbf1967936 From 1384c41140889358af52797ba37f3905c4db63d3 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Mon, 28 Nov 2022 17:54:38 +0000 Subject: [PATCH 018/192] Update .gitmodules to point back to support/HAFS branches for FV3dycore and ccpp-physics. --- .gitmodules | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index ae8c3c5701..bfd22639d1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,8 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere -# branch = support/HAFS - branch = feature/hafs_sync_202210 + branch = support/HAFS [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework @@ -10,8 +9,7 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics -# branch = support/HAFS - branch = feature/hafs_sync_202210 + branch = support/HAFS [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP From 1b036b21fef901a68593eb0828528c01d3167ec5 Mon Sep 17 00:00:00 2001 From: Jun Wang <37633869+junwang-noaa@users.noreply.github.com> Date: Tue, 14 Feb 2023 15:10:03 -0500 Subject: [PATCH 019/192] fix initialization issue for moving nest grid in debug mode (#622) * fix initialization for moving nest grid --- io/module_wrt_grid_comp.F90 | 93 +++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index ff142b559d..c3b76701aa 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -754,12 +754,14 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock, allocate( wrt_int_state%out_grid_info(n)%latPtr(wrt_int_state%out_grid_info(n)%i_start:wrt_int_state%out_grid_info(n)%i_end, & wrt_int_state%out_grid_info(n)%j_start:wrt_int_state%out_grid_info(n)%j_end) ) - do j=wrt_int_state%out_grid_info(n)%j_start, wrt_int_state%out_grid_info(n)%j_end - do i=wrt_int_state%out_grid_info(n)%i_start, wrt_int_state%out_grid_info(n)%i_end - wrt_int_state%out_grid_info(n)%latPtr(i,j) = latPtr(i,j) - wrt_int_state%out_grid_info(n)%lonPtr(i,j) = lonPtr(i,j) - enddo - enddo + if ( trim(output_grid(n)) /= 'regional_latlon_moving' .and. trim(output_grid(n)) /= 'rotated_latlon_moving' ) then + do j=wrt_int_state%out_grid_info(n)%j_start, wrt_int_state%out_grid_info(n)%j_end + do i=wrt_int_state%out_grid_info(n)%i_start, wrt_int_state%out_grid_info(n)%i_end + wrt_int_state%out_grid_info(n)%latPtr(i,j) = latPtr(i,j) + wrt_int_state%out_grid_info(n)%lonPtr(i,j) = lonPtr(i,j) + enddo + enddo + endif wrt_int_state%out_grid_info(n)%im = imo(n) wrt_int_state%out_grid_info(n)%jm = jmo(n) @@ -1076,19 +1078,20 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock, name="grid", value="latlon", rc=rc) call ESMF_AttributeAdd(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & attrList=(/"lon1","lat1","lon2","lat2","dlon","dlat"/), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lon1", value=lon1(grid_id), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lat1", value=lat1(grid_id), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lon2", value=lon2(grid_id), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lat2", value=lat2(grid_id), rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & name="dlon", value=dlon(grid_id), rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & name="dlat", value=dlat(grid_id), rc=rc) - + if (trim(output_grid(grid_id)) /= 'regional_latlon_moving') then + call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & + name="lon1", value=lon1(grid_id), rc=rc) + call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & + name="lat1", value=lat1(grid_id), rc=rc) + call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & + name="lon2", value=lon2(grid_id), rc=rc) + call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & + name="lat2", value=lat2(grid_id), rc=rc) + endif else if (trim(output_grid(grid_id)) == 'rotated_latlon' & .or. trim(output_grid(grid_id)) == 'rotated_latlon_moving') then @@ -1108,19 +1111,20 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock, name="cen_lon", value=cen_lon(grid_id), rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & name="cen_lat", value=cen_lat(grid_id), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lon1", value=lon1(grid_id), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lat1", value=lat1(grid_id), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lon2", value=lon2(grid_id), rc=rc) - call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & - name="lat2", value=lat2(grid_id), rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & name="dlon", value=dlon(grid_id), rc=rc) call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & name="dlat", value=dlat(grid_id), rc=rc) - + if (trim(output_grid(grid_id)) /= 'rotated_latlon_moving') then + call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & + name="lon1", value=lon1(grid_id), rc=rc) + call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & + name="lat1", value=lat1(grid_id), rc=rc) + call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & + name="lon2", value=lon2(grid_id), rc=rc) + call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & + name="lat2", value=lat2(grid_id), rc=rc) + endif else if (trim(output_grid(grid_id)) == 'lambert_conformal') then call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", & @@ -1393,7 +1397,7 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock, deallocate(attNameList, attNameList2, typekindList) ! -! write_init_tim = MPI_Wtime() - btim0 +! write_init_tim = MPI_Wtime() - btim0 ! !----------------------------------------------------------------------- ! @@ -1931,22 +1935,31 @@ subroutine wrt_run(wrt_comp, imp_state_write, exp_state_write,clock,rc) #ifdef INLINE_POST wbeg = MPI_Wtime() do n=1,ngrids - if (trim(output_grid(n)) == 'regional_latlon' .or. & - trim(output_grid(n)) == 'regional_latlon_moving' .or. & - trim(output_grid(n)) == 'rotated_latlon' .or. & - trim(output_grid(n)) == 'rotated_latlon_moving' .or. & - trim(output_grid(n)) == 'lambert_conformal') then - - !mask fields according to sfc pressure - do nbdl=1, wrt_int_state%FBCount - call mask_fields(wrt_int_state%wrtFB(nbdl),rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - enddo - lmask_fields = .true. - endif - call post_run_fv3(wrt_int_state, n, mype, wrt_mpi_comm, lead_write_task, & - itasks, jtasks, nf_hours, nf_minutes, nf_seconds) + if (trim(output_grid(n)) /= 'cubed_sphere_grid') then + + if (trim(output_grid(n)) == 'regional_latlon' .or. & + trim(output_grid(n)) == 'regional_latlon_moving' .or. & + trim(output_grid(n)) == 'rotated_latlon' .or. & + trim(output_grid(n)) == 'rotated_latlon_moving' .or. & + trim(output_grid(n)) == 'lambert_conformal') then + + !mask fields according to sfc pressure + do nbdl=1, wrt_int_state%FBCount + call mask_fields(wrt_int_state%wrtFB(nbdl),rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + enddo + lmask_fields = .true. + endif + + call post_run_fv3(wrt_int_state, n, mype, wrt_mpi_comm, lead_write_task, & + itasks, jtasks, nf_hours, nf_minutes, nf_seconds) + else + rc = ESMF_RC_NOT_IMPL + print *,'Inline post not available for cubed_sphere_grid' + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, file=__FILE__)) return + endif enddo wend = MPI_Wtime() if (lprnt) then From 3f5fcba2a9f690dec62c79488d4fd2e9f73bce60 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Thu, 23 Feb 2023 20:19:58 +0000 Subject: [PATCH 020/192] Update submodule atmos_cubed_sphere to point the production/hafs.v1 branch. --- .gitmodules | 4 ++-- atmos_cubed_sphere | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 22c723ac12..b95539151d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere + branch = production/hafs.v1 [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index a839395d54..59a74c9ccc 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit a839395d542ab860ae0afa7601e35b37d68d773e +Subproject commit 59a74c9cccc9864ff9efbcffdc5df40af9914cf6 From c3954a5a0eaa987c026233ebd116f7ba2ac6c398 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 28 Feb 2023 23:40:33 +0000 Subject: [PATCH 021/192] Update submodule upp, which cherry-picked the wind GUST fix from the develop branch. --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 2b2c84a609..dd9398b417 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 2b2c84a609f575fc293a4f90238391681bc383f0 +Subproject commit dd9398b4176339f2b95ba1878580700694f959dd From f6d76f97f6efaef8f566809531ea595cf2a71c6d Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 10 Mar 2023 23:11:15 +0000 Subject: [PATCH 022/192] Update submodule upp. --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index dd9398b417..62416c1671 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit dd9398b4176339f2b95ba1878580700694f959dd +Subproject commit 62416c167170a6bb2dba52b47788e40d13b3b56d From 40387db552c51a42a1fefbe86f396c2d8f88f76c Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 10 Mar 2023 23:51:16 +0000 Subject: [PATCH 023/192] Update .gitmodules. --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index b95539151d..44390135a4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere + url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere branch = production/hafs.v1 [submodule "ccpp/framework"] path = ccpp/framework @@ -13,4 +13,4 @@ [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP - branch = develop + branch = release/hafs_v1 From 4c4c2c1e3ea6d22911212832ad255560b4a99060 Mon Sep 17 00:00:00 2001 From: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com> Date: Wed, 25 Jan 2023 09:43:41 -0500 Subject: [PATCH 024/192] Create ESMF field attributes using the same kind as field data values (#618) * Use 32bit value for 'missing_value' and '_FillValue' attributes --- atmos_cubed_sphere | 2 +- io/FV3GFS_io.F90 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 59a74c9ccc..cc648261d6 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 59a74c9cccc9864ff9efbcffdc5df40af9914cf6 +Subproject commit cc648261d6c9846bf1ccb3b88eaa1b145b7d1190 diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index 775d7630de..6ee558fcb0 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -3784,7 +3784,7 @@ subroutine add_field_to_phybundle(var_name,long_name,units,cell_methods, axes,ph line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeSet(field, convention="NetCDF", purpose="FV3", & - name='missing_value',value=missing_value,rc=rc) + name='missing_value',value=real(missing_value,kind=4),rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -3794,7 +3794,7 @@ subroutine add_field_to_phybundle(var_name,long_name,units,cell_methods, axes,ph line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeSet(field, convention="NetCDF", purpose="FV3", & - name='_FillValue',value=missing_value,rc=rc) + name='_FillValue',value=real(missing_value,kind=4),rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) From c246398fa7a24f9fa477889bd3dd61ac33194edc Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sat, 25 Mar 2023 01:05:37 +0000 Subject: [PATCH 025/192] Update submodule UPP. --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 62416c1671..22fe733e95 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 62416c167170a6bb2dba52b47788e40d13b3b56d +Subproject commit 22fe733e95fb3e9b59ae547c2b8bb7de4418e385 From de7dd34f025a276689b2cdf8b4ebc6de41cfa592 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Mon, 3 Apr 2023 23:27:05 +0000 Subject: [PATCH 026/192] Update submodule ccpp/physics. --- .gitmodules | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 44390135a4..3f327b33a8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,8 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/ufs-community/ccpp-physics - branch = ufs/dev + url = https://github.com/hafs-community/ccpp-physics + branch = production/hafs.v1 [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index 4315912995..a501737d89 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 43159129954280bfb6fa43f24efb815f66338115 +Subproject commit a501737d8973b494d3e2b546e94295bba4aa07ce From 9b33cabc7930787af899883f8da76010ab0fb327 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Sun, 30 Apr 2023 19:47:52 -0500 Subject: [PATCH 027/192] Update submodules. --- .gitmodules | 10 +++++----- atmos_cubed_sphere | 2 +- ccpp/physics | 2 +- upp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3f327b33a8..ce466d152a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere - branch = production/hafs.v1 + url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere + branch = support/HAFS [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework @@ -9,8 +9,8 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics - branch = production/hafs.v1 + branch = support/HAFS [submodule "upp"] path = upp - url = https://github.com/NOAA-EMC/UPP - branch = release/hafs_v1 + url = https://github.com/hafs-community/UPP + branch = support/HAFS diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index cc648261d6..39f75ef286 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit cc648261d6c9846bf1ccb3b88eaa1b145b7d1190 +Subproject commit 39f75ef28657b70b8496e69f01efe581491cf054 diff --git a/ccpp/physics b/ccpp/physics index a501737d89..8be41c8c4a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit a501737d8973b494d3e2b546e94295bba4aa07ce +Subproject commit 8be41c8c4a3976775f9ee828340869b4c1bcc0c7 diff --git a/upp b/upp index 22fe733e95..7003ca63af 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 22fe733e95fb3e9b59ae547c2b8bb7de4418e385 +Subproject commit 7003ca63af9287cea2040715d92653ac6cf61905 From 5729c1cec8090e8c51ed3f80f375b6ff92374e31 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 12 May 2023 02:04:21 +0000 Subject: [PATCH 028/192] Update submodule upp. --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 22fe733e95..87b50ffac0 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 22fe733e95fb3e9b59ae547c2b8bb7de4418e385 +Subproject commit 87b50ffac0a84f8e1367ee0c7793287f3a6b3331 From e27560e46ae296a6e42a5f0a6a113e34833410d2 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sat, 22 Jul 2023 03:24:30 +0000 Subject: [PATCH 029/192] Update submodule upp. --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index dccb321769..54cf351ae7 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit dccb32176930676ef2a258eb65571ab4e3f7e7a4 +Subproject commit 54cf351ae7837a1143a25618329cefac3de881e9 From 75638232bef79721cee9ad1ca0fd00089f7c9634 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sat, 22 Jul 2023 12:32:31 +0000 Subject: [PATCH 030/192] Update submodule upp. --- .gitmodules | 4 ++-- upp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 22c723ac12..07790079da 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,5 +12,5 @@ branch = ufs/dev [submodule "upp"] path = upp - url = https://github.com/NOAA-EMC/UPP - branch = develop + url = https://github.com/hafs-community/UPP + branch = support/hafs.v1.1.0 diff --git a/upp b/upp index 54cf351ae7..b36cb4f673 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 54cf351ae7837a1143a25618329cefac3de881e9 +Subproject commit b36cb4f673855bfa57b16c339803cf0a426bc03f From 7011a5359c5ad42bb22791440dadbb70219e9a9c Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Wed, 8 Nov 2023 15:06:17 -0600 Subject: [PATCH 031/192] Update ccpp/suites_not_used/suite_FV3_HAFS_v1* files, needed for the latest sync. --- ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson.xml | 3 +-- ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp.xml | 3 +-- .../suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml | 3 +-- ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_nonsst.xml | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson.xml b/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson.xml index 746c8ceb70..53bc12ebec 100644 --- a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson.xml +++ b/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson.xml @@ -61,7 +61,6 @@ unified_ugwp_post GFS_GWD_generic_post GFS_suite_stateout_update - ozphys_2015 h2ophys get_phi_fv3 GFS_suite_interstitial_3 @@ -79,7 +78,7 @@ mp_thompson_post GFS_MP_generic_post maximum_hourly_diagnostics - phys_tend + GFS_physics_post diff --git a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp.xml b/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp.xml index 2022ef4d6a..51b1531f77 100644 --- a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp.xml +++ b/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp.xml @@ -61,7 +61,6 @@ unified_ugwp_post GFS_GWD_generic_post GFS_suite_stateout_update - ozphys_2015 h2ophys get_phi_fv3 GFS_suite_interstitial_3 @@ -79,7 +78,7 @@ mp_thompson_post GFS_MP_generic_post maximum_hourly_diagnostics - phys_tend + GFS_physics_post diff --git a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml b/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml index f66543c80b..f29ce046d2 100644 --- a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml +++ b/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml @@ -59,7 +59,6 @@ unified_ugwp_post GFS_GWD_generic_post GFS_suite_stateout_update - ozphys_2015 h2ophys get_phi_fv3 GFS_suite_interstitial_3 @@ -77,7 +76,7 @@ mp_thompson_post GFS_MP_generic_post maximum_hourly_diagnostics - phys_tend + GFS_physics_post diff --git a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_nonsst.xml b/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_nonsst.xml index 665a0b7e2d..9de93481af 100644 --- a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_nonsst.xml +++ b/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_nonsst.xml @@ -59,7 +59,6 @@ unified_ugwp_post GFS_GWD_generic_post GFS_suite_stateout_update - ozphys_2015 h2ophys get_phi_fv3 GFS_suite_interstitial_3 @@ -77,7 +76,7 @@ mp_thompson_post GFS_MP_generic_post maximum_hourly_diagnostics - phys_tend + GFS_physics_post From ebc2b0212a543b2eae3215b435303f9e3e536723 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Thu, 9 Nov 2023 21:57:12 +0000 Subject: [PATCH 032/192] Update submodule UPP to point to the feature/hafsv2_baseline branch. --- .gitmodules | 4 ++-- upp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 22c723ac12..e3eaf9afda 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,5 +12,5 @@ branch = ufs/dev [submodule "upp"] path = upp - url = https://github.com/NOAA-EMC/UPP - branch = develop + url = https://github.com/hafs-community/UPP + branch = feature/hafsv2_baseline diff --git a/upp b/upp index fae617ba48..f1b7180def 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit fae617ba485dbbadc8fc10f512a6a0c29c81741a +Subproject commit f1b7180deff6924f881228a217765b394d27aa1a From 453e630c8a24ad4f3b3c19d56e7b86aeeed3aa29 Mon Sep 17 00:00:00 2001 From: William Ramstrom Date: Mon, 20 Nov 2023 20:30:48 +0000 Subject: [PATCH 033/192] Moving Nest implementation of NOAH MP LSM --- moving_nest/fv_moving_nest.F90 | 203 +++-- moving_nest/fv_moving_nest_main.F90 | 246 +++++- moving_nest/fv_moving_nest_physics.F90 | 609 ++++++++++++- moving_nest/fv_moving_nest_types.F90 | 172 +++- moving_nest/fv_moving_nest_utils.F90 | 1090 ++++++++++++++++++++++-- 5 files changed, 2075 insertions(+), 245 deletions(-) diff --git a/moving_nest/fv_moving_nest.F90 b/moving_nest/fv_moving_nest.F90 index 6ef5ab384f..a817e7917c 100644 --- a/moving_nest/fv_moving_nest.F90 +++ b/moving_nest/fv_moving_nest.F90 @@ -72,11 +72,7 @@ module fv_moving_nest_mod use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp use bounding_box_mod, only: bbox, bbox_get_C2F_index, fill_bbox -#ifdef OVERLOAD_R4 - use constantsR4_mod, only: cp_air, omega, rdgas, grav, rvgas, kappa, pstd_mks, hlv -#else use constants_mod, only: cp_air, omega, rdgas, grav, rvgas, kappa, pstd_mks, hlv -#endif use field_manager_mod, only: MODEL_ATMOS use fv_arrays_mod, only: fv_atmos_type, fv_nest_type, fv_grid_type, R_GRID use fv_arrays_mod, only: allocate_fv_nest_bc_type, deallocate_fv_nest_bc_type @@ -130,11 +126,13 @@ module fv_moving_nest_mod !! Step 6 interface mn_var_shift_data module procedure mn_var_shift_data_r4_2d - module procedure mn_var_shift_data_r4_3d + module procedure mn_var_shift_data_r4_3d_highz + module procedure mn_var_shift_data_r4_3d_lowhighz module procedure mn_var_shift_data_r4_4d module procedure mn_var_shift_data_r8_2d - module procedure mn_var_shift_data_r8_3d + module procedure mn_var_shift_data_r8_3d_highz + module procedure mn_var_shift_data_r8_3d_lowhighz module procedure mn_var_shift_data_r8_4d end interface mn_var_shift_data @@ -614,10 +612,10 @@ subroutine mn_latlon_load_parent(surface_dir, Atm, n, parent_tile, delta_i_c, de parent_geo%nxp = Atm(1)%npx parent_geo%nyp = Atm(1)%npy - + parent_geo%nx = parent_geo%nxp - 1 parent_geo%ny = parent_geo%nyp - 1 - + call mn_static_filename(surface_dir, parent_tile, 'grid', 1, grid_filename) call load_nest_latlons_from_nc(grid_filename, parent_geo%nxp, parent_geo%nyp, 1, pelist, & parent_geo, p_istart_fine, p_iend_fine, p_jstart_fine, p_jend_fine) @@ -803,6 +801,7 @@ subroutine mn_latlon_read_hires_parent(npx, npy, refine, pelist, fp_super_tile_g call load_nest_latlons_from_nc(trim(grid_filename), npx, npy, refine, pelist, & fp_super_tile_geo, fp_super_istart_fine, fp_super_iend_fine, fp_super_jstart_fine, fp_super_jend_fine) + end subroutine mn_latlon_read_hires_parent !>@brief The subroutine 'mn_orog_read_hires_parent' loads parent orography data from netCDF @@ -1252,9 +1251,9 @@ subroutine mn_var_shift_data_r8_2d(data_var, interp_type, wt, ind, delta_i_c, de end subroutine mn_var_shift_data_r8_2d - !>@brief The subroutine 'mn_prog_shift_data_r4_3d' shifts the data for a variable on each nest PE + !>@brief The subroutine 'mn_prog_shift_data_r4_3d_highz' shifts the data for a variable on each nest PE !>@details For one single precision 3D variable - subroutine mn_var_shift_data_r4_3d(data_var, interp_type, wt, ind, delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) + subroutine mn_var_shift_data_r4_3d_highz(data_var, interp_type, wt, ind, delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) real*4, allocatable, intent(inout) :: data_var(:,:,:) !< Data variable integer, intent(in) :: interp_type !< Interpolation stagger type @@ -1265,6 +1264,22 @@ subroutine mn_var_shift_data_r4_3d(data_var, interp_type, wt, ind, delta_i_c, de type(nest_domain_type), intent(inout) :: nest_domain !< Nest domain structure integer, intent(in) :: position, nz !< Grid offset, number of vertical levels + call mn_var_shift_data_r4_3d_lowhighz(data_var, interp_type, wt, ind, delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, 1, nz) + + end subroutine mn_var_shift_data_r4_3d_highz + !>@brief The subroutine 'mn_prog_shift_data_r4_3d_lowhighz' shifts the data for a variable on each nest PE + !>@details For one single precision 3D variable + subroutine mn_var_shift_data_r4_3d_lowhighz(data_var, interp_type, wt, ind, delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, z_low, z_high) + + real*4, allocatable, intent(inout) :: data_var(:,:,:) !< Data variable + integer, intent(in) :: interp_type !< Interpolation stagger type + real, allocatable, intent(in) :: wt(:,:,:) !< Interpolation weight array + integer, allocatable, intent(in) :: ind(:,:,:) !< Fine to coarse index array + integer, intent(in) :: delta_i_c, delta_j_c, x_refine, y_refine !< delta i,j for nest move. Nest refinement. + logical, intent(in) :: is_fine_pe !< Is nest PE? + type(nest_domain_type), intent(inout) :: nest_domain !< Nest domain structure + integer, intent(in) :: position, z_low, z_high !< Grid offset, number of vertical levels + real*4, dimension(:,:,:), allocatable :: nbuffer, sbuffer, ebuffer, wbuffer type(bbox) :: north_fine, north_coarse ! step 4 type(bbox) :: south_fine, south_coarse @@ -1278,10 +1293,10 @@ subroutine mn_var_shift_data_r4_3d(data_var, interp_type, wt, ind, delta_i_c, de !! !!=========================================================== - call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, nz) - call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, nz) - call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, nz) - call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, nz) + call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, z_low, z_high) + call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, z_low, z_high) + call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, z_low, z_high) + call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, z_low, z_high) !==================================================== @@ -1310,10 +1325,10 @@ subroutine mn_var_shift_data_r4_3d(data_var, interp_type, wt, ind, delta_i_c, de !! !!=========================================================== - call fill_nest_from_buffer(interp_type, data_var, nbuffer, north_fine, north_coarse, nz, NORTH, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, sbuffer, south_fine, south_coarse, nz, SOUTH, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, ebuffer, east_fine, east_coarse, nz, EAST, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, wbuffer, west_fine, west_coarse, nz, WEST, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, nbuffer, north_fine, north_coarse, z_low, z_high, NORTH, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, sbuffer, south_fine, south_coarse, z_low, z_high, SOUTH, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, ebuffer, east_fine, east_coarse, z_low, z_high, EAST, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, wbuffer, west_fine, west_coarse, z_low, z_high, WEST, x_refine, y_refine, wt, ind) endif deallocate(nbuffer) @@ -1321,12 +1336,12 @@ subroutine mn_var_shift_data_r4_3d(data_var, interp_type, wt, ind, delta_i_c, de deallocate(ebuffer) deallocate(wbuffer) - end subroutine mn_var_shift_data_r4_3d + end subroutine mn_var_shift_data_r4_3d_lowhighz - !>@brief The subroutine 'mn_prog_shift_data_r8_3d' shifts the data for a variable on each nest PE + !>@brief The subroutine 'mn_prog_shift_data_r8_3d_highz' shifts the data for a variable on each nest PE !>@details For one double precision 3D variable - subroutine mn_var_shift_data_r8_3d(data_var, interp_type, wt, ind, delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) + subroutine mn_var_shift_data_r8_3d_highz(data_var, interp_type, wt, ind, delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) real*8, allocatable, intent(inout) :: data_var(:,:,:) !< Data variable integer, intent(in) :: interp_type !< Interpolation stagger type @@ -1337,6 +1352,23 @@ subroutine mn_var_shift_data_r8_3d(data_var, interp_type, wt, ind, delta_i_c, de type(nest_domain_type), intent(inout) :: nest_domain !< Nest domain structure integer, intent(in) :: position, nz !< Grid offset, number vertical levels + call mn_var_shift_data_r8_3d_lowhighz(data_var, interp_type, wt, ind, delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, 1, nz) + + end subroutine mn_var_shift_data_r8_3d_highz + + !>@brief The subroutine 'mn_prog_shift_data_r8_3d' shifts the data for a variable on each nest PE + !>@details For one double precision 3D variable + subroutine mn_var_shift_data_r8_3d_lowhighz(data_var, interp_type, wt, ind, delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, z_low, z_high) + + real*8, allocatable, intent(inout) :: data_var(:,:,:) !< Data variable + integer, intent(in) :: interp_type !< Interpolation stagger type + real, allocatable, intent(in) :: wt(:,:,:) !< Interpolation weight array + integer, allocatable, intent(in) :: ind(:,:,:) !< Fine to coarse index array + integer, intent(in) :: delta_i_c, delta_j_c, x_refine, y_refine !< delta i,j for nest move. Nest refinement. + logical, intent(in) :: is_fine_pe !< Is nest PE? + type(nest_domain_type), intent(inout) :: nest_domain !< Nest domain structure + integer, intent(in) :: position, z_low, z_high !< Grid offset, number vertical levels + real*8, dimension(:,:,:), allocatable :: nbuffer, sbuffer, ebuffer, wbuffer type(bbox) :: north_fine, north_coarse ! step 4 type(bbox) :: south_fine, south_coarse @@ -1350,10 +1382,10 @@ subroutine mn_var_shift_data_r8_3d(data_var, interp_type, wt, ind, delta_i_c, de !! !!=========================================================== - call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, nz) - call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, nz) - call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, nz) - call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, nz) + call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, z_low, z_high) + call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, z_low, z_high) + call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, z_low, z_high) + call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, z_low, z_high) !==================================================== ! Passes data from coarse grid to fine grid's halo buffers; requires nest_domain to be intent(inout) @@ -1380,10 +1412,10 @@ subroutine mn_var_shift_data_r8_3d(data_var, interp_type, wt, ind, delta_i_c, de !! !!=========================================================== - call fill_nest_from_buffer(interp_type, data_var, nbuffer, north_fine, north_coarse, nz, NORTH, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, sbuffer, south_fine, south_coarse, nz, SOUTH, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, ebuffer, east_fine, east_coarse, nz, EAST, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, wbuffer, west_fine, west_coarse, nz, WEST, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, nbuffer, north_fine, north_coarse, z_low, z_high, NORTH, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, sbuffer, south_fine, south_coarse, z_low, z_high, SOUTH, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, ebuffer, east_fine, east_coarse, z_low, z_high, EAST, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, wbuffer, west_fine, west_coarse, z_low, z_high, WEST, x_refine, y_refine, wt, ind) endif deallocate(nbuffer) @@ -1391,7 +1423,7 @@ subroutine mn_var_shift_data_r8_3d(data_var, interp_type, wt, ind, delta_i_c, de deallocate(ebuffer) deallocate(wbuffer) - end subroutine mn_var_shift_data_r8_3d + end subroutine mn_var_shift_data_r8_3d_lowhighz !>@brief The subroutine 'mn_prog_shift_data_r4_4d' shifts the data for a variable on each nest PE @@ -2121,14 +2153,14 @@ subroutine mn_var_dump_3d_to_netcdf( data_var, is_fine_pe, domain_coarse, domain call output_grid_to_nc("GH", isd_fine, ied_fine, jsd_fine, jed_fine, nz, data_var, prefix_fine, var_name, time_step, domain_fine, position) else - if (this_tile == 6) then + !if (this_tile == 6) then !call mpp_get_compute_domain(domain_coarse, isc_coarse, iec_coarse, jsc_coarse, jec_coarse, position=position) call mpp_get_data_domain(domain_coarse, isd_coarse, ied_coarse, jsd_coarse, jed_coarse, position=position) !call mpp_get_memory_domain(domain_coarse, ism_coarse, iem_coarse, jsm_coarse, jem_coarse, position=position) call output_grid_to_nc("GH", isd_coarse, ied_coarse, jsd_coarse, jed_coarse, nz, data_var, prefix_coarse, var_name, time_step, domain_coarse, position) - endif + !endif endif end subroutine mn_var_dump_3d_to_netcdf @@ -2172,14 +2204,14 @@ subroutine mn_var_dump_2d_to_netcdf( data_var, is_fine_pe, domain_coarse, domain call output_grid_to_nc("GH", isd_fine, ied_fine, jsd_fine, jed_fine, data_var, prefix_fine, var_name, time_step, domain_fine, position) else - if (this_tile == 6) then + !if (this_tile == 6) then !call mpp_get_compute_domain(domain_coarse, isc_coarse, iec_coarse, jsc_coarse, jec_coarse, position=position) call mpp_get_data_domain(domain_coarse, isd_coarse, ied_coarse, jsd_coarse, jed_coarse, position=position) !call mpp_get_memory_domain(domain_coarse, ism_coarse, iem_coarse, jsm_coarse, jem_coarse, position=position) call output_grid_to_nc("GH", isd_coarse, ied_coarse, jsd_coarse, jed_coarse, data_var, prefix_coarse, var_name, time_step, domain_coarse, position) - endif + !endif endif end subroutine mn_var_dump_2d_to_netcdf @@ -2439,7 +2471,7 @@ subroutine assign_p_grids(parent_geo, p_grid, position) do i = 1, ubound(p_grid,1) ! centered grid version p_grid(i, j, :) = 0.0 - + if (2*i .gt. ubound(parent_geo%lons,1)) then print '("[ERROR] WDR PG_CLONi npe=",I0," 2*i=",I0," ubound=",I0)', mpp_pe(), 2*i, ubound(parent_geo%lons,1) elseif (2*j .gt. ubound(parent_geo%lons,2)) then @@ -2450,7 +2482,7 @@ subroutine assign_p_grids(parent_geo, p_grid, position) endif enddo enddo - + do i = 1, ubound(p_grid,1) do j = 1, ubound(p_grid,2) @@ -2465,7 +2497,7 @@ subroutine assign_p_grids(parent_geo, p_grid, position) if (p_grid(i,j,1) .ne. 0.0) num_vals = num_vals + 1 enddo enddo - + if (num_zeros .gt. 0) print '("[INFO] WDR set p_grid npe=",I0," num_zeros=",I0," full_zeros=",I0," num_vals=",I0" nxp=",I0," nyp=",I0," parent_geo%lats(",I0,",",I0,")"," p_grid(",I0,",",I0,",2)")', mpp_pe(), num_zeros, full_zeros, num_vals, parent_geo%nxp, parent_geo%nyp, ubound(parent_geo%lats,1), ubound(parent_geo%lats,2), ubound(p_grid,1), ubound(p_grid,2) @@ -2480,15 +2512,15 @@ subroutine assign_p_grids(parent_geo, p_grid, position) elseif (2*j-1 .gt. ubound(parent_geo%lons,2)) then print '("[ERROR] WDR PG_ULONj npe=",I0," 2*j-1=",I0," ubound=",I0)', mpp_pe(), 2*j-1, ubound(parent_geo%lons,2) else - + ! This seems correct p_grid(i, j, 1) = parent_geo%lons(2*i, 2*j-1) p_grid(i, j, 2) = parent_geo%lats(2*i, 2*j-1) endif enddo enddo - - + + do i = 1, ubound(p_grid,1) do j = 1, ubound(p_grid,2) @@ -2516,18 +2548,18 @@ subroutine assign_p_grids(parent_geo, p_grid, position) print '("[ERROR] WDR PG_VLONi npe=",I0," 2*i-1=",I0," ubound=",I0)', mpp_pe(), 2*i-1, ubound(parent_geo%lons,1) elseif (2*j .gt. ubound(parent_geo%lons,2)) then print '("[ERROR] WDR PG_VLONj npe=",I0," 2*j=",I0," ubound=",I0)', mpp_pe(), 2*j, ubound(parent_geo%lons,2) - else + else ! This seems correct p_grid(i, j, 1) = parent_geo%lons(2*i-1, 2*j) p_grid(i, j, 2) = parent_geo%lats(2*i-1, 2*j) endif enddo enddo - + do i = 1, ubound(p_grid,1) do j = 1, ubound(p_grid,2) - + if (p_grid(i,j,1) .eq. 0.0) then num_zeros = num_zeros + 1 if (p_grid(i,j,2) .eq. 0.0) then @@ -2538,13 +2570,13 @@ subroutine assign_p_grids(parent_geo, p_grid, position) if (p_grid(i,j,1) .ne. 0.0) num_vals = num_vals + 1 enddo enddo - + if (num_zeros .gt. 0) print '("[INFO] WDR set p_grid_v npe=",I0," num_zeros=",I0," full_zeros=",I0," num_vals=",I0" nxp=",I0," nyp=",I0," parent_geo%lats(",I0,",",I0,")"," p_grid(",I0,",",I0,",2)")', mpp_pe(), num_zeros, full_zeros, num_vals, parent_geo%nxp, parent_geo%nyp, ubound(parent_geo%lats,1), ubound(parent_geo%lats,2), ubound(p_grid,1), ubound(p_grid,2) - - - + + + endif - + end subroutine assign_p_grids @@ -2596,9 +2628,9 @@ subroutine calc_inside(p_grid, ic, jc, n_grid1, n_grid2, istag, jstag, is_inside real(kind=R_GRID), intent(in) :: n_grid1, n_grid2 integer, intent(in) :: ic, jc, istag, jstag logical, intent(out) :: is_inside - logical, intent(in) :: verbose + logical, intent(in) :: verbose + - real(kind=R_GRID) :: max1, max2, min1, min2, eps max1 = max(p_grid(ic,jc,1), p_grid(ic,jc+1,1), p_grid(ic,jc+1,1), p_grid(ic+1,jc+1,1), p_grid(ic+1,jc+1,1), p_grid(ic+1,jc,1)) @@ -2606,21 +2638,21 @@ subroutine calc_inside(p_grid, ic, jc, n_grid1, n_grid2, istag, jstag, is_inside min1 = min(p_grid(ic,jc,1), p_grid(ic,jc+1,1), p_grid(ic,jc+1,1), p_grid(ic+1,jc+1,1), p_grid(ic+1,jc+1,1), p_grid(ic+1,jc,1)) min2 = min(p_grid(ic,jc,2), p_grid(ic,jc+1,2), p_grid(ic,jc+1,2), p_grid(ic+1,jc+1,2), p_grid(ic+1,jc+1,2), p_grid(ic+1,jc,2)) - + is_inside = .False. - + eps = 0.00001 !eps = 0.000001 if (n_grid1 .le. max1+eps .and. n_grid1 .ge. min1-eps) then if (n_grid2 .le. max2+eps .and. n_grid2 .ge. min2-eps) then is_inside = .True. - !if (verbose) print '("[INFO] WDR is_inside TRUE npe=",I0," ic=",I0," jc=",I0," n_grid1=",F12.8," min1=",F12.8," max1=",F12.8," n_grid2=",F12.8," min2=",F12.8," max2=", F12.8," p_grid(",I0,",",I0,",2) istag=",I0," jstag=",I0)', mpp_pe(), ic, jc, n_grid1, min1, max1, n_grid2, min2, max2, ubound(p_grid,1), ubound(p_grid,2), istag, jstag +! if (verbose) print '("[INFO] WDR is_inside TRUE npe=",I0," ic=",I0," jc=",I0," n_grid1=",F12.8," min1=",F12.8," max1=",F12.8," n_grid2=",F12.8," min2=",F12.8," max2=", F12.8," p_grid(",I0,",",I0,",2) istag=",I0," jstag=",I0)', mpp_pe(), ic, jc, n_grid1, min1, max1, n_grid2, min2, max2, ubound(p_grid,1), ubound(p_grid,2), istag, jstag endif endif if (verbose .and. .not. is_inside) then - print '("[INFO] WDR is_inside FALSE npe=",I0," ic=",I0," jc=",I0," n_grid1=",F12.8," min1=",F12.8," max1=",F12.8," n_grid2=",F12.8," min2=",F12.8," max2=", F10.4," p_grid(",I0,",",I0,",2) istag=",I0," jstag=",I0)', mpp_pe(), ic, jc, n_grid1, min1, max1, n_grid2, min2, max2, ubound(p_grid,1), ubound(p_grid,2), istag, jstag + print '("[WARN] WDR is_inside FALSE npe=",I0," ic=",I0," jc=",I0," n_grid1=",F12.8," min1=",F12.8," max1=",F12.8," n_grid2=",F12.8," min2=",F12.8," max2=", F10.4," p_grid(",I0,",",I0,",2) istag=",I0," jstag=",I0)', mpp_pe(), ic, jc, n_grid1, min1, max1, n_grid2, min2, max2, ubound(p_grid,1), ubound(p_grid,2), istag, jstag endif @@ -2672,7 +2704,7 @@ subroutine calc_nest_halo_weights(bbox_fine, bbox_coarse, p_grid, n_grid, wt, is ic = ind(i,j,1) if (ic+1 .gt. ubound(p_grid, 1)) print '("[ERROR] WDR CALCWT off end of p_grid i npe=",I0," ic+1=",I0," bound=",I0)', mpp_pe(), ic+1, ubound(p_grid,1) if (jc+1 .gt. ubound(p_grid, 2)) print '("[ERROR] WDR CALCWT off end of p_grid j npe=",I0," jc+1=",I0," bound=",I0)', mpp_pe(), jc+1, ubound(p_grid,2) - + ! dist2side_latlon takes points in longitude-latitude coordinates. dist1 = dist2side_latlon(p_grid(ic,jc,:), p_grid(ic,jc+1,:), n_grid(i,j,:)) dist2 = dist2side_latlon(p_grid(ic,jc+1,:), p_grid(ic+1,jc+1,:), n_grid(i,j,:)) @@ -2681,33 +2713,33 @@ subroutine calc_nest_halo_weights(bbox_fine, bbox_coarse, p_grid, n_grid, wt, is call calc_inside(p_grid, ic, jc, n_grid(i,j,1), n_grid(i,j,2), istag, jstag, is_inside, .True.) -! if (.not. is_inside) then -! adjusted = .False. -! -! do di = -2,2 -! do dj = -2,1 -! if (.not. adjusted) then -! call calc_inside(p_grid, ic+di, jc+dj, n_grid(i,j,1), n_grid(i,j,2), istag, jstag, is_inside, .False.) -! if (is_inside) then -! ic = ic + di -! jc = jc + dj -! -! print '("[INFO] WDR is_inside UPDATED npe=",I0," ic=",I0," jc=",I0," istart_coarse=",I0," jstart_coarse=",I0," i=",I0," j=",I0," di=",I0," dj=",I0," n_grid1=",F12.8," n_grid2=",F12.8," istag=",I0," jstag=",I0)', mpp_pe(), ic, jc, istart_coarse, jstart_coarse, i, j, di, dj, n_grid(i,j,1), n_grid(i,j,2), istag, jstag - -! dist1 = dist2side_latlon(p_grid(ic,jc,:), p_grid(ic,jc+1,:), n_grid(i,j,:)) -! dist2 = dist2side_latlon(p_grid(ic,jc+1,:), p_grid(ic+1,jc+1,:), n_grid(i,j,:)) -! dist3 = dist2side_latlon(p_grid(ic+1,jc+1,:), p_grid(ic+1,jc,:), n_grid(i,j,:)) -! dist4 = dist2side_latlon(p_grid(ic,jc,:), p_grid(ic+1,jc,:), n_grid(i,j,:)) -! -! adjusted = .True. -! endif -! endif -! enddo -! enddo -! if (.not. adjusted) print '("[ERROR] WDR is_inside UPDATE FAILED npe=",I0," i=",I0," j=",I0," ic=",I0," jc=",I0," n_grid1=",F12.8," n_grid2=",F12.8," istag=",I0," jstag=",I0)', mpp_pe(), i, j, ic, jc, n_grid(i,j,1), n_grid(i,j,2), istag, jstag -! -! endif - + if (.not. is_inside) then + adjusted = .False. + + do di = -2,2 + do dj = -2,1 + if (.not. adjusted) then + call calc_inside(p_grid, ic+di, jc+dj, n_grid(i,j,1), n_grid(i,j,2), istag, jstag, is_inside, .False.) + if (is_inside) then + ic = ic + di + jc = jc + dj + + print '("[INFO] WDR is_inside UPDATED npe=",I0," ic=",I0," jc=",I0," istart_coarse=",I0," jstart_coarse=",I0," i=",I0," j=",I0," di=",I0," dj=",I0," n_grid1=",F12.8," n_grid2=",F12.8," istag=",I0," jstag=",I0)', mpp_pe(), ic, jc, istart_coarse, jstart_coarse, i, j, di, dj, n_grid(i,j,1), n_grid(i,j,2), istag, jstag + + dist1 = dist2side_latlon(p_grid(ic,jc,:), p_grid(ic,jc+1,:), n_grid(i,j,:)) + dist2 = dist2side_latlon(p_grid(ic,jc+1,:), p_grid(ic+1,jc+1,:), n_grid(i,j,:)) + dist3 = dist2side_latlon(p_grid(ic+1,jc+1,:), p_grid(ic+1,jc,:), n_grid(i,j,:)) + dist4 = dist2side_latlon(p_grid(ic,jc,:), p_grid(ic+1,jc,:), n_grid(i,j,:)) + + adjusted = .True. + endif + endif + enddo + enddo + if (.not. adjusted) print '("[ERROR] WDR is_inside UPDATE FAILED npe=",I0," i=",I0," j=",I0," ic=",I0," jc=",I0," n_grid1=",F12.8," n_grid2=",F12.8," istag=",I0," jstag=",I0)', mpp_pe(), i, j, ic, jc, n_grid(i,j,1), n_grid(i,j,2), istag, jstag + + endif + old_weight = wt(i,j,:) wt(i,j,1)=dist2*dist3 ! ic, jc weight @@ -2723,9 +2755,9 @@ subroutine calc_nest_halo_weights(bbox_fine, bbox_coarse, p_grid, n_grid, wt, is call mpp_error(WARNING, "WARNING: calc_nest_halo_weights sum of weights is zero.") wt(i,j,:) = 0.25 - + else - wt(i,j,:)=wt(i,j,:)/sum + wt(i,j,:)=wt(i,j,:)/sum endif diff_weight = old_weight - wt(i,j,:) @@ -2733,7 +2765,7 @@ subroutine calc_nest_halo_weights(bbox_fine, bbox_coarse, p_grid, n_grid, wt, is if (abs(diff_weight(k)) .ge. 0.01) then print '("[WARN] WDR DIFFWT npe=",I0," old_wt=",F10.6," wt(",I0,",",I0,",",I0,")=",F10.6," diff=",F10.6," istag=",I0," jstag=",I0)', & mpp_pe(), old_weight(k), i, j, k, wt(i,j,k), diff_weight(k), istag, jstag - + endif enddo enddo @@ -2743,4 +2775,3 @@ subroutine calc_nest_halo_weights(bbox_fine, bbox_coarse, p_grid, n_grid, wt, is end subroutine calc_nest_halo_weights end module fv_moving_nest_mod - diff --git a/moving_nest/fv_moving_nest_main.F90 b/moving_nest/fv_moving_nest_main.F90 index 34af608c2e..65ecb54c08 100644 --- a/moving_nest/fv_moving_nest_main.F90 +++ b/moving_nest/fv_moving_nest_main.F90 @@ -33,11 +33,7 @@ module fv_moving_nest_main_mod ! FMS modules: !----------------- use block_control_mod, only: block_control_type -#ifdef OVERLOAD_R4 - use constantsR4_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks -#else use constants_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks -#endif use time_manager_mod, only: time_type, get_time, get_date, set_time, operator(+), & operator(-), operator(/), time_type_to_real use fms_mod, only: file_exist, open_namelist_file, & @@ -112,7 +108,7 @@ module fv_moving_nest_main_mod mn_prog_dump_to_netcdf, mn_prog_shift_data ! Physics variable routines use fv_moving_nest_physics_mod, only: mn_phys_fill_intern_nest_halos, mn_phys_fill_nest_halos_from_parent, & - mn_phys_dump_to_netcdf, mn_phys_shift_data, mn_phys_reset_sfc_props, move_nsst + mn_phys_dump_to_netcdf, mn_phys_shift_data, mn_phys_reset_sfc_props, move_nsst, mn_phys_set_slmsk ! Metadata routines use fv_moving_nest_mod, only: mn_meta_move_nest, mn_meta_recalc, mn_meta_reset_gridstruct, mn_shift_index @@ -156,7 +152,7 @@ module fv_moving_nest_main_mod ! Enable these for more debugging outputs logical :: debug_log = .false. ! Produces logging to out.* file - logical :: tsvar_out = .false. ! Produces netCDF outputs; be careful to not exceed file number limits set in namelist + logical :: tsvar_out = .true. ! Produces netCDF outputs; be careful to not exceed file number limits set in namelist ! --- Clock ids for moving_nest performance metering integer :: id_movnest1, id_movnest1_9, id_movnest2, id_movnest3, id_movnest4, id_movnest5 @@ -258,6 +254,12 @@ subroutine dump_moving_nest(Atm_block, IPD_control, IPD_data, time_step) type(domain2d), pointer :: domain_coarse, domain_fine logical :: is_fine_pe integer :: parent_grid_num, child_grid_num, nz, this_pe, n + character(len=160) :: line + character(len=1) :: mask_char + integer :: i,j + + integer :: nb, blen, ix, i_pe, j_pe, i_idx, j_idx, refine + real :: local_slmsk(Atm(2)%bd%isd:Atm(2)%bd%ied, Atm(2)%bd%jsd:Atm(2)%bd%jed) this_pe = mpp_pe() n = mygrid @@ -269,12 +271,81 @@ subroutine dump_moving_nest(Atm_block, IPD_control, IPD_data, time_step) domain_coarse => Atm(parent_grid_num)%domain is_fine_pe = Atm(n)%neststruct%nested .and. ANY(Atm(n)%pelist(:) == this_pe) nz = Atm(n)%npz + refine = Atm(child_grid_num)%neststruct%refinement ! Enable this to dump debug netCDF files. Files are automatically closed when dumped. !if (mod(a_step, 80) .eq. 0 ) then ! if (tsvar_out) call mn_prog_dump_to_netcdf(Atm(n), a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) ! if (tsvar_out) call mn_phys_dump_to_netcdf(Atm(n), Atm_block, IPD_control, IPD_data, a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) !endif + if (a_step .ge. 310) then + if (tsvar_out) call mn_phys_dump_to_netcdf(Atm(n), Atm_block, IPD_control, IPD_data, a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) + endif + + if (this_pe .eq. 60) then + do i=lbound(Atm(n)%oro,1), ubound(Atm(n)%oro,1) + line = "" + do j=lbound(Atm(n)%oro,2), ubound(Atm(n)%oro,2) + print '("[INFO] WDR oro size npe=",I0," is_allocated=",L1)', this_pe, allocated(Atm(n)%oro) + print '("[INFO] WDR oro size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0)', this_pe, lbound(Atm(n)%oro,1), ubound(Atm(n)%oro,1), lbound(Atm(n)%oro,2), ubound(Atm(n)%oro,2) + if (Atm(n)%oro(i,j) .eq. 1) then + ! land + line = trim(line) // "+" + elseif (Atm(n)%oro(i,j) .eq. 2) then + ! Water + line = trim(line) // "." + else + ! Unknown + line = trim(line) // "X" + endif + enddo + print '("[INFO] WDR oro npe=",I0," time=",I0," i=",I0," ",A80)',this_pe,a_step,i,trim(line) + + enddo + + + local_slmsk = 8 + print '("[INFO] WDR local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0," n=",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2), n + + do nb = 1,Atm_block%nblks + blen = Atm_block%blksz(nb) + do ix = 1, blen + i_pe = Atm_block%index(nb)%ii(ix) + j_pe = Atm_block%index(nb)%jj(ix) + + print '("[INFO] WDR local_slmsk npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe + + local_slmsk(i_pe, j_pe) = IPD_data(nb)%Sfcprop%slmsk(ix) + + enddo + enddo + + do i=lbound(local_slmsk,1), ubound(local_slmsk,1) + line = "" + do j=lbound(local_slmsk,2), ubound(local_slmsk,2) + print '("[INFO] WDR local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2) + if (local_slmsk(i,j) .eq. 1) then + ! land + line = trim(line) // "+" + elseif (local_slmsk(i,j) .eq. 2) then + ! Water + line = trim(line) // "." + else + ! Unknown + write (mask_char, "(I1)") int(local_slmsk(i,j)) + line = trim(line) // mask_char + endif + enddo + print '("[INFO] WDR local_slmsk_lake npe=",I0," time=",I3," i=",I3," ",A80)',this_pe,a_step,i,trim(line) + + enddo + + + + + + endif + end subroutine dump_moving_nest @@ -499,7 +570,6 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, integer, pointer :: ioffset, joffset real, pointer, dimension(:,:,:) :: grid, agrid type(domain2d), pointer :: domain_coarse, domain_fine - real(kind=R_GRID), pointer, dimension(:,:,:,:) :: grid_global ! Constants for mpp calls integer :: position = CENTER @@ -509,17 +579,11 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, integer :: x_refine, y_refine ! Currently equal, but allows for future flexibility logical :: is_fine_pe - ! TODO read halo size from the namelist instead to allow nest refinement > 3 - integer :: ehalo = 3 - integer :: whalo = 3 - integer :: nhalo = 3 - integer :: shalo = 3 integer :: extra_halo = 0 ! Extra halo for moving nest routines integer :: istart_fine, iend_fine, jstart_fine, jend_fine integer :: istart_coarse, iend_coarse, jstart_coarse, jend_coarse integer :: nx, ny, nz, nx_cubic, ny_cubic - integer :: p_istart_fine, p_iend_fine, p_jstart_fine, p_jend_fine ! Parent tile data, saved between timesteps logical, save :: first_nest_move = .true. @@ -541,9 +605,8 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, !real :: va(isd:ied,jsd:jed) logical :: filtered_terrain = .True. ! TODO set this from namelist - integer :: i, j, x, y, z, p, nn, n_moist + integer :: i, j integer :: parent_tile - logical :: found_nest_domain = .false. ! Variables to enable debugging use of mpp_sync logical :: debug_sync = .false. @@ -551,15 +614,12 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, integer :: pp, p1, p2 ! Variables for parent side of setup_aligned_nest() - integer :: isg, ieg, jsg, jeg, gid - integer :: isc_p, iec_p, jsc_p, jec_p - integer :: upoff, jind - integer :: ng, refinement integer :: npx, npy, npz, ncnst, pnats integer :: isc, iec, jsc, jec integer :: isd, ied, jsd, jed integer :: nq ! number of transported tracers integer :: is, ie, js, je, k ! For recalculation of omga + integer :: i_idx, j_idx integer, save :: output_step = 0 integer, allocatable :: pelist(:) character(len=16) :: errstring @@ -567,11 +627,17 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, integer :: year, month, day, hour, minute, second real(kind=R_GRID) :: pi = 4 * atan(1.0d0) real :: rad2deg + logical :: move_noahmp logical :: use_timers + !! For NOAHMP + ! (/0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0/) -- 3 snow levels, 4 soil levels + real :: zsns_default(-2:4) + zsns_default = [0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0 ] + + rad2deg = 180.0 / pi - gid = mpp_pe() this_pe = mpp_pe() use_timers = Atm(n)%flagstruct%fv_timers @@ -608,9 +674,14 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, is_fine_pe = Atm(n)%neststruct%nested .and. ANY(Atm(n)%pelist(:) == this_pe) + if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then + move_noahmp = .True. + else + move_noahmp = .False. + endif if (first_nest_move) then - + call fv_moving_nest_init_clocks(Atm(n)%flagstruct%fv_timers) ! If NSST is turned off, do not move the NSST variables. @@ -621,12 +692,14 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, move_nsst=.true. endif + ! This will only allocate the mn_prog and mn_phys for the active Atm(n), not all of them ! The others can safely remain unallocated. call allocate_fv_moving_nest_prog_type(isd, ied, jsd, jed, npz, Moving_nest(n)%mn_prog) - call allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_physics, move_nsst, & - IPD_Control%lsoil, IPD_Control%nmtvr, IPD_Control%levs, IPD_Control%ntot2d, IPD_Control%ntot3d, & + call allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_physics, move_noahmp, move_nsst, & + IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound, IPD_Control%lsoil, & + IPD_Control%nmtvr, IPD_Control%levs, IPD_Control%ntot2d, IPD_Control%ntot3d, & Moving_nest(n)%mn_phys) endif @@ -750,6 +823,9 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, Moving_nest(child_grid_num)%mn_flag%surface_dir, filtered_terrain, & mn_static%orog_grid, mn_static%orog_std_grid, mn_static%ls_mask_grid, mn_static%land_frac_grid, parent_tile) + ! Initialize the land sea mask (slmsk) in the mn_phys structure + call mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, x_refine) + ! If terrain_smoother method 1 is chosen, we need the parent coarse terrain if (Moving_nest(n)%mn_flag%terrain_smoother .eq. 1) then if (filtered_terrain) then @@ -759,6 +835,21 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, endif endif + ! Read in coarse resolution land sea mask to use for masked interpolations; factor in lakes as well + call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, Moving_nest(child_grid_num)%mn_flag%surface_dir, "oro_data", "slmsk", mn_static%parent_ls_mask_grid, parent_tile) + call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, Moving_nest(child_grid_num)%mn_flag%surface_dir, "oro_data", "land_frac", mn_static%parent_land_frac_grid, parent_tile) + + !print '("[INFO] WDR parent_ls_mask_grid npe=",I0," mn_static%parent_ls_mask_grid(",I0,":",I0,",",I0,":",I0,")")', this_pe, lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,1), lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,2) + + ! Alter parent_ls_mask_grid to set lakes to water(sea) values + do i_idx = lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,1) + do j_idx = lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,2) + if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%parent_land_frac_grid(i_idx, j_idx)) == 0 ) then + mn_static%parent_ls_mask_grid(i_idx, j_idx) = 0 + endif + enddo + enddo + call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "substrate_temperature", "substrate_temperature", mn_static%deep_soil_temp_grid, parent_tile) ! set any -999s to +4C call mn_replace_low_values(mn_static%deep_soil_temp_grid, -100.0, 277.0) @@ -1074,15 +1165,98 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, !!===================================================================================== if (use_timers) call mpp_clock_begin (id_movnest7_3) - call mn_prog_apply_temp_variables(Atm, n, child_grid_num, is_fine_pe, npz) - call mn_phys_apply_temp_variables(Atm, Atm_block, IPD_control, IPD_data, n, child_grid_num, is_fine_pe, npz) + if (is_fine_pe) then + if (move_noahmp) then + !print '("[INFO] WDR NOAHMP reset negative values npe=",I0)', mpp_pe() + do i=isd,ied + do j=jsd,jed + ! slmsk(:,:) !< land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1) then + ! NOAH MP Variables + ! This is normally a negative number +! if (Moving_nest(n)%mn_phys%snowxy(i,j) .lt. -9.0 .or. Moving_nest(n)%mn_phys%snowxy(i,j) .gt. 9.0 ) then +! print '("[INFO] WDR NOAHMP reset negative values npe=",I0," i=",I0," j=",I0," snowxy=",E12.5," alboldoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowxy(i,j), Moving_nest(n)%mn_phys%alboldxy(i,j) +! Moving_nest(n)%mn_phys%snowxy(i,j) = 0.0 +! endif + + if (Moving_nest(n)%mn_phys%alboldxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%alboldxy(i,j) .gt. 1.0 ) then + print '("[INFO] WDR NOAHMP reset old albedo alboldxy values npe=",I0," i=",I0," j=",I0," alboldoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%alboldxy(i,j) + Moving_nest(n)%mn_phys%alboldxy(i,j) = 0.65 ! Cold start value + endif + + do k=lbound(Moving_nest(n)%mn_phys%snicexy,3),ubound(Moving_nest(n)%mn_phys%snicexy,3) + if (Moving_nest(n)%mn_phys%snicexy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snicexy(i,j,k) .gt. 100.0 ) then + print '("[INFO] WDR NOAHMP reset ice thickness values npe=",I0," i=",I0," j=",I0," k=",I0," lat,lon=",F9.5,",",F10.5," snicexy=",E12.5," lsnow=",I0,"=",I0)', mpp_pe(), i, j, k, Atm(n)%gridstruct%agrid(i,j,2)*rad2deg, Atm(n)%gridstruct%agrid(i,j,1)*rad2deg - 360.0, Moving_nest(n)%mn_phys%snicexy(i,j,k), IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound + + print '("[INFO] WDR NOAHMP reset ice thickness values npe=",I0," isd-ied=",I0,"-",I0," jsd-jed",I0,"-",I0," k=",I0,"-",I0)', mpp_pe(), isd, ied, jsd, jed, lbound(Moving_nest(n)%mn_phys%snicexy,3), ubound(Moving_nest(n)%mn_phys%snicexy,3) + + + Moving_nest(n)%mn_phys%snicexy(i,j,k) = 0.0 ! Cold start value + endif + enddo + + do k=lbound(Moving_nest(n)%mn_phys%snliqxy,3),ubound(Moving_nest(n)%mn_phys%snliqxy,3) + if (Moving_nest(n)%mn_phys%snliqxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snliqxy(i,j,k) .gt. 100.0 ) then + print '("[INFO] WDR NOAHMP reset liq thickness values npe=",I0," i=",I0," j=",I0," snliqxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snliqxy(i,j,k) + Moving_nest(n)%mn_phys%snliqxy(i,j,k) = 0.0 ! Cold start value + endif + enddo + + ! (/0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0/) -- 3 snow levels, 4 soil levels + do k=lbound(Moving_nest(n)%mn_phys%zsnsoxy,3),ubound(Moving_nest(n)%mn_phys%zsnsoxy,3) + if (Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) .lt. -80.0 .or. Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) .gt. 100.0 ) then + print '("[INFO] WDR NOAHMP reset snow surface depth values npe=",I0," i=",I0," j=",I0," k=",I0," zsnsoxy=",E12.5)', mpp_pe(), i, j, k, Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) + !Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) = 0.0 ! Cold start value + Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) = zsns_default(k) ! Cold start value + endif + enddo + + if (Moving_nest(n)%mn_phys%snowd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snowd(i,j) .gt. 100.0 ) then + print '("[INFO] WDR NOAHMP reset snow thickness values npe=",I0," i=",I0," j=",I0," snowd=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowd(i,j) + Moving_nest(n)%mn_phys%snowd(i,j) = 0.0 ! Cold start value + endif + + if (Moving_nest(n)%mn_phys%weasd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%weasd(i,j) .gt. 100.0 ) then + print '("[INFO] WDR NOAHMP reset snow thickness values npe=",I0," i=",I0," j=",I0," weasd=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%weasd(i,j) + Moving_nest(n)%mn_phys%weasd(i,j) = 0.0 ! Cold start value + endif + + do k=lbound(Moving_nest(n)%mn_phys%tsnoxy,3),ubound(Moving_nest(n)%mn_phys%tsnoxy,3) + if (Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .gt. 320.0 ) then + print '("[INFO] WDR NOAHMP reset snow temp values npe=",I0," i=",I0," j=",I0," tsnoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tsnoxy(i,j,k) + Moving_nest(n)%mn_phys%tsnoxy(i,j,k) = 0.0 ! Cold start value + endif + enddo + + if (Moving_nest(n)%mn_phys%tvxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tvxy(i,j) .gt. 320.0 ) then + print '("[INFO] WDR NOAHMP reset vegetation canopy temp values npe=",I0," i=",I0," j=",I0," tvxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tvxy(i,j) + Moving_nest(n)%mn_phys%tvxy(i,j) = 298.0 ! skin temperature + endif + + if (Moving_nest(n)%mn_phys%tgxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. 320.0 ) then + print '("[INFO] WDR NOAHMP reset ground temp values npe=",I0," i=",I0," j=",I0," tgxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tgxy(i,j) + Moving_nest(n)%mn_phys%tgxy(i,j) = 298.0 ! skin temperature + endif + + if (Moving_nest(n)%mn_phys%tahxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tahxy(i,j) .gt. 320.0 ) then + print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," tahxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tahxy(i,j) + Moving_nest(n)%mn_phys%tahxy(i,j) = 298.0 ! skin temperature + endif + + + do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) + if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. 340.0 ) then + print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," stc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%stc(i,j,k) + Moving_nest(n)%mn_phys%stc(i,j,k) = 298.0 ! skin temperature + endif + enddo - if (use_timers) call mpp_clock_end (id_movnest7_3) - if (use_timers) call mpp_clock_begin (id_movnest8) + endif + enddo + enddo + endif + endif - !!============================================================================ - !! Step 8 -- Dump to netCDF - !!============================================================================ if (is_fine_pe) then @@ -1106,10 +1280,21 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, if (Moving_nest(n)%mn_phys%albdifvis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdifvis_lnd(i,j) = 0.5 if (Moving_nest(n)%mn_phys%albdifnir_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdifnir_lnd(i,j) = 0.5 + enddo enddo endif + call mn_prog_apply_temp_variables(Atm, n, child_grid_num, is_fine_pe, npz) + call mn_phys_apply_temp_variables(Atm, Atm_block, IPD_control, IPD_data, n, child_grid_num, is_fine_pe, npz, a_step) + + if (use_timers) call mpp_clock_end (id_movnest7_3) + if (use_timers) call mpp_clock_begin (id_movnest8) + + !!============================================================================ + !! Step 8 -- Dump to netCDF + !!============================================================================ + output_step = output_step + 1 if (debug_sync) call mpp_sync(full_pelist) ! Used to make debugging easier. Can be removed. @@ -1164,4 +1349,3 @@ subroutine mn_replace_low_values(data_grid, low_value, new_value) end subroutine mn_replace_low_values end module fv_moving_nest_main_mod - diff --git a/moving_nest/fv_moving_nest_physics.F90 b/moving_nest/fv_moving_nest_physics.F90 index 1219617a6c..4608ff1559 100644 --- a/moving_nest/fv_moving_nest_physics.F90 +++ b/moving_nest/fv_moving_nest_physics.F90 @@ -68,11 +68,7 @@ module fv_moving_nest_physics_mod use GFS_init, only: GFS_grid_populate use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp -#ifdef OVERLOAD_R4 - use constantsR4_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks, hlv -#else use constants_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks, hlv -#endif use field_manager_mod, only: MODEL_ATMOS use fv_arrays_mod, only: fv_atmos_type, fv_nest_type, fv_grid_type, R_GRID use fv_moving_nest_types_mod, only: fv_moving_nest_prog_type, fv_moving_nest_physics_type, mn_surface_grids, fv_moving_nest_type @@ -123,22 +119,17 @@ module fv_moving_nest_physics_mod contains - !>@brief The subroutine 'mn_phys_reset_sfc_props' sets the static surface parameters from the high-resolution input file data - !>@details This subroutine relies on earlier code reading the data from files into the mn_static data structure - !! This subroutine does not yet handle ice points or frac_grid - fractional landfrac/oceanfrac values - subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffset, joffset, refine) + + subroutine mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, refine) type(fv_atmos_type), intent(inout),allocatable :: Atm(:) !< Array of atmospheric data integer, intent(in) :: n !< Current grid number type(mn_surface_grids), intent(in) :: mn_static !< Static surface data - type(block_control_type), intent(in) :: Atm_block !< Physics block layout - type(IPD_data_type), intent(inout) :: IPD_data(:) !< Physics variable data integer, intent(in) :: ioffset, joffset !< Current nest offset in i,j direction integer, intent(in) :: refine !< Nest refinement ratio - ! For iterating through physics/surface vector data - integer :: nb, blen, ix, i_pe, j_pe, i_idx, j_idx - real(kind=kind_phys) :: phys_oro + integer :: i_pe, j_pe, i_idx, j_idx + !print '("[INFO] MASK inside mn_phys_set_slmsk npe=",I0)', mpp_pe() ! Setup local land sea mask grid for masked interpolations do i_pe = Atm(n)%bd%isd, Atm(n)%bd%ied do j_pe = Atm(n)%bd%jsd, Atm(n)%bd%jed @@ -148,6 +139,27 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffs Moving_nest(n)%mn_phys%slmsk(i_pe, j_pe) = mn_static%ls_mask_grid(i_idx, j_idx) enddo enddo + end subroutine mn_phys_set_slmsk + + + !>@brief The subroutine 'mn_phys_reset_sfc_props' sets the static surface parameters from the high-resolution input file data + !>@details This subroutine relies on earlier code reading the data from files into the mn_static data structure + !! This subroutine does not yet handle ice points or frac_grid - fractional landfrac/oceanfrac values + subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffset, joffset, refine) + type(fv_atmos_type), intent(inout),allocatable :: Atm(:) !< Array of atmospheric data + integer, intent(in) :: n !< Current grid number + type(mn_surface_grids), intent(in) :: mn_static !< Static surface data + type(block_control_type), intent(in) :: Atm_block !< Physics block layout + type(IPD_data_type), intent(inout) :: IPD_data(:) !< Physics variable data + integer, intent(in) :: ioffset, joffset !< Current nest offset in i,j direction + integer, intent(in) :: refine !< Nest refinement ratio + + ! For iterating through physics/surface vector data + integer :: nb, blen, ix, i_pe, j_pe, i_idx, j_idx + real(kind=kind_phys) :: phys_oro + + !print '("[INFO] MASK inside mn_phys_reset_sfc_props npe=",I0)', mpp_pe() + call mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, refine) ! Reset the variables from the fix_sfc files do nb = 1,Atm_block%nblks @@ -177,7 +189,7 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffs IPD_data(nb)%Sfcprop%tg3(ix) = mn_static%deep_soil_temp_grid(i_idx, j_idx) - ! Follow logic from FV3/io/fv3atm_sfc_io.F90 + ! Follow logic from FV3/io/FV3GFS_io.F90 line 1187 ! TODO this will need to be more complicated if we support frac_grid !if (nint(mn_static%soil_type_grid(i_idx, j_idx)) == 14 .or. int(mn_static%soil_type_grid(i_idx, j_idx)+0.5) <= 0) then !if (nint(mn_static%soil_type_grid(i_idx, j_idx)) == 14 .or. @@ -313,6 +325,7 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, integer :: nb, blen, i, j, k, ix, nv type(fv_moving_nest_physics_type), pointer :: mn_phys + integer :: err_field = 0 this_pe = mpp_pe() @@ -337,6 +350,86 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, mn_phys%ts(is:ie, js:je) = Atm(n)%ts(is:ie, js:je) + if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then + nb = 1 + if (.not. associated(IPD_Data(nb)%Sfcprop%snowxy)) err_field = 1 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%tvxy)) err_field = 2 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%tgxy)) err_field = 3 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%canicexy)) err_field = 4 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%canliqxy)) err_field = 5 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%eahxy)) err_field = 6 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%tahxy)) err_field = 7 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%cmxy)) err_field = 8 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%chxy)) err_field = 9 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%fwetxy)) err_field = 10 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%sneqvoxy)) err_field = 11 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%alboldxy)) err_field = 12 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%qsnowxy)) err_field = 13 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%wslakexy)) err_field = 14 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%zwtxy)) err_field = 15 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%waxy)) err_field = 16 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%wtxy)) err_field = 17 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%lfmassxy)) err_field = 18 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%rtmassxy)) err_field = 19 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%stmassxy)) err_field = 20 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%woodxy)) err_field = 21 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%stblcpxy)) err_field = 22 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%fastcpxy)) err_field = 23 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%xsaixy)) err_field = 24 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%xlaixy)) err_field = 25 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%taussxy)) err_field = 26 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%smcwtdxy)) err_field = 27 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%deeprechxy)) err_field = 28 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%rechxy)) err_field = 29 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + + if (.not. associated(IPD_Data(nb)%Sfcprop%snicexy)) err_field = 30 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%snliqxy)) err_field = 31 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%snowd)) err_field = 32 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%tsnoxy)) err_field = 33 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%weasd)) err_field = 34 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%zsnsoxy)) err_field = 35 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + + if (err_field .gt. 0) then + print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + stop + endif + endif + do nb = 1,Atm_block%nblks blen = Atm_block%blksz(nb) do ix = 1, blen @@ -430,6 +523,52 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, mn_phys%dt_cool(i,j)= IPD_Data(nb)%Sfcprop%dt_cool(ix) mn_phys%qrain(i,j) = IPD_Data(nb)%Sfcprop%qrain(ix) endif + + if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then + mn_phys%snowxy(i,j) = IPD_Data(nb)%Sfcprop%snowxy(ix) + mn_phys%tvxy(i,j) = IPD_Data(nb)%Sfcprop%tvxy(ix) + mn_phys%tgxy(i,j) = IPD_Data(nb)%Sfcprop%tgxy(ix) + mn_phys%canicexy(i,j) = IPD_Data(nb)%Sfcprop%canicexy(ix) + mn_phys%canliqxy(i,j) = IPD_Data(nb)%Sfcprop%canliqxy(ix) + mn_phys%eahxy(i,j) = IPD_Data(nb)%Sfcprop%eahxy(ix) + mn_phys%tahxy(i,j) = IPD_Data(nb)%Sfcprop%tahxy(ix) + mn_phys%cmxy(i,j) = IPD_Data(nb)%Sfcprop%cmxy(ix) + mn_phys%chxy(i,j) = IPD_Data(nb)%Sfcprop%chxy(ix) + mn_phys%fwetxy(i,j) = IPD_Data(nb)%Sfcprop%fwetxy(ix) + mn_phys%sneqvoxy(i,j) = IPD_Data(nb)%Sfcprop%sneqvoxy(ix) + mn_phys%alboldxy(i,j) = IPD_Data(nb)%Sfcprop%alboldxy(ix) + mn_phys%qsnowxy(i,j) = IPD_Data(nb)%Sfcprop%qsnowxy(ix) + mn_phys%wslakexy(i,j) = IPD_Data(nb)%Sfcprop%wslakexy(ix) + mn_phys%zwtxy(i,j) = IPD_Data(nb)%Sfcprop%zwtxy(ix) + mn_phys%waxy(i,j) = IPD_Data(nb)%Sfcprop%waxy(ix) + mn_phys%wtxy(i,j) = IPD_Data(nb)%Sfcprop%wtxy(ix) + mn_phys%lfmassxy(i,j) = IPD_Data(nb)%Sfcprop%lfmassxy(ix) + mn_phys%rtmassxy(i,j) = IPD_Data(nb)%Sfcprop%rtmassxy(ix) + mn_phys%stmassxy(i,j) = IPD_Data(nb)%Sfcprop%stmassxy(ix) + mn_phys%woodxy(i,j) = IPD_Data(nb)%Sfcprop%woodxy(ix) + mn_phys%stblcpxy(i,j) = IPD_Data(nb)%Sfcprop%stblcpxy(ix) + mn_phys%fastcpxy(i,j) = IPD_Data(nb)%Sfcprop%fastcpxy(ix) + mn_phys%xsaixy(i,j) = IPD_Data(nb)%Sfcprop%xsaixy(ix) + mn_phys%xlaixy(i,j) = IPD_Data(nb)%Sfcprop%xlaixy(ix) + mn_phys%taussxy(i,j) = IPD_Data(nb)%Sfcprop%taussxy(ix) + mn_phys%smcwtdxy(i,j) = IPD_Data(nb)%Sfcprop%smcwtdxy(ix) + mn_phys%deeprechxy(i,j) = IPD_Data(nb)%Sfcprop%deeprechxy(ix) + mn_phys%rechxy(i,j) = IPD_Data(nb)%Sfcprop%rechxy(ix) + + ! lsnow_lsm_lbound is a negative value, lsnow_ubound is usually 0 + do k = IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound + mn_phys%snicexy(i,j,k) = IPD_Data(nb)%Sfcprop%snicexy(ix,k) + mn_phys%snliqxy(i,j,k) = IPD_Data(nb)%Sfcprop%snliqxy(ix,k) + mn_phys%tsnoxy(i,j,k) = IPD_Data(nb)%Sfcprop%tsnoxy(ix,k) + enddo + + mn_phys%snowd(i,j) = IPD_Data(nb)%Sfcprop%snowd(ix) + mn_phys%weasd(i,j) = IPD_Data(nb)%Sfcprop%weasd(ix) + + do k = IPD_Control%lsnow_lsm_lbound, IPD_Control%lsoil + mn_phys%zsnsoxy(i,j,k) = IPD_Data(nb)%Sfcprop%zsnsoxy(ix,k) + enddo + endif enddo enddo @@ -438,7 +577,7 @@ end subroutine mn_phys_fill_temp_variables !>@brief The subroutine 'mn_phys_apply_temp_variables' copies moved 2D data back into 1D physics arryas for nest motion !>@details This subroutine fills the 1D physics arrays from the mn_phys structure on the Atm object !! Note that ice variables are not yet handled. - subroutine mn_phys_apply_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, child_grid_num, is_fine_pe, npz) + subroutine mn_phys_apply_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, child_grid_num, is_fine_pe, npz, a_step) type(fv_atmos_type), allocatable, target, intent(inout) :: Atm(:) !< Array of atmospheric data type (block_control_type), intent(in) :: Atm_block !< Physics block layout type(IPD_control_type), intent(in) :: IPD_Control !< Physics metadata @@ -446,6 +585,7 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n integer, intent(in) :: n, child_grid_num !< Current grid number, child grid number logical, intent(in) :: is_fine_pe !< Is this a nest PE? integer, intent(in) :: npz !< Number of vertical levels + integer, intent(in) :: a_step !< Timestep for logging integer :: is, ie, js, je integer :: this_pe @@ -474,7 +614,13 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n if (move_physics) then ! Surface properties + !print '("[INFO] WDR smc set npe=",I0," smc(",I0,",",I0,",",I0,")=",E18.10," slmsk=",I0)', this_pe, i, j, 1, mn_phys%smc(i,j,1), int(mn_phys%slmsk(i,j)) do k = 1, IPD_Control%lsoil + !if ( int(mn_phys%slmsk(i,j)) .eq. 1 .and. mn_phys%smc(i,j,k) .ge. 100) then + ! IPD_Data(nb)%Sfcprop%smc(ix,k) = 0.3 + !else + ! IPD_Data(nb)%Sfcprop%smc(ix,k) = mn_phys%smc(i,j,k) + !endif IPD_Data(nb)%Sfcprop%smc(ix,k) = mn_phys%smc(i,j,k) IPD_Data(nb)%Sfcprop%stc(ix,k) = mn_phys%stc(i,j,k) IPD_Data(nb)%Sfcprop%slc(ix,k) = mn_phys%slc(i,j,k) @@ -611,6 +757,54 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n IPD_Data(nb)%Sfcprop%qrain(ix) = mn_phys%qrain(i,j) endif + if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then +! if (this_pe .eq. 72) print '("[INFO] WDR SNOWXY npe=",I0," a_step=",I0," slmsk=",F7.3," snowxy(",I0,",",I0,")=",F12.5,",",E12.5," lat=",F10.5," lon=",F10.5)', this_pe, a_step, IPD_data(nb)%Sfcprop%slmsk(ix), i, j, mn_phys%snowxy(i,j), mn_phys%snowxy(i,j), IPD_data(nb)%Grid%xlat_d(ix), IPD_data(nb)%Grid%xlon_d(ix)-360.0 + + IPD_Data(nb)%Sfcprop%snowxy(ix) = mn_phys%snowxy(i,j) + IPD_Data(nb)%Sfcprop%tvxy(ix) = mn_phys%tvxy(i,j) + IPD_Data(nb)%Sfcprop%tgxy(ix) = mn_phys%tgxy(i,j) + IPD_Data(nb)%Sfcprop%canicexy(ix) = mn_phys%canicexy(i,j) + IPD_Data(nb)%Sfcprop%canliqxy(ix) = mn_phys%canliqxy(i,j) + IPD_Data(nb)%Sfcprop%eahxy(ix) = mn_phys%eahxy(i,j) + IPD_Data(nb)%Sfcprop%tahxy(ix) = mn_phys%tahxy(i,j) + IPD_Data(nb)%Sfcprop%cmxy(ix) = mn_phys%cmxy(i,j) + IPD_Data(nb)%Sfcprop%chxy(ix) = mn_phys%chxy(i,j) + IPD_Data(nb)%Sfcprop%fwetxy(ix) = mn_phys%fwetxy(i,j) + IPD_Data(nb)%Sfcprop%sneqvoxy(ix) = mn_phys%sneqvoxy(i,j) + IPD_Data(nb)%Sfcprop%alboldxy(ix) = mn_phys%alboldxy(i,j) + IPD_Data(nb)%Sfcprop%qsnowxy(ix) = mn_phys%qsnowxy(i,j) + IPD_Data(nb)%Sfcprop%wslakexy(ix) = mn_phys%wslakexy(i,j) + IPD_Data(nb)%Sfcprop%zwtxy(ix) = mn_phys%zwtxy(i,j) + IPD_Data(nb)%Sfcprop%waxy(ix) = mn_phys%waxy(i,j) + IPD_Data(nb)%Sfcprop%wtxy(ix) = mn_phys%wtxy(i,j) + IPD_Data(nb)%Sfcprop%lfmassxy(ix) = mn_phys%lfmassxy(i,j) + IPD_Data(nb)%Sfcprop%rtmassxy(ix) = mn_phys%rtmassxy(i,j) + IPD_Data(nb)%Sfcprop%stmassxy(ix) = mn_phys%stmassxy(i,j) + IPD_Data(nb)%Sfcprop%woodxy(ix) = mn_phys%woodxy(i,j) + IPD_Data(nb)%Sfcprop%stblcpxy(ix) = mn_phys%stblcpxy(i,j) + IPD_Data(nb)%Sfcprop%fastcpxy(ix) = mn_phys%fastcpxy(i,j) + IPD_Data(nb)%Sfcprop%xsaixy(ix) = mn_phys%xsaixy(i,j) + IPD_Data(nb)%Sfcprop%xlaixy(ix) = mn_phys%xlaixy(i,j) + IPD_Data(nb)%Sfcprop%taussxy(ix) = mn_phys%taussxy(i,j) + IPD_Data(nb)%Sfcprop%smcwtdxy(ix) = mn_phys%smcwtdxy(i,j) + IPD_Data(nb)%Sfcprop%deeprechxy(ix) = mn_phys%deeprechxy(i,j) + IPD_Data(nb)%Sfcprop%rechxy(ix) = mn_phys%rechxy(i,j) + + do k = IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound + IPD_Data(nb)%Sfcprop%snicexy(ix,k) = mn_phys%snicexy(i,j,k) + IPD_Data(nb)%Sfcprop%snliqxy(ix,k) = mn_phys%snliqxy(i,j,k) + IPD_Data(nb)%Sfcprop%tsnoxy(ix,k) = mn_phys%tsnoxy(i,j,k) + enddo + + IPD_Data(nb)%Sfcprop%snowd(ix) = mn_phys%snowd(i,j) + IPD_Data(nb)%Sfcprop%weasd(ix) = mn_phys%weasd(i,j) + + do k = IPD_Control%lsnow_lsm_lbound, IPD_Control%lsoil + IPD_Data(nb)%Sfcprop%zsnsoxy(ix,k) = mn_phys%zsnsoxy(i,j,k) + enddo + + endif + ! Check if stype and vtype are properly set for land points. Set to reasonable values if they have fill values. if ( (int(IPD_data(nb)%Sfcprop%slmsk(ix)) .eq. 1) ) then @@ -654,6 +848,21 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st integer :: x_refine, y_refine type(fv_moving_nest_physics_type), pointer :: mn_phys + integer, parameter :: M_WATER = 0, M_LAND = 1, M_SEAICE = 2 + !! For NOAHMP + ! (/0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0/) -- 3 snow levels, 4 soil levels + ! TODO make this more flexible for number of snow and soil levels + !do k = IPD_Control%lsnow_lsm_lbound, IPD_Control%lsoil + real(kind=kind_phys) :: zsns_default(-2:4) + + if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then + zsns_default = [0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0 ] + else + ! Expect that zsns_default is not used in this case, but just to be safe, set to 0 + zsns_default = 0.0 + endif + + interp_type = 1 ! cell-centered A-grid interp_type_u = 4 ! D-grid interp_type_v = 4 ! D-grid @@ -676,18 +885,22 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st is_fine_pe, nest_domain, position) if (move_physics) then - call fill_nest_halos_from_parent("smc", mn_phys%smc, interp_type, Atm(child_grid_num)%neststruct%wt_h, & + ! Default - Arbitrary value 0.3 + call fill_nest_halos_from_parent_masked("smc", mn_phys%smc, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, IPD_Control%lsoil) - call fill_nest_halos_from_parent("stc", mn_phys%stc, interp_type, Atm(child_grid_num)%neststruct%wt_h, & + is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.3D0) + ! Defaults - use surface temperature to set soil temperature at each level + call fill_nest_halos_from_parent_masked("stc", mn_phys%stc, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, IPD_Control%lsoil) - call fill_nest_halos_from_parent("slc", mn_phys%slc, interp_type, Atm(child_grid_num)%neststruct%wt_h, & + is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, mn_phys%ts) + ! Default - Arbitrary value 0.3 + call fill_nest_halos_from_parent_masked("slc", mn_phys%slc, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, IPD_Control%lsoil) + is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.3D0) + call fill_nest_halos_from_parent("phy_f2d", mn_phys%phy_f2d, interp_type, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & @@ -707,21 +920,22 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st ! is_fine_pe, nest_domain, position) ! sea/land mask array (sea:0,land:1,sea-ice:2) + !integer, parameter :: M_WATER = 0, M_LAND = 1, M_SEAICE = 2 call fill_nest_halos_from_parent_masked("emis_lnd", mn_phys%emis_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 1, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) call fill_nest_halos_from_parent_masked("emis_ice", mn_phys%emis_ice, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 2, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_SEAICE, 0.5D0) call fill_nest_halos_from_parent_masked("emis_wat", mn_phys%emis_wat, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 0, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_WATER, 0.5D0) !call fill_nest_halos_from_parent("sfalb_lnd_bck", mn_phys%sfalb_lnd_bck, interp_type, Atm(child_grid_num)%neststruct%wt_h, & ! Atm(child_grid_num)%neststruct%ind_h, & @@ -770,14 +984,23 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st x_refine, y_refine, & is_fine_pe, nest_domain, position) - call fill_nest_halos_from_parent("canopy", mn_phys%canopy, interp_type, Atm(child_grid_num)%neststruct%wt_h, & - Atm(child_grid_num)%neststruct%ind_h, & - x_refine, y_refine, & - is_fine_pe, nest_domain, position) - call fill_nest_halos_from_parent("vegfrac", mn_phys%vegfrac, interp_type, Atm(child_grid_num)%neststruct%wt_h, & - Atm(child_grid_num)%neststruct%ind_h, & - x_refine, y_refine, & - is_fine_pe, nest_domain, position) +! call fill_nest_halos_from_parent("canopy", mn_phys%canopy, interp_type, Atm(child_grid_num)%neststruct%wt_h, & +! Atm(child_grid_num)%neststruct%ind_h, & +! x_refine, y_refine, & +! is_fine_pe, nest_domain, position) +! call fill_nest_halos_from_parent("vegfrac", mn_phys%vegfrac, interp_type, Atm(child_grid_num)%neststruct%wt_h, & +! Atm(child_grid_num)%neststruct%ind_h, & +! x_refine, y_refine, & +! is_fine_pe, nest_domain, position) + call fill_nest_halos_from_parent_masked("canopy", mn_phys%canopy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + call fill_nest_halos_from_parent_masked("vegfrac", mn_phys%vegfrac, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.50D0) + + + call fill_nest_halos_from_parent("uustar", mn_phys%uustar, interp_type, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & @@ -798,15 +1021,15 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st call fill_nest_halos_from_parent_masked("zorll", mn_phys%zorll, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 1, 86.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, 1, 86.0D0) call fill_nest_halos_from_parent_masked("zorlwav", mn_phys%zorlwav, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 0, 77.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, 0, 77.0D0) call fill_nest_halos_from_parent_masked("zorlw", mn_phys%zorlw, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 0, 78.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, 0, 78.0D0) call fill_nest_halos_from_parent("tsfco", mn_phys%tsfco, interp_type, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & @@ -824,19 +1047,19 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st call fill_nest_halos_from_parent_masked("albdirvis_lnd", mn_phys%albdirvis_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 1, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) call fill_nest_halos_from_parent_masked("albdirnir_lnd", mn_phys%albdirnir_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 1, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) call fill_nest_halos_from_parent_masked("albdifvis_lnd", mn_phys%albdifvis_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 1, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) call fill_nest_halos_from_parent_masked("albdifnir_lnd", mn_phys%albdifnir_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, 1, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) @@ -927,6 +1150,175 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st endif + if (move_physics .and. IPD_Control%lsm == IPD_Control%lsm_noahmp) then + + !integer, parameter :: M_WATER = 0, M_LAND = 1, M_SEAICE = 2 + + ! Land Sea Mask has values of 0 for oceans/lakes, 1 for land, 2 for sea ice + + call fill_nest_halos_from_parent_masked("snowxy", mn_phys%snowxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + call fill_nest_halos_from_parent_masked("tvxy", mn_phys%tvxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, mn_phys%ts) + call fill_nest_halos_from_parent_masked("tgxy", mn_phys%tgxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, mn_phys%ts) + + call fill_nest_halos_from_parent_masked("canicexy", mn_phys%canicexy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + call fill_nest_halos_from_parent_masked("canliqxy", mn_phys%canliqxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + call fill_nest_halos_from_parent_masked("eahxy", mn_phys%eahxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 2000.0D0) + + call fill_nest_halos_from_parent_masked("tahxy", mn_phys%tahxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, mn_phys%ts) + + ! TODO get realistic default value here -- bulk momentum drag coefficient + call fill_nest_halos_from_parent_masked("cmxy", mn_phys%cmxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 2.4D-3) + + ! TODO get realistic default value here -- bulk sensible heat drag coefficient + call fill_nest_halos_from_parent_masked("chxy", mn_phys%chxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 2.4D-3) + + ! wetted or snowed fraction of the canopy + call fill_nest_halos_from_parent_masked("fwetxy", mn_phys%fwetxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! snow mass at last time step[mm h2o] + call fill_nest_halos_from_parent_masked("sneqvoxy", mn_phys%sneqvoxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! Albedo assuming deep snow on prev timestep - default to 0.65 + call fill_nest_halos_from_parent_masked("alboldxy", mn_phys%alboldxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.65D0) + + ! Liquid equivalent snow - default to 0 + call fill_nest_halos_from_parent_masked("qsnowxy", mn_phys%qsnowxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! Lake water storage [mm] -- TODO find better default + call fill_nest_halos_from_parent_masked("wslakexy", mn_phys%wslakexy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! Water table depth - set to 2.5, cold start value + call fill_nest_halos_from_parent_masked("zwtxy", mn_phys%zwtxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 2.5D0) + + ! Water storage in aquifer - set to 4900.0, cold start value + call fill_nest_halos_from_parent_masked("waxy", mn_phys%waxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 4900.0D0) + ! Water storage in aquifer and saturated soil - set to 4900.0, cold start value + call fill_nest_halos_from_parent_masked("wtxy", mn_phys%wtxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 4900.0D0) + + + ! Leaf mass [g/m2] -- TODO find better default + call fill_nest_halos_from_parent_masked("lfmassxy", mn_phys%lfmassxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + ! Fine root mass [g/m2] -- TODO find better default + call fill_nest_halos_from_parent_masked("rtmassxy", mn_phys%rtmassxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + ! Stem mass [g/m2] -- TODO find better default + call fill_nest_halos_from_parent_masked("stmassxy", mn_phys%stmassxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + ! Wood mass [g/m2] -- TODO find better default + call fill_nest_halos_from_parent_masked("woodxy", mn_phys%woodxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! stable carbon in deep soil [g/m2] -- TODO find a better default + call fill_nest_halos_from_parent_masked("stblcpxy", mn_phys%stblcpxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + ! short-lived carbon, shallow soil [g/m2] -- TODO find a better default + call fill_nest_halos_from_parent_masked("fastcpxy", mn_phys%fastcpxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! stem area index [m2/m2] -- TODO find a better default + call fill_nest_halos_from_parent_masked("xsaixy", mn_phys%xsaixy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + ! leaf area index [m2/m2] -- TODO find a better default + call fill_nest_halos_from_parent_masked("xlaixy", mn_phys%xlaixy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! snow age factor [-] -- TODO find a better default + call fill_nest_halos_from_parent_masked("taussxy", mn_phys%taussxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! soil moisture content in the layer to the water table when deep -- TODO find a better default + call fill_nest_halos_from_parent_masked("smcwtdxy", mn_phys%smcwtdxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! recharge to the water table when deep -- TODO find a better default + call fill_nest_halos_from_parent_masked("deeprechxy", mn_phys%deeprechxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + ! recharge to the water table -- TODO find a better default + call fill_nest_halos_from_parent_masked("rechxy", mn_phys%rechxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + call fill_nest_halos_from_parent_masked("snicexy", mn_phys%snicexy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound, & + mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + call fill_nest_halos_from_parent_masked("snliqxy", mn_phys%snliqxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound, & + mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! surface snow thickness water equivalent over land - - default to 0 + call fill_nest_halos_from_parent_masked("snowd", mn_phys%snowd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! Temperature in surface snow -- TODO notes say default to 0, but I will put 273.15K + call fill_nest_halos_from_parent_masked("tsnoxy", mn_phys%tsnoxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound, & + !mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 273.15D0) + mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + ! water equivalent accumulated snow depth over land - - default to 0 + call fill_nest_halos_from_parent_masked("weasd", mn_phys%weasd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + + call fill_nest_halos_from_parent_masked("zsnsoxy", mn_phys%zsnsoxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsoil, & + mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, zsns_default) + + endif + end subroutine mn_phys_fill_nest_halos_from_parent !>@brief The subroutine 'mn_phys_fill_intern_nest_halos' fills the intenal nest halos for the physics variables @@ -1013,6 +1405,46 @@ subroutine mn_phys_fill_intern_nest_halos(moving_nest, IPD_Control, IPD_Data, do call mn_var_fill_intern_nest_halos(mn_phys%qrain, domain_fine, is_fine_pe) endif + if (move_physics .and. IPD_Control%lsm == IPD_Control%lsm_noahmp) then + call mn_var_fill_intern_nest_halos(mn_phys%snowxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%tvxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%tgxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%canicexy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%canliqxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%eahxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%tahxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%cmxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%chxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%fwetxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%sneqvoxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%alboldxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%qsnowxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%wslakexy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%zwtxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%waxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%wtxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%lfmassxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%rtmassxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%stmassxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%woodxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%stblcpxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%fastcpxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%xsaixy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%xlaixy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%taussxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%smcwtdxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%deeprechxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%rechxy, domain_fine, is_fine_pe) + + call mn_var_fill_intern_nest_halos(mn_phys%snicexy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%snliqxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%snowd, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%tsnoxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%weasd, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%zsnsoxy, domain_fine, is_fine_pe) + + endif + end subroutine mn_phys_fill_intern_nest_halos !>@brief The subroutine 'mn_phys_shift_data' shifts the variable in the nest, including interpolating at the leading edge @@ -1171,6 +1603,82 @@ subroutine mn_phys_shift_data(Atm, IPD_Control, IPD_Data, n, child_grid_num, wt_ delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) endif + if (move_physics .and. IPD_Control%lsm == IPD_Control%lsm_noahmp) then + call mn_var_shift_data(mn_phys%snowxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%tvxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%tgxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%canicexy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%canliqxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%eahxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%tahxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%cmxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%chxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%fwetxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%sneqvoxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%alboldxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%qsnowxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%wslakexy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%zwtxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%waxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%wtxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%lfmassxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%rtmassxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%stmassxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%woodxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%stblcpxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%fastcpxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%xsaixy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%xlaixy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%taussxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%smcwtdxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%deeprechxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%rechxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + + call mn_var_shift_data(mn_phys%snicexy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound) + call mn_var_shift_data(mn_phys%snliqxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound) + call mn_var_shift_data(mn_phys%snowd, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%tsnoxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound) + call mn_var_shift_data(mn_phys%weasd, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%zsnsoxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsoil) + + endif + + end subroutine mn_phys_shift_data !>@brief The subroutine 'mn_phys_dump_to_netcdf' dumps physics variables to debugging netCDF files @@ -1211,6 +1719,10 @@ subroutine mn_phys_dump_to_netcdf(Atm, Atm_block, IPD_Control, IPD_Data, time_va real, allocatable :: lakefrac_pr_local (:,:) !< lake fraction real, allocatable :: landfrac_pr_local (:,:) !< land fraction real, allocatable :: emis_lnd_pr_local (:,:) !< emissivity land + real, allocatable :: snowxy_pr_local (:,:) !< number of snow layers + + logical :: move_noahmp + move_noahmp = .True. this_pe = mpp_pe() @@ -1275,6 +1787,10 @@ subroutine mn_phys_dump_to_netcdf(Atm, Atm_block, IPD_Control, IPD_Data, time_va allocate ( ifd_pr_local(is:ie, js:je) ) endif + if (move_noahmp) then + allocate ( snowxy_pr_local(is:ie, js:je) ) + endif + if (move_physics) then smc_pr_local = +99999.9 stc_pr_local = +99999.9 @@ -1302,6 +1818,9 @@ subroutine mn_phys_dump_to_netcdf(Atm, Atm_block, IPD_Control, IPD_Data, time_va xv_pr_local = +99999.9 ifd_pr_local = +99999.9 endif + if (move_nsst) then + snowxy_pr_local = +99999.9 + endif do nb = 1,Atm_block%nblks blen = Atm_block%blksz(nb) @@ -1363,6 +1882,11 @@ subroutine mn_phys_dump_to_netcdf(Atm, Atm_block, IPD_Control, IPD_Data, time_va xv_pr_local(i,j) = IPD_data(nb)%Sfcprop%xv(ix) ifd_pr_local(i,j) = IPD_data(nb)%Sfcprop%ifd(ix) endif + + if (move_noahmp) then + snowxy_pr_local(i,j) = IPD_data(nb)%Sfcprop%snowxy(ix) + endif + enddo enddo @@ -1417,6 +1941,10 @@ subroutine mn_phys_dump_to_netcdf(Atm, Atm_block, IPD_Control, IPD_Data, time_va call mn_var_dump_to_netcdf(ifd_pr_local, is_fine_pe, domain_coarse, domain_fine, position, time_val, Atm%global_tile, file_prefix, "IFD") endif + if (move_noahmp) then + call mn_var_dump_to_netcdf(snowxy_pr_local, is_fine_pe, domain_coarse, domain_fine, position, time_val, Atm%global_tile, file_prefix, "SNOWXY") + endif + if (move_physics) then deallocate(smc_pr_local) deallocate(stc_pr_local) @@ -1435,6 +1963,9 @@ subroutine mn_phys_dump_to_netcdf(Atm, Atm_block, IPD_Control, IPD_Data, time_va if (move_nsst) deallocate(tref_pr_local, c_0_pr_local, xt_pr_local, xu_pr_local, xv_pr_local, ifd_pr_local) + if (move_noahmp) deallocate(snowxy_pr_local) + + end subroutine mn_phys_dump_to_netcdf end module fv_moving_nest_physics_mod diff --git a/moving_nest/fv_moving_nest_types.F90 b/moving_nest/fv_moving_nest_types.F90 index 45bd12504f..a4d2e73e26 100644 --- a/moving_nest/fv_moving_nest_types.F90 +++ b/moving_nest/fv_moving_nest_types.F90 @@ -83,6 +83,8 @@ module fv_moving_nest_types_mod real, allocatable :: orog_grid(:,:) _NULL ! orography -- raw or filtered depending on namelist option, in meters real, allocatable :: orog_std_grid(:,:) _NULL ! terrain standard deviation for gravity wave drag, in meters (?) real, allocatable :: ls_mask_grid(:,:) _NULL ! land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + real, allocatable :: parent_ls_mask_grid(:,:) _NULL ! Coarse parent land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + real, allocatable :: parent_land_frac_grid(:,:) _NULL ! Coarse parent land fraction grid; figure out where lakes are located real, allocatable :: land_frac_grid(:,:) _NULL ! Continuous land fraction - 0.0 ocean, 0.5 half of each, 1.0 all land real, allocatable :: parent_orog_grid(:,:) _NULL ! parent orography -- only used for terrain_smoother=1. @@ -206,6 +208,44 @@ module fv_moving_nest_types_mod real (kind=kind_phys), _ALLOCATABLE :: dt_cool (:,:) _NULL !< sub-layer cooling amount for NSSTM real (kind=kind_phys), _ALLOCATABLE :: qrain (:,:) _NULL !< sensible heat flux due to rainfall for NSSTM + ! NOAH MP LSM Variables + real (kind=kind_phys), _ALLOCATABLE :: snowxy (:,:) _NULL !< number of snow layers + real (kind=kind_phys), _ALLOCATABLE :: tvxy (:,:) _NULL !< canopy temperature + real (kind=kind_phys), _ALLOCATABLE :: tgxy (:,:) _NULL !< ground temperature + real (kind=kind_phys), _ALLOCATABLE :: canicexy (:,:) _NULL !< canopy intercepted ice mass + real (kind=kind_phys), _ALLOCATABLE :: canliqxy (:,:) _NULL !< canopy intercepted liquid water + real (kind=kind_phys), _ALLOCATABLE :: eahxy (:,:) _NULL !< air vapor pressure in canopy + real (kind=kind_phys), _ALLOCATABLE :: tahxy (:,:) _NULL !< air temperature in canopy + real (kind=kind_phys), _ALLOCATABLE :: cmxy (:,:) _NULL !< bulk momentum drag coefficient [m/s] + real (kind=kind_phys), _ALLOCATABLE :: chxy (:,:) _NULL !< bulk sensible heat exchange coefficient [m/s] + real (kind=kind_phys), _ALLOCATABLE :: fwetxy (:,:) _NULL !< wetted or snowed fraction of the canopy + real (kind=kind_phys), _ALLOCATABLE :: sneqvoxy (:,:) _NULL !< snow mass at last time step[mm h2o] + real (kind=kind_phys), _ALLOCATABLE :: alboldxy (:,:) _NULL !< surface albedo assuming deep snow on previous timestep + real (kind=kind_phys), _ALLOCATABLE :: qsnowxy (:,:) _NULL !< liquid water equiv. snowfall rate + real (kind=kind_phys), _ALLOCATABLE :: wslakexy (:,:) _NULL !< lake water storage [mm] + real (kind=kind_phys), _ALLOCATABLE :: zwtxy (:,:) _NULL !< water table depth + real (kind=kind_phys), _ALLOCATABLE :: waxy (:,:) _NULL !< water storage in aquifer + real (kind=kind_phys), _ALLOCATABLE :: wtxy (:,:) _NULL !< water storage in aquifer and saturated soil + real (kind=kind_phys), _ALLOCATABLE :: lfmassxy (:,:) _NULL !< leaf mass [g/m2] + real (kind=kind_phys), _ALLOCATABLE :: rtmassxy (:,:) _NULL !< mass of fine roots [g/m2] + real (kind=kind_phys), _ALLOCATABLE :: stmassxy (:,:) _NULL !< stem mass [g/m2] + real (kind=kind_phys), _ALLOCATABLE :: woodxy (:,:) _NULL !< mass of wood (incl. woody roots) [g/m2] + real (kind=kind_phys), _ALLOCATABLE :: stblcpxy (:,:) _NULL !< stable carbon in deep soil [g/m2] + real (kind=kind_phys), _ALLOCATABLE :: fastcpxy (:,:) _NULL !< short-lived carbon, shallow soil [g/m2] + real (kind=kind_phys), _ALLOCATABLE :: xsaixy (:,:) _NULL !< stem area index [m2/m2] + real (kind=kind_phys), _ALLOCATABLE :: xlaixy (:,:) _NULL !< leaf area index [m2/m2] + real (kind=kind_phys), _ALLOCATABLE :: taussxy (:,:) _NULL !< snow age factor [-] + real (kind=kind_phys), _ALLOCATABLE :: smcwtdxy (:,:) _NULL !< soil moisture content in the layer to the water table when deep + real (kind=kind_phys), _ALLOCATABLE :: deeprechxy (:,:) _NULL !< recharge to the water table when deep + real (kind=kind_phys), _ALLOCATABLE :: rechxy (:,:) _NULL !< recharge to the water table + + real (kind=kind_phys), _ALLOCATABLE :: snicexy (:,:,:) _NULL !< liq water equiv thickness of ice in surface snow + real (kind=kind_phys), _ALLOCATABLE :: snliqxy (:,:,:) _NULL !< liq water equiv thickness of liquid water in surface snow + real (kind=kind_phys), _ALLOCATABLE :: snowd (:,:) _NULL !< surface snow thickness water equivalent over land + real (kind=kind_phys), _ALLOCATABLE :: tsnoxy (:,:,:) _NULL !< temperature in surface snow + real (kind=kind_phys), _ALLOCATABLE :: weasd (:,:) _NULL !< water equivalent accumulated snow depth over land + real (kind=kind_phys), _ALLOCATABLE :: zsnsoxy (:,:,:) _NULL !< depth from snow surface at bottom interface + end type fv_moving_nest_physics_type type fv_moving_nest_type @@ -348,15 +388,17 @@ subroutine deallocate_fv_moving_nest_prog_type(mn_prog) end subroutine deallocate_fv_moving_nest_prog_type - subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_physics, move_nsst, lsoil, nmtvr, levs, ntot2d, ntot3d, mn_phys) + subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_physics, move_noahmp, move_nsst, lsnow_lbound, lsnow_ubound, lsoil, nmtvr, levs, ntot2d, ntot3d, mn_phys) integer, intent(in) :: isd, ied, jsd, jed, npz - logical, intent(in) :: move_physics, move_nsst - integer, intent(in) :: lsoil, nmtvr, levs, ntot2d, ntot3d ! From IPD_Control + logical, intent(in) :: move_physics, move_noahmp, move_nsst + integer, intent(in) :: lsnow_lbound, lsnow_ubound, lsoil, nmtvr, levs, ntot2d, ntot3d ! From IPD_Control type(fv_moving_nest_physics_type), intent(inout) :: mn_phys ! The local/temporary variables need to be allocated to the larger data (compute + halos) domain so that the nest motion code has halos to use allocate ( mn_phys%ts(isd:ied, jsd:jed) ) + !print '("[INFO] WDR allocate_fv_moving_nest_physics_type npe=",I0," lsnow_lbound=",I0," lsnow_ubound=",I0," lsoil=",I0)', mpp_pe(), lsnow_lbound, lsnow_ubound, lsoil + if (move_physics) then allocate ( mn_phys%slmsk(isd:ied, jsd:jed) ) allocate ( mn_phys%smc(isd:ied, jsd:jed, lsoil) ) @@ -440,6 +482,47 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p allocate ( mn_phys%qrain(isd:ied, jsd:jed) ) end if + if (move_noahmp) then + allocate ( mn_phys%snowxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%tvxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%tgxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%canicexy(isd:ied, jsd:jed) ) + allocate ( mn_phys%canliqxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%eahxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%tahxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%cmxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%chxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%fwetxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%sneqvoxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%alboldxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%qsnowxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%wslakexy(isd:ied, jsd:jed) ) + allocate ( mn_phys%zwtxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%waxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%wtxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%lfmassxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%rtmassxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%stmassxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%woodxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%stblcpxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%fastcpxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%xsaixy(isd:ied, jsd:jed) ) + allocate ( mn_phys%xlaixy(isd:ied, jsd:jed) ) + allocate ( mn_phys%taussxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%smcwtdxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%deeprechxy(isd:ied, jsd:jed) ) + allocate ( mn_phys%rechxy(isd:ied, jsd:jed) ) + + allocate ( mn_phys%snicexy(isd:ied, jsd:jed, lsnow_lbound:lsnow_ubound) ) + allocate ( mn_phys%snliqxy(isd:ied, jsd:jed, lsnow_lbound:lsnow_ubound) ) + allocate ( mn_phys%snowd(isd:ied, jsd:jed) ) + allocate ( mn_phys%tsnoxy(isd:ied, jsd:jed, lsnow_lbound:lsnow_ubound) ) + allocate ( mn_phys%weasd(isd:ied, jsd:jed) ) + allocate ( mn_phys%zsnsoxy(isd:ied, jsd:jed, lsnow_lbound:lsoil) ) + + !allocate ( mn_phys%ustar1(isd:ied, jsd:jed) ) + endif + mn_phys%ts = +99999.9 if (move_physics) then mn_phys%slmsk = +99999.9 @@ -524,6 +607,48 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p mn_phys%qrain = +99999.9 end if + + if (move_noahmp) then + mn_phys%snowxy = +99999.9 + mn_phys%tvxy = +99999.9 + mn_phys%tgxy = +99999.9 + mn_phys%canicexy = +99999.9 + mn_phys%canliqxy = +99999.9 + mn_phys%eahxy = +99999.9 + mn_phys%tahxy = +99999.9 + mn_phys%cmxy = +99999.9 + mn_phys%chxy = +99999.9 + mn_phys%fwetxy = +99999.9 + mn_phys%sneqvoxy = +99999.9 + mn_phys%alboldxy = +99999.9 + mn_phys%qsnowxy = +99999.9 + mn_phys%wslakexy = +99999.9 + mn_phys%zwtxy = +99999.9 + mn_phys%waxy = +99999.9 + mn_phys%wtxy = +99999.9 + mn_phys%lfmassxy = +99999.9 + mn_phys%rtmassxy = +99999.9 + mn_phys%stmassxy = +99999.9 + mn_phys%woodxy = +99999.9 + mn_phys%stblcpxy = +99999.9 + mn_phys%fastcpxy = +99999.9 + mn_phys%xsaixy = +99999.9 + mn_phys%xlaixy = +99999.9 + mn_phys%taussxy = +99999.9 + mn_phys%smcwtdxy = +99999.9 + mn_phys%deeprechxy = +99999.9 + mn_phys%rechxy = +99999.9 + + mn_phys%snicexy = +99999.9 + mn_phys%snliqxy = +99999.9 + mn_phys%snowd = +99999.9 + mn_phys%tsnoxy = +99999.9 + mn_phys%weasd = +99999.9 + mn_phys%zsnsoxy = +99999.9 + + !mn_phys%ustar1 = +99999.9 + endif + end subroutine allocate_fv_moving_nest_physics_type @@ -621,6 +746,47 @@ subroutine deallocate_fv_moving_nest_physics_type(mn_phys) deallocate( mn_phys%qrain ) end if + ! NOAH MP LSM + if (allocated(mn_phys%snowxy)) then + deallocate ( mn_phys%snowxy ) + deallocate ( mn_phys%tvxy ) + deallocate ( mn_phys%tgxy ) + deallocate ( mn_phys%canicexy ) + deallocate ( mn_phys%canliqxy ) + deallocate ( mn_phys%eahxy ) + deallocate ( mn_phys%tahxy ) + deallocate ( mn_phys%cmxy ) + deallocate ( mn_phys%chxy ) + deallocate ( mn_phys%fwetxy ) + deallocate ( mn_phys%sneqvoxy ) + deallocate ( mn_phys%alboldxy ) + deallocate ( mn_phys%qsnowxy ) + deallocate ( mn_phys%wslakexy ) + deallocate ( mn_phys%zwtxy ) + deallocate ( mn_phys%waxy ) + deallocate ( mn_phys%wtxy ) + deallocate ( mn_phys%lfmassxy ) + deallocate ( mn_phys%rtmassxy ) + deallocate ( mn_phys%stmassxy ) + deallocate ( mn_phys%woodxy ) + deallocate ( mn_phys%stblcpxy ) + deallocate ( mn_phys%fastcpxy ) + deallocate ( mn_phys%xsaixy ) + deallocate ( mn_phys%xlaixy ) + deallocate ( mn_phys%taussxy ) + deallocate ( mn_phys%smcwtdxy ) + deallocate ( mn_phys%deeprechxy ) + deallocate ( mn_phys%rechxy ) + + deallocate ( mn_phys%snicexy ) + deallocate ( mn_phys%snliqxy ) + deallocate ( mn_phys%snowd ) + deallocate ( mn_phys%tsnoxy ) + deallocate ( mn_phys%weasd ) + deallocate ( mn_phys%zsnsoxy ) + + endif + end subroutine deallocate_fv_moving_nest_physics_type end module fv_moving_nest_types_mod diff --git a/moving_nest/fv_moving_nest_utils.F90 b/moving_nest/fv_moving_nest_utils.F90 index 06136a2b15..f3c21b9cd2 100644 --- a/moving_nest/fv_moving_nest_utils.F90 +++ b/moving_nest/fv_moving_nest_utils.F90 @@ -67,11 +67,7 @@ module fv_moving_nest_utils_mod use IPD_typedefs, only: kind_phys => IPD_kind_phys #endif -#ifdef OVERLOAD_R4 - use constantsR4_mod, only: grav -#else use constants_mod, only: grav -#endif use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp use bounding_box_mod, only: bbox, bbox_get_C2F_index, fill_bbox @@ -94,6 +90,12 @@ module fv_moving_nest_utils_mod integer, parameter:: f_p = selected_real_kind(20) #endif +#ifdef OVERLOAD_R4 + real, parameter:: real_snan=x'FFBFFFFF' +#else + real, parameter:: real_snan=x'FFF7FFFFFFFFFFFF' +#endif + integer, parameter :: UWIND = 1 integer, parameter :: VWIND = 2 @@ -112,41 +114,50 @@ module fv_moving_nest_utils_mod interface fill_nest_halos_from_parent module procedure fill_nest_halos_from_parent_r4_2d - module procedure fill_nest_halos_from_parent_r4_3d + module procedure fill_nest_halos_from_parent_r4_3d_highz + module procedure fill_nest_halos_from_parent_r4_3d_lowhighz module procedure fill_nest_halos_from_parent_r4_4d module procedure fill_nest_halos_from_parent_r8_2d - module procedure fill_nest_halos_from_parent_r8_3d + module procedure fill_nest_halos_from_parent_r8_3d_highz + module procedure fill_nest_halos_from_parent_r8_3d_lowhighz module procedure fill_nest_halos_from_parent_r8_4d end interface fill_nest_halos_from_parent + interface alloc_halo_buffer module procedure alloc_halo_buffer_r4_2d - module procedure alloc_halo_buffer_r4_3d + module procedure alloc_halo_buffer_r4_3d_highz + module procedure alloc_halo_buffer_r4_3d_lowhighz module procedure alloc_halo_buffer_r4_4d module procedure alloc_halo_buffer_r8_2d - module procedure alloc_halo_buffer_r8_3d + module procedure alloc_halo_buffer_r8_3d_highz + module procedure alloc_halo_buffer_r8_3d_lowhighz module procedure alloc_halo_buffer_r8_4d end interface alloc_halo_buffer interface fill_nest_from_buffer module procedure fill_nest_from_buffer_r4_2d - module procedure fill_nest_from_buffer_r4_3d + module procedure fill_nest_from_buffer_r4_3d_highz + module procedure fill_nest_from_buffer_r4_3d_lowhighz module procedure fill_nest_from_buffer_r4_4d module procedure fill_nest_from_buffer_r8_2d - module procedure fill_nest_from_buffer_r8_3d + module procedure fill_nest_from_buffer_r8_3d_highz + module procedure fill_nest_from_buffer_r8_3d_lowhighz module procedure fill_nest_from_buffer_r8_4d end interface fill_nest_from_buffer interface fill_nest_from_buffer_cell_center module procedure fill_nest_from_buffer_cell_center_r4_2d - module procedure fill_nest_from_buffer_cell_center_r4_3d + module procedure fill_nest_from_buffer_cell_center_r4_3d_highz + module procedure fill_nest_from_buffer_cell_center_r4_3d_lowhighz module procedure fill_nest_from_buffer_cell_center_r4_4d module procedure fill_nest_from_buffer_cell_center_r8_2d - module procedure fill_nest_from_buffer_cell_center_r8_3d + module procedure fill_nest_from_buffer_cell_center_r8_3d_highz + module procedure fill_nest_from_buffer_cell_center_r8_3d_lowhighz module procedure fill_nest_from_buffer_cell_center_r8_4d end interface fill_nest_from_buffer_cell_center @@ -161,6 +172,28 @@ module fv_moving_nest_utils_mod module procedure fill_grid_from_supergrid_r8_4d end interface fill_grid_from_supergrid + ! Masked subroutines + interface fill_nest_halos_from_parent_masked + module procedure fill_nest_halos_from_parent_masked_r8_2d_const + module procedure fill_nest_halos_from_parent_masked_r8_2d_2d + module procedure fill_nest_halos_from_parent_masked_r8_3d_lowhighZ_const + module procedure fill_nest_halos_from_parent_masked_r8_3d_lowhighZ_1d + module procedure fill_nest_halos_from_parent_masked_r8_3d_lowhighZ_2d + end interface fill_nest_halos_from_parent_masked + + interface fill_nest_from_buffer_masked + module procedure fill_nest_from_buffer_masked_r8_2d_const + module procedure fill_nest_from_buffer_masked_r8_2d_2d + module procedure fill_nest_from_buffer_masked_r8_3d_1d + module procedure fill_nest_from_buffer_masked_r8_3d_2d + end interface fill_nest_from_buffer_masked + + interface fill_nest_from_buffer_cell_center_masked + module procedure fill_nest_from_buffer_cell_center_masked_2d_const + module procedure fill_nest_from_buffer_cell_center_masked_2d_2d + module procedure fill_nest_from_buffer_cell_center_masked_3d_1d + module procedure fill_nest_from_buffer_cell_center_masked_3d_2d + end interface fill_nest_from_buffer_cell_center_masked contains @@ -483,7 +516,7 @@ subroutine fill_nest_halos_from_parent_r8_2d(var_name, data_var, interp_type, wt end subroutine fill_nest_halos_from_parent_r8_2d - subroutine fill_nest_halos_from_parent_masked(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, mask_var, mask_val, default_val) + subroutine fill_nest_halos_from_parent_masked_r8_2d_const(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, mask_var, parent_mask_var, mask_val, default_val) character(len=*), intent(in) :: var_name real*8, allocatable, intent(inout) :: data_var(:,:) integer, intent(in) :: interp_type @@ -494,6 +527,7 @@ subroutine fill_nest_halos_from_parent_masked(var_name, data_var, interp_type, w type(nest_domain_type), intent(inout) :: nest_domain integer, intent(in) :: position real*4, allocatable, intent(in) :: mask_var(:,:) + real*4, allocatable, intent(in) :: parent_mask_var(:,:) integer, intent(in) :: mask_val real*8, intent(in) :: default_val @@ -529,10 +563,222 @@ subroutine fill_nest_halos_from_parent_masked(var_name, data_var, interp_type, w !! !!=========================================================== - call fill_nest_from_buffer_masked(interp_type, data_var, nbuffer, north_fine, north_coarse, NORTH, x_refine, y_refine, wt, ind, mask_var, mask_val, default_val) - call fill_nest_from_buffer_masked(interp_type, data_var, sbuffer, south_fine, south_coarse, SOUTH, x_refine, y_refine, wt, ind, mask_var, mask_val, default_val) - call fill_nest_from_buffer_masked(interp_type, data_var, ebuffer, east_fine, east_coarse, EAST, x_refine, y_refine, wt, ind, mask_var, mask_val, default_val) - call fill_nest_from_buffer_masked(interp_type, data_var, wbuffer, west_fine, west_coarse, WEST, x_refine, y_refine, wt, ind, mask_var, mask_val, default_val) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, nbuffer, north_fine, north_coarse, NORTH, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, sbuffer, south_fine, south_coarse, SOUTH, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, ebuffer, east_fine, east_coarse, EAST, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, wbuffer, west_fine, west_coarse, WEST, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) + + endif + + deallocate(nbuffer) + deallocate(sbuffer) + deallocate(ebuffer) + deallocate(wbuffer) + + end subroutine fill_nest_halos_from_parent_masked_r8_2d_const + + subroutine fill_nest_halos_from_parent_masked_r8_2d_2d(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, mask_var, parent_mask_var, mask_val, default_grid) + character(len=*), intent(in) :: var_name + real*8, allocatable, intent(inout) :: data_var(:,:) + integer, intent(in) :: interp_type + real, allocatable, intent(in) :: wt(:,:,:) ! TODO should this also be real*8? + integer, allocatable, intent(in) :: ind(:,:,:) + integer, intent(in) :: x_refine, y_refine + logical, intent(in) :: is_fine_pe + type(nest_domain_type), intent(inout) :: nest_domain + integer, intent(in) :: position + real*4, allocatable, intent(in) :: mask_var(:,:) + real*4, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val + real, allocatable, intent(in) :: default_grid(:,:) + + real*8, dimension(:,:), allocatable :: nbuffer, sbuffer, ebuffer, wbuffer + type(bbox) :: north_fine, north_coarse + type(bbox) :: south_fine, south_coarse + type(bbox) :: east_fine, east_coarse + type(bbox) :: west_fine, west_coarse + integer :: this_pe + integer :: nest_level = 1 ! TODO allow to vary + + this_pe = mpp_pe() + + !!=========================================================== + !! + !! Fill halo buffers + !! + !!=========================================================== + + call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position) + call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position) + call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position) + call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position) + + ! Passes data from coarse grid to fine grid's halo + call mpp_update_nest_fine(data_var, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level, position=position) + + if (is_fine_pe) then + + !!=========================================================== + !! + !! Apply halo data + !! + !!=========================================================== + + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, nbuffer, north_fine, north_coarse, NORTH, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, sbuffer, south_fine, south_coarse, SOUTH, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, ebuffer, east_fine, east_coarse, EAST, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, wbuffer, west_fine, west_coarse, WEST, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + + endif + + deallocate(nbuffer) + deallocate(sbuffer) + deallocate(ebuffer) + deallocate(wbuffer) + + end subroutine fill_nest_halos_from_parent_masked_r8_2d_2d + + + + + subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_const(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, low_z, high_z, mask_var, parent_mask_var, mask_val, default_val) + character(len=*), intent(in) :: var_name + real*8, allocatable, intent(inout) :: data_var(:,:,:) + integer, intent(in) :: interp_type + real, allocatable, intent(in) :: wt(:,:,:) ! TODO should this be real*8? + integer, allocatable, intent(in) :: ind(:,:,:) + integer, intent(in) :: x_refine, y_refine + logical, intent(in) :: is_fine_pe + type(nest_domain_type), intent(inout) :: nest_domain + integer, intent(in) :: position, low_z, high_z + real*4, allocatable, intent(in) :: mask_var(:,:) + real*4, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val + real*8, intent(in) :: default_val + + real*8 :: default_vector(low_z:high_z) + + default_vector = default_val + + call fill_nest_halos_from_parent_masked_r8_3d_lowhighz_1d(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, low_z, high_z, mask_var, parent_mask_var, mask_val, default_vector) + + end subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_const + + + + subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_1d(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, low_z, high_z, mask_var, parent_mask_var, mask_val, default_val) + character(len=*), intent(in) :: var_name + real*8, allocatable, intent(inout) :: data_var(:,:,:) + integer, intent(in) :: interp_type + real, allocatable, intent(in) :: wt(:,:,:) ! TODO should this be real*8? + integer, allocatable, intent(in) :: ind(:,:,:) + integer, intent(in) :: x_refine, y_refine + logical, intent(in) :: is_fine_pe + type(nest_domain_type), intent(inout) :: nest_domain + integer, intent(in) :: position, low_z, high_z + real*4, allocatable, intent(in) :: mask_var(:,:) + real*4, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val + real*8, intent(in) :: default_val(low_z:high_z) + + real*8, dimension(:,:,:), allocatable :: nbuffer, sbuffer, ebuffer, wbuffer + type(bbox) :: north_fine, north_coarse + type(bbox) :: south_fine, south_coarse + type(bbox) :: east_fine, east_coarse + type(bbox) :: west_fine, west_coarse + integer :: this_pe + integer :: nest_level = 1 ! TODO allow to vary + + this_pe = mpp_pe() + + !!=========================================================== + !! + !! Fill halo buffers + !! + !!=========================================================== + + call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, low_z, high_z) + call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, low_z, high_z) + call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, low_z, high_z) + call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, low_z, high_z) + + ! Passes data from coarse grid to fine grid's halo + call mpp_update_nest_fine(data_var, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level, position=position) + + if (is_fine_pe) then + + !!=========================================================== + !! + !! Apply halo data + !! + !!=========================================================== + + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, nbuffer, north_fine, north_coarse, low_z, high_z, NORTH, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, sbuffer, south_fine, south_coarse, low_z, high_z, SOUTH, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, ebuffer, east_fine, east_coarse, low_z, high_z, EAST, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, wbuffer, west_fine, west_coarse, low_z, high_z, WEST, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) + + endif + + deallocate(nbuffer) + deallocate(sbuffer) + deallocate(ebuffer) + deallocate(wbuffer) + + end subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_1d + + + subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_2d(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, low_z, high_z, mask_var, parent_mask_var, mask_val, default_grid) + character(len=*), intent(in) :: var_name + real*8, allocatable, intent(inout) :: data_var(:,:,:) + integer, intent(in) :: interp_type + real, allocatable, intent(in) :: wt(:,:,:) ! TODO should this be real*8? + integer, allocatable, intent(in) :: ind(:,:,:) + integer, intent(in) :: x_refine, y_refine + logical, intent(in) :: is_fine_pe + type(nest_domain_type), intent(inout) :: nest_domain + integer, intent(in) :: position, low_z, high_z + real*4, allocatable, intent(in) :: mask_var(:,:) + real*4, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val + real, allocatable, intent(in) :: default_grid(:,:) + + real*8, dimension(:,:,:), allocatable :: nbuffer, sbuffer, ebuffer, wbuffer + type(bbox) :: north_fine, north_coarse + type(bbox) :: south_fine, south_coarse + type(bbox) :: east_fine, east_coarse + type(bbox) :: west_fine, west_coarse + integer :: this_pe + integer :: nest_level = 1 ! TODO allow to vary + + this_pe = mpp_pe() + + !!=========================================================== + !! + !! Fill halo buffers + !! + !!=========================================================== + + call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, low_z, high_z) + call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, low_z, high_z) + call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, low_z, high_z) + call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, low_z, high_z) + + ! Passes data from coarse grid to fine grid's halo + call mpp_update_nest_fine(data_var, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level, position=position) + + if (is_fine_pe) then + + !!=========================================================== + !! + !! Apply halo data + !! + !!=========================================================== + + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, nbuffer, north_fine, north_coarse, low_z, high_z, NORTH, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, sbuffer, south_fine, south_coarse, low_z, high_z, SOUTH, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, ebuffer, east_fine, east_coarse, low_z, high_z, EAST, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + call fill_nest_from_buffer_masked(var_name, interp_type, data_var, wbuffer, west_fine, west_coarse, low_z, high_z, WEST, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) endif @@ -541,10 +787,11 @@ subroutine fill_nest_halos_from_parent_masked(var_name, data_var, interp_type, w deallocate(ebuffer) deallocate(wbuffer) - end subroutine fill_nest_halos_from_parent_masked + end subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_2d + - subroutine fill_nest_halos_from_parent_r4_3d(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) + subroutine fill_nest_halos_from_parent_r4_3d_highz(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) character(len=*), intent(in) :: var_name real*4, allocatable, intent(inout) :: data_var(:,:,:) integer, intent(in) :: interp_type @@ -555,6 +802,22 @@ subroutine fill_nest_halos_from_parent_r4_3d(var_name, data_var, interp_type, wt type(nest_domain_type), intent(inout) :: nest_domain integer, intent(in) :: position, nz + + call fill_nest_halos_from_parent_r4_3d_lowhighz(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, 1, nz) + + end subroutine fill_nest_halos_from_parent_r4_3d_highz + + subroutine fill_nest_halos_from_parent_r4_3d_lowhighz(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, low_z, high_z) + character(len=*), intent(in) :: var_name + real*4, allocatable, intent(inout) :: data_var(:,:,:) + integer, intent(in) :: interp_type + real, allocatable, intent(in) :: wt(:,:,:) + integer, allocatable, intent(in) :: ind(:,:,:) + integer, intent(in) :: x_refine, y_refine + logical, intent(in) :: is_fine_pe + type(nest_domain_type), intent(inout) :: nest_domain + integer, intent(in) :: position, low_z, high_z + real*4, dimension(:,:,:), allocatable :: nbuffer, sbuffer, ebuffer, wbuffer type(bbox) :: north_fine, north_coarse type(bbox) :: south_fine, south_coarse @@ -571,10 +834,10 @@ subroutine fill_nest_halos_from_parent_r4_3d(var_name, data_var, interp_type, wt !! !!=========================================================== - call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, nz) - call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, nz) - call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, nz) - call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, nz) + call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, low_z, high_z) + call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, low_z, high_z) + call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, low_z, high_z) + call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, low_z, high_z) ! Passes data from coarse grid to fine grid's halo call mpp_update_nest_fine(data_var, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level, position=position) @@ -587,10 +850,10 @@ subroutine fill_nest_halos_from_parent_r4_3d(var_name, data_var, interp_type, wt !! !!=========================================================== - call fill_nest_from_buffer(interp_type, data_var, nbuffer, north_fine, north_coarse, nz, NORTH, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, sbuffer, south_fine, south_coarse, nz, SOUTH, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, ebuffer, east_fine, east_coarse, nz, EAST, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, wbuffer, west_fine, west_coarse, nz, WEST, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, nbuffer, north_fine, north_coarse, low_z, high_z, NORTH, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, sbuffer, south_fine, south_coarse, low_z, high_z, SOUTH, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, ebuffer, east_fine, east_coarse, low_z, high_z, EAST, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, wbuffer, west_fine, west_coarse, low_z, high_z, WEST, x_refine, y_refine, wt, ind) endif @@ -599,10 +862,9 @@ subroutine fill_nest_halos_from_parent_r4_3d(var_name, data_var, interp_type, wt deallocate(ebuffer) deallocate(wbuffer) - end subroutine fill_nest_halos_from_parent_r4_3d + end subroutine fill_nest_halos_from_parent_r4_3d_lowhighz - - subroutine fill_nest_halos_from_parent_r8_3d(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) + subroutine fill_nest_halos_from_parent_r8_3d_highz(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) character(len=*), intent(in) :: var_name real*8, allocatable, intent(inout) :: data_var(:,:,:) integer, intent(in) :: interp_type @@ -613,6 +875,21 @@ subroutine fill_nest_halos_from_parent_r8_3d(var_name, data_var, interp_type, wt type(nest_domain_type), intent(inout) :: nest_domain integer, intent(in) :: position, nz + call fill_nest_halos_from_parent_r8_3d_lowhighz(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, 1, nz) + + end subroutine fill_nest_halos_from_parent_r8_3d_highz + + subroutine fill_nest_halos_from_parent_r8_3d_lowhighz(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, low_z, high_z) + character(len=*), intent(in) :: var_name + real*8, allocatable, intent(inout) :: data_var(:,:,:) + integer, intent(in) :: interp_type + real, allocatable, intent(in) :: wt(:,:,:) ! TODO should this be real*8? + integer, allocatable, intent(in) :: ind(:,:,:) + integer, intent(in) :: x_refine, y_refine + logical, intent(in) :: is_fine_pe + type(nest_domain_type), intent(inout) :: nest_domain + integer, intent(in) :: position, low_z, high_z + real*8, dimension(:,:,:), allocatable :: nbuffer, sbuffer, ebuffer, wbuffer type(bbox) :: north_fine, north_coarse type(bbox) :: south_fine, south_coarse @@ -629,10 +906,10 @@ subroutine fill_nest_halos_from_parent_r8_3d(var_name, data_var, interp_type, wt !! !!=========================================================== - call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, nz) - call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, nz) - call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, nz) - call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, nz) + call alloc_halo_buffer(nbuffer, north_fine, north_coarse, nest_domain, NORTH, position, low_z, high_z) + call alloc_halo_buffer(sbuffer, south_fine, south_coarse, nest_domain, SOUTH, position, low_z, high_z) + call alloc_halo_buffer(ebuffer, east_fine, east_coarse, nest_domain, EAST, position, low_z, high_z) + call alloc_halo_buffer(wbuffer, west_fine, west_coarse, nest_domain, WEST, position, low_z, high_z) ! Passes data from coarse grid to fine grid's halo call mpp_update_nest_fine(data_var, nest_domain, wbuffer, sbuffer, ebuffer, nbuffer, nest_level, position=position) @@ -645,10 +922,10 @@ subroutine fill_nest_halos_from_parent_r8_3d(var_name, data_var, interp_type, wt !! !!=========================================================== - call fill_nest_from_buffer(interp_type, data_var, nbuffer, north_fine, north_coarse, nz, NORTH, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, sbuffer, south_fine, south_coarse, nz, SOUTH, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, ebuffer, east_fine, east_coarse, nz, EAST, x_refine, y_refine, wt, ind) - call fill_nest_from_buffer(interp_type, data_var, wbuffer, west_fine, west_coarse, nz, WEST, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, nbuffer, north_fine, north_coarse, low_z, high_z, NORTH, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, sbuffer, south_fine, south_coarse, low_z, high_z, SOUTH, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, ebuffer, east_fine, east_coarse, low_z, high_z, EAST, x_refine, y_refine, wt, ind) + call fill_nest_from_buffer(interp_type, data_var, wbuffer, west_fine, west_coarse, low_z, high_z, WEST, x_refine, y_refine, wt, ind) endif @@ -657,7 +934,7 @@ subroutine fill_nest_halos_from_parent_r8_3d(var_name, data_var, interp_type, wt deallocate(ebuffer) deallocate(wbuffer) - end subroutine fill_nest_halos_from_parent_r8_3d + end subroutine fill_nest_halos_from_parent_r8_3d_lowhighz subroutine fill_nest_halos_from_parent_r4_4d(var_name, data_var, interp_type, wt, ind, x_refine, y_refine, is_fine_pe, nest_domain, position, nz) @@ -836,17 +1113,27 @@ subroutine alloc_halo_buffer_r4_2d(buffer, bbox_fine, bbox_coarse, nest_domain, end subroutine alloc_halo_buffer_r4_2d - subroutine alloc_halo_buffer_r4_3d(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, nz) + subroutine alloc_halo_buffer_r4_3d_highz(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, high_z) + real*4, dimension(:,:,:), allocatable, intent(out) :: buffer + type(bbox), intent(out) :: bbox_fine, bbox_coarse + type(nest_domain_type), intent(in) :: nest_domain + integer, intent(in) :: direction, position, high_z + + call alloc_halo_buffer_r4_3d_lowhighz(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, 1, high_z) + + end subroutine alloc_halo_buffer_r4_3d_highz + + subroutine alloc_halo_buffer_r4_3d_lowhighz(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, low_z, high_z) real*4, dimension(:,:,:), allocatable, intent(out) :: buffer type(bbox), intent(out) :: bbox_fine, bbox_coarse type(nest_domain_type), intent(in) :: nest_domain - integer, intent(in) :: direction, position, nz + integer, intent(in) :: direction, position, low_z, high_z call bbox_get_C2F_index(nest_domain, bbox_fine, bbox_coarse, direction, position) if( bbox_coarse.ie .GE. bbox_coarse.is .AND. bbox_coarse.je .GE. bbox_coarse.js ) then - allocate(buffer(bbox_coarse.is:bbox_coarse.ie, bbox_coarse.js:bbox_coarse.je,1:nz)) + allocate(buffer(bbox_coarse.is:bbox_coarse.ie, bbox_coarse.js:bbox_coarse.je, low_z:high_z)) else ! The buffer must have some storage allocated, whether it's a useful buffer or just a dummy. allocate(buffer(1,1,1)) @@ -854,19 +1141,29 @@ subroutine alloc_halo_buffer_r4_3d(buffer, bbox_fine, bbox_coarse, nest_domain, buffer = 0 - end subroutine alloc_halo_buffer_r4_3d + end subroutine alloc_halo_buffer_r4_3d_lowhighz + + + subroutine alloc_halo_buffer_r8_3d_highz(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, high_z) + real*8, dimension(:,:,:), allocatable, intent(out) :: buffer + type(bbox), intent(out) :: bbox_fine, bbox_coarse + type(nest_domain_type), intent(in) :: nest_domain + integer, intent(in) :: direction, position, high_z + + call alloc_halo_buffer_r8_3d_lowhighz(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, 1, high_z) + end subroutine alloc_halo_buffer_r8_3d_highz - subroutine alloc_halo_buffer_r8_3d(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, nz) + subroutine alloc_halo_buffer_r8_3d_lowhighz(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, low_z, high_z) real*8, dimension(:,:,:), allocatable, intent(out) :: buffer type(bbox), intent(out) :: bbox_fine, bbox_coarse type(nest_domain_type), intent(in) :: nest_domain - integer, intent(in) :: direction, position, nz + integer, intent(in) :: direction, position, low_z, high_z call bbox_get_C2F_index(nest_domain, bbox_fine, bbox_coarse, direction, position) if( bbox_coarse.ie .GE. bbox_coarse.is .AND. bbox_coarse.je .GE. bbox_coarse.js ) then - allocate(buffer(bbox_coarse.is:bbox_coarse.ie, bbox_coarse.js:bbox_coarse.je,1:nz)) + allocate(buffer(bbox_coarse.is:bbox_coarse.ie, bbox_coarse.js:bbox_coarse.je, low_z:high_z)) else ! The buffer must have some storage allocated, whether it's a useful buffer or just a dummy. allocate(buffer(1,1,1)) @@ -874,7 +1171,7 @@ subroutine alloc_halo_buffer_r8_3d(buffer, bbox_fine, bbox_coarse, nest_domain, buffer = 0 - end subroutine alloc_halo_buffer_r8_3d + end subroutine alloc_halo_buffer_r8_3d_lowhighz subroutine alloc_halo_buffer_r4_4d(buffer, bbox_fine, bbox_coarse, nest_domain, direction, position, nz, n4d) @@ -1522,9 +1819,10 @@ subroutine fill_nest_from_buffer_r8_2d(interp_type, x, buffer, bbox_fine, bbox_c end subroutine fill_nest_from_buffer_r8_2d - subroutine fill_nest_from_buffer_masked(interp_type, x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, mask_val, default_val) + subroutine fill_nest_from_buffer_masked_r8_2d_const(var_name, interp_type, x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) implicit none + character(len=*), intent(in) :: var_name integer, intent(in) :: interp_type real*8, allocatable, intent(inout) :: x(:,:) real*8, allocatable, intent(in) :: buffer(:,:) @@ -1533,6 +1831,7 @@ subroutine fill_nest_from_buffer_masked(interp_type, x, buffer, bbox_fine, bbox_ real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 integer, allocatable, intent(in) :: ind(:,:,:) real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) integer, intent(in) :: mask_val real*8, intent(in) :: default_val @@ -1542,12 +1841,14 @@ subroutine fill_nest_from_buffer_masked(interp_type, x, buffer, bbox_fine, bbox_ ! Output the interpolation type select case (interp_type) case (1) + print '("[WARN] fv_moving_nest_utils.F90 fill_nest_from_buffer_mask interp_type 1 not implemented. var_name=",A16)', var_name call fill_nest_from_buffer_cell_center("A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind) ! case (3) ! C grid staggered case (4) + print '("[WARN] fv_moving_nest_utils.F90 fill_nest_from_buffer_mask interp_type 4 not implemented. var_name=",A16)', var_name call fill_nest_from_buffer_cell_center("D", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind) case (7) - call fill_nest_from_buffer_cell_center_masked("A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, mask_val, default_val) + call fill_nest_from_buffer_cell_center_masked(var_name, "A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) case (9) !call fill_nest_from_buffer_nearest_neighbor(x, buffer, bbox_fine, bbox_coarse, dir, wt) call mpp_error(FATAL, '2D fill_nest_from_buffer_nearest_neighbor not yet implemented.') @@ -1555,21 +1856,23 @@ subroutine fill_nest_from_buffer_masked(interp_type, x, buffer, bbox_fine, bbox_ call mpp_error(FATAL, 'interp_single_nest got invalid value for interp_type from namelist.') end select - end subroutine fill_nest_from_buffer_masked - + end subroutine fill_nest_from_buffer_masked_r8_2d_const - - subroutine fill_nest_from_buffer_r4_3d(interp_type, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + subroutine fill_nest_from_buffer_masked_r8_2d_2d(var_name, interp_type, x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) implicit none + character(len=*), intent(in) :: var_name integer, intent(in) :: interp_type - real*4, allocatable, intent(inout) :: x(:,:,:) - real*4, allocatable, intent(in) :: buffer(:,:,:) + real*8, allocatable, intent(inout) :: x(:,:) + real*8, allocatable, intent(in) :: buffer(:,:) type(bbox), intent(in) :: bbox_fine, bbox_coarse - integer, intent(in) :: nz integer, intent(in) :: dir, x_refine, y_refine real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 integer, allocatable, intent(in) :: ind(:,:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val + real, allocatable, intent(in) :: default_grid(:,:) integer :: this_pe this_pe = mpp_pe() @@ -1577,31 +1880,39 @@ subroutine fill_nest_from_buffer_r4_3d(interp_type, x, buffer, bbox_fine, bbox_c ! Output the interpolation type select case (interp_type) case (1) - call fill_nest_from_buffer_cell_center("A", x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) - ! case (3) ! C grid staggered + print '("[WARN] fv_moving_nest_utils.F90 fill_nest_from_buffer_mask interp_type 1 not implemented. var_name=",A16)', var_name + call fill_nest_from_buffer_cell_center("A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind) + ! case (3) ! C grid staggered case (4) - call fill_nest_from_buffer_cell_center("D", x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + print '("[WARN] fv_moving_nest_utils.F90 fill_nest_from_buffer_mask interp_type 4 not implemented. var_name=",A16)', var_name + call fill_nest_from_buffer_cell_center("D", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind) + case (7) + call fill_nest_from_buffer_cell_center_masked(var_name, "A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) case (9) - !call fill_nest_from_buffer_nearest_neighbor(x, buffer, bbox_fine, bbox_coarse, nz, dir, wt) - call mpp_error(FATAL, 'fill_nest_from_buffer_nearest_neighbor is not yet implemented.') + !call fill_nest_from_buffer_nearest_neighbor(x, buffer, bbox_fine, bbox_coarse, dir, wt) + call mpp_error(FATAL, '2D fill_nest_from_buffer_nearest_neighbor not yet implemented.') case default call mpp_error(FATAL, 'interp_single_nest got invalid value for interp_type from namelist.') end select - end subroutine fill_nest_from_buffer_r4_3d + end subroutine fill_nest_from_buffer_masked_r8_2d_2d - subroutine fill_nest_from_buffer_r8_3d(interp_type, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + subroutine fill_nest_from_buffer_masked_r8_3d_1d(var_name, interp_type, x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_vector) implicit none + character(len=*), intent(in) :: var_name integer, intent(in) :: interp_type real*8, allocatable, intent(inout) :: x(:,:,:) real*8, allocatable, intent(in) :: buffer(:,:,:) type(bbox), intent(in) :: bbox_fine, bbox_coarse - integer, intent(in) :: nz - integer, intent(in) :: dir, x_refine, y_refine + integer, intent(in) :: dir, x_refine, y_refine, low_z, high_z real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 integer, allocatable, intent(in) :: ind(:,:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val + real*8, intent(in) :: default_vector(low_z:high_z) integer :: this_pe this_pe = mpp_pe() @@ -1609,18 +1920,163 @@ subroutine fill_nest_from_buffer_r8_3d(interp_type, x, buffer, bbox_fine, bbox_c ! Output the interpolation type select case (interp_type) case (1) - call fill_nest_from_buffer_cell_center("A", x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + print '("[WARN] fv_moving_nest_utils.F90 fill_nest_from_buffer_mask interp_type 1 not implemented. var_name=",A16)', var_name + call mpp_error(FATAL, '3D fill_nest_from_buffer_nearest_neighbor not yet implemented.') + !call fill_nest_from_buffer_cell_center("A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind) ! case (3) ! C grid staggered case (4) - call fill_nest_from_buffer_cell_center("D", x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + print '("[WARN] fv_moving_nest_utils.F90 fill_nest_from_buffer_mask interp_type 4 not implemented. var_name=",A16)', var_name + call mpp_error(FATAL, '3D fill_nest_from_buffer_nearest_neighbor not yet implemented.') + !call fill_nest_from_buffer_cell_center("D", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind) + case (7) + call fill_nest_from_buffer_cell_center_masked(var_name, "A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, low_z, high_z, default_vector) case (9) - call mpp_error(FATAL, 'nearest_neighbor is not yet implemented for fv_moving_nest_utils.F90::fill_nest_from_buffer_3D_kindphys') - !call fill_nest_from_buffer_nearest_neighbor(x, buffer, bbox_fine, bbox_coarse, nz, dir, wt) + !call fill_nest_from_buffer_nearest_neighbor(x, buffer, bbox_fine, bbox_coarse, dir, wt) + call mpp_error(FATAL, '3D fill_nest_from_buffer_nearest_neighbor not yet implemented.') + case default + call mpp_error(FATAL, 'interp_single_nest got invalid value for interp_type from namelist.') + end select + + end subroutine fill_nest_from_buffer_masked_r8_3d_1d + + + subroutine fill_nest_from_buffer_masked_r8_3d_2d(var_name, interp_type, x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + implicit none + + character(len=*), intent(in) :: var_name + integer, intent(in) :: interp_type + real*8, allocatable, intent(inout) :: x(:,:,:) + real*8, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: dir, x_refine, y_refine, low_z, high_z + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val + real, allocatable, intent(in) :: default_grid(:,:) + + integer :: this_pe + this_pe = mpp_pe() + + ! Output the interpolation type + select case (interp_type) + case (1) + print '("[WARN] fv_moving_nest_utils.F90 fill_nest_from_buffer_mask interp_type 1 not implemented. var_name=",A16)', var_name + call mpp_error(FATAL, '3D fill_nest_from_buffer_nearest_neighbor not yet implemented.') + !call fill_nest_from_buffer_cell_center("A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind) + ! case (3) ! C grid staggered + case (4) + print '("[WARN] fv_moving_nest_utils.F90 fill_nest_from_buffer_mask interp_type 4 not implemented. var_name=",A16)', var_name + call mpp_error(FATAL, '3D fill_nest_from_buffer_nearest_neighbor not yet implemented.') + !call fill_nest_from_buffer_cell_center("D", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind) + case (7) + call fill_nest_from_buffer_cell_center_masked(var_name, "A", x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, low_z, high_z, default_grid) + case (9) + !call fill_nest_from_buffer_nearest_neighbor(x, buffer, bbox_fine, bbox_coarse, dir, wt) + call mpp_error(FATAL, '3D fill_nest_from_buffer_nearest_neighbor not yet implemented.') + case default + call mpp_error(FATAL, 'interp_single_nest got invalid value for interp_type from namelist.') + end select + + end subroutine fill_nest_from_buffer_masked_r8_3d_2d + + + + subroutine fill_nest_from_buffer_r4_3d_highz(interp_type, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + implicit none + + integer, intent(in) :: interp_type + real*4, allocatable, intent(inout) :: x(:,:,:) + real*4, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: nz + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + + call fill_nest_from_buffer_r4_3d_lowhighz(interp_type, x, buffer, bbox_fine, bbox_coarse, 1, nz, dir, x_refine, y_refine, wt, ind) + + end subroutine fill_nest_from_buffer_r4_3d_highz + + subroutine fill_nest_from_buffer_r4_3d_lowhighz(interp_type, x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind) + implicit none + + integer, intent(in) :: interp_type + real*4, allocatable, intent(inout) :: x(:,:,:) + real*4, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: low_z, high_z + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + + integer :: this_pe + this_pe = mpp_pe() + + ! Output the interpolation type + select case (interp_type) + case (1) + call fill_nest_from_buffer_cell_center("A", x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind) + ! case (3) ! C grid staggered + case (4) + call fill_nest_from_buffer_cell_center("D", x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind) + case (9) + !call fill_nest_from_buffer_nearest_neighbor(x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, wt) + call mpp_error(FATAL, 'fill_nest_from_buffer_nearest_neighbor is not yet implemented.') + case default + call mpp_error(FATAL, 'interp_single_nest got invalid value for interp_type from namelist.') + end select + + end subroutine fill_nest_from_buffer_r4_3d_lowhighz + + + subroutine fill_nest_from_buffer_r8_3d_highz(interp_type, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + implicit none + + integer, intent(in) :: interp_type + real*8, allocatable, intent(inout) :: x(:,:,:) + real*8, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: nz + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + + call fill_nest_from_buffer_r8_3d_lowhighz(interp_type, x, buffer, bbox_fine, bbox_coarse, 1, nz, dir, x_refine, y_refine, wt, ind) + + end subroutine fill_nest_from_buffer_r8_3d_highz + + subroutine fill_nest_from_buffer_r8_3d_lowhighz(interp_type, x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind) + implicit none + + integer, intent(in) :: interp_type + real*8, allocatable, intent(inout) :: x(:,:,:) + real*8, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: low_z, high_z + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + + integer :: this_pe + this_pe = mpp_pe() + + ! Output the interpolation type + select case (interp_type) + case (1) + call fill_nest_from_buffer_cell_center("A", x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind) + ! case (3) ! C grid staggered + case (4) + call fill_nest_from_buffer_cell_center("D", x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind) + case (9) + call mpp_error(FATAL, 'nearest_neighbor is not yet implemented for fv_moving_nest_utils.F90::fill_nest_from_buffer_3D_kindphys') + !call fill_nest_from_buffer_nearest_neighbor(x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, wt) case default call mpp_error(FATAL, 'interp_single_nest got invalid value for interp_type from namelist.') end select - end subroutine fill_nest_from_buffer_r8_3d + end subroutine fill_nest_from_buffer_r8_3d_lowhighz !>@brief This subroutine fills the nest halo data from the coarse grid data by downscaling. @@ -1795,8 +2251,9 @@ subroutine fill_nest_from_buffer_cell_center_r8_2d(stagger, x, buffer, bbox_fine end subroutine fill_nest_from_buffer_cell_center_r8_2d - subroutine fill_nest_from_buffer_cell_center_masked(stagger, x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, mask_val, default_val) + subroutine fill_nest_from_buffer_cell_center_masked_2d_const(var_name, stagger, x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_val) implicit none + character(len=*), intent(in) :: var_name character ( len = 1 ), intent(in) :: stagger real*8, allocatable, intent(inout) :: x(:,:) real*8, allocatable, intent(in) :: buffer(:,:) @@ -1805,12 +2262,21 @@ subroutine fill_nest_from_buffer_cell_center_masked(stagger, x, buffer, bbox_fin real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 integer, allocatable, intent(in) :: ind(:,:,:) real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) integer, intent(in) :: mask_val real*8, intent(in) :: default_val character(len=8) :: dir_str integer :: i, j, k, ic, jc real :: tw + real :: dummy_val, dummy_mask + integer :: num_reset, num_weights + integer :: this_pe + + this_pe = mpp_pe() + + num_reset = 0 + dummy_val = real_snan select case(dir) case (NORTH) @@ -1842,30 +2308,452 @@ subroutine fill_nest_from_buffer_cell_center_masked(stagger, x, buffer, bbox_fin !if (mask_var(i,j) .eq. mask_val) then x(i,j) = 0.0 tw = 0.0 - if (buffer(ic,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) - if (buffer(ic,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc+1) - if (buffer(ic+1,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic+1,jc+1) - if (buffer(ic+1,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic+1,jc ) + num_weights = 0 + +! WDR Original -- seems like the wt values should range from 1-4, not all use wt(i,j,1) +! will likely alter land values of shifted physics fields in regression tests. +! old values were (slightly) incorrect -- averaged of the 4 nearby points instead of actual weights +! if (buffer(ic,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) +! if (buffer(ic,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc+1) +! if (buffer(ic+1,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic+1,jc+1) +! if (buffer(ic+1,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic+1,jc ) +! +! if (buffer(ic,jc) .gt. -1.0) tw = tw + wt(i,j,1) +! if (buffer(ic,jc+1) .gt. -1.0) tw = tw + wt(i,j,1) +! if (buffer(ic+1,jc+1) .gt. -1.0) tw = tw + wt(i,j,1) +! if (buffer(ic+1,jc) .gt. -1.0) tw = tw + wt(i,j,1) + + +! Intermediate: Corrected the weights +! if (buffer(ic,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) +! if (buffer(ic,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,2)*buffer(ic, jc+1) +! if (buffer(ic+1,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,3)*buffer(ic+1,jc+1) +! if (buffer(ic+1,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,4)*buffer(ic+1,jc ) +! +! if (buffer(ic,jc) .gt. -1.0) tw = tw + wt(i,j,1) +! if (buffer(ic,jc+1) .gt. -1.0) tw = tw + wt(i,j,2) +! if (buffer(ic+1,jc+1) .gt. -1.0) tw = tw + wt(i,j,3) +! if (buffer(ic+1,jc) .gt. -1.0) tw = tw + wt(i,j,4) + + +! print '("[INFO] MASK2D npe=",I0," ",A16," parent_mask_var(",I0,",",I0,")=",F15.5," mask_var(",I0,",",I0,")=",F15.5)', mpp_pe(), var_name, ic, jc, parent_mask_var(ic,jc), i, j, mask_var(i,j) + + + + ! Note that weights don't seem to always be exactly 0.0 when the corner points are aligned + ! Use the land sea mask to choose which points to add to weight and buffer + if (parent_mask_var(ic,jc) .eq. mask_var(i,j) .and. wt(i,j,1) .gt. 0.0001 ) then + num_weights = num_weights + 1 + x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) + tw = tw + wt(i,j,1) + +! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY AA npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc, buffer(ic,jc), i, j, x(i,j), tw, wt(i,j,1) + + endif + + if (parent_mask_var(ic,jc+1) .eq. mask_var(i,j) .and. wt(i,j,2) .gt. 0.0001) then + num_weights = num_weights + 2 + x(i,j) = x(i,j) + wt(i,j,2)*buffer(ic, jc+1) + tw = tw + wt(i,j,2) + +! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY BB npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc+1, buffer(ic,jc+1), i, j, x(i,j), tw, wt(i,j,2) + endif + + if (parent_mask_var(ic+1,jc+1) .eq. mask_var(i,j) .and. wt(i,j,3) .gt. 0.0001) then + num_weights = num_weights + 4 + x(i,j) = x(i,j) + wt(i,j,3)*buffer(ic+1,jc+1) + tw = tw + wt(i,j,3) + +! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY CC npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10,",",E12.5," parent_mask(",I0,",",I0,")=",F8.3)', this_pe, num_weights, ic+1, jc+1, buffer(ic+1,jc+1), i, j, x(i,j), tw, wt(i,j,3), wt(i,j,3), ic+1, jc+1, parent_mask_var(ic+1, jc+1) + endif + + if (parent_mask_var(ic+1,jc) .eq. mask_var(i,j) .and. wt(i,j,4) .gt. 0.0001) then + num_weights = num_weights + 8 + x(i,j) = x(i,j) + wt(i,j,4)*buffer(ic+1,jc ) + tw = tw + wt(i,j,4) + + ! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY DD npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic+1, jc, buffer(ic+1,jc), i, j, x(i,j), tw, wt(i,j,4) + + endif - if (buffer(ic,jc) .gt. -1.0) tw = tw + wt(i,j,1) - if (buffer(ic,jc+1) .gt. -1.0) tw = tw + wt(i,j,1) - if (buffer(ic+1,jc+1) .gt. -1.0) tw = tw + wt(i,j,1) - if (buffer(ic+1,jc) .gt. -1.0) tw = tw + wt(i,j,1) if (tw .gt. 0.0) then x(i,j) = x(i,j) / tw else + num_reset = num_reset + 1 + dummy_val = buffer(ic, jc) + dummy_mask = mask_var(i,j) x(i,j) = default_val endif +! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY npe=",I0," num_weights=",I0," x(",I0,",",I0,")=",E12.5)', this_pe, num_weights, i, j, x(i,j) + + enddo enddo endif - end subroutine fill_nest_from_buffer_cell_center_masked +! if (.not. isnan(dummy_val)) print '("[INFO] WDR fill_nest_from_buffer_cell_center_masked npe=",I0," num_reset=",I0," var=",A12," mask_var=",F10.4," dummy_val=",F14.4," ",E15.8)', mpp_pe(), num_reset, trim(var_name), dummy_mask, dummy_val, dummy_val + end subroutine fill_nest_from_buffer_cell_center_masked_2d_const - subroutine fill_nest_from_buffer_cell_center_r4_3d(stagger, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + subroutine fill_nest_from_buffer_cell_center_masked_2d_2d(var_name, stagger, x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, default_grid) + implicit none + character(len=*), intent(in) :: var_name + character ( len = 1 ), intent(in) :: stagger + real*8, allocatable, intent(inout) :: x(:,:) + real*8, allocatable, intent(in) :: buffer(:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val + real, allocatable, intent(in) :: default_grid(:,:) + + character(len=8) :: dir_str + integer :: i, j, k, ic, jc + real :: tw + real :: dummy_val, dummy_mask + integer :: num_reset, num_weights + integer :: this_pe + + this_pe = mpp_pe() + + num_reset = 0 + dummy_val = real_snan + + select case(dir) + case (NORTH) + dir_str = "NORTH" + case (SOUTH) + dir_str = "SOUTH" + case (EAST) + dir_str = "EAST" + case (WEST) + dir_str = "WEST" + case default + dir_str = "ERR DIR" + end select + + if( bbox_coarse%ie .GE. bbox_coarse%is .AND. bbox_coarse%je .GE. bbox_coarse%js ) then + do j=bbox_fine%js, bbox_fine%je + do i=bbox_fine%is, bbox_fine%ie + + ic = ind(i,j,1) + jc = ind(i,j,2) + + !x(i,j) = & + ! wt(i,j,1)*buffer(ic, jc ) + & + ! wt(i,j,2)*buffer(ic, jc+1) + & + ! wt(i,j,3)*buffer(ic+1,jc+1) + & + ! wt(i,j,4)*buffer(ic+1,jc ) + + ! Land type + !if (mask_var(i,j) .eq. mask_val) then + x(i,j) = 0.0 + tw = 0.0 + num_weights = 0 + +! WDR Original -- seems like the wt values should range from 1-4, not all use wt(i,j,1) +! will likely alter land values of shifted physics fields in regression tests. +! old values were (slightly) incorrect -- averaged of the 4 nearby points instead of actual weights +! if (buffer(ic,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) +! if (buffer(ic,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc+1) +! if (buffer(ic+1,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic+1,jc+1) +! if (buffer(ic+1,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic+1,jc ) +! +! if (buffer(ic,jc) .gt. -1.0) tw = tw + wt(i,j,1) +! if (buffer(ic,jc+1) .gt. -1.0) tw = tw + wt(i,j,1) +! if (buffer(ic+1,jc+1) .gt. -1.0) tw = tw + wt(i,j,1) +! if (buffer(ic+1,jc) .gt. -1.0) tw = tw + wt(i,j,1) + + +! Intermediate: Corrected the weights +! if (buffer(ic,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) +! if (buffer(ic,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,2)*buffer(ic, jc+1) +! if (buffer(ic+1,jc+1) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,3)*buffer(ic+1,jc+1) +! if (buffer(ic+1,jc) .gt. -1.0) x(i,j) = x(i,j) + wt(i,j,4)*buffer(ic+1,jc ) +! +! if (buffer(ic,jc) .gt. -1.0) tw = tw + wt(i,j,1) +! if (buffer(ic,jc+1) .gt. -1.0) tw = tw + wt(i,j,2) +! if (buffer(ic+1,jc+1) .gt. -1.0) tw = tw + wt(i,j,3) +! if (buffer(ic+1,jc) .gt. -1.0) tw = tw + wt(i,j,4) + + +! print '("[INFO] MASK2D npe=",I0," ",A16," parent_mask_var(",I0,",",I0,")=",F15.5," mask_var(",I0,",",I0,")=",F15.5)', mpp_pe(), var_name, ic, jc, parent_mask_var(ic,jc), i, j, mask_var(i,j) + + + + ! Note that weights don't seem to always be exactly 0.0 when the corner points are aligned + ! Use the land sea mask to choose which points to add to weight and buffer + if (parent_mask_var(ic,jc) .eq. mask_var(i,j) .and. wt(i,j,1) .gt. 0.0001 ) then + num_weights = num_weights + 1 + x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) + tw = tw + wt(i,j,1) + +! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY AA npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc, buffer(ic,jc), i, j, x(i,j), tw, wt(i,j,1) + + endif + + if (parent_mask_var(ic,jc+1) .eq. mask_var(i,j) .and. wt(i,j,2) .gt. 0.0001) then + num_weights = num_weights + 2 + x(i,j) = x(i,j) + wt(i,j,2)*buffer(ic, jc+1) + tw = tw + wt(i,j,2) + +! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY BB npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc+1, buffer(ic,jc+1), i, j, x(i,j), tw, wt(i,j,2) + endif + + if (parent_mask_var(ic+1,jc+1) .eq. mask_var(i,j) .and. wt(i,j,3) .gt. 0.0001) then + num_weights = num_weights + 4 + x(i,j) = x(i,j) + wt(i,j,3)*buffer(ic+1,jc+1) + tw = tw + wt(i,j,3) + +! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY CC npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10,",",E12.5," parent_mask(",I0,",",I0,")=",F8.3)', this_pe, num_weights, ic+1, jc+1, buffer(ic+1,jc+1), i, j, x(i,j), tw, wt(i,j,3), wt(i,j,3), ic+1, jc+1, parent_mask_var(ic+1, jc+1) + endif + + if (parent_mask_var(ic+1,jc) .eq. mask_var(i,j) .and. wt(i,j,4) .gt. 0.0001) then + num_weights = num_weights + 8 + x(i,j) = x(i,j) + wt(i,j,4)*buffer(ic+1,jc ) + tw = tw + wt(i,j,4) + + ! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY DD npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic+1, jc, buffer(ic+1,jc), i, j, x(i,j), tw, wt(i,j,4) + + endif + + + if (tw .gt. 0.0) then + x(i,j) = x(i,j) / tw + else + num_reset = num_reset + 1 + dummy_val = buffer(ic, jc) + dummy_mask = mask_var(i,j) + x(i,j) = default_grid(i,j) + endif + +! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY npe=",I0," num_weights=",I0," x(",I0,",",I0,")=",E12.5)', this_pe, num_weights, i, j, x(i,j) + + + enddo + enddo + endif + +! if (.not. isnan(dummy_val)) print '("[INFO] WDR fill_nest_from_buffer_cell_center_masked npe=",I0," num_reset=",I0," var=",A12," mask_var=",F10.4," dummy_val=",F14.4," ",E15.8)', mpp_pe(), num_reset, trim(var_name), dummy_mask, dummy_val, dummy_val + + end subroutine fill_nest_from_buffer_cell_center_masked_2d_2d + + + subroutine fill_nest_from_buffer_cell_center_masked_3d_1d(var_name, stagger, x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, low_z, high_z, default_vector) + implicit none + character(len=*), intent(in) :: var_name + character ( len = 1 ), intent(in) :: stagger + real*8, allocatable, intent(inout) :: x(:,:,:) + real*8, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val, low_z, high_z + real*8, intent(in) :: default_vector(low_z:high_z) + + character(len=8) :: dir_str + integer :: i, j, k, ic, jc + real :: tw + real :: dummy_val, dummy_mask + + dummy_val = real_snan + + select case(dir) + case (NORTH) + dir_str = "NORTH" + case (SOUTH) + dir_str = "SOUTH" + case (EAST) + dir_str = "EAST" + case (WEST) + dir_str = "WEST" + case default + dir_str = "ERR DIR" + end select + + if( bbox_coarse%ie .GE. bbox_coarse%is .AND. bbox_coarse%je .GE. bbox_coarse%js ) then + do j=bbox_fine%js, bbox_fine%je + do i=bbox_fine%is, bbox_fine%ie + + ic = ind(i,j,1) + jc = ind(i,j,2) + + !x(i,j) = & + ! wt(i,j,1)*buffer(ic, jc ) + & + ! wt(i,j,2)*buffer(ic, jc+1) + & + ! wt(i,j,3)*buffer(ic+1,jc+1) + & + ! wt(i,j,4)*buffer(ic+1,jc ) + + ! Land type + !if (mask_var(i,j) .eq. mask_val) then + + + do k=lbound(x,3), ubound(x,3) + x(i,j,k) = 0.0 + tw = 0.0 + + + +! print '("[INFO] MASK3D npe=",I0," ",A16," parent_mask_var(",I0,",",I0,")=",F15.5," mask_var(",I0,",",I0,")=",F15.5)', mpp_pe(), var_name, ic, jc, parent_mask_var(ic,jc), i, j, mask_var(i,j) + + + ! Use the land sea mask to choose which points to add to weight and buffer + if (parent_mask_var(ic,jc) .eq. mask_var(i,j)) then + x(i,j,k) = x(i,j,k) + wt(i,j,1)*buffer(ic, jc ,k) + tw = tw + wt(i,j,1) + endif + + if (parent_mask_var(ic,jc+1) .eq. mask_var(i,j)) then + x(i,j,k) = x(i,j,k) + wt(i,j,2)*buffer(ic, jc+1,k) + tw = tw + wt(i,j,2) + endif + + if (parent_mask_var(ic+1,jc+1) .eq. mask_var(i,j)) then + x(i,j,k) = x(i,j,k) + wt(i,j,3)*buffer(ic+1,jc+1,k) + tw = tw + wt(i,j,3) + endif + + if (parent_mask_var(ic+1,jc) .eq. mask_var(i,j)) then + x(i,j,k) = x(i,j,k) + wt(i,j,4)*buffer(ic+1,jc ,k) + tw = tw + wt(i,j,4) + endif + + + if (tw .gt. 0.0) then + x(i,j,k) = x(i,j,k) / tw + else + dummy_val = buffer(ic, jc,k) + dummy_mask = mask_var(i,j) + x(i,j,k) = default_vector(k) + endif + + enddo + enddo + enddo + endif + +! if (.not. isnan(dummy_val)) then +! print '("[INFO WDR CCM3 fill_nest_from_buffer_cell_center_masked_3d npe=",I0)', mpp_pe() +! print '("[INFO] WDR CCM3 fill_nest_from_buffer_cell_center_masked npe=",I0," var=",A16," mask_var=",F10.4," dummy_val=",F14.4," ",E15.8)', mpp_pe(), trim(var_name), dummy_mask, dummy_val, dummy_val +! endif + + end subroutine fill_nest_from_buffer_cell_center_masked_3d_1d + + + subroutine fill_nest_from_buffer_cell_center_masked_3d_2d(var_name, stagger, x, buffer, bbox_fine, bbox_coarse, dir, x_refine, y_refine, wt, ind, mask_var, parent_mask_var, mask_val, low_z, high_z, default_grid) + implicit none + character(len=*), intent(in) :: var_name + character ( len = 1 ), intent(in) :: stagger + real*8, allocatable, intent(inout) :: x(:,:,:) + real*8, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) + integer, intent(in) :: mask_val, low_z, high_z + real, allocatable, intent(in) :: default_grid(:,:) + + character(len=8) :: dir_str + integer :: i, j, k, ic, jc + real :: tw + real :: dummy_val, dummy_mask + + dummy_val = real_snan + + select case(dir) + case (NORTH) + dir_str = "NORTH" + case (SOUTH) + dir_str = "SOUTH" + case (EAST) + dir_str = "EAST" + case (WEST) + dir_str = "WEST" + case default + dir_str = "ERR DIR" + end select + + if( bbox_coarse%ie .GE. bbox_coarse%is .AND. bbox_coarse%je .GE. bbox_coarse%js ) then + do j=bbox_fine%js, bbox_fine%je + do i=bbox_fine%is, bbox_fine%ie + + ic = ind(i,j,1) + jc = ind(i,j,2) + + !x(i,j) = & + ! wt(i,j,1)*buffer(ic, jc ) + & + ! wt(i,j,2)*buffer(ic, jc+1) + & + ! wt(i,j,3)*buffer(ic+1,jc+1) + & + ! wt(i,j,4)*buffer(ic+1,jc ) + + ! Land type + !if (mask_var(i,j) .eq. mask_val) then + + + do k=lbound(x,3), ubound(x,3) + x(i,j,k) = 0.0 + tw = 0.0 + + + +! print '("[INFO] MASK3D npe=",I0," ",A16," parent_mask_var(",I0,",",I0,")=",F15.5," mask_var(",I0,",",I0,")=",F15.5)', mpp_pe(), var_name, ic, jc, parent_mask_var(ic,jc), i, j, mask_var(i,j) + + + ! Use the land sea mask to choose which points to add to weight and buffer + if (parent_mask_var(ic,jc) .eq. mask_var(i,j)) then + x(i,j,k) = x(i,j,k) + wt(i,j,1)*buffer(ic, jc ,k) + tw = tw + wt(i,j,1) + endif + + if (parent_mask_var(ic,jc+1) .eq. mask_var(i,j)) then + x(i,j,k) = x(i,j,k) + wt(i,j,2)*buffer(ic, jc+1,k) + tw = tw + wt(i,j,2) + endif + + if (parent_mask_var(ic+1,jc+1) .eq. mask_var(i,j)) then + x(i,j,k) = x(i,j,k) + wt(i,j,3)*buffer(ic+1,jc+1,k) + tw = tw + wt(i,j,3) + endif + + if (parent_mask_var(ic+1,jc) .eq. mask_var(i,j)) then + x(i,j,k) = x(i,j,k) + wt(i,j,4)*buffer(ic+1,jc ,k) + tw = tw + wt(i,j,4) + endif + + + if (tw .gt. 0.0) then + x(i,j,k) = x(i,j,k) / tw + else + dummy_val = buffer(ic, jc,k) + dummy_mask = mask_var(i,j) + x(i,j,k) = default_grid(i,j) + endif + + enddo + enddo + enddo + endif + +! if (.not. isnan(dummy_val)) then +! print '("[INFO WDR CCM3 fill_nest_from_buffer_cell_center_masked_3d npe=",I0)', mpp_pe() +! print '("[INFO] WDR CCM3 fill_nest_from_buffer_cell_center_masked npe=",I0," var=",A16," mask_var=",F10.4," dummy_val=",F14.4," ",E15.8)', mpp_pe(), trim(var_name), dummy_mask, dummy_val, dummy_val +! endif + + end subroutine fill_nest_from_buffer_cell_center_masked_3d_2d + + + + subroutine fill_nest_from_buffer_cell_center_r4_3d_highz(stagger, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) implicit none character ( len = 1 ), intent(in) :: stagger real*4, allocatable, intent(inout) :: x(:,:,:) @@ -1876,6 +2764,21 @@ subroutine fill_nest_from_buffer_cell_center_r4_3d(stagger, x, buffer, bbox_fine real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 integer, allocatable, intent(in) :: ind(:,:,:) + call fill_nest_from_buffer_cell_center_r4_3d_lowhighz(stagger, x, buffer, bbox_fine, bbox_coarse, 1, nz, dir, x_refine, y_refine, wt, ind) + + end subroutine fill_nest_from_buffer_cell_center_r4_3d_highz + + subroutine fill_nest_from_buffer_cell_center_r4_3d_lowhighz(stagger, x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind) + implicit none + character ( len = 1 ), intent(in) :: stagger + real*4, allocatable, intent(inout) :: x(:,:,:) + real*4, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: low_z, high_z + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + character(len=8) :: dir_str integer :: i, j, k, ic, jc @@ -1893,7 +2796,7 @@ subroutine fill_nest_from_buffer_cell_center_r4_3d(stagger, x, buffer, bbox_fine end select if( bbox_coarse%ie .GE. bbox_coarse%is .AND. bbox_coarse%je .GE. bbox_coarse%js ) then - do k=1,nz + do k=low_z, high_z do j=bbox_fine%js, bbox_fine%je do i=bbox_fine%is, bbox_fine%ie !if (stagger == "A") then @@ -1915,9 +2818,9 @@ subroutine fill_nest_from_buffer_cell_center_r4_3d(stagger, x, buffer, bbox_fine enddo endif - end subroutine fill_nest_from_buffer_cell_center_r4_3d + end subroutine fill_nest_from_buffer_cell_center_r4_3d_lowhighz - subroutine fill_nest_from_buffer_cell_center_r8_3d(stagger, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) + subroutine fill_nest_from_buffer_cell_center_r8_3d_highz(stagger, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) implicit none character ( len = 1 ), intent(in) :: stagger real*8, allocatable, intent(inout) :: x(:,:,:) @@ -1928,6 +2831,21 @@ subroutine fill_nest_from_buffer_cell_center_r8_3d(stagger, x, buffer, bbox_fine real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 integer, allocatable, intent(in) :: ind(:,:,:) + call fill_nest_from_buffer_cell_center_r8_3d_lowhighz(stagger, x, buffer, bbox_fine, bbox_coarse, 1, nz, dir, x_refine, y_refine, wt, ind) + + end subroutine fill_nest_from_buffer_cell_center_r8_3d_highz + + subroutine fill_nest_from_buffer_cell_center_r8_3d_lowhighz(stagger, x, buffer, bbox_fine, bbox_coarse, low_z, high_z, dir, x_refine, y_refine, wt, ind) + implicit none + character ( len = 1 ), intent(in) :: stagger + real*8, allocatable, intent(inout) :: x(:,:,:) + real*8, allocatable, intent(in) :: buffer(:,:,:) + type(bbox), intent(in) :: bbox_fine, bbox_coarse + integer, intent(in) :: low_z, high_z + integer, intent(in) :: dir, x_refine, y_refine + real, allocatable, intent(in) :: wt(:,:,:) ! The final dimension is always 4 + integer, allocatable, intent(in) :: ind(:,:,:) + character(len=8) :: dir_str integer :: i, j, k, ic, jc @@ -1945,7 +2863,7 @@ subroutine fill_nest_from_buffer_cell_center_r8_3d(stagger, x, buffer, bbox_fine end select if( bbox_coarse%ie .GE. bbox_coarse%is .AND. bbox_coarse%je .GE. bbox_coarse%js ) then - do k=1,nz + do k=low_z, high_z do j=bbox_fine%js, bbox_fine%je do i=bbox_fine%is, bbox_fine%ie !if (stagger == "A") then @@ -1966,7 +2884,7 @@ subroutine fill_nest_from_buffer_cell_center_r8_3d(stagger, x, buffer, bbox_fine enddo endif - end subroutine fill_nest_from_buffer_cell_center_r8_3d + end subroutine fill_nest_from_buffer_cell_center_r8_3d_lowhighz subroutine fill_nest_from_buffer_cell_center_r4_4d(stagger, x, buffer, bbox_fine, bbox_coarse, nz, dir, x_refine, y_refine, wt, ind) From a3eae5e64d23abe5d79cd373bedf14395e2b1ec1 Mon Sep 17 00:00:00 2001 From: William Ramstrom Date: Mon, 18 Dec 2023 15:53:59 +0000 Subject: [PATCH 034/192] Updates to NOAHMP moving nest code to correct land sea mask. --- moving_nest/fv_moving_nest.F90 | 6 +- moving_nest/fv_moving_nest_main.F90 | 710 +++++++++++++++++++++---- moving_nest/fv_moving_nest_physics.F90 | 22 +- moving_nest/fv_moving_nest_types.F90 | 49 +- moving_nest/fv_moving_nest_utils.F90 | 49 +- 5 files changed, 691 insertions(+), 145 deletions(-) diff --git a/moving_nest/fv_moving_nest.F90 b/moving_nest/fv_moving_nest.F90 index a817e7917c..04020ab7eb 100644 --- a/moving_nest/fv_moving_nest.F90 +++ b/moving_nest/fv_moving_nest.F90 @@ -72,7 +72,11 @@ module fv_moving_nest_mod use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp use bounding_box_mod, only: bbox, bbox_get_C2F_index, fill_bbox +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: cp_air, omega, rdgas, grav, rvgas, kappa, pstd_mks, hlv +#else use constants_mod, only: cp_air, omega, rdgas, grav, rvgas, kappa, pstd_mks, hlv +#endif use field_manager_mod, only: MODEL_ATMOS use fv_arrays_mod, only: fv_atmos_type, fv_nest_type, fv_grid_type, R_GRID use fv_arrays_mod, only: allocate_fv_nest_bc_type, deallocate_fv_nest_bc_type @@ -814,7 +818,7 @@ subroutine mn_orog_read_hires_parent(npx, npy, refine, pelist, surface_dir, filt real, allocatable, intent(out) :: orog_grid(:,:) !< Output orography grid real, allocatable, intent(out) :: orog_std_grid(:,:) !< Output orography standard deviation grid real, allocatable, intent(out) :: ls_mask_grid(:,:) !< Output land sea mask grid - real, allocatable, intent(out) :: land_frac_grid(:,:)!< Output land fraction grid + real(kind=kind_phys), allocatable, intent(out) :: land_frac_grid(:,:)!< Output land fraction grid integer, intent(in) :: parent_tile !< Parent tile number integer :: nx_cubic, nx, ny, fp_nx, fp_ny, mid_nx, mid_ny diff --git a/moving_nest/fv_moving_nest_main.F90 b/moving_nest/fv_moving_nest_main.F90 index 65ecb54c08..05b5228a41 100644 --- a/moving_nest/fv_moving_nest_main.F90 +++ b/moving_nest/fv_moving_nest_main.F90 @@ -33,7 +33,11 @@ module fv_moving_nest_main_mod ! FMS modules: !----------------- use block_control_mod, only: block_control_type +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks +#else use constants_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks +#endif use time_manager_mod, only: time_type, get_time, get_date, set_time, operator(+), & operator(-), operator(/), time_type_to_real use fms_mod, only: file_exist, open_namelist_file, & @@ -152,7 +156,7 @@ module fv_moving_nest_main_mod ! Enable these for more debugging outputs logical :: debug_log = .false. ! Produces logging to out.* file - logical :: tsvar_out = .true. ! Produces netCDF outputs; be careful to not exceed file number limits set in namelist + logical :: tsvar_out = .false. ! Produces netCDF outputs; be careful to not exceed file number limits set in namelist ! --- Clock ids for moving_nest performance metering integer :: id_movnest1, id_movnest1_9, id_movnest2, id_movnest3, id_movnest4, id_movnest5 @@ -161,6 +165,13 @@ module fv_moving_nest_main_mod integer :: id_movnestTot integer, save :: output_step = 0 + type(mn_surface_grids), save :: mn_static + + interface overwrite_with_nest_init_values + module procedure overwrite_with_nest_init_values_r4 + module procedure overwrite_with_nest_init_values_r8 + end interface overwrite_with_nest_init_values + contains !>@brief The subroutine 'update_moving_nest' decides whether the nest should be moved, and if so, performs the move. @@ -243,109 +254,313 @@ end subroutine nest_tracker_end - !>@brief The subroutine 'dump_moving_nest' outputs native grid format data to netCDF files - !>@details This subroutine exports model variables using FMS IO to netCDF files if tsvar_out is set to .True. - subroutine dump_moving_nest(Atm_block, IPD_control, IPD_data, time_step) + + subroutine log_landsea_mask(Atm_block, IPD_control, IPD_data, time_step, parent_grid_num, child_grid_num) type(block_control_type), intent(in) :: Atm_block !< Physics block layout type(IPD_control_type), intent(in) :: IPD_control !< Physics metadata type(IPD_data_type), intent(in) :: IPD_data(:) !< Physics variable data type(time_type), intent(in) :: time_step !< Current timestep + integer, intent(in) :: parent_grid_num, child_grid_num + - type(domain2d), pointer :: domain_coarse, domain_fine - logical :: is_fine_pe - integer :: parent_grid_num, child_grid_num, nz, this_pe, n character(len=160) :: line character(len=1) :: mask_char - integer :: i,j - + character(len=1) :: num_char + integer :: i,j integer :: nb, blen, ix, i_pe, j_pe, i_idx, j_idx, refine - real :: local_slmsk(Atm(2)%bd%isd:Atm(2)%bd%ied, Atm(2)%bd%jsd:Atm(2)%bd%jed) + integer :: ioffset, joffset + real :: local_slmsk(Atm(2)%bd%isd:Atm(2)%bd%ied, Atm(2)%bd%jsd:Atm(2)%bd%jed) + integer :: nz, this_pe, n + integer :: num_land, num_water this_pe = mpp_pe() n = mygrid - parent_grid_num = 1 - child_grid_num = 2 - - domain_fine => Atm(child_grid_num)%domain - domain_coarse => Atm(parent_grid_num)%domain - is_fine_pe = Atm(n)%neststruct%nested .and. ANY(Atm(n)%pelist(:) == this_pe) - nz = Atm(n)%npz refine = Atm(child_grid_num)%neststruct%refinement + ioffset = Atm(child_grid_num)%neststruct%ioffset + joffset = Atm(child_grid_num)%neststruct%joffset + + do i=lbound(Atm(n)%oro,1), ubound(Atm(n)%oro,1) + line = "" + do j=lbound(Atm(n)%oro,2), ubound(Atm(n)%oro,2) + !print '("[INFO] WDR oro size npe=",I0," is_allocated=",L1)', this_pe, allocated(Atm(n)%oro) + !print '("[INFO] WDR oro size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0)', this_pe, lbound(Atm(n)%oro,1), ubound(Atm(n)%oro,1), lbound(Atm(n)%oro,2), ubound(Atm(n)%oro,2) + if (Atm(n)%oro(i,j) .eq. 1) then + ! land + line = trim(line) // "+" + elseif (Atm(n)%oro(i,j) .eq. 2) then + ! Water + line = trim(line) // "." + else + ! Unknown + line = trim(line) // "X" + endif + enddo + !print '("[INFO] WDR oro npe=",I0," time=",I0," i=",I0," ",A80)',this_pe,a_step,i,trim(line) + + enddo + + + local_slmsk = 8 + !print '("[INFO] WDR local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0," n=",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2), n + + do nb = 1,Atm_block%nblks + blen = Atm_block%blksz(nb) + do ix = 1, blen + i_pe = Atm_block%index(nb)%ii(ix) + j_pe = Atm_block%index(nb)%jj(ix) + + !print '("[INFO] WDR local_slmsk npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe + + local_slmsk(i_pe, j_pe) = IPD_data(nb)%Sfcprop%slmsk(ix) + + if (allocated(Moving_nest)) then + if (allocated(Moving_nest(n)%mn_phys%slmsk)) then + if (int(local_slmsk(i_pe,j_pe)) .ne. 8) then + if (int(local_slmsk(i_pe,j_pe)) .ne. int(Moving_nest(n)%mn_phys%slmsk(i_pe,j_pe))) then + print '("[INFO] WDR mismatch local_slmsk_lake npe=",I0," time=",I3," i_pe=",I3," j_pe=",I3," slmsk=",I0," phys%slmsk=",I0," soil_type_grid=",I0," phys%soil_type=",I0," ipd%landfrac=",F10.5," land_frac_grid=",F12.5," ipd%lakefrac=",F10.5," ipd%oceanfrac=",F10.5)', & + this_pe,a_step,i_pe,j_pe, int(local_slmsk(i_pe,j_pe)), & + int(Moving_nest(n)%mn_phys%slmsk(i_pe,j_pe)), & + int(IPD_data(nb)%Sfcprop%stype(ix)), & + int(mn_static%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + IPD_data(nb)%Sfcprop%landfrac(ix), & + int(mn_static%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + IPD_data(nb)%Sfcprop%lakefrac(ix), & + IPD_data(nb)%Sfcprop%oceanfrac(ix) + endif + endif + endif + endif + enddo + enddo + + print '("[INFO] WDR local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2) + + line = "" + do j=lbound(local_slmsk,2), ubound(local_slmsk,2) + write(num_char, "(I1)"), mod(j,10) + line = trim(line) // trim(num_char) + enddo + print '("[INFO] WDR local_slmsk_lake npe=",I0," time=",I3," i=",I3," ",A60)',this_pe,a_step,-99,trim(line) + + do i=lbound(local_slmsk,1), ubound(local_slmsk,1) + line = "" + num_land = 0 + num_water = 0 + + do j=lbound(local_slmsk,2), ubound(local_slmsk,2) + + if (local_slmsk(i,j) .eq. 1) then + ! land + line = trim(line) // "+" + num_land = num_land + 1 + elseif (local_slmsk(i,j) .eq. 2) then + ! Water + line = trim(line) // "T" + elseif (local_slmsk(i,j) .eq. 0) then + ! Zero == lake? + line = trim(line) // "." + num_water = num_water + 1 + elseif (local_slmsk(i,j) .eq. 8) then + ! Missing/edge + line = trim(line) // "M" + else + ! Unknown + print '("[INFO] WDR local_slmsk_lake npe=",I0," time=",I3," i=",I3," j=",I3," slmsk=",E12.5)',this_pe,a_step,i,j, local_slmsk(i,j) + write (mask_char, "(I1)") int(local_slmsk(i,j)) + line = trim(line) // mask_char + endif + enddo + print '("[INFO] WDR local_slmsk_lake npe=",I0," time=",I3," i=",I3," ",A60," ",I2," ",I2)',this_pe,a_step,i,trim(line), num_land, num_water + enddo + end subroutine log_landsea_mask + + + subroutine validate_geo_coords(tag, geo_grid, nest_geo_grid, refine, ioffset, joffset) + character(len=*) :: tag + real(kind=kind_phys), allocatable, intent(in) :: geo_grid(:,:) + real(kind=kind_phys), allocatable, intent(in) :: nest_geo_grid(:,:) + integer, intent(in) :: refine, ioffset, joffset + + integer :: i,j, this_pe + real(kind=kind_phys) :: diff - ! Enable this to dump debug netCDF files. Files are automatically closed when dumped. - !if (mod(a_step, 80) .eq. 0 ) then - ! if (tsvar_out) call mn_prog_dump_to_netcdf(Atm(n), a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) - ! if (tsvar_out) call mn_phys_dump_to_netcdf(Atm(n), Atm_block, IPD_control, IPD_data, a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) - !endif - if (a_step .ge. 310) then - if (tsvar_out) call mn_phys_dump_to_netcdf(Atm(n), Atm_block, IPD_control, IPD_data, a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) - endif + this_pe = mpp_pe() - if (this_pe .eq. 60) then - do i=lbound(Atm(n)%oro,1), ubound(Atm(n)%oro,1) - line = "" - do j=lbound(Atm(n)%oro,2), ubound(Atm(n)%oro,2) - print '("[INFO] WDR oro size npe=",I0," is_allocated=",L1)', this_pe, allocated(Atm(n)%oro) - print '("[INFO] WDR oro size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0)', this_pe, lbound(Atm(n)%oro,1), ubound(Atm(n)%oro,1), lbound(Atm(n)%oro,2), ubound(Atm(n)%oro,2) - if (Atm(n)%oro(i,j) .eq. 1) then - ! land - line = trim(line) // "+" - elseif (Atm(n)%oro(i,j) .eq. 2) then - ! Water - line = trim(line) // "." - else - ! Unknown - line = trim(line) // "X" - endif - enddo - print '("[INFO] WDR oro npe=",I0," time=",I0," i=",I0," ",A80)',this_pe,a_step,i,trim(line) + do i = lbound(nest_geo_grid,1), ubound(nest_geo_grid,1) + do j = lbound(nest_geo_grid,2), ubound(nest_geo_grid,2) + + diff = nest_geo_grid(i,j) - geo_grid((ioffset-1)*refine+i, (joffset-1)*refine+j) + print '("[INFO] WDR VALIDATEGEO tag=",A3," npe=",I0," i=",I0," j=",I0," diff=",F20.12," nest_val=",F16.12)', tag, this_pe, i, j, diff, nest_geo_grid(i,j) enddo + enddo + + end subroutine validate_geo_coords + subroutine overwrite_with_nest_init_values_r8(tag, var_grid, nest_var_grid, refine, ioffset, joffset) + character(len=*) :: tag + real*8, allocatable, intent(inout) :: var_grid(:,:) + real*8, allocatable, intent(in) :: nest_var_grid(:,:) - local_slmsk = 8 - print '("[INFO] WDR local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0," n=",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2), n + integer, intent(in) :: refine, ioffset, joffset + integer :: i,j, this_pe - do nb = 1,Atm_block%nblks - blen = Atm_block%blksz(nb) - do ix = 1, blen - i_pe = Atm_block%index(nb)%ii(ix) - j_pe = Atm_block%index(nb)%jj(ix) +! this_pe = mpp_pe() - print '("[INFO] WDR local_slmsk npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe + do i = lbound(nest_var_grid,1), ubound(nest_var_grid,1) + do j = lbound(nest_var_grid,2), ubound(nest_var_grid,2) + var_grid((ioffset-1)*refine+i, (joffset-1)*refine+j) = nest_var_grid(i,j) + enddo + enddo + + end subroutine overwrite_with_nest_init_values_r8 - local_slmsk(i_pe, j_pe) = IPD_data(nb)%Sfcprop%slmsk(ix) + subroutine overwrite_with_nest_init_values_r4(tag, var_grid, nest_var_grid, refine, ioffset, joffset) + character(len=*) :: tag + real*4, allocatable, intent(inout) :: var_grid(:,:) + real*4, allocatable, intent(in) :: nest_var_grid(:,:) - enddo + integer, intent(in) :: refine, ioffset, joffset + integer :: i,j, this_pe + +! this_pe = mpp_pe() + + do i = lbound(nest_var_grid,1), ubound(nest_var_grid,1) + do j = lbound(nest_var_grid,2), ubound(nest_var_grid,2) + var_grid((ioffset-1)*refine+i, (joffset-1)*refine+j) = nest_var_grid(i,j) enddo + enddo + + end subroutine overwrite_with_nest_init_values_r4 - do i=lbound(local_slmsk,1), ubound(local_slmsk,1) - line = "" - do j=lbound(local_slmsk,2), ubound(local_slmsk,2) - print '("[INFO] WDR local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2) - if (local_slmsk(i,j) .eq. 1) then - ! land - line = trim(line) // "+" - elseif (local_slmsk(i,j) .eq. 2) then - ! Water - line = trim(line) // "." - else - ! Unknown - write (mask_char, "(I1)") int(local_slmsk(i,j)) - line = trim(line) // mask_char - endif - enddo - print '("[INFO] WDR local_slmsk_lake npe=",I0," time=",I3," i=",I3," ",A80)',this_pe,a_step,i,trim(line) + + + subroutine validate_navigation_fields(tag, Atm_block, IPD_control, IPD_data, parent_grid_num, child_grid_num) + character(len=*) :: tag + type(block_control_type), intent(in) :: Atm_block !< Physics block layout + type(IPD_control_type), intent(in) :: IPD_control !< Physics metadata + type(IPD_data_type), intent(in) :: IPD_data(:) !< Physics variable data + integer, intent(in) :: parent_grid_num, child_grid_num + + + character(len=160) :: line + character(len=1) :: mask_char + character(len=1) :: num_char + integer :: i,j + integer :: nb, blen, ix, i_pe, j_pe, i_idx, j_idx, refine + integer :: ioffset, joffset + real :: local_slmsk(Atm(2)%bd%isd:Atm(2)%bd%ied, Atm(2)%bd%jsd:Atm(2)%bd%jed) + integer :: nz, this_pe, n + integer :: num_land, num_water + + this_pe = mpp_pe() + n = mygrid + + refine = Atm(child_grid_num)%neststruct%refinement + ioffset = Atm(child_grid_num)%neststruct%ioffset + joffset = Atm(child_grid_num)%neststruct%joffset + + local_slmsk = 8 + print '("[INFO] WDR VALIDATE local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0," n=",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2), n + + do nb = 1,Atm_block%nblks + blen = Atm_block%blksz(nb) + do ix = 1, blen + i_pe = Atm_block%index(nb)%ii(ix) + j_pe = Atm_block%index(nb)%jj(ix) + + !print '("[INFO] WDR local_slmsk npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe + + local_slmsk(i_pe, j_pe) = IPD_data(nb)%Sfcprop%slmsk(ix) + + if (allocated(Moving_nest)) then + if (allocated(Moving_nest(n)%mn_phys%slmsk)) then + !print '("[INFO] WDR VALIDATE local_slmsk npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe + + if (int(local_slmsk(i_pe,j_pe)) .ne. 8) then + if (int(local_slmsk(i_pe,j_pe)) .ne. int(Moving_nest(n)%mn_phys%slmsk(i_pe,j_pe))) then + print '("[INFO] WDR mismatch VALIDATE A tag=",A4," npe=",I0," time=",I3," i_pe=",I3," j_pe=",I3," IPD%slmsk=",I0," phys%slmsk=",I0," fp_slmsk=",I0," soil_type_grid=",I0," phys%soil_type=",I0," ipd%landfrac=",F10.5," land_frac_grid=",F12.5," ipd%lakefrac=",F10.5," ipd%oceanfrac=",F10.5)', & + tag, this_pe,a_step,i_pe,j_pe, int(local_slmsk(i_pe,j_pe)), & + int(Moving_nest(n)%mn_phys%slmsk(i_pe,j_pe)), & + int(mn_static%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(IPD_data(nb)%Sfcprop%stype(ix)), & + int(mn_static%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + IPD_data(nb)%Sfcprop%landfrac(ix), & + int(mn_static%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + IPD_data(nb)%Sfcprop%lakefrac(ix), & + IPD_data(nb)%Sfcprop%oceanfrac(ix) + endif + + +! if ((i_pe .eq. 149 .and. j_pe .eq. 169) .or.(i_pe .eq. 152 .and. j_pe .eq. 169) .or. int(local_slmsk(i_pe,j_pe)) .ne. int(mn_static%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe))) then + if (int(local_slmsk(i_pe,j_pe)) .ne. int(mn_static%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe))) then + print '("[INFO] WDR mismatch VALIDATE B tag=",A4," npe=",I0," time=",I3," i_pe=",I3," j_pe=",I3," IPD%slmsk=",I0," phys%slmsk=",I0," fp_slmsk=",I0," soil_type_grid=",I0," phys%soil_type=",I0," ipd%landfrac=",F10.5," land_frac_grid=",F12.5," ipd%lakefrac=",F10.5," ipd%oceanfrac=",F10.5)', & + tag, this_pe,a_step,i_pe,j_pe, int(local_slmsk(i_pe,j_pe)), & + int(Moving_nest(n)%mn_phys%slmsk(i_pe,j_pe)), & + int(mn_static%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(IPD_data(nb)%Sfcprop%stype(ix)), & + int(mn_static%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + IPD_data(nb)%Sfcprop%landfrac(ix), & + int(mn_static%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + IPD_data(nb)%Sfcprop%lakefrac(ix), & + IPD_data(nb)%Sfcprop%oceanfrac(ix) + endif + + + + endif + endif + endif enddo + enddo + end subroutine validate_navigation_fields - endif + !>@brief The subroutine 'dump_moving_nest' outputs native grid format data to netCDF files + !>@details This subroutine exports model variables using FMS IO to netCDF files if tsvar_out is set to .True. + subroutine dump_moving_nest(Atm_block, IPD_control, IPD_data, time_step) + type(block_control_type), intent(in) :: Atm_block !< Physics block layout + type(IPD_control_type), intent(in) :: IPD_control !< Physics metadata + type(IPD_data_type), intent(in) :: IPD_data(:) !< Physics variable data + type(time_type), intent(in) :: time_step !< Current timestep + type(domain2d), pointer :: domain_coarse, domain_fine + logical :: is_fine_pe + integer :: parent_grid_num, child_grid_num, nz, this_pe, n + + this_pe = mpp_pe() + n = mygrid + + parent_grid_num = 1 + child_grid_num = 2 + + domain_fine => Atm(child_grid_num)%domain + domain_coarse => Atm(parent_grid_num)%domain + is_fine_pe = Atm(n)%neststruct%nested .and. ANY(Atm(n)%pelist(:) == this_pe) + nz = Atm(n)%npz + + ! Enable this to dump debug netCDF files. Files are automatically closed when dumped. + !if (mod(a_step, 80) .eq. 0 ) then + ! if (tsvar_out) call mn_prog_dump_to_netcdf(Atm(n), a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) + ! if (tsvar_out) call mn_phys_dump_to_netcdf(Atm(n), Atm_block, IPD_control, IPD_data, a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) + !endif + !if (a_step .ge. 310) then + !if (mod(a_step, 80) .eq. 0 ) then + ! if (tsvar_out) call mn_phys_dump_to_netcdf(Atm(n), Atm_block, IPD_control, IPD_data, a_step, "tsavar", is_fine_pe, domain_coarse, domain_fine, nz) + !endif + + ! if (is_fine_pe) then + ! call validate_navigation_fields("DUMP", Atm_block, IPD_control, IPD_data, parent_grid_num, child_grid_num) + ! endif + + !if (this_pe .eq. 88 .or. this_pe .eq. 89) then + ! call log_landsea_mask(Atm_block, IPD_control, IPD_data, time_step, parent_grid_num, child_grid_num) + !endif end subroutine dump_moving_nest @@ -589,7 +804,7 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, logical, save :: first_nest_move = .true. type(grid_geometry), save :: parent_geo type(grid_geometry), save :: fp_super_tile_geo - type(mn_surface_grids), save :: mn_static +! type(mn_surface_grids), save :: mn_static real(kind=R_GRID), allocatable, save :: p_grid(:,:,:) real(kind=R_GRID), allocatable, save :: p_grid_u(:,:,:) real(kind=R_GRID), allocatable, save :: p_grid_v(:,:,:) @@ -628,18 +843,26 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, real(kind=R_GRID) :: pi = 4 * atan(1.0d0) real :: rad2deg logical :: move_noahmp + integer :: static_nest_num logical :: use_timers + real(kind=kind_phys):: maxSkinTempK !! For NOAHMP ! (/0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0/) -- 3 snow levels, 4 soil levels real :: zsns_default(-2:4) zsns_default = [0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0 ] - rad2deg = 180.0 / pi this_pe = mpp_pe() + ! Highest satellite observed skin temperatures on Earth are on the order of +70C/343K/+160F + ! Mildrexler, D. J., M. Zhao, and S. W. Running, 2011: Satellite Finds Highest Land Skin Temperatures on Earth. Bull. Amer. Meteor. Soc., 92, 855–860, + ! https://doi.org/10.1175/2011BAMS3067.1. + ! https://journals.ametsoc.org/view/journals/bams/92/7/2011bams3067_1.xml?tab_body=pdf + + maxSkinTempK = 273.15 + 80.0 + use_timers = Atm(n)%flagstruct%fv_timers allocate(pelist(mpp_npes())) @@ -813,6 +1036,8 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, ! Also read in other static variables from the orography and surface files if (first_nest_move) then + ! Compute this more flexibly + static_nest_num = 8 ! TODO set pelist for the correct nest instead of hard-coded Atm(2)%pelist to allow multiple moving nests @@ -839,24 +1064,131 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, Moving_nest(child_grid_num)%mn_flag%surface_dir, "oro_data", "slmsk", mn_static%parent_ls_mask_grid, parent_tile) call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, Moving_nest(child_grid_num)%mn_flag%surface_dir, "oro_data", "land_frac", mn_static%parent_land_frac_grid, parent_tile) + + !! Lat lons for debugging + call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "oro_data", "geolat", mn_static%geolat_grid, parent_tile) + call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "oro_data", "geolon", mn_static%geolon_grid, parent_tile) + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "oro_data", "geolat", mn_static%nest_geolat_grid, static_nest_num) + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/.." , "oro_data", "geolon", mn_static%nest_geolon_grid, static_nest_num) + + !call validate_geo_coords("LAT", mn_static%geolat_grid, mn_static%nest_geolat_grid, x_refine, ioffset, joffset) + !call validate_geo_coords("LON", mn_static%geolon_grid, mn_static%nest_geolon_grid, x_refine, ioffset, joffset) + + + call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "substrate_temperature", "substrate_temperature", mn_static%deep_soil_temp_grid, parent_tile) + ! set any -999s to +4C + call mn_replace_low_values(mn_static%deep_soil_temp_grid, -100.0, 277.0) + + call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "soil_type", "soil_type", mn_static%soil_type_grid, parent_tile) + ! To match initialization behavior, set any -999s to 0 in soil_type + call mn_replace_low_values(mn_static%soil_type_grid, -100.0, 0.0) + + ! Need parent soil type to determine lakes + call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "soil_type", "soil_type", mn_static%parent_soil_type_grid, parent_tile) + ! To match initialization behavior, set any -999s to 0 in soil_type + call mn_replace_low_values(mn_static%parent_soil_type_grid, -100.0, 0.0) + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Read static grids for nest initialization + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "oro_data", "slmsk", mn_static%nest_ls_mask_grid, static_nest_num) + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "oro_data", "land_frac", mn_static%nest_land_frac_grid, static_nest_num) + + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "substrate_temperature", "substrate_temperature", mn_static%nest_deep_soil_temp_grid, static_nest_num) + call mn_replace_low_values(mn_static%nest_deep_soil_temp_grid, -100.0, 277.0) + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "soil_type", "soil_type", mn_static%nest_soil_type_grid, static_nest_num) + ! To match initialization behavior, set any -999s to 0 in soil_type + call mn_replace_low_values(mn_static%nest_soil_type_grid, -100.0, 0.0) + + + + !print '("[INFO] WDR parent_ls_mask_grid npe=",I0," mn_static%parent_ls_mask_grid(",I0,":",I0,",",I0,":",I0,")")', this_pe, lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,1), lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,2) - ! Alter parent_ls_mask_grid to set lakes to water(sea) values + ! Alter hires full panel ls_mask_grid to set lakes to water(sea) values + do i_idx = lbound(mn_static%ls_mask_grid,1), ubound(mn_static%ls_mask_grid,1) + do j_idx = lbound(mn_static%ls_mask_grid,1), ubound(mn_static%ls_mask_grid,2) + !if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%land_frac_grid(i_idx, j_idx)) == 0 ) then + !!if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%land_frac_grid(i_idx, j_idx) .lt. 0.999 ) then + + ! Use epsilon of 1.0e-6 on land_frac_grid, based on CCPP code in physics/physics/gcycle.F90 + ! Fixes a bug where land mask changes with first nest move if land_frac_grid = 0.5000 + if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%land_frac_grid(i_idx, j_idx)-1.0e-6_kind_phys) .eq. 0 ) then + mn_static%ls_mask_grid(i_idx, j_idx) = 0 + endif + ! Soil type adjustments from io/fv3atm_sfc_io.F90 + if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. int(mn_static%soil_type_grid(i_idx, j_idx)) .eq. 14 ) then + mn_static%ls_mask_grid(i_idx, j_idx) = 0 + endif + if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%soil_type_grid(i_idx, j_idx) .lt. 0.8 ) then + mn_static%ls_mask_grid(i_idx, j_idx) = 0 + endif + enddo + enddo + + + ! Alter parent full panel ls_mask_grid to set lakes to water(sea) values do i_idx = lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,1) do j_idx = lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,2) - if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%parent_land_frac_grid(i_idx, j_idx)) == 0 ) then + !if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%parent_land_frac_grid(i_idx, j_idx)) == 0 ) then + !!if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%parent_land_frac_grid(i_idx, j_idx) .lt. 0.999 ) then + + ! Use epsilon of 1.0e-6 on land_frac_grid, based on CCPP code in physics/physics/gcycle.F90 + ! Fixes a bug where land mask changes with first nest move if land_frac_grid = 0.5000 + if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%parent_land_frac_grid(i_idx, j_idx)-1.0e-6_kind_phys) .eq. 0 ) then + mn_static%parent_ls_mask_grid(i_idx, j_idx) = 0 + endif + ! Soil type adjustments from io/fv3atm_sfc_io.F90 + if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. int(mn_static%parent_soil_type_grid(i_idx, j_idx)) .eq. 14 ) then + mn_static%parent_ls_mask_grid(i_idx, j_idx) = 0 + endif + if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%parent_soil_type_grid(i_idx, j_idx) .lt. 0.8 ) then mn_static%parent_ls_mask_grid(i_idx, j_idx) = 0 endif enddo enddo - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "substrate_temperature", "substrate_temperature", mn_static%deep_soil_temp_grid, parent_tile) - ! set any -999s to +4C - call mn_replace_low_values(mn_static%deep_soil_temp_grid, -100.0, 277.0) - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "soil_type", "soil_type", mn_static%soil_type_grid, parent_tile) - ! To match initialization behavior, set any -999s to 0 in soil_type - call mn_replace_low_values(mn_static%soil_type_grid, -100.0, 0.0) + + ! Alter nest panel ls_mask_grid to set lakes to water(sea) values + do i_idx = lbound(mn_static%nest_ls_mask_grid,1), ubound(mn_static%nest_ls_mask_grid,1) + do j_idx = lbound(mn_static%nest_ls_mask_grid,1), ubound(mn_static%nest_ls_mask_grid,2) + + ! Use epsilon of 1.0e-6 on land_frac_grid, based on CCPP code in physics/physics/gcycle.F90 + ! Fixes a bug where land mask changes with first nest move if land_frac_grid = 0.5000 + if (mn_static%nest_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%nest_land_frac_grid(i_idx, j_idx)-1.0e-6_kind_phys) .eq. 0 ) then + mn_static%nest_ls_mask_grid(i_idx, j_idx) = 0 + endif + ! Soil type adjustments from io/fv3atm_sfc_io.F90 + if (mn_static%nest_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. int(mn_static%nest_soil_type_grid(i_idx, j_idx)) .eq. 14 ) then + mn_static%nest_ls_mask_grid(i_idx, j_idx) = 0 + endif + if (mn_static%nest_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%nest_soil_type_grid(i_idx, j_idx) .lt. 0.8 ) then + mn_static%nest_ls_mask_grid(i_idx, j_idx) = 0 + endif + enddo + enddo + + + ! Update full panel with nest init values (there are a few mismatches) + ! TODO maybe add orog_raw/orog_filt + call overwrite_with_nest_init_values("ls_mask", mn_static%ls_mask_grid, mn_static%nest_ls_mask_grid, x_refine, ioffset, joffset) + + ! Initialize the land sea mask (slmsk) in the mn_phys structure + ! Probably important this is done after adjusting for lakes! + call mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, x_refine) + + !if (is_fine_pe) then + ! call validate_navigation_fields("INIT", Atm_block, IPD_control, IPD_data, parent_grid_num, child_grid_num) + !endif + + call overwrite_with_nest_init_values("soil_type", mn_static%soil_type_grid, mn_static%nest_soil_type_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("land_frac", mn_static%land_frac_grid, mn_static%nest_land_frac_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("deep_soil_temp", mn_static%deep_soil_temp_grid, mn_static%nest_deep_soil_temp_grid, x_refine, ioffset, joffset) !! TODO investigate reading high-resolution veg_frac and veg_greenness @@ -916,6 +1248,66 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, call mn_replace_low_values(mn_static%alnsf_grid, -100.0, 0.06) call mn_replace_low_values(mn_static%alnwf_grid, -100.0, 0.06) + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Read in static nest variables + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "vegetation_type", "vegetation_type", mn_static%nest_veg_type_grid, static_nest_num) + ! To match initialization behavior, set any -999s to 0 in veg_type + call mn_replace_low_values(mn_static%nest_veg_type_grid, -100.0, 0.0) + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "slope_type", "slope_type", mn_static%nest_slope_type_grid, static_nest_num) + ! To match initialization behavior, set any -999s to 0 in veg_type + call mn_replace_low_values(mn_static%nest_slope_type_grid, -100.0, 0.0) + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "maximum_snow_albedo", "maximum_snow_albedo", mn_static%nest_max_snow_alb_grid, static_nest_num) + ! Set any -999s to 0.5 + call mn_replace_low_values(mn_static%nest_max_snow_alb_grid, -100.0, 0.5) + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "facsf", "facsf", mn_static%nest_facsf_grid, static_nest_num) + + allocate(mn_static%nest_facwf_grid(lbound(mn_static%nest_facsf_grid,1):ubound(mn_static%nest_facsf_grid,1),lbound(mn_static%nest_facsf_grid,2):ubound(mn_static%nest_facsf_grid,2))) + + ! For land points, set facwf = 1.0 - facsf + ! To match initialization behavior, set any -999s to 0 + do i=lbound(mn_static%nest_facsf_grid,1),ubound(mn_static%nest_facsf_grid,1) + do j=lbound(mn_static%nest_facsf_grid,2),ubound(mn_static%nest_facsf_grid,2) + if (mn_static%nest_facsf_grid(i,j) .lt. -100) then + mn_static%nest_facsf_grid(i,j) = 0 + mn_static%nest_facwf_grid(i,j) = 0 + else + mn_static%nest_facwf_grid(i,j) = 1.0 - mn_static%nest_facsf_grid(i,j) + endif + enddo + enddo + + + call overwrite_with_nest_init_values("veg_type", mn_static%veg_type_grid, mn_static%nest_veg_type_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("slope_type", mn_static%slope_type_grid, mn_static%nest_slope_type_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("max_snow_alb", mn_static%max_snow_alb_grid, mn_static%nest_max_snow_alb_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("facsf", mn_static%facsf_grid, mn_static%nest_facsf_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("facwf", mn_static%facwf_grid, mn_static%nest_facwf_grid, x_refine, ioffset, joffset) + + + + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "snowfree_albedo", "visible_black_sky_albedo", mn_static%nest_alvsf_grid, static_nest_num) + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "snowfree_albedo", "visible_white_sky_albedo", mn_static%nest_alvwf_grid, static_nest_num) + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "snowfree_albedo", "near_IR_black_sky_albedo", mn_static%nest_alnsf_grid, static_nest_num) + call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "snowfree_albedo", "near_IR_black_sky_albedo", mn_static%nest_alnwf_grid, static_nest_num) + ! Set the -999s to small value of 0.06, matching initialization code in chgres + + call mn_replace_low_values(mn_static%nest_alvsf_grid, -100.0, 0.06) + call mn_replace_low_values(mn_static%nest_alvwf_grid, -100.0, 0.06) + call mn_replace_low_values(mn_static%nest_alnsf_grid, -100.0, 0.06) + call mn_replace_low_values(mn_static%nest_alnwf_grid, -100.0, 0.06) + + + call overwrite_with_nest_init_values("alvsf", mn_static%alvsf_grid, mn_static%nest_alvsf_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("alvwf", mn_static%alvwf_grid, mn_static%nest_alvwf_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("alnsf", mn_static%alnsf_grid, mn_static%nest_alnsf_grid, x_refine, ioffset, joffset) + call overwrite_with_nest_init_values("alnwf", mn_static%alnwf_grid, mn_static%nest_alnwf_grid, x_refine, ioffset, joffset) + endif endif @@ -1166,42 +1558,103 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, if (use_timers) call mpp_clock_begin (id_movnest7_3) if (is_fine_pe) then - if (move_noahmp) then - !print '("[INFO] WDR NOAHMP reset negative values npe=",I0)', mpp_pe() - do i=isd,ied - do j=jsd,jed + !print '("[INFO] WDR NOAHMP reset negative values npe=",I0)', mpp_pe() + ! do i=isd,ied + ! do j=jsd,jed + + ! This just needs to check in the compute domain. While the mn_phys fields extend into the halo, the IPD structure from CCPP only covers the compute domain. + do i=isc,iec + do j=jsc,jec + + ! Regular physics variables + do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) + if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. maxSkinTempK ) then + print '("[INFO] WDR NOAHMP reset soil temp values npe=",I0," i=",I0," j=",I0," stc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%stc(i,j,k) + Moving_nest(n)%mn_phys%stc(i,j,k) = 298.0 + endif + if (Moving_nest(n)%mn_phys%smc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%smc(i,j,k) .gt. 1000.0 ) then + print '("[INFO] WDR NOAHMP reset soil moisture values npe=",I0," i=",I0," j=",I0," smc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%smc(i,j,k) + Moving_nest(n)%mn_phys%smc(i,j,k) = 0.3 + endif + if (Moving_nest(n)%mn_phys%slc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%slc(i,j,k) .gt. 1000.0 ) then + print '("[INFO] WDR NOAHMP reset soil liquid values npe=",I0," i=",I0," j=",I0," slc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%slc(i,j,k) + Moving_nest(n)%mn_phys%slc(i,j,k) = 0.3 + endif + enddo + + + if (Moving_nest(n)%mn_phys%canopy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%canopy(i,j) .gt. 100.0 ) then + print '("[INFO] WDR NOAHMP reset canopy water values npe=",I0," i=",I0," j=",I0," canopy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%canopy(i,j) + Moving_nest(n)%mn_phys%canopy(i,j) = 0.0 ! Zero out if no other information + endif + if (Moving_nest(n)%mn_phys%vegfrac(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%vegfrac(i,j) .gt. 100.0 ) then + print '("[INFO] WDR NOAHMP reset vegfrac values npe=",I0," i=",I0," j=",I0," vegfrac=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%vegfrac(i,j) + Moving_nest(n)%mn_phys%vegfrac(i,j) = 0.5 ! Default to half. Confirmed that values are fractions. + endif + + + + + if (move_noahmp) then + + !! Patch to reset slmsk + !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1 .and. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. 1e+10) then + ! print '("[INFO] WDR NOAHMP reset land to water for lake npe=",I0," i=",I0," j=",I0," tgxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tgxy(i,j) + ! Moving_nest(n)%mn_phys%slmsk(i,j) = 0 + !endif + ! slmsk(:,:) !< land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + + !if (this_pe .eq. 89) then + ! print '("[INFO] WDR NOAHMP debug npe=",I0," i=",I0," j=",I0," shdmax=",E12.5," shdmin=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%shdmax(i,j), Moving_nest(n)%mn_phys%shdmin(i,j) + ! print '("[INFO] WDR NOAHMP debug npe=",I0," i=",I0," j=",I0," tsfc=",E12.5," tsfcl=",E12.5," tsfco=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tsfc(i,j), Moving_nest(n)%mn_phys%tsfcl(i,j), Moving_nest(n)%mn_phys%tsfco(i,j) + !endif + + if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1) then ! NOAH MP Variables ! This is normally a negative number -! if (Moving_nest(n)%mn_phys%snowxy(i,j) .lt. -9.0 .or. Moving_nest(n)%mn_phys%snowxy(i,j) .gt. 9.0 ) then -! print '("[INFO] WDR NOAHMP reset negative values npe=",I0," i=",I0," j=",I0," snowxy=",E12.5," alboldoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowxy(i,j), Moving_nest(n)%mn_phys%alboldxy(i,j) -! Moving_nest(n)%mn_phys%snowxy(i,j) = 0.0 -! endif + if (Moving_nest(n)%mn_phys%snowxy(i,j) .lt. -9.0 .or. Moving_nest(n)%mn_phys%snowxy(i,j) .gt. 9.0 ) then + print '("[INFO] WDR NOAHMP reset negative values npe=",I0," i=",I0," j=",I0," snowxy=",E12.5," alboldoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowxy(i,j), Moving_nest(n)%mn_phys%alboldxy(i,j) + print '("[INFO] WDR NOAHMP reset snowxy npe=",I0," i=",I0," j=",I0," land_frac=",E19.12," nint(land_frac)=",I0)', mpp_pe(), i, j, mn_static%land_frac_grid((ioffset-1)*x_refine+i, (joffset-1)*y_refine+j), nint(mn_static%land_frac_grid((ioffset-1)*x_refine+i, (joffset-1)*y_refine+j)) + + do k=lbound(Moving_nest(n)%mn_phys%hprime,3),ubound(Moving_nest(n)%mn_phys%hprime,3) + print '("[INFO] WDR NOAHMP reset show hprime values npe=",I0," i=",I0," j=",I0," k=",I0," hprime=",E12.5)', mpp_pe(), i, j, k, Moving_nest(n)%mn_phys%hprime(i,j,k) + enddo + + + Moving_nest(n)%mn_phys%snowxy(i,j) = 0.0 + endif + + if (Moving_nest(n)%mn_phys%soilcolor(i,j) .lt. 1.0 .or. Moving_nest(n)%mn_phys%soilcolor(i,j) .gt. 19.0 ) then + print '("[INFO] WDR NOAHMP reset soilcolor values npe=",I0," i=",I0," j=",I0," soilcolor=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%soilcolor(i,j) + Moving_nest(n)%mn_phys%soilcolor(i,j) = 1.0 ! Default sand/desert bright color + endif + if (Moving_nest(n)%mn_phys%alboldxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%alboldxy(i,j) .gt. 1.0 ) then - print '("[INFO] WDR NOAHMP reset old albedo alboldxy values npe=",I0," i=",I0," j=",I0," alboldoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%alboldxy(i,j) + print '("[INFO] WDR NOAHMP reset old albedo alboldxy values npe=",I0," i=",I0," j=",I0," alboldxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%alboldxy(i,j) Moving_nest(n)%mn_phys%alboldxy(i,j) = 0.65 ! Cold start value endif - + do k=lbound(Moving_nest(n)%mn_phys%snicexy,3),ubound(Moving_nest(n)%mn_phys%snicexy,3) if (Moving_nest(n)%mn_phys%snicexy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snicexy(i,j,k) .gt. 100.0 ) then - print '("[INFO] WDR NOAHMP reset ice thickness values npe=",I0," i=",I0," j=",I0," k=",I0," lat,lon=",F9.5,",",F10.5," snicexy=",E12.5," lsnow=",I0,"=",I0)', mpp_pe(), i, j, k, Atm(n)%gridstruct%agrid(i,j,2)*rad2deg, Atm(n)%gridstruct%agrid(i,j,1)*rad2deg - 360.0, Moving_nest(n)%mn_phys%snicexy(i,j,k), IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound - - print '("[INFO] WDR NOAHMP reset ice thickness values npe=",I0," isd-ied=",I0,"-",I0," jsd-jed",I0,"-",I0," k=",I0,"-",I0)', mpp_pe(), isd, ied, jsd, jed, lbound(Moving_nest(n)%mn_phys%snicexy,3), ubound(Moving_nest(n)%mn_phys%snicexy,3) - - + print '("[INFO] WDR NOAHMP reset ice thickness values npe=",I0," a_step=",I0," i=",I0," j=",I0," k=",I0," lat,lon=",F9.5,",",F10.5," snicexy=",E12.5," lsnow=",I0,"-",I0)', mpp_pe(), a_step, i, j, k, Atm(n)%gridstruct%agrid(i,j,2)*rad2deg, Atm(n)%gridstruct%agrid(i,j,1)*rad2deg - 360.0, Moving_nest(n)%mn_phys%snicexy(i,j,k), IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound + + !print '("[INFO] WDR NOAHMP snicexy reset ice thickness values npe=",I0," isd-ied=",I0,"-",I0," jsd-jed",I0,"-",I0," k=",I0,"-",I0)', mpp_pe(), isd, ied, jsd, jed, lbound(Moving_nest(n)%mn_phys%snicexy,3), ubound(Moving_nest(n)%mn_phys%snicexy,3) + + Moving_nest(n)%mn_phys%snicexy(i,j,k) = 0.0 ! Cold start value endif enddo - + do k=lbound(Moving_nest(n)%mn_phys%snliqxy,3),ubound(Moving_nest(n)%mn_phys%snliqxy,3) if (Moving_nest(n)%mn_phys%snliqxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snliqxy(i,j,k) .gt. 100.0 ) then print '("[INFO] WDR NOAHMP reset liq thickness values npe=",I0," i=",I0," j=",I0," snliqxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snliqxy(i,j,k) Moving_nest(n)%mn_phys%snliqxy(i,j,k) = 0.0 ! Cold start value endif enddo - + ! (/0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0/) -- 3 snow levels, 4 soil levels do k=lbound(Moving_nest(n)%mn_phys%zsnsoxy,3),ubound(Moving_nest(n)%mn_phys%zsnsoxy,3) if (Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) .lt. -80.0 .or. Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) .gt. 100.0 ) then @@ -1210,55 +1663,76 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) = zsns_default(k) ! Cold start value endif enddo - - if (Moving_nest(n)%mn_phys%snowd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snowd(i,j) .gt. 100.0 ) then + + if (Moving_nest(n)%mn_phys%snowd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snowd(i,j) .gt. 1000.0 ) then print '("[INFO] WDR NOAHMP reset snow thickness values npe=",I0," i=",I0," j=",I0," snowd=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowd(i,j) Moving_nest(n)%mn_phys%snowd(i,j) = 0.0 ! Cold start value endif - - if (Moving_nest(n)%mn_phys%weasd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%weasd(i,j) .gt. 100.0 ) then + + if (Moving_nest(n)%mn_phys%weasd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%weasd(i,j) .gt. 1000.0 ) then print '("[INFO] WDR NOAHMP reset snow thickness values npe=",I0," i=",I0," j=",I0," weasd=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%weasd(i,j) Moving_nest(n)%mn_phys%weasd(i,j) = 0.0 ! Cold start value endif - + do k=lbound(Moving_nest(n)%mn_phys%tsnoxy,3),ubound(Moving_nest(n)%mn_phys%tsnoxy,3) - if (Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .gt. 320.0 ) then + if (Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset snow temp values npe=",I0," i=",I0," j=",I0," tsnoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tsnoxy(i,j,k) Moving_nest(n)%mn_phys%tsnoxy(i,j,k) = 0.0 ! Cold start value endif enddo - - if (Moving_nest(n)%mn_phys%tvxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tvxy(i,j) .gt. 320.0 ) then + + if (Moving_nest(n)%mn_phys%tvxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tvxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset vegetation canopy temp values npe=",I0," i=",I0," j=",I0," tvxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tvxy(i,j) Moving_nest(n)%mn_phys%tvxy(i,j) = 298.0 ! skin temperature endif - - if (Moving_nest(n)%mn_phys%tgxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. 320.0 ) then + + if (Moving_nest(n)%mn_phys%tgxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset ground temp values npe=",I0," i=",I0," j=",I0," tgxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tgxy(i,j) Moving_nest(n)%mn_phys%tgxy(i,j) = 298.0 ! skin temperature endif - - if (Moving_nest(n)%mn_phys%tahxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tahxy(i,j) .gt. 320.0 ) then + + if (Moving_nest(n)%mn_phys%tahxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tahxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," tahxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tahxy(i,j) Moving_nest(n)%mn_phys%tahxy(i,j) = 298.0 ! skin temperature endif - - + + do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) - if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. 340.0 ) then + if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," stc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%stc(i,j,k) Moving_nest(n)%mn_phys%stc(i,j,k) = 298.0 ! skin temperature endif enddo - endif - enddo - enddo - endif - endif + if (Moving_nest(n)%mn_phys%cmxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%cmxy(i,j) .gt. 100 ) then + print '("[INFO] WDR NOAHMP reset drag coeff values npe=",I0," i=",I0," j=",I0," cmxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%cmxy(i,j) + Moving_nest(n)%mn_phys%cmxy(i,j) = 2.4D-3 + endif + if (Moving_nest(n)%mn_phys%chxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%chxy(i,j) .gt. 100 ) then + print '("[INFO] WDR NOAHMP reset drag coeff values npe=",I0," i=",I0," j=",I0," chxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%chxy(i,j) + Moving_nest(n)%mn_phys%chxy(i,j) = 2.4D-3 + endif + + if (Moving_nest(n)%mn_phys%lakefrac(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%lakefrac(i,j) .gt. 100 ) then + print '("[INFO] WDR NOAHMP reset lake frac values npe=",I0," i=",I0," j=",I0," lakefrac=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%lakefrac(i,j) + Moving_nest(n)%mn_phys%lakefrac(i,j) = 0.0 + endif + + if (Moving_nest(n)%mn_phys%lakedepth(i,j) .lt. -1.0e+04 .or. Moving_nest(n)%mn_phys%lakedepth(i,j) .gt. 2000 ) then + print '("[INFO] WDR NOAHMP reset lake depth values npe=",I0," i=",I0," j=",I0," lakedepth=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%lakedepth(i,j) + Moving_nest(n)%mn_phys%lakedepth(i,j) = 0.0 + endif + + endif ! if slmsk=1 + endif ! if move_noahmp + enddo ! do j + enddo ! do i + endif ! if is_fine_pe + + if (is_fine_pe) then do i=isc,iec do j=jsc,jec diff --git a/moving_nest/fv_moving_nest_physics.F90 b/moving_nest/fv_moving_nest_physics.F90 index 4608ff1559..b57e6f4d1a 100644 --- a/moving_nest/fv_moving_nest_physics.F90 +++ b/moving_nest/fv_moving_nest_physics.F90 @@ -68,7 +68,11 @@ module fv_moving_nest_physics_mod use GFS_init, only: GFS_grid_populate use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks, hlv +#else use constants_mod, only: cp_air, rdgas, grav, rvgas, kappa, pstd_mks, hlv +#endif use field_manager_mod, only: MODEL_ATMOS use fv_arrays_mod, only: fv_atmos_type, fv_nest_type, fv_grid_type, R_GRID use fv_moving_nest_types_mod, only: fv_moving_nest_prog_type, fv_moving_nest_physics_type, mn_surface_grids, fv_moving_nest_type @@ -352,6 +356,8 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then nb = 1 + if (.not. associated(IPD_Data(nb)%Sfcprop%scolor)) err_field = 51 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field if (.not. associated(IPD_Data(nb)%Sfcprop%snowxy)) err_field = 1 if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field if (.not. associated(IPD_Data(nb)%Sfcprop%tvxy)) err_field = 2 @@ -525,7 +531,11 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, endif if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then + mn_phys%soilcolor(i,j) = IPD_Data(nb)%Sfcprop%scolor(ix) mn_phys%snowxy(i,j) = IPD_Data(nb)%Sfcprop%snowxy(ix) + !if (i .eq. 149 .and. j .eq. 169) print '("[INFO] WDR SNOWXY MASK2D npe=",I0," i=",I0," j=",I0," snowxy=",E10.5)', this_pe, i, j, mn_phys%snowxy(i,j) + + mn_phys%tvxy(i,j) = IPD_Data(nb)%Sfcprop%tvxy(ix) mn_phys%tgxy(i,j) = IPD_Data(nb)%Sfcprop%tgxy(ix) mn_phys%canicexy(i,j) = IPD_Data(nb)%Sfcprop%canicexy(ix) @@ -758,8 +768,9 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n endif if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then -! if (this_pe .eq. 72) print '("[INFO] WDR SNOWXY npe=",I0," a_step=",I0," slmsk=",F7.3," snowxy(",I0,",",I0,")=",F12.5,",",E12.5," lat=",F10.5," lon=",F10.5)', this_pe, a_step, IPD_data(nb)%Sfcprop%slmsk(ix), i, j, mn_phys%snowxy(i,j), mn_phys%snowxy(i,j), IPD_data(nb)%Grid%xlat_d(ix), IPD_data(nb)%Grid%xlon_d(ix)-360.0 + !if (this_pe .eq. 89) print '("[INFO] WDR SNOWXY npe=",I0," a_step=",I0," slmsk=",F7.3," snowxy(",I0,",",I0,")=",F12.5,",",E12.5," lat=",F10.5," lon=",F10.5)', this_pe, a_step, IPD_data(nb)%Sfcprop%slmsk(ix), i, j, mn_phys%snowxy(i,j), mn_phys%snowxy(i,j), IPD_data(nb)%Grid%xlat_d(ix), IPD_data(nb)%Grid%xlon_d(ix)-360.0 + IPD_Data(nb)%Sfcprop%scolor(ix) = mn_phys%soilcolor(i,j) IPD_Data(nb)%Sfcprop%snowxy(ix) = mn_phys%snowxy(i,j) IPD_Data(nb)%Sfcprop%tvxy(ix) = mn_phys%tvxy(i,j) IPD_Data(nb)%Sfcprop%tgxy(ix) = mn_phys%tgxy(i,j) @@ -1156,6 +1167,12 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st ! Land Sea Mask has values of 0 for oceans/lakes, 1 for land, 2 for sea ice + ! Soil color. Default is set to sandy soil/desert 1, which seems appropriate for isolated islands + ! Reference: https://www.jsg.utexas.edu/noah-mp/files/Users_Guide_v0.pdf + call fill_nest_halos_from_parent_masked("soilcol", mn_phys%soilcolor, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 1.0D0) + call fill_nest_halos_from_parent_masked("snowxy", mn_phys%snowxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) @@ -1406,6 +1423,7 @@ subroutine mn_phys_fill_intern_nest_halos(moving_nest, IPD_Control, IPD_Data, do endif if (move_physics .and. IPD_Control%lsm == IPD_Control%lsm_noahmp) then + call mn_var_fill_intern_nest_halos(mn_phys%soilcolor, domain_fine, is_fine_pe) call mn_var_fill_intern_nest_halos(mn_phys%snowxy, domain_fine, is_fine_pe) call mn_var_fill_intern_nest_halos(mn_phys%tvxy, domain_fine, is_fine_pe) call mn_var_fill_intern_nest_halos(mn_phys%tgxy, domain_fine, is_fine_pe) @@ -1604,6 +1622,8 @@ subroutine mn_phys_shift_data(Atm, IPD_Control, IPD_Data, n, child_grid_num, wt_ endif if (move_physics .and. IPD_Control%lsm == IPD_Control%lsm_noahmp) then + call mn_var_shift_data(mn_phys%soilcolor, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) call mn_var_shift_data(mn_phys%snowxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) call mn_var_shift_data(mn_phys%tvxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & diff --git a/moving_nest/fv_moving_nest_types.F90 b/moving_nest/fv_moving_nest_types.F90 index a4d2e73e26..fee0726210 100644 --- a/moving_nest/fv_moving_nest_types.F90 +++ b/moving_nest/fv_moving_nest_types.F90 @@ -83,16 +83,26 @@ module fv_moving_nest_types_mod real, allocatable :: orog_grid(:,:) _NULL ! orography -- raw or filtered depending on namelist option, in meters real, allocatable :: orog_std_grid(:,:) _NULL ! terrain standard deviation for gravity wave drag, in meters (?) real, allocatable :: ls_mask_grid(:,:) _NULL ! land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + ! Land frac needs to be kind_phys because CCPP defines it that way. Can have rounding mismatches around 0.5 if types don't match. real, allocatable :: parent_ls_mask_grid(:,:) _NULL ! Coarse parent land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. - real, allocatable :: parent_land_frac_grid(:,:) _NULL ! Coarse parent land fraction grid; figure out where lakes are located - real, allocatable :: land_frac_grid(:,:) _NULL ! Continuous land fraction - 0.0 ocean, 0.5 half of each, 1.0 all land + real(kind=kind_phys), allocatable :: parent_land_frac_grid(:,:) _NULL ! Coarse parent land fraction grid; figure out where lakes are located + real(kind=kind_phys), allocatable :: land_frac_grid(:,:) _NULL ! Continuous land fraction - 0.0 ocean, 0.5 half of each, 1.0 all land real, allocatable :: parent_orog_grid(:,:) _NULL ! parent orography -- only used for terrain_smoother=1. ! raw or filtered depending on namelist option,in meters + + real(kind=kind_phys), allocatable :: geolat_grid(:,:) _NULL + real(kind=kind_phys), allocatable :: geolon_grid(:,:) _NULL + real(kind=kind_phys), allocatable :: nest_geolat_grid(:,:) _NULL + real(kind=kind_phys), allocatable :: nest_geolon_grid(:,:) _NULL + + + ! Soil variables real, allocatable :: deep_soil_temp_grid(:,:) _NULL ! deep soil temperature at 5m, in degrees K real, allocatable :: soil_type_grid(:,:) _NULL ! STATSGO soil type + real, allocatable :: parent_soil_type_grid(:,:) _NULL ! STATSGO soil type ! Vegetation variables real, allocatable :: veg_frac_grid(:,:) _NULL ! vegetation fraction @@ -121,6 +131,37 @@ module fv_moving_nest_types_mod real, allocatable :: alnsf_grid(:,:) _NULL ! Near IR black sky albedo; netCDF file has monthly values real, allocatable :: alnwf_grid(:,:) _NULL ! Near IR white sky albedo; netCDF file has monthly values + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Nest variables + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + real, allocatable :: nest_ls_mask_grid(:,:) _NULL ! land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + real(kind=kind_phys), allocatable :: nest_land_frac_grid(:,:) _NULL ! Continuous land fraction - 0.0 ocean, 0.5 half of each, 1.0 all land + + ! Soil variables + real, allocatable :: nest_deep_soil_temp_grid(:,:) _NULL ! deep soil temperature at 5m, in degrees K + real, allocatable :: nest_soil_type_grid(:,:) _NULL ! STATSGO soil type + real, allocatable :: nest_parent_soil_type_grid(:,:) _NULL ! STATSGO soil type + + ! Vegetation variables + real, allocatable :: nest_veg_frac_grid(:,:) _NULL ! vegetation fraction + real, allocatable :: nest_veg_type_grid(:,:) _NULL ! IGBP vegetation type + real, allocatable :: nest_veg_greenness_grid(:,:) _NULL ! NESDIS vegetation greenness; netCDF file has monthly values + + ! Orography variables + real, allocatable :: nest_slope_type_grid(:,:) _NULL ! legacy 1 degree GFS slope type + + ! Albedo variables + real, allocatable :: nest_max_snow_alb_grid(:,:) _NULL ! max snow albedo + real, allocatable :: nest_facsf_grid(:,:) _NULL ! fractional coverage with strong cosz dependency + real, allocatable :: nest_facwf_grid(:,:) _NULL ! fractional coverage with weak cosz dependency + + ! Snow free albedo + real, allocatable :: nest_alvsf_grid(:,:) _NULL ! Visible black sky albedo; netCDF file has monthly values + real, allocatable :: nest_alvwf_grid(:,:) _NULL ! Visible white sky albedo; netCDF file has monthly values + real, allocatable :: nest_alnsf_grid(:,:) _NULL ! Near IR black sky albedo; netCDF file has monthly values + real, allocatable :: nest_alnwf_grid(:,:) _NULL ! Near IR white sky albedo; netCDF file has monthly values + end type mn_surface_grids type fv_moving_nest_physics_type @@ -209,6 +250,7 @@ module fv_moving_nest_types_mod real (kind=kind_phys), _ALLOCATABLE :: qrain (:,:) _NULL !< sensible heat flux due to rainfall for NSSTM ! NOAH MP LSM Variables + real (kind=kind_phys), _ALLOCATABLE :: soilcolor (:,:) _NULL !< soil color real (kind=kind_phys), _ALLOCATABLE :: snowxy (:,:) _NULL !< number of snow layers real (kind=kind_phys), _ALLOCATABLE :: tvxy (:,:) _NULL !< canopy temperature real (kind=kind_phys), _ALLOCATABLE :: tgxy (:,:) _NULL !< ground temperature @@ -483,6 +525,7 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p end if if (move_noahmp) then + allocate ( mn_phys%soilcolor(isd:ied, jsd:jed) ) allocate ( mn_phys%snowxy(isd:ied, jsd:jed) ) allocate ( mn_phys%tvxy(isd:ied, jsd:jed) ) allocate ( mn_phys%tgxy(isd:ied, jsd:jed) ) @@ -609,6 +652,7 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p if (move_noahmp) then + mn_phys%soilcolor = +99999.9 mn_phys%snowxy = +99999.9 mn_phys%tvxy = +99999.9 mn_phys%tgxy = +99999.9 @@ -748,6 +792,7 @@ subroutine deallocate_fv_moving_nest_physics_type(mn_phys) ! NOAH MP LSM if (allocated(mn_phys%snowxy)) then + deallocate ( mn_phys%soilcolor ) deallocate ( mn_phys%snowxy ) deallocate ( mn_phys%tvxy ) deallocate ( mn_phys%tgxy ) diff --git a/moving_nest/fv_moving_nest_utils.F90 b/moving_nest/fv_moving_nest_utils.F90 index f3c21b9cd2..e6b4e3cf0e 100644 --- a/moving_nest/fv_moving_nest_utils.F90 +++ b/moving_nest/fv_moving_nest_utils.F90 @@ -66,9 +66,11 @@ module fv_moving_nest_utils_mod #else use IPD_typedefs, only: kind_phys => IPD_kind_phys #endif - +#ifdef OVERLOAD_R4 + use constantsR4_mod, only: grav +#else use constants_mod, only: grav - +#endif use boundary_mod, only: update_coarse_grid, update_coarse_grid_mpp use bounding_box_mod, only: bbox, bbox_get_C2F_index, fill_bbox use fms2_io_mod, only: read_data, write_data, open_file, close_file, register_axis, register_field @@ -526,8 +528,8 @@ subroutine fill_nest_halos_from_parent_masked_r8_2d_const(var_name, data_var, in logical, intent(in) :: is_fine_pe type(nest_domain_type), intent(inout) :: nest_domain integer, intent(in) :: position - real*4, allocatable, intent(in) :: mask_var(:,:) - real*4, allocatable, intent(in) :: parent_mask_var(:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) integer, intent(in) :: mask_val real*8, intent(in) :: default_val @@ -587,8 +589,8 @@ subroutine fill_nest_halos_from_parent_masked_r8_2d_2d(var_name, data_var, inter logical, intent(in) :: is_fine_pe type(nest_domain_type), intent(inout) :: nest_domain integer, intent(in) :: position - real*4, allocatable, intent(in) :: mask_var(:,:) - real*4, allocatable, intent(in) :: parent_mask_var(:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) integer, intent(in) :: mask_val real, allocatable, intent(in) :: default_grid(:,:) @@ -651,8 +653,8 @@ subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_const(var_name, dat logical, intent(in) :: is_fine_pe type(nest_domain_type), intent(inout) :: nest_domain integer, intent(in) :: position, low_z, high_z - real*4, allocatable, intent(in) :: mask_var(:,:) - real*4, allocatable, intent(in) :: parent_mask_var(:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) integer, intent(in) :: mask_val real*8, intent(in) :: default_val @@ -676,8 +678,8 @@ subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_1d(var_name, data_v logical, intent(in) :: is_fine_pe type(nest_domain_type), intent(inout) :: nest_domain integer, intent(in) :: position, low_z, high_z - real*4, allocatable, intent(in) :: mask_var(:,:) - real*4, allocatable, intent(in) :: parent_mask_var(:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) integer, intent(in) :: mask_val real*8, intent(in) :: default_val(low_z:high_z) @@ -738,8 +740,8 @@ subroutine fill_nest_halos_from_parent_masked_r8_3d_lowhighz_2d(var_name, data_v logical, intent(in) :: is_fine_pe type(nest_domain_type), intent(inout) :: nest_domain integer, intent(in) :: position, low_z, high_z - real*4, allocatable, intent(in) :: mask_var(:,:) - real*4, allocatable, intent(in) :: parent_mask_var(:,:) + real, allocatable, intent(in) :: mask_var(:,:) + real, allocatable, intent(in) :: parent_mask_var(:,:) integer, intent(in) :: mask_val real, allocatable, intent(in) :: default_grid(:,:) @@ -2338,6 +2340,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_const(var_name, stagger, ! print '("[INFO] MASK2D npe=",I0," ",A16," parent_mask_var(",I0,",",I0,")=",F15.5," mask_var(",I0,",",I0,")=",F15.5)', mpp_pe(), var_name, ic, jc, parent_mask_var(ic,jc), i, j, mask_var(i,j) + !if (this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK2D SNOWXY npe=",I0," ",A16," parent_mask_var(",I0,",",I0,")=",F15.5," mask_var(",I0,",",I0,")=",F15.5)', mpp_pe(), var_name, ic, jc, parent_mask_var(ic,jc), i, j, mask_var(i,j) ! Note that weights don't seem to always be exactly 0.0 when the corner points are aligned @@ -2346,8 +2349,8 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_const(var_name, stagger, num_weights = num_weights + 1 x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) tw = tw + wt(i,j,1) - -! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY AA npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc, buffer(ic,jc), i, j, x(i,j), tw, wt(i,j,1) + + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY AA npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc, buffer(ic,jc), i, j, x(i,j), tw, wt(i,j,1) endif @@ -2356,7 +2359,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_const(var_name, stagger, x(i,j) = x(i,j) + wt(i,j,2)*buffer(ic, jc+1) tw = tw + wt(i,j,2) -! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY BB npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc+1, buffer(ic,jc+1), i, j, x(i,j), tw, wt(i,j,2) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY BB npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc+1, buffer(ic,jc+1), i, j, x(i,j), tw, wt(i,j,2) endif if (parent_mask_var(ic+1,jc+1) .eq. mask_var(i,j) .and. wt(i,j,3) .gt. 0.0001) then @@ -2364,7 +2367,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_const(var_name, stagger, x(i,j) = x(i,j) + wt(i,j,3)*buffer(ic+1,jc+1) tw = tw + wt(i,j,3) -! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY CC npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10,",",E12.5," parent_mask(",I0,",",I0,")=",F8.3)', this_pe, num_weights, ic+1, jc+1, buffer(ic+1,jc+1), i, j, x(i,j), tw, wt(i,j,3), wt(i,j,3), ic+1, jc+1, parent_mask_var(ic+1, jc+1) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY CC npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10,",",E12.5," parent_mask(",I0,",",I0,")=",F8.3)', this_pe, num_weights, ic+1, jc+1, buffer(ic+1,jc+1), i, j, x(i,j), tw, wt(i,j,3), wt(i,j,3), ic+1, jc+1, parent_mask_var(ic+1, jc+1) endif if (parent_mask_var(ic+1,jc) .eq. mask_var(i,j) .and. wt(i,j,4) .gt. 0.0001) then @@ -2372,7 +2375,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_const(var_name, stagger, x(i,j) = x(i,j) + wt(i,j,4)*buffer(ic+1,jc ) tw = tw + wt(i,j,4) - ! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY DD npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic+1, jc, buffer(ic+1,jc), i, j, x(i,j), tw, wt(i,j,4) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY DD npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic+1, jc, buffer(ic+1,jc), i, j, x(i,j), tw, wt(i,j,4) endif @@ -2386,7 +2389,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_const(var_name, stagger, x(i,j) = default_val endif -! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY npe=",I0," num_weights=",I0," x(",I0,",",I0,")=",E12.5)', this_pe, num_weights, i, j, x(i,j) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY 2d_const npe=",I0," num_weights=",I0," x(",I0,",",I0,")=",E12.5)', this_pe, num_weights, i, j, x(i,j) enddo @@ -2493,7 +2496,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_2d(var_name, stagger, x, x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) tw = tw + wt(i,j,1) -! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY AA npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc, buffer(ic,jc), i, j, x(i,j), tw, wt(i,j,1) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY AA npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc, buffer(ic,jc), i, j, x(i,j), tw, wt(i,j,1) endif @@ -2502,7 +2505,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_2d(var_name, stagger, x, x(i,j) = x(i,j) + wt(i,j,2)*buffer(ic, jc+1) tw = tw + wt(i,j,2) -! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY BB npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc+1, buffer(ic,jc+1), i, j, x(i,j), tw, wt(i,j,2) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY BB npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc+1, buffer(ic,jc+1), i, j, x(i,j), tw, wt(i,j,2) endif if (parent_mask_var(ic+1,jc+1) .eq. mask_var(i,j) .and. wt(i,j,3) .gt. 0.0001) then @@ -2510,7 +2513,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_2d(var_name, stagger, x, x(i,j) = x(i,j) + wt(i,j,3)*buffer(ic+1,jc+1) tw = tw + wt(i,j,3) -! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY CC npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10,",",E12.5," parent_mask(",I0,",",I0,")=",F8.3)', this_pe, num_weights, ic+1, jc+1, buffer(ic+1,jc+1), i, j, x(i,j), tw, wt(i,j,3), wt(i,j,3), ic+1, jc+1, parent_mask_var(ic+1, jc+1) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY CC npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10,",",E12.5," parent_mask(",I0,",",I0,")=",F8.3)', this_pe, num_weights, ic+1, jc+1, buffer(ic+1,jc+1), i, j, x(i,j), tw, wt(i,j,3), wt(i,j,3), ic+1, jc+1, parent_mask_var(ic+1, jc+1) endif if (parent_mask_var(ic+1,jc) .eq. mask_var(i,j) .and. wt(i,j,4) .gt. 0.0001) then @@ -2518,7 +2521,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_2d(var_name, stagger, x, x(i,j) = x(i,j) + wt(i,j,4)*buffer(ic+1,jc ) tw = tw + wt(i,j,4) - ! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY DD npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic+1, jc, buffer(ic+1,jc), i, j, x(i,j), tw, wt(i,j,4) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY DD npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic+1, jc, buffer(ic+1,jc), i, j, x(i,j), tw, wt(i,j,4) endif @@ -2532,7 +2535,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_2d(var_name, stagger, x, x(i,j) = default_grid(i,j) endif -! if ( this_pe .eq. 72 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY npe=",I0," num_weights=",I0," x(",I0,",",I0,")=",E12.5)', this_pe, num_weights, i, j, x(i,j) + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY 2d_2d npe=",I0," num_weights=",I0," x(",I0,",",I0,")=",E12.5)', this_pe, num_weights, i, j, x(i,j) enddo From 89e8eb98c777e47421e0533a63b72be162e7fef5 Mon Sep 17 00:00:00 2001 From: William Ramstrom Date: Tue, 19 Dec 2023 16:18:12 +0000 Subject: [PATCH 035/192] Changed default value for soilcolor to 10, based on advice from Mike Barlage. --- moving_nest/fv_moving_nest_main.F90 | 3 ++- moving_nest/fv_moving_nest_physics.F90 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/moving_nest/fv_moving_nest_main.F90 b/moving_nest/fv_moving_nest_main.F90 index 05b5228a41..ebf35cc50a 100644 --- a/moving_nest/fv_moving_nest_main.F90 +++ b/moving_nest/fv_moving_nest_main.F90 @@ -1629,7 +1629,8 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, if (Moving_nest(n)%mn_phys%soilcolor(i,j) .lt. 1.0 .or. Moving_nest(n)%mn_phys%soilcolor(i,j) .gt. 19.0 ) then print '("[INFO] WDR NOAHMP reset soilcolor values npe=",I0," i=",I0," j=",I0," soilcolor=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%soilcolor(i,j) - Moving_nest(n)%mn_phys%soilcolor(i,j) = 1.0 ! Default sand/desert bright color + ! Default changed to 10 based on suggestion from Mike Barlage; more middle of the spectrum value. + Moving_nest(n)%mn_phys%soilcolor(i,j) = 10.0 endif if (Moving_nest(n)%mn_phys%alboldxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%alboldxy(i,j) .gt. 1.0 ) then diff --git a/moving_nest/fv_moving_nest_physics.F90 b/moving_nest/fv_moving_nest_physics.F90 index b57e6f4d1a..34e4514a5a 100644 --- a/moving_nest/fv_moving_nest_physics.F90 +++ b/moving_nest/fv_moving_nest_physics.F90 @@ -1169,9 +1169,10 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st ! Soil color. Default is set to sandy soil/desert 1, which seems appropriate for isolated islands ! Reference: https://www.jsg.utexas.edu/noah-mp/files/Users_Guide_v0.pdf + ! Default changed to 10 based on suggestion from Mike Barlage; more middle of the spectrum value. call fill_nest_halos_from_parent_masked("soilcol", mn_phys%soilcolor, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 1.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 10.0D0) call fill_nest_halos_from_parent_masked("snowxy", mn_phys%snowxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & From ccbd565fcb9599da405156986afe39de6ef29179 Mon Sep 17 00:00:00 2001 From: William Ramstrom Date: Fri, 22 Dec 2023 18:59:55 +0000 Subject: [PATCH 036/192] Restructured moving nest fix file initialization. --- moving_nest/fv_moving_nest.F90 | 106 ++++++- moving_nest/fv_moving_nest_main.F90 | 381 ++++--------------------- moving_nest/fv_moving_nest_physics.F90 | 134 ++++----- moving_nest/fv_moving_nest_types.F90 | 232 ++++++++++++--- 4 files changed, 414 insertions(+), 439 deletions(-) diff --git a/moving_nest/fv_moving_nest.F90 b/moving_nest/fv_moving_nest.F90 index 04020ab7eb..3102b1952d 100644 --- a/moving_nest/fv_moving_nest.F90 +++ b/moving_nest/fv_moving_nest.F90 @@ -87,7 +87,7 @@ module fv_moving_nest_mod use fv_nwp_nudge_mod, only: do_adiabatic_init use init_hydro_mod, only: p_var use tracer_manager_mod, only: get_tracer_index, get_tracer_names - use fv_moving_nest_types_mod, only: fv_moving_nest_prog_type, fv_moving_nest_physics_type, Moving_nest + use fv_moving_nest_types_mod, only: fv_moving_nest_prog_type, fv_moving_nest_physics_type, Moving_nest, mn_land_mask_grids, mn_fix_grids, alloc_set_facwf use fv_moving_nest_utils_mod, only: alloc_halo_buffer, load_nest_latlons_from_nc, grid_geometry, output_grid_to_nc use fv_moving_nest_utils_mod, only: fill_nest_from_buffer, fill_nest_from_buffer_cell_center, fill_nest_from_buffer_nearest_neighbor use fv_moving_nest_utils_mod, only: fill_nest_halos_from_parent, fill_grid_from_supergrid, fill_weight_grid @@ -860,6 +860,110 @@ subroutine mn_orog_read_hires_parent(npx, npy, refine, pelist, surface_dir, filt end subroutine mn_orog_read_hires_parent + !>@brief The subroutine 'mn_replace_low_values' replaces low values with a default value. + subroutine mn_replace_low_values(data_grid, low_value, new_value) + real, _ALLOCATABLE, intent(inout) :: data_grid(:,:) !< 2D grid of data + real, intent(in) :: low_value !< Low value to check for; e.g. negative or fill value + real, intent(in) :: new_value !< Value to replace low value with + + integer :: i, j + + do i=lbound(data_grid,1),ubound(data_grid,1) + do j=lbound(data_grid,2),ubound(data_grid,2) + if (data_grid(i,j) .le. low_value) data_grid(i,j) = new_value + enddo + enddo + end subroutine mn_replace_low_values + + subroutine mn_static_read_ls(static_ls, npx, npy, refine, pelist, surface_dir, tile_num, terrain_smoother, filtered_terrain) + type(mn_land_mask_grids), intent(inout) :: static_ls + integer, intent(in) :: npx, npy, refine, tile_num !< Number of x,y points and nest refinement, (parent) tile number + integer, allocatable, intent(in) :: pelist(:) !< PE list for fms2_io + character(len=*), intent(in) :: surface_dir !< Surface directory + integer, intent(in) :: terrain_smoother + logical, intent(in) :: filtered_terrain + + ! If terrain_smoother method 1 is chosen, we need the parent coarse terrain + if (terrain_smoother .eq. 1) then + if (filtered_terrain) then + call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "oro_data", "orog_filt", static_ls%orog_grid, tile_num) + else + call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "oro_data", "orog_raw", static_ls%orog_grid, tile_num) + endif + endif + + ! Read in coarse resolution land sea mask to use for masked interpolations; factor in lakes as well + call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "oro_data", "slmsk", static_ls%ls_mask_grid, tile_num) + call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "oro_data", "land_frac", static_ls%land_frac_grid, tile_num) + + !! Lat lons for debugging + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "oro_data", "geolat", static_ls%geolat_grid, tile_num) + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "oro_data", "geolon", static_ls%geolon_grid, tile_num) + + ! Need parent soil type to determine lakes + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "soil_type", "soil_type", static_ls%soil_type_grid, tile_num) + ! To match initialization behavior, set any -999s to 0 in soil_type + call mn_replace_low_values(static_ls%soil_type_grid, -100.0, 0.0) + + end subroutine mn_static_read_ls + + subroutine mn_static_read_fix(static_fix, npx, npy, refine, pelist, surface_dir, tile_num, month) + type(mn_fix_grids), intent(inout) :: static_fix + integer, allocatable, intent(in) :: pelist(:) !< PE list for fms2_io + character(len=*), intent(in) :: surface_dir !< Surface directory + integer, intent(in) :: npx, npy, refine, tile_num, month !< Number of x,y points and nest refinement, (parent) tile number + + call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "substrate_temperature", "substrate_temperature", static_fix%deep_soil_temp_grid, tile_num) + ! set any -999s to +4C + call mn_replace_low_values(static_fix%deep_soil_temp_grid, -100.0, 277.0) + + + !! TODO investigate reading high-resolution veg_frac and veg_greenness + !call mn_static_read_hires(npx, npy, refine, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "", mn_static%veg_frac_grid) + + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "vegetation_type", "vegetation_type", static_fix%veg_type_grid, tile_num) + ! To match initialization behavior, set any -999s to 0 in veg_type + call mn_replace_low_values(static_fix%veg_type_grid, -100.0, 0.0) + + + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "slope_type", "slope_type", static_fix%slope_type_grid, tile_num) + ! To match initialization behavior, set any -999s to 0 in slope_type + call mn_replace_low_values(static_fix%slope_type_grid, -100.0, 0.0) + + + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "maximum_snow_albedo", "maximum_snow_albedo", static_fix%max_snow_alb_grid, tile_num) + ! Set any -999s to 0.5 + call mn_replace_low_values(static_fix%max_snow_alb_grid, -100.0, 0.5) + + ! Albedo fraction -- read and calculate + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "facsf", "facsf", static_fix%facsf_grid, tile_num) + + call alloc_set_facwf(static_fix) + + ! Additional albedo variables + ! black sky = strong cosz -- direct sunlight + ! white sky = weak cosz -- diffuse light + + ! alvsf = visible strong cosz = visible_black_sky_albedo + ! alvwf = visible weak cosz = visible_white_sky_albedo + ! alnsf = near IR strong cosz = near_IR_black_sky_albedo + ! alnwf = near IR weak cosz = near_IR_white_sky_albedo + + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "snowfree_albedo", "visible_black_sky_albedo", static_fix%alvsf_grid, tile_num, time=month) + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "snowfree_albedo", "visible_white_sky_albedo", static_fix%alvwf_grid, tile_num, time=month) + + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "snowfree_albedo", "near_IR_black_sky_albedo", static_fix%alnsf_grid, tile_num, time=month) + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "snowfree_albedo", "near_IR_white_sky_albedo", static_fix%alnwf_grid, tile_num, time=month) + + ! Set the -999s to small value of 0.06, matching initialization code in chgres + + call mn_replace_low_values(static_fix%alvsf_grid, -100.0, 0.06) + call mn_replace_low_values(static_fix%alvwf_grid, -100.0, 0.06) + call mn_replace_low_values(static_fix%alnsf_grid, -100.0, 0.06) + call mn_replace_low_values(static_fix%alnwf_grid, -100.0, 0.06) + + end subroutine mn_static_read_fix + !>@brief The subroutine 'mn_static_read_hires_r4' loads high resolution data from netCDF !>@details Gathers a single variable from the netCDF file subroutine mn_static_read_hires_r4(npx, npy, refine, pelist, surface_dir, file_prefix, var_name, data_grid, parent_tile, time) diff --git a/moving_nest/fv_moving_nest_main.F90 b/moving_nest/fv_moving_nest_main.F90 index ebf35cc50a..b7c5e92b6a 100644 --- a/moving_nest/fv_moving_nest_main.F90 +++ b/moving_nest/fv_moving_nest_main.F90 @@ -106,10 +106,14 @@ module fv_moving_nest_main_mod use fv_moving_nest_types_mod, only: allocate_fv_moving_nest_prog_type, allocate_fv_moving_nest_physics_type use fv_moving_nest_types_mod, only: deallocate_fv_moving_nests use fv_moving_nest_types_mod, only: Moving_nest - + use fv_moving_nest_types_mod, only: mn_apply_lakes, mn_overwrite_with_nest_init_values, alloc_set_facwf + use fv_moving_nest_types_mod, only: mn_static_overwrite_ls_from_nest, mn_static_overwrite_fix_from_nest + use fv_moving_nest_types_mod, only: deallocate_land_mask_grids, deallocate_fix_grids + ! Prognostic variable routines use fv_moving_nest_mod, only: mn_prog_fill_intern_nest_halos, mn_prog_fill_nest_halos_from_parent, & mn_prog_dump_to_netcdf, mn_prog_shift_data + use fv_moving_nest_mod, only: mn_static_read_ls, mn_static_read_fix ! Physics variable routines use fv_moving_nest_physics_mod, only: mn_phys_fill_intern_nest_halos, mn_phys_fill_nest_halos_from_parent, & mn_phys_dump_to_netcdf, mn_phys_shift_data, mn_phys_reset_sfc_props, move_nsst, mn_phys_set_slmsk @@ -167,10 +171,6 @@ module fv_moving_nest_main_mod type(mn_surface_grids), save :: mn_static - interface overwrite_with_nest_init_values - module procedure overwrite_with_nest_init_values_r4 - module procedure overwrite_with_nest_init_values_r8 - end interface overwrite_with_nest_init_values contains @@ -322,9 +322,9 @@ subroutine log_landsea_mask(Atm_block, IPD_control, IPD_data, time_step, parent_ this_pe,a_step,i_pe,j_pe, int(local_slmsk(i_pe,j_pe)), & int(Moving_nest(n)%mn_phys%slmsk(i_pe,j_pe)), & int(IPD_data(nb)%Sfcprop%stype(ix)), & - int(mn_static%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(mn_static%fp_ls%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & IPD_data(nb)%Sfcprop%landfrac(ix), & - int(mn_static%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(mn_static%fp_ls%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & IPD_data(nb)%Sfcprop%lakefrac(ix), & IPD_data(nb)%Sfcprop%oceanfrac(ix) endif @@ -398,43 +398,6 @@ subroutine validate_geo_coords(tag, geo_grid, nest_geo_grid, refine, ioffset, jo end subroutine validate_geo_coords - subroutine overwrite_with_nest_init_values_r8(tag, var_grid, nest_var_grid, refine, ioffset, joffset) - character(len=*) :: tag - real*8, allocatable, intent(inout) :: var_grid(:,:) - real*8, allocatable, intent(in) :: nest_var_grid(:,:) - - integer, intent(in) :: refine, ioffset, joffset - integer :: i,j, this_pe - -! this_pe = mpp_pe() - - do i = lbound(nest_var_grid,1), ubound(nest_var_grid,1) - do j = lbound(nest_var_grid,2), ubound(nest_var_grid,2) - var_grid((ioffset-1)*refine+i, (joffset-1)*refine+j) = nest_var_grid(i,j) - enddo - enddo - - end subroutine overwrite_with_nest_init_values_r8 - - subroutine overwrite_with_nest_init_values_r4(tag, var_grid, nest_var_grid, refine, ioffset, joffset) - character(len=*) :: tag - real*4, allocatable, intent(inout) :: var_grid(:,:) - real*4, allocatable, intent(in) :: nest_var_grid(:,:) - - integer, intent(in) :: refine, ioffset, joffset - integer :: i,j, this_pe - -! this_pe = mpp_pe() - - do i = lbound(nest_var_grid,1), ubound(nest_var_grid,1) - do j = lbound(nest_var_grid,2), ubound(nest_var_grid,2) - var_grid((ioffset-1)*refine+i, (joffset-1)*refine+j) = nest_var_grid(i,j) - enddo - enddo - - end subroutine overwrite_with_nest_init_values_r4 - - subroutine validate_navigation_fields(tag, Atm_block, IPD_control, IPD_data, parent_grid_num, child_grid_num) @@ -484,26 +447,26 @@ subroutine validate_navigation_fields(tag, Atm_block, IPD_control, IPD_data, par print '("[INFO] WDR mismatch VALIDATE A tag=",A4," npe=",I0," time=",I3," i_pe=",I3," j_pe=",I3," IPD%slmsk=",I0," phys%slmsk=",I0," fp_slmsk=",I0," soil_type_grid=",I0," phys%soil_type=",I0," ipd%landfrac=",F10.5," land_frac_grid=",F12.5," ipd%lakefrac=",F10.5," ipd%oceanfrac=",F10.5)', & tag, this_pe,a_step,i_pe,j_pe, int(local_slmsk(i_pe,j_pe)), & int(Moving_nest(n)%mn_phys%slmsk(i_pe,j_pe)), & - int(mn_static%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(mn_static%fp_ls%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & int(IPD_data(nb)%Sfcprop%stype(ix)), & - int(mn_static%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(mn_static%fp_ls%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & IPD_data(nb)%Sfcprop%landfrac(ix), & - int(mn_static%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(mn_static%fp_ls%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & IPD_data(nb)%Sfcprop%lakefrac(ix), & IPD_data(nb)%Sfcprop%oceanfrac(ix) endif ! if ((i_pe .eq. 149 .and. j_pe .eq. 169) .or.(i_pe .eq. 152 .and. j_pe .eq. 169) .or. int(local_slmsk(i_pe,j_pe)) .ne. int(mn_static%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe))) then - if (int(local_slmsk(i_pe,j_pe)) .ne. int(mn_static%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe))) then + if (int(local_slmsk(i_pe,j_pe)) .ne. int(mn_static%fp_ls%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe))) then print '("[INFO] WDR mismatch VALIDATE B tag=",A4," npe=",I0," time=",I3," i_pe=",I3," j_pe=",I3," IPD%slmsk=",I0," phys%slmsk=",I0," fp_slmsk=",I0," soil_type_grid=",I0," phys%soil_type=",I0," ipd%landfrac=",F10.5," land_frac_grid=",F12.5," ipd%lakefrac=",F10.5," ipd%oceanfrac=",F10.5)', & tag, this_pe,a_step,i_pe,j_pe, int(local_slmsk(i_pe,j_pe)), & int(Moving_nest(n)%mn_phys%slmsk(i_pe,j_pe)), & - int(mn_static%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(mn_static%fp_ls%ls_mask_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & int(IPD_data(nb)%Sfcprop%stype(ix)), & - int(mn_static%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(mn_static%fp_ls%soil_type_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & IPD_data(nb)%Sfcprop%landfrac(ix), & - int(mn_static%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & + int(mn_static%fp_ls%land_frac_grid((ioffset-1)*refine+i_pe, (joffset-1)*refine+j_pe)), & IPD_data(nb)%Sfcprop%lakefrac(ix), & IPD_data(nb)%Sfcprop%oceanfrac(ix) endif @@ -1036,277 +999,54 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, ! Also read in other static variables from the orography and surface files if (first_nest_move) then - ! Compute this more flexibly - static_nest_num = 8 + ! TODO Compute this more flexibly for multiple moving nests + if (parent_tile .eq. 1) then + static_nest_num = 8 ! Regional + else + static_nest_num = 7 ! Global + endif + + !print '("[INFO] WDR NEST_NUM npe=",I0," is_regional=",L1," static_nest_num=",I0," parent_tile=",I0,", ntiles=",I0)', this_pe, Atm(n)%flagstruct%regional, static_nest_num, parent_tile, Atm(1)%flagstruct%ntiles ! TODO set pelist for the correct nest instead of hard-coded Atm(2)%pelist to allow multiple moving nests call mn_latlon_read_hires_parent(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, fp_super_tile_geo, & Moving_nest(child_grid_num)%mn_flag%surface_dir, parent_tile) - call mn_orog_read_hires_parent(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, & - Moving_nest(child_grid_num)%mn_flag%surface_dir, filtered_terrain, & - mn_static%orog_grid, mn_static%orog_std_grid, mn_static%ls_mask_grid, mn_static%land_frac_grid, parent_tile) - - ! Initialize the land sea mask (slmsk) in the mn_phys structure - call mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, x_refine) - - ! If terrain_smoother method 1 is chosen, we need the parent coarse terrain - if (Moving_nest(n)%mn_flag%terrain_smoother .eq. 1) then - if (filtered_terrain) then - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, Moving_nest(child_grid_num)%mn_flag%surface_dir, "oro_data", "orog_filt", mn_static%parent_orog_grid, parent_tile) - else - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, Moving_nest(child_grid_num)%mn_flag%surface_dir, "oro_data", "orog_raw", mn_static%parent_orog_grid, parent_tile) - endif - endif - - ! Read in coarse resolution land sea mask to use for masked interpolations; factor in lakes as well - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, Moving_nest(child_grid_num)%mn_flag%surface_dir, "oro_data", "slmsk", mn_static%parent_ls_mask_grid, parent_tile) - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, Moving_nest(child_grid_num)%mn_flag%surface_dir, "oro_data", "land_frac", mn_static%parent_land_frac_grid, parent_tile) - - - !! Lat lons for debugging - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "oro_data", "geolat", mn_static%geolat_grid, parent_tile) - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "oro_data", "geolon", mn_static%geolon_grid, parent_tile) - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "oro_data", "geolat", mn_static%nest_geolat_grid, static_nest_num) - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/.." , "oro_data", "geolon", mn_static%nest_geolon_grid, static_nest_num) - - !call validate_geo_coords("LAT", mn_static%geolat_grid, mn_static%nest_geolat_grid, x_refine, ioffset, joffset) - !call validate_geo_coords("LON", mn_static%geolon_grid, mn_static%nest_geolon_grid, x_refine, ioffset, joffset) - - - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "substrate_temperature", "substrate_temperature", mn_static%deep_soil_temp_grid, parent_tile) - ! set any -999s to +4C - call mn_replace_low_values(mn_static%deep_soil_temp_grid, -100.0, 277.0) - - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "soil_type", "soil_type", mn_static%soil_type_grid, parent_tile) - ! To match initialization behavior, set any -999s to 0 in soil_type - call mn_replace_low_values(mn_static%soil_type_grid, -100.0, 0.0) - - ! Need parent soil type to determine lakes - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "soil_type", "soil_type", mn_static%parent_soil_type_grid, parent_tile) - ! To match initialization behavior, set any -999s to 0 in soil_type - call mn_replace_low_values(mn_static%parent_soil_type_grid, -100.0, 0.0) - - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Read static grids for nest initialization - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "oro_data", "slmsk", mn_static%nest_ls_mask_grid, static_nest_num) - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "oro_data", "land_frac", mn_static%nest_land_frac_grid, static_nest_num) - - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "substrate_temperature", "substrate_temperature", mn_static%nest_deep_soil_temp_grid, static_nest_num) - call mn_replace_low_values(mn_static%nest_deep_soil_temp_grid, -100.0, 277.0) - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "soil_type", "soil_type", mn_static%nest_soil_type_grid, static_nest_num) - ! To match initialization behavior, set any -999s to 0 in soil_type - call mn_replace_low_values(mn_static%nest_soil_type_grid, -100.0, 0.0) - - - - - !print '("[INFO] WDR parent_ls_mask_grid npe=",I0," mn_static%parent_ls_mask_grid(",I0,":",I0,",",I0,":",I0,")")', this_pe, lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,1), lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,2) - - ! Alter hires full panel ls_mask_grid to set lakes to water(sea) values - do i_idx = lbound(mn_static%ls_mask_grid,1), ubound(mn_static%ls_mask_grid,1) - do j_idx = lbound(mn_static%ls_mask_grid,1), ubound(mn_static%ls_mask_grid,2) - !if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%land_frac_grid(i_idx, j_idx)) == 0 ) then - !!if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%land_frac_grid(i_idx, j_idx) .lt. 0.999 ) then - - ! Use epsilon of 1.0e-6 on land_frac_grid, based on CCPP code in physics/physics/gcycle.F90 - ! Fixes a bug where land mask changes with first nest move if land_frac_grid = 0.5000 - if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%land_frac_grid(i_idx, j_idx)-1.0e-6_kind_phys) .eq. 0 ) then - mn_static%ls_mask_grid(i_idx, j_idx) = 0 - endif - ! Soil type adjustments from io/fv3atm_sfc_io.F90 - if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. int(mn_static%soil_type_grid(i_idx, j_idx)) .eq. 14 ) then - mn_static%ls_mask_grid(i_idx, j_idx) = 0 - endif - if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%soil_type_grid(i_idx, j_idx) .lt. 0.8 ) then - mn_static%ls_mask_grid(i_idx, j_idx) = 0 - endif - enddo - enddo - - - ! Alter parent full panel ls_mask_grid to set lakes to water(sea) values - do i_idx = lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,1) - do j_idx = lbound(mn_static%parent_ls_mask_grid,1), ubound(mn_static%parent_ls_mask_grid,2) - !if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%parent_land_frac_grid(i_idx, j_idx)) == 0 ) then - !!if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%parent_land_frac_grid(i_idx, j_idx) .lt. 0.999 ) then - - ! Use epsilon of 1.0e-6 on land_frac_grid, based on CCPP code in physics/physics/gcycle.F90 - ! Fixes a bug where land mask changes with first nest move if land_frac_grid = 0.5000 - if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%parent_land_frac_grid(i_idx, j_idx)-1.0e-6_kind_phys) .eq. 0 ) then - mn_static%parent_ls_mask_grid(i_idx, j_idx) = 0 - endif - ! Soil type adjustments from io/fv3atm_sfc_io.F90 - if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. int(mn_static%parent_soil_type_grid(i_idx, j_idx)) .eq. 14 ) then - mn_static%parent_ls_mask_grid(i_idx, j_idx) = 0 - endif - if (mn_static%parent_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%parent_soil_type_grid(i_idx, j_idx) .lt. 0.8 ) then - mn_static%parent_ls_mask_grid(i_idx, j_idx) = 0 - endif - enddo - enddo - + ! Read static parent land sea mask fields + call mn_static_read_ls(mn_static%parent_ls, Atm(1)%npx, Atm(1)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), parent_tile, Moving_nest(n)%mn_flag%terrain_smoother, filtered_terrain) + ! Read full panel + call mn_static_read_ls(mn_static%fp_ls, Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), parent_tile, Moving_nest(n)%mn_flag%terrain_smoother, filtered_terrain) - ! Alter nest panel ls_mask_grid to set lakes to water(sea) values - do i_idx = lbound(mn_static%nest_ls_mask_grid,1), ubound(mn_static%nest_ls_mask_grid,1) - do j_idx = lbound(mn_static%nest_ls_mask_grid,1), ubound(mn_static%nest_ls_mask_grid,2) + ! Read static nest land sea mask fields + call mn_static_read_ls(mn_static%nest_ls, Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", static_nest_num, Moving_nest(n)%mn_flag%terrain_smoother, filtered_terrain) - ! Use epsilon of 1.0e-6 on land_frac_grid, based on CCPP code in physics/physics/gcycle.F90 - ! Fixes a bug where land mask changes with first nest move if land_frac_grid = 0.5000 - if (mn_static%nest_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%nest_land_frac_grid(i_idx, j_idx)-1.0e-6_kind_phys) .eq. 0 ) then - mn_static%nest_ls_mask_grid(i_idx, j_idx) = 0 - endif - ! Soil type adjustments from io/fv3atm_sfc_io.F90 - if (mn_static%nest_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. int(mn_static%nest_soil_type_grid(i_idx, j_idx)) .eq. 14 ) then - mn_static%nest_ls_mask_grid(i_idx, j_idx) = 0 - endif - if (mn_static%nest_ls_mask_grid(i_idx, j_idx) .eq. 1 .and. mn_static%nest_soil_type_grid(i_idx, j_idx) .lt. 0.8 ) then - mn_static%nest_ls_mask_grid(i_idx, j_idx) = 0 - endif - enddo - enddo + !call validate_geo_coords("LAT", mn_static%fp_ls%geolat_grid, mn_static%nest_ls%geolat_grid, x_refine, ioffset, joffset) + !call validate_geo_coords("LON", mn_static%fp_ls%geolon_grid, mn_static%nest_ls%geolon_grid, x_refine, ioffset, joffset) + !! Apply lakes to land mask based on land_frac and soil_type + call mn_apply_lakes(mn_static%parent_ls) + call mn_apply_lakes(mn_static%fp_ls) + call mn_apply_lakes(mn_static%nest_ls) - ! Update full panel with nest init values (there are a few mismatches) - ! TODO maybe add orog_raw/orog_filt - call overwrite_with_nest_init_values("ls_mask", mn_static%ls_mask_grid, mn_static%nest_ls_mask_grid, x_refine, ioffset, joffset) + call mn_static_overwrite_ls_from_nest(mn_static%fp_ls, mn_static%nest_ls, x_refine, ioffset, joffset) ! Initialize the land sea mask (slmsk) in the mn_phys structure - ! Probably important this is done after adjusting for lakes! + ! Important this is done after adjusting for lakes! call mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, x_refine) - !if (is_fine_pe) then - ! call validate_navigation_fields("INIT", Atm_block, IPD_control, IPD_data, parent_grid_num, child_grid_num) - !endif - - call overwrite_with_nest_init_values("soil_type", mn_static%soil_type_grid, mn_static%nest_soil_type_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("land_frac", mn_static%land_frac_grid, mn_static%nest_land_frac_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("deep_soil_temp", mn_static%deep_soil_temp_grid, mn_static%nest_deep_soil_temp_grid, x_refine, ioffset, joffset) - - - !! TODO investigate reading high-resolution veg_frac and veg_greenness - !call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "", mn_static%veg_frac_grid) - - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "vegetation_type", "vegetation_type", mn_static%veg_type_grid, parent_tile) - ! To match initialization behavior, set any -999s to 0 in veg_type - call mn_replace_low_values(mn_static%veg_type_grid, -100.0, 0.0) - - - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "slope_type", "slope_type", mn_static%slope_type_grid, parent_tile) - ! To match initialization behavior, set any -999s to 0 in slope_type - call mn_replace_low_values(mn_static%slope_type_grid, -100.0, 0.0) - - - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "maximum_snow_albedo", "maximum_snow_albedo", mn_static%max_snow_alb_grid, parent_tile) - ! Set any -999s to 0.5 - call mn_replace_low_values(mn_static%max_snow_alb_grid, -100.0, 0.5) - - ! Albedo fraction -- read and calculate - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "facsf", "facsf", mn_static%facsf_grid, parent_tile) - - allocate(mn_static%facwf_grid(lbound(mn_static%facsf_grid,1):ubound(mn_static%facsf_grid,1),lbound(mn_static%facsf_grid,2):ubound(mn_static%facsf_grid,2))) - - ! For land points, set facwf = 1.0 - facsf - ! To match initialization behavior, set any -999s to 0 - do i=lbound(mn_static%facsf_grid,1),ubound(mn_static%facsf_grid,1) - do j=lbound(mn_static%facsf_grid,2),ubound(mn_static%facsf_grid,2) - if (mn_static%facsf_grid(i,j) .lt. -100) then - mn_static%facsf_grid(i,j) = 0 - mn_static%facwf_grid(i,j) = 0 - else - mn_static%facwf_grid(i,j) = 1.0 - mn_static%facsf_grid(i,j) - endif - enddo - enddo - - ! Additional albedo variables - ! black sky = strong cosz -- direct sunlight - ! white sky = weak cosz -- diffuse light + ! Read in full panel fix data + call mn_static_read_fix(mn_static%fp_fix, Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), parent_tile, month) + ! Read in nest fix data + call mn_static_read_fix(mn_static%nest_fix, Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", static_nest_num, month) - ! alvsf = visible strong cosz = visible_black_sky_albedo - ! alvwf = visible weak cosz = visible_white_sky_albedo - ! alnsf = near IR strong cosz = near_IR_black_sky_albedo - ! alnwf = near IR weak cosz = near_IR_white_sky_albedo + ! Overwrite fix data from nest initialization + call mn_static_overwrite_fix_from_nest(mn_static%fp_fix, mn_static%nest_fix, x_refine, ioffset, joffset) - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "snowfree_albedo", "visible_black_sky_albedo", mn_static%alvsf_grid, parent_tile, time=month) - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "snowfree_albedo", "visible_white_sky_albedo", mn_static%alvwf_grid, parent_tile, time=month) - - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "snowfree_albedo", "near_IR_black_sky_albedo", mn_static%alnsf_grid, parent_tile, time=month) - call mn_static_read_hires(Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), "snowfree_albedo", "near_IR_white_sky_albedo", mn_static%alnwf_grid, parent_tile, time=month) - - ! Set the -999s to small value of 0.06, matching initialization code in chgres - - call mn_replace_low_values(mn_static%alvsf_grid, -100.0, 0.06) - call mn_replace_low_values(mn_static%alvwf_grid, -100.0, 0.06) - call mn_replace_low_values(mn_static%alnsf_grid, -100.0, 0.06) - call mn_replace_low_values(mn_static%alnwf_grid, -100.0, 0.06) - - - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Read in static nest variables - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "vegetation_type", "vegetation_type", mn_static%nest_veg_type_grid, static_nest_num) - ! To match initialization behavior, set any -999s to 0 in veg_type - call mn_replace_low_values(mn_static%nest_veg_type_grid, -100.0, 0.0) - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "slope_type", "slope_type", mn_static%nest_slope_type_grid, static_nest_num) - ! To match initialization behavior, set any -999s to 0 in veg_type - call mn_replace_low_values(mn_static%nest_slope_type_grid, -100.0, 0.0) - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "maximum_snow_albedo", "maximum_snow_albedo", mn_static%nest_max_snow_alb_grid, static_nest_num) - ! Set any -999s to 0.5 - call mn_replace_low_values(mn_static%nest_max_snow_alb_grid, -100.0, 0.5) - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "facsf", "facsf", mn_static%nest_facsf_grid, static_nest_num) - - allocate(mn_static%nest_facwf_grid(lbound(mn_static%nest_facsf_grid,1):ubound(mn_static%nest_facsf_grid,1),lbound(mn_static%nest_facsf_grid,2):ubound(mn_static%nest_facsf_grid,2))) - - ! For land points, set facwf = 1.0 - facsf - ! To match initialization behavior, set any -999s to 0 - do i=lbound(mn_static%nest_facsf_grid,1),ubound(mn_static%nest_facsf_grid,1) - do j=lbound(mn_static%nest_facsf_grid,2),ubound(mn_static%nest_facsf_grid,2) - if (mn_static%nest_facsf_grid(i,j) .lt. -100) then - mn_static%nest_facsf_grid(i,j) = 0 - mn_static%nest_facwf_grid(i,j) = 0 - else - mn_static%nest_facwf_grid(i,j) = 1.0 - mn_static%nest_facsf_grid(i,j) - endif - enddo - enddo - - - call overwrite_with_nest_init_values("veg_type", mn_static%veg_type_grid, mn_static%nest_veg_type_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("slope_type", mn_static%slope_type_grid, mn_static%nest_slope_type_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("max_snow_alb", mn_static%max_snow_alb_grid, mn_static%nest_max_snow_alb_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("facsf", mn_static%facsf_grid, mn_static%nest_facsf_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("facwf", mn_static%facwf_grid, mn_static%nest_facwf_grid, x_refine, ioffset, joffset) - - - - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "snowfree_albedo", "visible_black_sky_albedo", mn_static%nest_alvsf_grid, static_nest_num) - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "snowfree_albedo", "visible_white_sky_albedo", mn_static%nest_alvwf_grid, static_nest_num) - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "snowfree_albedo", "near_IR_black_sky_albedo", mn_static%nest_alnsf_grid, static_nest_num) - call mn_static_read_hires(Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", "snowfree_albedo", "near_IR_black_sky_albedo", mn_static%nest_alnwf_grid, static_nest_num) - ! Set the -999s to small value of 0.06, matching initialization code in chgres - - call mn_replace_low_values(mn_static%nest_alvsf_grid, -100.0, 0.06) - call mn_replace_low_values(mn_static%nest_alvwf_grid, -100.0, 0.06) - call mn_replace_low_values(mn_static%nest_alnsf_grid, -100.0, 0.06) - call mn_replace_low_values(mn_static%nest_alnwf_grid, -100.0, 0.06) - - - call overwrite_with_nest_init_values("alvsf", mn_static%alvsf_grid, mn_static%nest_alvsf_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("alvwf", mn_static%alvwf_grid, mn_static%nest_alvwf_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("alnsf", mn_static%alnsf_grid, mn_static%nest_alnsf_grid, x_refine, ioffset, joffset) - call overwrite_with_nest_init_values("alnwf", mn_static%alnwf_grid, mn_static%nest_alnwf_grid, x_refine, ioffset, joffset) + ! The nest static grids are only used for this step; can safely deallocate them now. + call deallocate_land_mask_grids(mn_static%nest_ls) + call deallocate_fix_grids(mn_static%nest_fix) endif @@ -1490,21 +1230,21 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, select case(Moving_nest(n)%mn_flag%terrain_smoother) case (0) ! High-resolution terrain for entire nest - Atm(n)%phis(isd:ied, jsd:jed) = mn_static%orog_grid((ioffset-1)*x_refine+isd:(ioffset-1)*x_refine+ied, (joffset-1)*y_refine+jsd:(joffset-1)*y_refine+jed) * grav + Atm(n)%phis(isd:ied, jsd:jed) = mn_static%fp_ls%orog_grid((ioffset-1)*x_refine+isd:(ioffset-1)*x_refine+ied, (joffset-1)*y_refine+jsd:(joffset-1)*y_refine+jed) * grav case (1) ! Static nest smoothing algorithm - interpolation of coarse terrain in halo zone and 5 point blending zone of coarse and fine data - call set_blended_terrain(Atm(n), mn_static%parent_orog_grid, mn_static%orog_grid, x_refine, Atm(n)%bd%ng, 5, a_step) + call set_blended_terrain(Atm(n), mn_static%parent_ls%orog_grid, mn_static%fp_ls%orog_grid, x_refine, Atm(n)%bd%ng, 5, a_step) case (2) ! Static nest smoothing algorithm - interpolation of coarse terrain in halo zone and 5 point blending zone of coarse and fine data - call set_blended_terrain(Atm(n), mn_static%parent_orog_grid, mn_static%orog_grid, x_refine, Atm(n)%bd%ng, 10, a_step) + call set_blended_terrain(Atm(n), mn_static%parent_ls%orog_grid, mn_static%fp_ls%orog_grid, x_refine, Atm(n)%bd%ng, 10, a_step) case (4) ! Use coarse terrain; no-op here. ; case (5) ! 5 pt smoother. blend zone of 5 to match static nest - call set_smooth_nest_terrain(Atm(n), mn_static%orog_grid, x_refine, 5, Atm(n)%bd%ng, 5) + call set_smooth_nest_terrain(Atm(n), mn_static%fp_ls%orog_grid, x_refine, 5, Atm(n)%bd%ng, 5) case (9) ! 9 pt smoother. blend zone of 5 to match static nest - call set_smooth_nest_terrain(Atm(n), mn_static%orog_grid, x_refine, 9, Atm(n)%bd%ng, 5) + call set_smooth_nest_terrain(Atm(n), mn_static%fp_ls%orog_grid, x_refine, 9, Atm(n)%bd%ng, 5) case default write (errstring, "(I0)") Moving_nest(n)%mn_flag%terrain_smoother call mpp_error(FATAL,'Invalid terrain_smoother in fv_moving_nest_main '//errstring) @@ -1522,8 +1262,8 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, !real, _ALLOCATABLE :: oro(:,:) _NULL !< land fraction (1: all land; 0: all water) !real, _ALLOCATABLE :: sgh(:,:) _NULL !< Terrain standard deviation - Atm(n)%oro(isc:iec, jsc:jec) = mn_static%land_frac_grid((ioffset-1)*x_refine+isc:(ioffset-1)*x_refine+iec, (joffset-1)*y_refine+jsc:(joffset-1)*y_refine+jec) - Atm(n)%sgh(isc:iec, jsc:jec) = mn_static%orog_std_grid((ioffset-1)*x_refine+isc:(ioffset-1)*x_refine+iec, (joffset-1)*y_refine+jsc:(joffset-1)*y_refine+jec) + Atm(n)%oro(isc:iec, jsc:jec) = mn_static%fp_ls%land_frac_grid((ioffset-1)*x_refine+isc:(ioffset-1)*x_refine+iec, (joffset-1)*y_refine+jsc:(joffset-1)*y_refine+jec) + Atm(n)%sgh(isc:iec, jsc:jec) = mn_static%fp_ls%orog_std_grid((ioffset-1)*x_refine+isc:(ioffset-1)*x_refine+iec, (joffset-1)*y_refine+jsc:(joffset-1)*y_refine+jec) endif call mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffset, joffset, x_refine) @@ -1616,7 +1356,7 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, ! This is normally a negative number if (Moving_nest(n)%mn_phys%snowxy(i,j) .lt. -9.0 .or. Moving_nest(n)%mn_phys%snowxy(i,j) .gt. 9.0 ) then print '("[INFO] WDR NOAHMP reset negative values npe=",I0," i=",I0," j=",I0," snowxy=",E12.5," alboldoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowxy(i,j), Moving_nest(n)%mn_phys%alboldxy(i,j) - print '("[INFO] WDR NOAHMP reset snowxy npe=",I0," i=",I0," j=",I0," land_frac=",E19.12," nint(land_frac)=",I0)', mpp_pe(), i, j, mn_static%land_frac_grid((ioffset-1)*x_refine+i, (joffset-1)*y_refine+j), nint(mn_static%land_frac_grid((ioffset-1)*x_refine+i, (joffset-1)*y_refine+j)) + print '("[INFO] WDR NOAHMP reset snowxy npe=",I0," i=",I0," j=",I0," land_frac=",E19.12," nint(land_frac)=",I0)', mpp_pe(), i, j, mn_static%fp_ls%land_frac_grid((ioffset-1)*x_refine+i, (joffset-1)*y_refine+j), nint(mn_static%fp_ls%land_frac_grid((ioffset-1)*x_refine+i, (joffset-1)*y_refine+j)) do k=lbound(Moving_nest(n)%mn_phys%hprime,3),ubound(Moving_nest(n)%mn_phys%hprime,3) @@ -1808,19 +1548,4 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, end subroutine fv_moving_nest_exec - !>@brief The subroutine 'mn_replace_low_values' replaces low values with a default value. - subroutine mn_replace_low_values(data_grid, low_value, new_value) - real, _ALLOCATABLE, intent(inout) :: data_grid(:,:) !< 2D grid of data - real, intent(in) :: low_value !< Low value to check for; e.g. negative or fill value - real, intent(in) :: new_value !< Value to replace low value with - - integer :: i, j - - do i=lbound(data_grid,1),ubound(data_grid,1) - do j=lbound(data_grid,2),ubound(data_grid,2) - if (data_grid(i,j) .le. low_value) data_grid(i,j) = new_value - enddo - enddo - end subroutine mn_replace_low_values - end module fv_moving_nest_main_mod diff --git a/moving_nest/fv_moving_nest_physics.F90 b/moving_nest/fv_moving_nest_physics.F90 index 34e4514a5a..ccb4c4b03c 100644 --- a/moving_nest/fv_moving_nest_physics.F90 +++ b/moving_nest/fv_moving_nest_physics.F90 @@ -140,7 +140,7 @@ subroutine mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, refine) i_idx = (ioffset-1)*refine + i_pe j_idx = (joffset-1)*refine + j_pe - Moving_nest(n)%mn_phys%slmsk(i_pe, j_pe) = mn_static%ls_mask_grid(i_idx, j_idx) + Moving_nest(n)%mn_phys%slmsk(i_pe, j_pe) = mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) enddo enddo end subroutine mn_phys_set_slmsk @@ -176,12 +176,12 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffs j_idx = (joffset-1)*refine + j_pe ! Reset the land sea mask from the hires parent data - IPD_data(nb)%Sfcprop%slmsk(ix) = mn_static%ls_mask_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%slmsk(ix) = mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) ! IFD values are 0 for land, and 1 for oceans/lakes -- reverse of the land sea mask ! Land Sea Mask has values of 0 for oceans/lakes, 1 for land, 2 for sea ice ! TODO figure out what ifd should be for sea ice - if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 ) then + if (mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) .eq. 1 ) then if (move_nsst) IPD_data(nb)%Sfcprop%ifd(ix) = 0 ! Land IPD_data(nb)%Sfcprop%oceanfrac(ix) = 0 ! Land -- TODO permit fractions IPD_data(nb)%Sfcprop%landfrac(ix) = 1 ! Land -- TODO permit fractions @@ -191,7 +191,7 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffs IPD_data(nb)%Sfcprop%landfrac(ix) = 0 ! Ocean -- TODO permit fractions endif - IPD_data(nb)%Sfcprop%tg3(ix) = mn_static%deep_soil_temp_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%tg3(ix) = mn_static%fp_fix%deep_soil_temp_grid(i_idx, j_idx) ! Follow logic from FV3/io/FV3GFS_io.F90 line 1187 ! TODO this will need to be more complicated if we support frac_grid @@ -200,7 +200,7 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffs !if ( (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%land_frac_grid(i_idx, j_idx)) == 0) .or. & ! mn_static%soil_type_grid(i_idx, j_idx) < 0.5) then - if (mn_static%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%land_frac_grid(i_idx, j_idx)) == 0 ) then + if (mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(mn_static%fp_ls%land_frac_grid(i_idx, j_idx)) == 0 ) then ! Water soil type == lake, etc. -- override the other variables and make this water !!print '("mn_phys_reset_sfc_props LAKE SOIL npe=",I0," x,y=",I0,",",I0," lat=",F10.3," lon=",F10.3)', mpp_pe(), i_idx, j_idx, IPD_data(nb)%Grid%xlat_d(ix), IPD_data(nb)%Grid%xlon_d(ix)-360.0 @@ -211,21 +211,21 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, IPD_data, ioffs IPD_data(nb)%Sfcprop%stype(ix) = 0 IPD_data(nb)%Sfcprop%slmsk(ix) = 0 else - IPD_data(nb)%Sfcprop%stype(ix) = nint(mn_static%soil_type_grid(i_idx, j_idx)) + IPD_data(nb)%Sfcprop%stype(ix) = nint(mn_static%fp_ls%soil_type_grid(i_idx, j_idx)) endif !IPD_data(nb)%Sfcprop%vfrac(ix) = mn_static%veg_frac_grid(i_idx, j_idx) - IPD_data(nb)%Sfcprop%vtype(ix) = nint(mn_static%veg_type_grid(i_idx, j_idx)) - IPD_data(nb)%Sfcprop%slope(ix) = nint(mn_static%slope_type_grid(i_idx, j_idx)) - IPD_data(nb)%Sfcprop%snoalb(ix) = mn_static%max_snow_alb_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%vtype(ix) = nint(mn_static%fp_fix%veg_type_grid(i_idx, j_idx)) + IPD_data(nb)%Sfcprop%slope(ix) = nint(mn_static%fp_fix%slope_type_grid(i_idx, j_idx)) + IPD_data(nb)%Sfcprop%snoalb(ix) = mn_static%fp_fix%max_snow_alb_grid(i_idx, j_idx) - IPD_data(nb)%Sfcprop%facsf(ix) = mn_static%facsf_grid(i_idx, j_idx) - IPD_data(nb)%Sfcprop%facwf(ix) = mn_static%facwf_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%facsf(ix) = mn_static%fp_fix%facsf_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%facwf(ix) = mn_static%fp_fix%facwf_grid(i_idx, j_idx) - IPD_data(nb)%Sfcprop%alvsf(ix) = mn_static%alvsf_grid(i_idx, j_idx) - IPD_data(nb)%Sfcprop%alvwf(ix) = mn_static%alvwf_grid(i_idx, j_idx) - IPD_data(nb)%Sfcprop%alnsf(ix) = mn_static%alnsf_grid(i_idx, j_idx) - IPD_data(nb)%Sfcprop%alnwf(ix) = mn_static%alnwf_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%alvsf(ix) = mn_static%fp_fix%alvsf_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%alvwf(ix) = mn_static%fp_fix%alvwf_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%alnsf(ix) = mn_static%fp_fix%alnsf_grid(i_idx, j_idx) + IPD_data(nb)%Sfcprop%alnwf(ix) = mn_static%fp_fix%alnwf_grid(i_idx, j_idx) ! Reset the orography in the physics arrays, using the smoothed values from above phys_oro = Atm(n)%phis(i_pe, j_pe) / grav @@ -900,17 +900,17 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st call fill_nest_halos_from_parent_masked("smc", mn_phys%smc, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.3D0) + is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.3D0) ! Defaults - use surface temperature to set soil temperature at each level call fill_nest_halos_from_parent_masked("stc", mn_phys%stc, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, mn_phys%ts) + is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, mn_phys%ts) ! Default - Arbitrary value 0.3 call fill_nest_halos_from_parent_masked("slc", mn_phys%slc, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.3D0) + is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.3D0) call fill_nest_halos_from_parent("phy_f2d", mn_phys%phy_f2d, interp_type, Atm(child_grid_num)%neststruct%wt_h, & @@ -936,17 +936,17 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st call fill_nest_halos_from_parent_masked("emis_lnd", mn_phys%emis_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.5D0) call fill_nest_halos_from_parent_masked("emis_ice", mn_phys%emis_ice, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_SEAICE, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_SEAICE, 0.5D0) call fill_nest_halos_from_parent_masked("emis_wat", mn_phys%emis_wat, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_WATER, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_WATER, 0.5D0) !call fill_nest_halos_from_parent("sfalb_lnd_bck", mn_phys%sfalb_lnd_bck, interp_type, Atm(child_grid_num)%neststruct%wt_h, & ! Atm(child_grid_num)%neststruct%ind_h, & @@ -1005,10 +1005,10 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st ! is_fine_pe, nest_domain, position) call fill_nest_halos_from_parent_masked("canopy", mn_phys%canopy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) call fill_nest_halos_from_parent_masked("vegfrac", mn_phys%vegfrac, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.50D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.50D0) @@ -1032,15 +1032,15 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st call fill_nest_halos_from_parent_masked("zorll", mn_phys%zorll, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, 1, 86.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, 1, 86.0D0) call fill_nest_halos_from_parent_masked("zorlwav", mn_phys%zorlwav, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, 0, 77.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, 0, 77.0D0) call fill_nest_halos_from_parent_masked("zorlw", mn_phys%zorlw, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, 0, 78.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, 0, 78.0D0) call fill_nest_halos_from_parent("tsfco", mn_phys%tsfco, interp_type, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & @@ -1058,19 +1058,19 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st call fill_nest_halos_from_parent_masked("albdirvis_lnd", mn_phys%albdirvis_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.5D0) call fill_nest_halos_from_parent_masked("albdirnir_lnd", mn_phys%albdirnir_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.5D0) call fill_nest_halos_from_parent_masked("albdifvis_lnd", mn_phys%albdifvis_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.5D0) call fill_nest_halos_from_parent_masked("albdifnir_lnd", mn_phys%albdifnir_lnd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.5D0) @@ -1172,168 +1172,168 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st ! Default changed to 10 based on suggestion from Mike Barlage; more middle of the spectrum value. call fill_nest_halos_from_parent_masked("soilcol", mn_phys%soilcolor, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 10.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 10.0D0) call fill_nest_halos_from_parent_masked("snowxy", mn_phys%snowxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) call fill_nest_halos_from_parent_masked("tvxy", mn_phys%tvxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, mn_phys%ts) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, mn_phys%ts) call fill_nest_halos_from_parent_masked("tgxy", mn_phys%tgxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, mn_phys%ts) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, mn_phys%ts) call fill_nest_halos_from_parent_masked("canicexy", mn_phys%canicexy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) call fill_nest_halos_from_parent_masked("canliqxy", mn_phys%canliqxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) call fill_nest_halos_from_parent_masked("eahxy", mn_phys%eahxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 2000.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 2000.0D0) call fill_nest_halos_from_parent_masked("tahxy", mn_phys%tahxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, mn_phys%ts) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, mn_phys%ts) ! TODO get realistic default value here -- bulk momentum drag coefficient call fill_nest_halos_from_parent_masked("cmxy", mn_phys%cmxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 2.4D-3) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 2.4D-3) ! TODO get realistic default value here -- bulk sensible heat drag coefficient call fill_nest_halos_from_parent_masked("chxy", mn_phys%chxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 2.4D-3) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 2.4D-3) ! wetted or snowed fraction of the canopy call fill_nest_halos_from_parent_masked("fwetxy", mn_phys%fwetxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! snow mass at last time step[mm h2o] call fill_nest_halos_from_parent_masked("sneqvoxy", mn_phys%sneqvoxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! Albedo assuming deep snow on prev timestep - default to 0.65 call fill_nest_halos_from_parent_masked("alboldxy", mn_phys%alboldxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.65D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.65D0) ! Liquid equivalent snow - default to 0 call fill_nest_halos_from_parent_masked("qsnowxy", mn_phys%qsnowxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! Lake water storage [mm] -- TODO find better default call fill_nest_halos_from_parent_masked("wslakexy", mn_phys%wslakexy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! Water table depth - set to 2.5, cold start value call fill_nest_halos_from_parent_masked("zwtxy", mn_phys%zwtxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 2.5D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 2.5D0) ! Water storage in aquifer - set to 4900.0, cold start value call fill_nest_halos_from_parent_masked("waxy", mn_phys%waxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 4900.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 4900.0D0) ! Water storage in aquifer and saturated soil - set to 4900.0, cold start value call fill_nest_halos_from_parent_masked("wtxy", mn_phys%wtxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 4900.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 4900.0D0) ! Leaf mass [g/m2] -- TODO find better default call fill_nest_halos_from_parent_masked("lfmassxy", mn_phys%lfmassxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! Fine root mass [g/m2] -- TODO find better default call fill_nest_halos_from_parent_masked("rtmassxy", mn_phys%rtmassxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! Stem mass [g/m2] -- TODO find better default call fill_nest_halos_from_parent_masked("stmassxy", mn_phys%stmassxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! Wood mass [g/m2] -- TODO find better default call fill_nest_halos_from_parent_masked("woodxy", mn_phys%woodxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! stable carbon in deep soil [g/m2] -- TODO find a better default call fill_nest_halos_from_parent_masked("stblcpxy", mn_phys%stblcpxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! short-lived carbon, shallow soil [g/m2] -- TODO find a better default call fill_nest_halos_from_parent_masked("fastcpxy", mn_phys%fastcpxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! stem area index [m2/m2] -- TODO find a better default call fill_nest_halos_from_parent_masked("xsaixy", mn_phys%xsaixy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! leaf area index [m2/m2] -- TODO find a better default call fill_nest_halos_from_parent_masked("xlaixy", mn_phys%xlaixy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! snow age factor [-] -- TODO find a better default call fill_nest_halos_from_parent_masked("taussxy", mn_phys%taussxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! soil moisture content in the layer to the water table when deep -- TODO find a better default call fill_nest_halos_from_parent_masked("smcwtdxy", mn_phys%smcwtdxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! recharge to the water table when deep -- TODO find a better default call fill_nest_halos_from_parent_masked("deeprechxy", mn_phys%deeprechxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! recharge to the water table -- TODO find a better default call fill_nest_halos_from_parent_masked("rechxy", mn_phys%rechxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) call fill_nest_halos_from_parent_masked("snicexy", mn_phys%snicexy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound, & - mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) call fill_nest_halos_from_parent_masked("snliqxy", mn_phys%snliqxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound, & - mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! surface snow thickness water equivalent over land - - default to 0 call fill_nest_halos_from_parent_masked("snowd", mn_phys%snowd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! Temperature in surface snow -- TODO notes say default to 0, but I will put 273.15K call fill_nest_halos_from_parent_masked("tsnoxy", mn_phys%tsnoxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound, & - !mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 273.15D0) - mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + !mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 273.15D0) + mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) ! water equivalent accumulated snow depth over land - - default to 0 call fill_nest_halos_from_parent_masked("weasd", mn_phys%weasd, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & - is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, 0.0D0) + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) call fill_nest_halos_from_parent_masked("zsnsoxy", mn_phys%zsnsoxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsoil, & - mn_phys%slmsk, mn_static%parent_ls_mask_grid, M_LAND, zsns_default) + mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, zsns_default) endif diff --git a/moving_nest/fv_moving_nest_types.F90 b/moving_nest/fv_moving_nest_types.F90 index fee0726210..db4fc7e7f3 100644 --- a/moving_nest/fv_moving_nest_types.F90 +++ b/moving_nest/fv_moving_nest_types.F90 @@ -76,38 +76,30 @@ module fv_moving_nest_types_mod real, _ALLOCATABLE :: delz(:,:,:) _NULL !< layer thickness (meters) end type fv_moving_nest_prog_type - ! TODO deallocate these at end of model run. They are only allocated once, at first nest move, inside mn_static_read_hires(). - ! Note these are only 32 bits for now; matching the precision of the input netCDF files - ! though the model generally handles physics variables with 64 bit precision - type mn_surface_grids + + type mn_land_mask_grids real, allocatable :: orog_grid(:,:) _NULL ! orography -- raw or filtered depending on namelist option, in meters real, allocatable :: orog_std_grid(:,:) _NULL ! terrain standard deviation for gravity wave drag, in meters (?) real, allocatable :: ls_mask_grid(:,:) _NULL ! land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + real, allocatable :: soil_type_grid(:,:) _NULL ! STATSGO soil type ! Land frac needs to be kind_phys because CCPP defines it that way. Can have rounding mismatches around 0.5 if types don't match. - real, allocatable :: parent_ls_mask_grid(:,:) _NULL ! Coarse parent land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. - real(kind=kind_phys), allocatable :: parent_land_frac_grid(:,:) _NULL ! Coarse parent land fraction grid; figure out where lakes are located real(kind=kind_phys), allocatable :: land_frac_grid(:,:) _NULL ! Continuous land fraction - 0.0 ocean, 0.5 half of each, 1.0 all land - real, allocatable :: parent_orog_grid(:,:) _NULL ! parent orography -- only used for terrain_smoother=1. ! raw or filtered depending on namelist option,in meters - - real(kind=kind_phys), allocatable :: geolat_grid(:,:) _NULL real(kind=kind_phys), allocatable :: geolon_grid(:,:) _NULL - real(kind=kind_phys), allocatable :: nest_geolat_grid(:,:) _NULL - real(kind=kind_phys), allocatable :: nest_geolon_grid(:,:) _NULL - + end type mn_land_mask_grids + type mn_fix_grids ! Soil variables real, allocatable :: deep_soil_temp_grid(:,:) _NULL ! deep soil temperature at 5m, in degrees K - real, allocatable :: soil_type_grid(:,:) _NULL ! STATSGO soil type - real, allocatable :: parent_soil_type_grid(:,:) _NULL ! STATSGO soil type ! Vegetation variables real, allocatable :: veg_frac_grid(:,:) _NULL ! vegetation fraction real, allocatable :: veg_type_grid(:,:) _NULL ! IGBP vegetation type - real, allocatable :: veg_greenness_grid(:,:) _NULL ! NESDIS vegetation greenness; netCDF file has monthly values + ! TODO do we need veg_greenness? + !real, allocatable :: veg_greenness_grid(:,:) _NULL ! NESDIS vegetation greenness; netCDF file has monthly values ! Orography variables real, allocatable :: slope_type_grid(:,:) _NULL ! legacy 1 degree GFS slope type @@ -130,37 +122,22 @@ module fv_moving_nest_types_mod real, allocatable :: alvwf_grid(:,:) _NULL ! Visible white sky albedo; netCDF file has monthly values real, allocatable :: alnsf_grid(:,:) _NULL ! Near IR black sky albedo; netCDF file has monthly values real, allocatable :: alnwf_grid(:,:) _NULL ! Near IR white sky albedo; netCDF file has monthly values + end type mn_fix_grids - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Nest variables - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - real, allocatable :: nest_ls_mask_grid(:,:) _NULL ! land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. - real(kind=kind_phys), allocatable :: nest_land_frac_grid(:,:) _NULL ! Continuous land fraction - 0.0 ocean, 0.5 half of each, 1.0 all land - - ! Soil variables - real, allocatable :: nest_deep_soil_temp_grid(:,:) _NULL ! deep soil temperature at 5m, in degrees K - real, allocatable :: nest_soil_type_grid(:,:) _NULL ! STATSGO soil type - real, allocatable :: nest_parent_soil_type_grid(:,:) _NULL ! STATSGO soil type - ! Vegetation variables - real, allocatable :: nest_veg_frac_grid(:,:) _NULL ! vegetation fraction - real, allocatable :: nest_veg_type_grid(:,:) _NULL ! IGBP vegetation type - real, allocatable :: nest_veg_greenness_grid(:,:) _NULL ! NESDIS vegetation greenness; netCDF file has monthly values - ! Orography variables - real, allocatable :: nest_slope_type_grid(:,:) _NULL ! legacy 1 degree GFS slope type + ! TODO deallocate these at end of model run. They are only allocated once, at first nest move, inside mn_static_read_hires(). + ! Note these are only 32 bits for now; matching the precision of the input netCDF files + ! though the model generally handles physics variables with 64 bit precision + type mn_surface_grids - ! Albedo variables - real, allocatable :: nest_max_snow_alb_grid(:,:) _NULL ! max snow albedo - real, allocatable :: nest_facsf_grid(:,:) _NULL ! fractional coverage with strong cosz dependency - real, allocatable :: nest_facwf_grid(:,:) _NULL ! fractional coverage with weak cosz dependency + type(mn_land_mask_grids) :: parent_ls + type(mn_land_mask_grids) :: fp_ls + type(mn_land_mask_grids) :: nest_ls - ! Snow free albedo - real, allocatable :: nest_alvsf_grid(:,:) _NULL ! Visible black sky albedo; netCDF file has monthly values - real, allocatable :: nest_alvwf_grid(:,:) _NULL ! Visible white sky albedo; netCDF file has monthly values - real, allocatable :: nest_alnsf_grid(:,:) _NULL ! Near IR black sky albedo; netCDF file has monthly values - real, allocatable :: nest_alnwf_grid(:,:) _NULL ! Near IR white sky albedo; netCDF file has monthly values + ! type(mn_fix_grids) :: parent_fix ! Not needed at present + type(mn_fix_grids) :: fp_fix + type(mn_fix_grids) :: nest_fix end type mn_surface_grids @@ -249,7 +226,7 @@ module fv_moving_nest_types_mod real (kind=kind_phys), _ALLOCATABLE :: dt_cool (:,:) _NULL !< sub-layer cooling amount for NSSTM real (kind=kind_phys), _ALLOCATABLE :: qrain (:,:) _NULL !< sensible heat flux due to rainfall for NSSTM - ! NOAH MP LSM Variables + ! NOAH MP LSM Variables real (kind=kind_phys), _ALLOCATABLE :: soilcolor (:,:) _NULL !< soil color real (kind=kind_phys), _ALLOCATABLE :: snowxy (:,:) _NULL !< number of snow layers real (kind=kind_phys), _ALLOCATABLE :: tvxy (:,:) _NULL !< canopy temperature @@ -325,6 +302,12 @@ module fv_moving_nest_types_mod type(fv_moving_nest_type), _ALLOCATABLE, target :: Moving_nest(:) + interface mn_overwrite_with_nest_init_values + module procedure mn_overwrite_with_nest_init_values_r4 + module procedure mn_overwrite_with_nest_init_values_r8 + end interface mn_overwrite_with_nest_init_values + + contains subroutine fv_moving_nest_init(Atm, this_grid) @@ -414,6 +397,169 @@ subroutine deallocate_fv_moving_nest(n) end subroutine deallocate_fv_moving_nest + subroutine mn_apply_lakes(land_mask_grids) + type(mn_land_mask_grids), intent(inout) :: land_mask_grids + + integer :: i_idx, j_idx + + ! Alter hires full panel ls_mask_grid to set lakes to water(sea) values + do i_idx = lbound(land_mask_grids%ls_mask_grid,1), ubound(land_mask_grids%ls_mask_grid,1) + do j_idx = lbound(land_mask_grids%ls_mask_grid,1), ubound(land_mask_grids%ls_mask_grid,2) + !if (land_mask_grids%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(land_mask_grids%land_frac_grid(i_idx, j_idx)) == 0 ) then + !!if (land_mask_grids%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. land_mask_grids%land_frac_grid(i_idx, j_idx) .lt. 0.999 ) then + + ! Use epsilon of 1.0e-6 on land_frac_grid, based on CCPP code in physics/physics/gcycle.F90 + ! Fixes a bug where land mask changes with first nest move if land_frac_grid = 0.5000 + ! TODO test wrapping these reals with int() or nint() + if (land_mask_grids%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. nint(land_mask_grids%land_frac_grid(i_idx, j_idx)-1.0e-6_kind_phys) .eq. 0 ) then + land_mask_grids%ls_mask_grid(i_idx, j_idx) = 0 + endif + ! Soil type adjustments from io/fv3atm_sfc_io.F90 + if (land_mask_grids%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. int(land_mask_grids%soil_type_grid(i_idx, j_idx)) .eq. 14 ) then + land_mask_grids%ls_mask_grid(i_idx, j_idx) = 0 + endif + if (land_mask_grids%ls_mask_grid(i_idx, j_idx) .eq. 1 .and. land_mask_grids%soil_type_grid(i_idx, j_idx) .lt. 0.8 ) then + land_mask_grids%ls_mask_grid(i_idx, j_idx) = 0 + endif + enddo + enddo + + end subroutine mn_apply_lakes + + subroutine mn_overwrite_with_nest_init_values_r8(tag, var_grid, nest_var_grid, refine, ioffset, joffset) + character(len=*) :: tag + real*8, allocatable, intent(inout) :: var_grid(:,:) + real*8, allocatable, intent(in) :: nest_var_grid(:,:) + + integer, intent(in) :: refine, ioffset, joffset + integer :: i,j, this_pe + + ! this_pe = mpp_pe() + + do i = lbound(nest_var_grid,1), ubound(nest_var_grid,1) + do j = lbound(nest_var_grid,2), ubound(nest_var_grid,2) + var_grid((ioffset-1)*refine+i, (joffset-1)*refine+j) = nest_var_grid(i,j) + enddo + enddo + + end subroutine mn_overwrite_with_nest_init_values_r8 + + subroutine mn_overwrite_with_nest_init_values_r4(tag, var_grid, nest_var_grid, refine, ioffset, joffset) + character(len=*) :: tag + real*4, allocatable, intent(inout) :: var_grid(:,:) + real*4, allocatable, intent(in) :: nest_var_grid(:,:) + + integer, intent(in) :: refine, ioffset, joffset + integer :: i,j, this_pe + + ! this_pe = mpp_pe() + + do i = lbound(nest_var_grid,1), ubound(nest_var_grid,1) + do j = lbound(nest_var_grid,2), ubound(nest_var_grid,2) + var_grid((ioffset-1)*refine+i, (joffset-1)*refine+j) = nest_var_grid(i,j) + enddo + enddo + + end subroutine mn_overwrite_with_nest_init_values_r4 + + subroutine deallocate_land_mask_grids(land_mask_grids) + type(mn_land_mask_grids), intent(inout) :: land_mask_grids + + if (allocated(land_mask_grids%orog_grid)) deallocate(land_mask_grids%orog_grid) + if (allocated(land_mask_grids%orog_std_grid)) deallocate(land_mask_grids%orog_std_grid) + if (allocated(land_mask_grids%ls_mask_grid)) deallocate(land_mask_grids%ls_mask_grid) + if (allocated(land_mask_grids%soil_type_grid)) deallocate(land_mask_grids%soil_type_grid) + if (allocated(land_mask_grids%land_frac_grid)) deallocate(land_mask_grids%land_frac_grid) + if (allocated(land_mask_grids%geolat_grid)) deallocate(land_mask_grids%geolat_grid) + if (allocated(land_mask_grids%geolon_grid)) deallocate(land_mask_grids%geolon_grid) + end subroutine deallocate_land_mask_grids + + + + subroutine alloc_set_facwf(fix_grids) + type(mn_fix_grids), intent(inout) :: fix_grids + + integer :: i,j + + allocate(fix_grids%facwf_grid(lbound(fix_grids%facsf_grid,1):ubound(fix_grids%facsf_grid,1),lbound(fix_grids%facsf_grid,2):ubound(fix_grids%facsf_grid,2))) + + ! For land points, set facwf = 1.0 - facsf + ! To match initialization behavior, set any -999s to 0 + do i=lbound(fix_grids%facsf_grid,1),ubound(fix_grids%facsf_grid,1) + do j=lbound(fix_grids%facsf_grid,2),ubound(fix_grids%facsf_grid,2) + if (fix_grids%facsf_grid(i,j) .lt. -100) then + fix_grids%facsf_grid(i,j) = 0 + fix_grids%facwf_grid(i,j) = 0 + else + fix_grids%facwf_grid(i,j) = 1.0 - fix_grids%facsf_grid(i,j) + endif + enddo + enddo + end subroutine alloc_set_facwf + + + + subroutine mn_static_overwrite_ls_from_nest(fp_ls, nest_ls, refine, ioffset, joffset) + type(mn_land_mask_grids), intent(inout) :: fp_ls + type(mn_land_mask_grids), intent(in) :: nest_ls + integer, intent(in) :: refine, ioffset, joffset + + ! Update full panel with nest init values (there are a few mismatches) + ! TODO maybe add orog_raw/orog_filt + call mn_overwrite_with_nest_init_values("ls_mask", fp_ls%ls_mask_grid, nest_ls%ls_mask_grid, refine, ioffset, joffset) + + !if (is_fine_pe) then + ! call validate_navigation_fields("INIT", Atm_block, IPD_control, IPD_data, parent_grid_num, child_grid_num) + !endif + + call mn_overwrite_with_nest_init_values("soil_type", fp_ls%soil_type_grid, nest_ls%soil_type_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("land_frac", fp_ls%land_frac_grid, nest_ls%land_frac_grid, refine, ioffset, joffset) + + end subroutine mn_static_overwrite_ls_from_nest + + subroutine mn_static_overwrite_fix_from_nest(fp_fix, nest_fix, refine, ioffset, joffset) + type(mn_fix_grids), intent(inout) :: fp_fix + type(mn_fix_grids), intent(in) :: nest_fix + integer, intent(in) :: refine, ioffset, joffset + + call mn_overwrite_with_nest_init_values("deep_soil_temp", fp_fix%deep_soil_temp_grid, nest_fix%deep_soil_temp_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("veg_type", fp_fix%veg_type_grid, nest_fix%veg_type_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("slope_type", fp_fix%slope_type_grid, nest_fix%slope_type_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("max_snow_alb", fp_fix%max_snow_alb_grid, nest_fix%max_snow_alb_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("facsf", fp_fix%facsf_grid, nest_fix%facsf_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("facwf", fp_fix%facwf_grid, nest_fix%facwf_grid, refine, ioffset, joffset) + + call mn_overwrite_with_nest_init_values("alvsf", fp_fix%alvsf_grid, nest_fix%alvsf_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("alvwf", fp_fix%alvwf_grid, nest_fix%alvwf_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("alnsf", fp_fix%alnsf_grid, nest_fix%alnsf_grid, refine, ioffset, joffset) + call mn_overwrite_with_nest_init_values("alnwf", fp_fix%alnwf_grid, nest_fix%alnwf_grid, refine, ioffset, joffset) + + end subroutine mn_static_overwrite_fix_from_nest + + subroutine deallocate_fix_grids(fix_grids) + type(mn_fix_grids), intent(inout) :: fix_grids + + if (allocated(fix_grids%deep_soil_temp_grid)) deallocate(fix_grids%deep_soil_temp_grid) + if (allocated(fix_grids%veg_frac_grid)) deallocate(fix_grids%veg_frac_grid) + if (allocated(fix_grids%veg_type_grid)) deallocate(fix_grids%veg_type_grid) + !if (allocated(fix_grids%veg_greenness_grid)) deallocate(fix_grids%veg_greenness_grid) + if (allocated(fix_grids%slope_type_grid)) deallocate(fix_grids%slope_type_grid) + if (allocated(fix_grids%max_snow_alb_grid)) deallocate(fix_grids%max_snow_alb_grid) + if (allocated(fix_grids%facsf_grid)) deallocate(fix_grids%facsf_grid) + if (allocated(fix_grids%facwf_grid)) deallocate(fix_grids%facwf_grid) + if (allocated(fix_grids%alvsf_grid)) deallocate(fix_grids%alvsf_grid) + if (allocated(fix_grids%alvwf_grid)) deallocate(fix_grids%alvwf_grid) + if (allocated(fix_grids%alnsf_grid)) deallocate(fix_grids%alnsf_grid) + if (allocated(fix_grids%alnwf_grid)) deallocate(fix_grids%alnwf_grid) + + end subroutine deallocate_fix_grids + + + + + + + subroutine allocate_fv_moving_nest_prog_type(isd, ied, jsd, jed, npz, mn_prog) integer, intent(in) :: isd, ied, jsd, jed, npz type(fv_moving_nest_prog_type), intent(inout) :: mn_prog @@ -790,7 +936,7 @@ subroutine deallocate_fv_moving_nest_physics_type(mn_phys) deallocate( mn_phys%qrain ) end if - ! NOAH MP LSM + ! NOAH MP LSM if (allocated(mn_phys%snowxy)) then deallocate ( mn_phys%soilcolor ) deallocate ( mn_phys%snowxy ) From a61935d5ef92a067e354b7433e6146a632808ec5 Mon Sep 17 00:00:00 2001 From: William Ramstrom Date: Fri, 22 Dec 2023 19:10:34 +0000 Subject: [PATCH 037/192] Removed trailing whitespace. --- moving_nest/fv_moving_nest.F90 | 12 +-- moving_nest/fv_moving_nest_main.F90 | 106 ++++++++++++------------- moving_nest/fv_moving_nest_physics.F90 | 2 +- moving_nest/fv_moving_nest_types.F90 | 14 ++-- moving_nest/fv_moving_nest_utils.F90 | 2 +- 5 files changed, 68 insertions(+), 68 deletions(-) diff --git a/moving_nest/fv_moving_nest.F90 b/moving_nest/fv_moving_nest.F90 index 3102b1952d..1c1288ca01 100644 --- a/moving_nest/fv_moving_nest.F90 +++ b/moving_nest/fv_moving_nest.F90 @@ -877,9 +877,9 @@ end subroutine mn_replace_low_values subroutine mn_static_read_ls(static_ls, npx, npy, refine, pelist, surface_dir, tile_num, terrain_smoother, filtered_terrain) type(mn_land_mask_grids), intent(inout) :: static_ls - integer, intent(in) :: npx, npy, refine, tile_num !< Number of x,y points and nest refinement, (parent) tile number - integer, allocatable, intent(in) :: pelist(:) !< PE list for fms2_io - character(len=*), intent(in) :: surface_dir !< Surface directory + integer, intent(in) :: npx, npy, refine, tile_num !< Number of x,y points and nest refinement, (parent) tile number + integer, allocatable, intent(in) :: pelist(:) !< PE list for fms2_io + character(len=*), intent(in) :: surface_dir !< Surface directory integer, intent(in) :: terrain_smoother logical, intent(in) :: filtered_terrain @@ -909,9 +909,9 @@ end subroutine mn_static_read_ls subroutine mn_static_read_fix(static_fix, npx, npy, refine, pelist, surface_dir, tile_num, month) type(mn_fix_grids), intent(inout) :: static_fix - integer, allocatable, intent(in) :: pelist(:) !< PE list for fms2_io - character(len=*), intent(in) :: surface_dir !< Surface directory - integer, intent(in) :: npx, npy, refine, tile_num, month !< Number of x,y points and nest refinement, (parent) tile number + integer, allocatable, intent(in) :: pelist(:) !< PE list for fms2_io + character(len=*), intent(in) :: surface_dir !< Surface directory + integer, intent(in) :: npx, npy, refine, tile_num, month !< Number of x,y points and nest refinement, (parent) tile number call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "substrate_temperature", "substrate_temperature", static_fix%deep_soil_temp_grid, tile_num) ! set any -999s to +4C diff --git a/moving_nest/fv_moving_nest_main.F90 b/moving_nest/fv_moving_nest_main.F90 index b7c5e92b6a..fd656a9a01 100644 --- a/moving_nest/fv_moving_nest_main.F90 +++ b/moving_nest/fv_moving_nest_main.F90 @@ -109,7 +109,7 @@ module fv_moving_nest_main_mod use fv_moving_nest_types_mod, only: mn_apply_lakes, mn_overwrite_with_nest_init_values, alloc_set_facwf use fv_moving_nest_types_mod, only: mn_static_overwrite_ls_from_nest, mn_static_overwrite_fix_from_nest use fv_moving_nest_types_mod, only: deallocate_land_mask_grids, deallocate_fix_grids - + ! Prognostic variable routines use fv_moving_nest_mod, only: mn_prog_fill_intern_nest_halos, mn_prog_fill_nest_halos_from_parent, & mn_prog_dump_to_netcdf, mn_prog_shift_data @@ -261,7 +261,7 @@ subroutine log_landsea_mask(Atm_block, IPD_control, IPD_data, time_step, parent_ type(IPD_data_type), intent(in) :: IPD_data(:) !< Physics variable data type(time_type), intent(in) :: time_step !< Current timestep integer, intent(in) :: parent_grid_num, child_grid_num - + character(len=160) :: line character(len=1) :: mask_char @@ -297,23 +297,23 @@ subroutine log_landsea_mask(Atm_block, IPD_control, IPD_data, time_step, parent_ endif enddo !print '("[INFO] WDR oro npe=",I0," time=",I0," i=",I0," ",A80)',this_pe,a_step,i,trim(line) - + enddo - - + + local_slmsk = 8 !print '("[INFO] WDR local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0," n=",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2), n - + do nb = 1,Atm_block%nblks blen = Atm_block%blksz(nb) do ix = 1, blen i_pe = Atm_block%index(nb)%ii(ix) j_pe = Atm_block%index(nb)%jj(ix) - + !print '("[INFO] WDR local_slmsk npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe - + local_slmsk(i_pe, j_pe) = IPD_data(nb)%Sfcprop%slmsk(ix) - + if (allocated(Moving_nest)) then if (allocated(Moving_nest(n)%mn_phys%slmsk)) then if (int(local_slmsk(i_pe,j_pe)) .ne. 8) then @@ -333,23 +333,23 @@ subroutine log_landsea_mask(Atm_block, IPD_control, IPD_data, time_step, parent_ endif enddo enddo - + print '("[INFO] WDR local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2) - + line = "" do j=lbound(local_slmsk,2), ubound(local_slmsk,2) write(num_char, "(I1)"), mod(j,10) line = trim(line) // trim(num_char) enddo print '("[INFO] WDR local_slmsk_lake npe=",I0," time=",I3," i=",I3," ",A60)',this_pe,a_step,-99,trim(line) - + do i=lbound(local_slmsk,1), ubound(local_slmsk,1) line = "" num_land = 0 num_water = 0 do j=lbound(local_slmsk,2), ubound(local_slmsk,2) - + if (local_slmsk(i,j) .eq. 1) then ! land line = trim(line) // "+" @@ -374,11 +374,11 @@ subroutine log_landsea_mask(Atm_block, IPD_control, IPD_data, time_step, parent_ print '("[INFO] WDR local_slmsk_lake npe=",I0," time=",I3," i=",I3," ",A60," ",I2," ",I2)',this_pe,a_step,i,trim(line), num_land, num_water enddo end subroutine log_landsea_mask - - + + subroutine validate_geo_coords(tag, geo_grid, nest_geo_grid, refine, ioffset, joffset) character(len=*) :: tag - real(kind=kind_phys), allocatable, intent(in) :: geo_grid(:,:) + real(kind=kind_phys), allocatable, intent(in) :: geo_grid(:,:) real(kind=kind_phys), allocatable, intent(in) :: nest_geo_grid(:,:) integer, intent(in) :: refine, ioffset, joffset @@ -395,7 +395,7 @@ subroutine validate_geo_coords(tag, geo_grid, nest_geo_grid, refine, ioffset, jo enddo enddo - + end subroutine validate_geo_coords @@ -407,7 +407,7 @@ subroutine validate_navigation_fields(tag, Atm_block, IPD_control, IPD_data, par type(IPD_data_type), intent(in) :: IPD_data(:) !< Physics variable data integer, intent(in) :: parent_grid_num, child_grid_num - + character(len=160) :: line character(len=1) :: mask_char character(len=1) :: num_char @@ -427,17 +427,17 @@ subroutine validate_navigation_fields(tag, Atm_block, IPD_control, IPD_data, par local_slmsk = 8 print '("[INFO] WDR VALIDATE local_slmsk size npe=",I0," i=",I0,"-",I0," j=",I0,"-",I0," n=",I0)', this_pe, lbound(local_slmsk,1), ubound(local_slmsk,1), lbound(local_slmsk,2), ubound(local_slmsk,2), n - + do nb = 1,Atm_block%nblks blen = Atm_block%blksz(nb) do ix = 1, blen i_pe = Atm_block%index(nb)%ii(ix) j_pe = Atm_block%index(nb)%jj(ix) - + !print '("[INFO] WDR local_slmsk npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe - + local_slmsk(i_pe, j_pe) = IPD_data(nb)%Sfcprop%slmsk(ix) - + if (allocated(Moving_nest)) then if (allocated(Moving_nest(n)%mn_phys%slmsk)) then !print '("[INFO] WDR VALIDATE local_slmsk npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe @@ -820,10 +820,10 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, this_pe = mpp_pe() ! Highest satellite observed skin temperatures on Earth are on the order of +70C/343K/+160F - ! Mildrexler, D. J., M. Zhao, and S. W. Running, 2011: Satellite Finds Highest Land Skin Temperatures on Earth. Bull. Amer. Meteor. Soc., 92, 855–860, + ! Mildrexler, D. J., M. Zhao, and S. W. Running, 2011: Satellite Finds Highest Land Skin Temperatures on Earth. Bull. Amer. Meteor. Soc., 92, 855–860, ! https://doi.org/10.1175/2011BAMS3067.1. ! https://journals.ametsoc.org/view/journals/bams/92/7/2011bams3067_1.xml?tab_body=pdf - + maxSkinTempK = 273.15 + 80.0 use_timers = Atm(n)%flagstruct%fv_timers @@ -1037,7 +1037,7 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, call mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, x_refine) ! Read in full panel fix data - call mn_static_read_fix(mn_static%fp_fix, Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), parent_tile, month) + call mn_static_read_fix(mn_static%fp_fix, Atm(1)%npx, Atm(1)%npy, x_refine, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir), parent_tile, month) ! Read in nest fix data call mn_static_read_fix(mn_static%nest_fix, Atm(2)%npx, Atm(2)%npy, 1, Atm(2)%pelist, trim(Moving_nest(child_grid_num)%mn_flag%surface_dir) // "/..", static_nest_num, month) @@ -1301,24 +1301,24 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, !print '("[INFO] WDR NOAHMP reset negative values npe=",I0)', mpp_pe() ! do i=isd,ied ! do j=jsd,jed - + ! This just needs to check in the compute domain. While the mn_phys fields extend into the halo, the IPD structure from CCPP only covers the compute domain. do i=isc,iec do j=jsc,jec - + ! Regular physics variables do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset soil temp values npe=",I0," i=",I0," j=",I0," stc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%stc(i,j,k) - Moving_nest(n)%mn_phys%stc(i,j,k) = 298.0 + Moving_nest(n)%mn_phys%stc(i,j,k) = 298.0 endif if (Moving_nest(n)%mn_phys%smc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%smc(i,j,k) .gt. 1000.0 ) then print '("[INFO] WDR NOAHMP reset soil moisture values npe=",I0," i=",I0," j=",I0," smc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%smc(i,j,k) - Moving_nest(n)%mn_phys%smc(i,j,k) = 0.3 + Moving_nest(n)%mn_phys%smc(i,j,k) = 0.3 endif if (Moving_nest(n)%mn_phys%slc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%slc(i,j,k) .gt. 1000.0 ) then print '("[INFO] WDR NOAHMP reset soil liquid values npe=",I0," i=",I0," j=",I0," slc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%slc(i,j,k) - Moving_nest(n)%mn_phys%slc(i,j,k) = 0.3 + Moving_nest(n)%mn_phys%slc(i,j,k) = 0.3 endif enddo @@ -1336,13 +1336,13 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, if (move_noahmp) then - + !! Patch to reset slmsk !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1 .and. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. 1e+10) then ! print '("[INFO] WDR NOAHMP reset land to water for lake npe=",I0," i=",I0," j=",I0," tgxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tgxy(i,j) ! Moving_nest(n)%mn_phys%slmsk(i,j) = 0 !endif - + ! slmsk(:,:) !< land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. !if (this_pe .eq. 89) then @@ -1350,7 +1350,7 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, ! print '("[INFO] WDR NOAHMP debug npe=",I0," i=",I0," j=",I0," tsfc=",E12.5," tsfcl=",E12.5," tsfco=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tsfc(i,j), Moving_nest(n)%mn_phys%tsfcl(i,j), Moving_nest(n)%mn_phys%tsfco(i,j) !endif - + if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1) then ! NOAH MP Variables ! This is normally a negative number @@ -1362,40 +1362,40 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, do k=lbound(Moving_nest(n)%mn_phys%hprime,3),ubound(Moving_nest(n)%mn_phys%hprime,3) print '("[INFO] WDR NOAHMP reset show hprime values npe=",I0," i=",I0," j=",I0," k=",I0," hprime=",E12.5)', mpp_pe(), i, j, k, Moving_nest(n)%mn_phys%hprime(i,j,k) enddo - + Moving_nest(n)%mn_phys%snowxy(i,j) = 0.0 endif - + if (Moving_nest(n)%mn_phys%soilcolor(i,j) .lt. 1.0 .or. Moving_nest(n)%mn_phys%soilcolor(i,j) .gt. 19.0 ) then print '("[INFO] WDR NOAHMP reset soilcolor values npe=",I0," i=",I0," j=",I0," soilcolor=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%soilcolor(i,j) ! Default changed to 10 based on suggestion from Mike Barlage; more middle of the spectrum value. - Moving_nest(n)%mn_phys%soilcolor(i,j) = 10.0 + Moving_nest(n)%mn_phys%soilcolor(i,j) = 10.0 endif - + if (Moving_nest(n)%mn_phys%alboldxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%alboldxy(i,j) .gt. 1.0 ) then print '("[INFO] WDR NOAHMP reset old albedo alboldxy values npe=",I0," i=",I0," j=",I0," alboldxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%alboldxy(i,j) Moving_nest(n)%mn_phys%alboldxy(i,j) = 0.65 ! Cold start value endif - + do k=lbound(Moving_nest(n)%mn_phys%snicexy,3),ubound(Moving_nest(n)%mn_phys%snicexy,3) if (Moving_nest(n)%mn_phys%snicexy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snicexy(i,j,k) .gt. 100.0 ) then print '("[INFO] WDR NOAHMP reset ice thickness values npe=",I0," a_step=",I0," i=",I0," j=",I0," k=",I0," lat,lon=",F9.5,",",F10.5," snicexy=",E12.5," lsnow=",I0,"-",I0)', mpp_pe(), a_step, i, j, k, Atm(n)%gridstruct%agrid(i,j,2)*rad2deg, Atm(n)%gridstruct%agrid(i,j,1)*rad2deg - 360.0, Moving_nest(n)%mn_phys%snicexy(i,j,k), IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound - + !print '("[INFO] WDR NOAHMP snicexy reset ice thickness values npe=",I0," isd-ied=",I0,"-",I0," jsd-jed",I0,"-",I0," k=",I0,"-",I0)', mpp_pe(), isd, ied, jsd, jed, lbound(Moving_nest(n)%mn_phys%snicexy,3), ubound(Moving_nest(n)%mn_phys%snicexy,3) - - + + Moving_nest(n)%mn_phys%snicexy(i,j,k) = 0.0 ! Cold start value endif enddo - + do k=lbound(Moving_nest(n)%mn_phys%snliqxy,3),ubound(Moving_nest(n)%mn_phys%snliqxy,3) if (Moving_nest(n)%mn_phys%snliqxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snliqxy(i,j,k) .gt. 100.0 ) then print '("[INFO] WDR NOAHMP reset liq thickness values npe=",I0," i=",I0," j=",I0," snliqxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snliqxy(i,j,k) Moving_nest(n)%mn_phys%snliqxy(i,j,k) = 0.0 ! Cold start value endif enddo - + ! (/0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0/) -- 3 snow levels, 4 soil levels do k=lbound(Moving_nest(n)%mn_phys%zsnsoxy,3),ubound(Moving_nest(n)%mn_phys%zsnsoxy,3) if (Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) .lt. -80.0 .or. Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) .gt. 100.0 ) then @@ -1404,40 +1404,40 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) = zsns_default(k) ! Cold start value endif enddo - + if (Moving_nest(n)%mn_phys%snowd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snowd(i,j) .gt. 1000.0 ) then print '("[INFO] WDR NOAHMP reset snow thickness values npe=",I0," i=",I0," j=",I0," snowd=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowd(i,j) Moving_nest(n)%mn_phys%snowd(i,j) = 0.0 ! Cold start value endif - + if (Moving_nest(n)%mn_phys%weasd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%weasd(i,j) .gt. 1000.0 ) then print '("[INFO] WDR NOAHMP reset snow thickness values npe=",I0," i=",I0," j=",I0," weasd=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%weasd(i,j) Moving_nest(n)%mn_phys%weasd(i,j) = 0.0 ! Cold start value endif - + do k=lbound(Moving_nest(n)%mn_phys%tsnoxy,3),ubound(Moving_nest(n)%mn_phys%tsnoxy,3) if (Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset snow temp values npe=",I0," i=",I0," j=",I0," tsnoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tsnoxy(i,j,k) Moving_nest(n)%mn_phys%tsnoxy(i,j,k) = 0.0 ! Cold start value endif enddo - + if (Moving_nest(n)%mn_phys%tvxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tvxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset vegetation canopy temp values npe=",I0," i=",I0," j=",I0," tvxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tvxy(i,j) Moving_nest(n)%mn_phys%tvxy(i,j) = 298.0 ! skin temperature endif - + if (Moving_nest(n)%mn_phys%tgxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset ground temp values npe=",I0," i=",I0," j=",I0," tgxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tgxy(i,j) Moving_nest(n)%mn_phys%tgxy(i,j) = 298.0 ! skin temperature endif - + if (Moving_nest(n)%mn_phys%tahxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tahxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," tahxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tahxy(i,j) Moving_nest(n)%mn_phys%tahxy(i,j) = 298.0 ! skin temperature endif - - + + do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," stc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%stc(i,j,k) @@ -1472,8 +1472,8 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, enddo ! do j enddo ! do i endif ! if is_fine_pe - - + + if (is_fine_pe) then do i=isc,iec do j=jsc,jec diff --git a/moving_nest/fv_moving_nest_physics.F90 b/moving_nest/fv_moving_nest_physics.F90 index ccb4c4b03c..f73a6607c8 100644 --- a/moving_nest/fv_moving_nest_physics.F90 +++ b/moving_nest/fv_moving_nest_physics.F90 @@ -534,7 +534,7 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, mn_phys%soilcolor(i,j) = IPD_Data(nb)%Sfcprop%scolor(ix) mn_phys%snowxy(i,j) = IPD_Data(nb)%Sfcprop%snowxy(ix) !if (i .eq. 149 .and. j .eq. 169) print '("[INFO] WDR SNOWXY MASK2D npe=",I0," i=",I0," j=",I0," snowxy=",E10.5)', this_pe, i, j, mn_phys%snowxy(i,j) - + mn_phys%tvxy(i,j) = IPD_Data(nb)%Sfcprop%tvxy(ix) mn_phys%tgxy(i,j) = IPD_Data(nb)%Sfcprop%tgxy(ix) diff --git a/moving_nest/fv_moving_nest_types.F90 b/moving_nest/fv_moving_nest_types.F90 index db4fc7e7f3..3120509b73 100644 --- a/moving_nest/fv_moving_nest_types.F90 +++ b/moving_nest/fv_moving_nest_types.F90 @@ -86,8 +86,8 @@ module fv_moving_nest_types_mod real(kind=kind_phys), allocatable :: land_frac_grid(:,:) _NULL ! Continuous land fraction - 0.0 ocean, 0.5 half of each, 1.0 all land ! raw or filtered depending on namelist option,in meters - real(kind=kind_phys), allocatable :: geolat_grid(:,:) _NULL - real(kind=kind_phys), allocatable :: geolon_grid(:,:) _NULL + real(kind=kind_phys), allocatable :: geolat_grid(:,:) _NULL + real(kind=kind_phys), allocatable :: geolon_grid(:,:) _NULL end type mn_land_mask_grids @@ -428,7 +428,7 @@ end subroutine mn_apply_lakes subroutine mn_overwrite_with_nest_init_values_r8(tag, var_grid, nest_var_grid, refine, ioffset, joffset) character(len=*) :: tag - real*8, allocatable, intent(inout) :: var_grid(:,:) + real*8, allocatable, intent(inout) :: var_grid(:,:) real*8, allocatable, intent(in) :: nest_var_grid(:,:) integer, intent(in) :: refine, ioffset, joffset @@ -446,7 +446,7 @@ end subroutine mn_overwrite_with_nest_init_values_r8 subroutine mn_overwrite_with_nest_init_values_r4(tag, var_grid, nest_var_grid, refine, ioffset, joffset) character(len=*) :: tag - real*4, allocatable, intent(inout) :: var_grid(:,:) + real*4, allocatable, intent(inout) :: var_grid(:,:) real*4, allocatable, intent(in) :: nest_var_grid(:,:) integer, intent(in) :: refine, ioffset, joffset @@ -503,7 +503,7 @@ subroutine mn_static_overwrite_ls_from_nest(fp_ls, nest_ls, refine, ioffset, jof type(mn_land_mask_grids), intent(inout) :: fp_ls type(mn_land_mask_grids), intent(in) :: nest_ls integer, intent(in) :: refine, ioffset, joffset - + ! Update full panel with nest init values (there are a few mismatches) ! TODO maybe add orog_raw/orog_filt call mn_overwrite_with_nest_init_values("ls_mask", fp_ls%ls_mask_grid, nest_ls%ls_mask_grid, refine, ioffset, joffset) @@ -511,10 +511,10 @@ subroutine mn_static_overwrite_ls_from_nest(fp_ls, nest_ls, refine, ioffset, jof !if (is_fine_pe) then ! call validate_navigation_fields("INIT", Atm_block, IPD_control, IPD_data, parent_grid_num, child_grid_num) !endif - + call mn_overwrite_with_nest_init_values("soil_type", fp_ls%soil_type_grid, nest_ls%soil_type_grid, refine, ioffset, joffset) call mn_overwrite_with_nest_init_values("land_frac", fp_ls%land_frac_grid, nest_ls%land_frac_grid, refine, ioffset, joffset) - + end subroutine mn_static_overwrite_ls_from_nest subroutine mn_static_overwrite_fix_from_nest(fp_fix, nest_fix, refine, ioffset, joffset) diff --git a/moving_nest/fv_moving_nest_utils.F90 b/moving_nest/fv_moving_nest_utils.F90 index e6b4e3cf0e..932dc99840 100644 --- a/moving_nest/fv_moving_nest_utils.F90 +++ b/moving_nest/fv_moving_nest_utils.F90 @@ -2349,7 +2349,7 @@ subroutine fill_nest_from_buffer_cell_center_masked_2d_const(var_name, stagger, num_weights = num_weights + 1 x(i,j) = x(i,j) + wt(i,j,1)*buffer(ic, jc ) tw = tw + wt(i,j,1) - + !if ( this_pe .eq. 89 .and. trim(var_name) .eq. "snowxy") print '("[INFO] MASK_SNOWXY AA npe=",I0," num_weights=",I0," buffer(",I0,",",I0,")=",E12.5," snowxy(",I0,",",I0,")=",E12.5," tw=",F8.5," wt=",F14.10)', this_pe, num_weights, ic, jc, buffer(ic,jc), i, j, x(i,j), tw, wt(i,j,1) endif From 6695d8e22f94168f80060189286aef2fb8a47e9a Mon Sep 17 00:00:00 2001 From: Ruiyu Sun Date: Mon, 22 Jan 2024 15:13:08 +0000 Subject: [PATCH 038/192] removed gfdl mp v1 files from orginal directory and moved to newly aded v1 directory --- ccpp/config/ccpp_prebuild_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py index 1ed2c6245c..f03f4168b2 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/ccpp/config/ccpp_prebuild_config.py @@ -153,8 +153,8 @@ 'physics/physics/photochem/h2ophys.f', 'physics/physics/photochem/module_ozphys.F90', 'physics/physics/MP/Ferrier_Aligo/mp_fer_hires.F90', - 'physics/physics/MP/GFDL/gfdl_cloud_microphys.F90', - 'physics/physics/MP/GFDL/fv_sat_adj.F90', + 'physics/physics/MP/GFDL/v1/gfdl_cloud_microphys.F90', + 'physics/physics/MP/GFDL/v1/fv_sat_adj.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro_pre.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro_post.F90', From 855936759890e8f03703510b2c6398051352e54e Mon Sep 17 00:00:00 2001 From: Ruiyu Sun Date: Mon, 22 Jan 2024 17:13:31 +0000 Subject: [PATCH 039/192] change the .gitmodules to use my ccpp/physics branch --- .gitmodules | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 22c723ac12..7f2098b7c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,11 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/ufs-community/ccpp-physics - branch = ufs/dev + #url = https://github.com/ufs-community/ccpp-physics + #branch = ufs/dev + url = https://github.com/RuiyuSun/ccpp-physics + branch = feature_gfdlmpv3 + [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP From ce28fae5c160049ad4e02dd686924acf3a116030 Mon Sep 17 00:00:00 2001 From: Ruiyu Sun Date: Thu, 1 Feb 2024 16:15:57 +0000 Subject: [PATCH 040/192] add GFDLMP v3 --- ccpp/config/ccpp_prebuild_config.py | 6 ++++-- ccpp/data/CCPP_typedefs.F90 | 18 ++++++++++++------ ccpp/data/CCPP_typedefs.meta | 8 ++++---- ccpp/data/GFS_typedefs.F90 | 16 +++++++++++++--- ccpp/data/GFS_typedefs.meta | 8 +++++++- 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py index f03f4168b2..2af5d380b2 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/ccpp/config/ccpp_prebuild_config.py @@ -153,8 +153,10 @@ 'physics/physics/photochem/h2ophys.f', 'physics/physics/photochem/module_ozphys.F90', 'physics/physics/MP/Ferrier_Aligo/mp_fer_hires.F90', - 'physics/physics/MP/GFDL/v1/gfdl_cloud_microphys.F90', - 'physics/physics/MP/GFDL/v1/fv_sat_adj.F90', + 'physics/physics/MP/GFDL_2019_v1/gfdl_cloud_microphys.F90', + 'physics/physics/MP/GFDL_2019_v1/fv_sat_adj.F90', + 'physics/physics/MP/GFDL_2022_v3/gfdl_cld_mp_v3.F90', + 'physics/physics/MP/GFDL_2022_v3/fv_sat_adj_v3.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro_pre.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro_post.F90', diff --git a/ccpp/data/CCPP_typedefs.F90 b/ccpp/data/CCPP_typedefs.F90 index 7d93513376..09159bd5f2 100644 --- a/ccpp/data/CCPP_typedefs.F90 +++ b/ccpp/data/CCPP_typedefs.F90 @@ -829,8 +829,10 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model) end if ! ! Allocate arrays that are conditional on physics choices - if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson & - .or. Model%imp_physics == Model%imp_physics_nssl & + if (Model%imp_physics == Model%imp_physics_gfdl & + .or. Model%imp_physics == Model%imp_physics_gfdl_v3 & + .or. Model%imp_physics == Model%imp_physics_thompson & + .or. Model%imp_physics == Model%imp_physics_nssl & ) then allocate (Interstitial%graupelmp (IM)) allocate (Interstitial%icemp (IM)) @@ -988,7 +990,8 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model) Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 Interstitial%ntrwx = 4 - elseif (Model%imp_physics == Model%imp_physics_gfdl) then + elseif (Model%imp_physics == Model%imp_physics_gfdl & + .or. Model%imp_physics == Model%imp_physics_gfdl_v3 ) then Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 Interstitial%ntrwx = 4 @@ -1016,7 +1019,8 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model) else Interstitial%nvdiff = 10 endif - elseif (Model%imp_physics == Model%imp_physics_gfdl) then + elseif (Model%imp_physics == Model%imp_physics_gfdl & + .or. Model%imp_physics == Model%imp_physics_gfdl_v3) then Interstitial%nvdiff = 7 elseif (Model%imp_physics == Model%imp_physics_thompson) then if (Model%ltaerosol) then @@ -1438,8 +1442,10 @@ subroutine gfs_interstitial_phys_reset (Interstitial, Model) end if ! ! Reset fields that are conditional on physics choices - if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson & - .or. Model%imp_physics == Model%imp_physics_nssl & + if (Model%imp_physics == Model%imp_physics_gfdl & + .or. Model%imp_physics == Model%imp_physics_gfdl_v3 & + .or. Model%imp_physics == Model%imp_physics_thompson & + .or. Model%imp_physics == Model%imp_physics_nssl & ) then Interstitial%graupelmp = clear_val Interstitial%icemp = clear_val diff --git a/ccpp/data/CCPP_typedefs.meta b/ccpp/data/CCPP_typedefs.meta index a2d1105dfd..8f6e1a9445 100644 --- a/ccpp/data/CCPP_typedefs.meta +++ b/ccpp/data/CCPP_typedefs.meta @@ -1127,7 +1127,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_gfdl_microphysics_v3_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) [gwdcu] standard_name = tendency_of_x_wind_due_to_convective_gravity_wave_drag long_name = zonal wind tendency due to convective gravity wave drag @@ -1219,7 +1219,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_gfdl_microphysics_v3_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) [dry] standard_name = flag_nonzero_land_surface_fraction long_name = flag indicating presence of some land surface area fraction @@ -1726,7 +1726,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_gfdl_microphysics_v3_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) [rainp] standard_name = tendency_of_rain_water_mixing_ratio_due_to_microphysics long_name = tendency of rain water mixing ratio due to microphysics @@ -1982,7 +1982,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_gfdl_microphysics_v3_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) [snowmt] standard_name = surface_snow_melt long_name = snow melt during timestep diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 5a8368a40f..ed36990a19 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -901,6 +901,7 @@ module GFS_typedefs !--- new microphysical switch integer :: imp_physics !< choice of microphysics scheme integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme + integer :: imp_physics_gfdl_v3 = 13 !< choice of GFDL microphysics version 3 scheme integer :: imp_physics_thompson = 8 !< choice of Thompson microphysics scheme integer :: imp_physics_wsm6 = 6 !< choice of WSMG microphysics scheme integer :: imp_physics_zhao_carr = 99 !< choice of Zhao-Carr microphysics scheme @@ -4691,7 +4692,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%use_ufo = use_ufo Model%exticeden = exticeden if (Model%exticeden .and. & - (Model%imp_physics /= Model%imp_physics_gfdl .and. Model%imp_physics /= Model%imp_physics_thompson .and. & + (Model%imp_physics /= Model%imp_physics_gfdl .and. & + Model%imp_physics /= Model%imp_physics_gfdl_v3 .and. & + Model%imp_physics /= Model%imp_physics_thompson .and. & Model%imp_physics /= Model%imp_physics_nssl )) then !see GFS_MP_generic_post.F90; exticeden is only compatible with GFDL, !Thompson, or NSSL MP @@ -6038,7 +6041,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' mg_alf=', Model%mg_alf, ' mg_qcmin=', Model%mg_qcmin, & ' mg_do_ice_gmao=', Model%mg_do_ice_gmao, ' mg_do_liq_liu=', Model%mg_do_liq_liu - elseif (Model%imp_physics == Model%imp_physics_gfdl) then !GFDL microphysics + elseif (Model%imp_physics == Model%imp_physics_gfdl .or. & + Model%imp_physics == Model%imp_physics_gfdl_v3) then !GFDL microphysics Model%npdf3d = 0 if(Model%effr_in) then Model%num_p3d = 5 @@ -6567,7 +6571,13 @@ subroutine control_print(Model) print *, ' ' endif if (Model%imp_physics == Model%imp_physics_gfdl) then - print *, ' GFDL microphysical parameters' + print *, ' GFDL microphysical parameters v1' + print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad + print *, ' lrefres : ', Model%lrefres + print *, ' ' + endif + if (Model%imp_physics == Model%imp_physics_gfdl_v3) then + print *, ' GFDL microphysical parameters v3' print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad print *, ' lrefres : ', Model%lrefres print *, ' ' diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index ebaa9af7fa..d0178b0b44 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4074,6 +4074,12 @@ units = flag dimensions = () type = integer +[imp_physics_gfdl_v3] + standard_name = identifier_for_gfdl_microphysics_v3_scheme + long_name = choice of GFDL microphysics v3 scheme + units = flag + dimensions = () + type = integer [imp_physics_thompson] standard_name = identifier_for_thompson_microphysics_scheme long_name = choice of Thompson microphysics scheme @@ -9867,7 +9873,7 @@ dependencies = hooks/machine.F,hooks/physcons.F90 dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/h2o_def.f,photochem/module_ozphys.F90 - dependencies = MP/GFDL/GFDL_parse_tracers.F90 + dependencies = MP/GFDL_parse_tracers.F90 [ccpp-arg-table] name = GFS_typedefs From 1efbd926ddec94fddf0f7552c988a414621d0639 Mon Sep 17 00:00:00 2001 From: Ruiyu Sun Date: Thu, 1 Feb 2024 16:16:47 +0000 Subject: [PATCH 041/192] add two suites for gfdlmp v3 --- ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml | 92 +++++++++++++++++++ .../suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml | 92 +++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100644 ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml create mode 100644 ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml diff --git a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml new file mode 100644 index 0000000000..c3d8c3b23b --- /dev/null +++ b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml @@ -0,0 +1,92 @@ + + + + + + + fv_sat_adj_v3 + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + gfdl_cld_mp_v3 + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml new file mode 100644 index 0000000000..a1c57f46c4 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml @@ -0,0 +1,92 @@ + + + + + + + fv_sat_adj_v3 + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + gfdl_cld_mp_v3 + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + From e5366c0243582222a05dbb0744e0cced30821f04 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 2 Feb 2024 15:32:34 +0000 Subject: [PATCH 042/192] Update submodule UPP. --- .gitmodules | 6 ++++-- upp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 22c723ac12..3388be79fa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,5 +12,7 @@ branch = ufs/dev [submodule "upp"] path = upp - url = https://github.com/NOAA-EMC/UPP - branch = develop +# url = https://github.com/NOAA-EMC/UPP +# branch = develop + url = https://github.com/hafs-community/UPP + branch = feature/hafsv2_final diff --git a/upp b/upp index 78f369b011..b5abdf889e 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 78f369b011ec41dca87a1260298d0228f2c4f38f +Subproject commit b5abdf889e02ebb8389907b8ff6c1a21112a2f88 From 78168ec40bd7d84e9ba5cf754d7bbac888994801 Mon Sep 17 00:00:00 2001 From: BijuThomas-NOAA Date: Fri, 2 Feb 2024 20:39:02 +0000 Subject: [PATCH 043/192] Updating modules based on official installation and consistent with ufs-weather-model --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index b5abdf889e..6d9f5c8172 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit b5abdf889e02ebb8389907b8ff6c1a21112a2f88 +Subproject commit 6d9f5c8172105155e41dcf3cb4ed3f48f71eba64 From fece8a166a3b78b0e478e4fc47e021d6a0d44ade Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Wed, 6 Mar 2024 21:37:03 +0000 Subject: [PATCH 044/192] Update submodule upp. --- .gitmodules | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3388be79fa..061a9649b6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,5 @@ branch = ufs/dev [submodule "upp"] path = upp -# url = https://github.com/NOAA-EMC/UPP -# branch = develop url = https://github.com/hafs-community/UPP - branch = feature/hafsv2_final + branch = production/hafs.v2 From cbdf74c11d37cd2d88ca62677a331b3a7939a815 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 18 Mar 2024 14:50:36 +0000 Subject: [PATCH 045/192] GFDLv3 --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 8dff959bc1..3194de95f1 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 8dff959bc1762dc46d14c3d277e38c689fe3152d +Subproject commit 3194de95f122bd16280548a032af0da24209300e From b6eb89d875e524d6dcc51ab9780fd5f4f6972d6f Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 19 Mar 2024 01:42:40 +0000 Subject: [PATCH 046/192] Update submodule upp to point to the release/hafs_v2 branch. --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 061a9649b6..168ec30082 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,5 +12,5 @@ branch = ufs/dev [submodule "upp"] path = upp - url = https://github.com/hafs-community/UPP - branch = production/hafs.v2 + url = https://github.com/NOAA-EMC/UPP + branch = release/hafs_v2 From 3cb2e52b9344b440a1e8c58f379a46a52fa50b2d Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 19 Mar 2024 04:27:55 +0000 Subject: [PATCH 047/192] refactor gfdlmp. work in progress --- ccpp/config/ccpp_prebuild_config.py | 8 ++++---- ccpp/physics | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py index c260f53bce..595f57f6ff 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/ccpp/config/ccpp_prebuild_config.py @@ -153,10 +153,10 @@ 'physics/physics/photochem/h2ophys.f', 'physics/physics/photochem/module_ozphys.F90', 'physics/physics/MP/Ferrier_Aligo/mp_fer_hires.F90', - 'physics/physics/MP/GFDL_2019_v1/gfdl_cloud_microphys.F90', - 'physics/physics/MP/GFDL_2019_v1/fv_sat_adj.F90', - 'physics/physics/MP/GFDL_2022_v3/gfdl_cld_mp_v3.F90', - 'physics/physics/MP/GFDL_2022_v3/fv_sat_adj_v3.F90', + 'physics/physics/MP/GFDL/v1_2019/gfdl_cloud_microphys.F90', + 'physics/physics/MP/GFDL/fv_sat_adj.F90', + 'physics/physics/MP/GFDL/v3_2022/gfdl_cloud_microphys_v3.F90', + 'physics/physics/MP/GFDL/fv_sat_adj_v3.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro_pre.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro_post.F90', diff --git a/ccpp/physics b/ccpp/physics index 3194de95f1..47b8af3e5c 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 3194de95f122bd16280548a032af0da24209300e +Subproject commit 47b8af3e5ceb2ebf52fe49286ed3d637763dce2b From 32d7d52049b61c4676198eebf780a31ae02769ea Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 20 Mar 2024 21:56:33 +0000 Subject: [PATCH 048/192] Update physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 47b8af3e5c..b33604deca 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 47b8af3e5ceb2ebf52fe49286ed3d637763dce2b +Subproject commit b33604decafbea1617075139a96562d2eeb6f1a8 From 7b110d76390a038b21fd98a99e818912569e097b Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 20 Mar 2024 22:18:49 +0000 Subject: [PATCH 049/192] Update physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index b33604deca..3d75ef83ca 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit b33604decafbea1617075139a96562d2eeb6f1a8 +Subproject commit 3d75ef83cad0fc1c494683d4a3f35ef26512421c From aca4042e7ff97cbe499b25ec5d6956556b1afac5 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Sat, 23 Mar 2024 11:38:31 +0000 Subject: [PATCH 050/192] Updating modulefiles for production transition --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 6d9f5c8172..f8fc8a297f 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 6d9f5c8172105155e41dcf3cb4ed3f48f71eba64 +Subproject commit f8fc8a297f37668d89a4b8a39319d0057cdcb6cd From d0f8a40380089e1eef6fe8d33462b098b9b527ec Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 3 Apr 2024 19:38:10 +0000 Subject: [PATCH 051/192] Synced physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 3d75ef83ca..a04c4e7e77 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 3d75ef83cad0fc1c494683d4a3f35ef26512421c +Subproject commit a04c4e7e77dac933f05cfe369f3498f9f42c3645 From 6b5ec4863e13cf74b36ac2eb9bef0f62616adb98 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 3 Apr 2024 20:04:41 +0000 Subject: [PATCH 052/192] Additional cleanup --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index a04c4e7e77..c776501c36 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit a04c4e7e77dac933f05cfe369f3498f9f42c3645 +Subproject commit c776501c3636ccce4633b4467bc4d3bfe7fbe6c2 From 10130419b1f96ca38102bce7ad2b198fe6b60041 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 3 Apr 2024 20:41:35 +0000 Subject: [PATCH 053/192] Reverted some changes in physics --- ccpp/config/ccpp_prebuild_config.py | 1 - ccpp/physics | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py index d703b1cb43..f10536f1ae 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/ccpp/config/ccpp_prebuild_config.py @@ -157,7 +157,6 @@ 'physics/physics/MP/GFDL/v1_2019/gfdl_cloud_microphys.F90', 'physics/physics/MP/GFDL/fv_sat_adj.F90', 'physics/physics/MP/GFDL/v3_2022/gfdl_cloud_microphys_v3.F90', - 'physics/physics/MP/GFDL/fv_sat_adj_v3.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro_pre.F90', 'physics/physics/MP/Morrison_Gettelman/m_micro_post.F90', diff --git a/ccpp/physics b/ccpp/physics index c776501c36..ecc0692581 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c776501c3636ccce4633b4467bc4d3bfe7fbe6c2 +Subproject commit ecc0692581b29045a0b547de142e17ba637cd02c From adc6edc5179c032abc3050947e510898d0758ae0 Mon Sep 17 00:00:00 2001 From: BijuThomas-NOAA Date: Fri, 5 Apr 2024 14:03:19 +0000 Subject: [PATCH 054/192] Remove nowarn flag from build --- atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 6663459e58..6fcbe1357d 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 6663459e58a04e3bda2157d5891d227e3abc3c7a +Subproject commit 6fcbe1357dff6b5bdc4abd67c342b56ab2de935c From 468dee71f46f40dfcff66732448abf913e5ebe35 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sun, 7 Apr 2024 18:41:36 +0000 Subject: [PATCH 055/192] Update the moving_nest/fv_tracker.F90 to output moving nest domain location to support the moving-nesting forecast restart capability. --- moving_nest/fv_tracker.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moving_nest/fv_tracker.F90 b/moving_nest/fv_tracker.F90 index 5cda9083fe..bdeacf6a7b 100644 --- a/moving_nest/fv_tracker.F90 +++ b/moving_nest/fv_tracker.F90 @@ -827,19 +827,19 @@ subroutine output_partial_atcfunix(Atm,Time, & 313 format(A15,", ", & "W10 = ",F7.3," kn, PMIN = ",F8.3," mbar, ", & "LAT = ",F6.3,A1,", LON = ",F7.3,A1,", ", & - "RMW = ",F7.3," nmi") + "RMW = ",F7.3," nmi, NEST_IS = ",I6,", NEST_JS = ",I6) if (Tracker(n)%tracker_fixlon .gt. 180.0) then write(Moving_nest(n)%mn_flag%outatcf_lun+Atm%grid_number,313) timestr, & Tracker(n)%tracker_vmax*mps2kn,Tracker(n)%tracker_pmin/100., & abs(Tracker(n)%tracker_fixlat),get_lat_ns(Tracker(n)%tracker_fixlat), & abs(Tracker(n)%tracker_fixlon-360.0),get_lon_ew(Tracker(n)%tracker_fixlon-360.0), & - Tracker(n)%tracker_rmw*km2nmi + Tracker(n)%tracker_rmw*km2nmi,Atm%neststruct%ioffset,Atm%neststruct%joffset else write(Moving_nest(n)%mn_flag%outatcf_lun+Atm%grid_number,313) timestr, & Tracker(n)%tracker_vmax*mps2kn,Tracker(n)%tracker_pmin/100., & abs(Tracker(n)%tracker_fixlat),get_lat_ns(Tracker(n)%tracker_fixlat), & abs(Tracker(n)%tracker_fixlon),get_lon_ew(Tracker(n)%tracker_fixlon), & - Tracker(n)%tracker_rmw*km2nmi + Tracker(n)%tracker_rmw*km2nmi,Atm%neststruct%ioffset,Atm%neststruct%joffset end if end subroutine output_partial_atcfunix From 311a0123caecfa146bb2fe70598440f17b819866 Mon Sep 17 00:00:00 2001 From: BijuThomas-NOAA Date: Mon, 8 Apr 2024 18:40:44 +0000 Subject: [PATCH 056/192] Adding -qoverride-limits flag to have all OpenMP processing --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index f8fc8a297f..2abf645bcc 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit f8fc8a297f37668d89a4b8a39319d0057cdcb6cd +Subproject commit 2abf645bccd84b50e6fe56be1406b9d1cbeff148 From 29a98c82a677e4cd20cbf044ba1272dcad9c0eae Mon Sep 17 00:00:00 2001 From: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com> Date: Fri, 9 Feb 2024 16:27:07 -0500 Subject: [PATCH 057/192] Fix out of bound errors in block_atmos_copy routines (#778) --- cpl/module_block_data.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cpl/module_block_data.F90 b/cpl/module_block_data.F90 index 7bd0a71b3a..b5dc6cc803 100644 --- a/cpl/module_block_data.F90 +++ b/cpl/module_block_data.F90 @@ -365,7 +365,7 @@ subroutine block_array_copy_2d_r8_to_2d_r8(destin_ptr, source_arr, block, block_ jb = block%index(block_index)%jj(ix) i = ib - block%isc + 1 j = jb - block%jsc + 1 - destin_ptr(i,j) = factor * source_arr(ib,jb) + destin_ptr(i,j) = factor * source_arr(i,j) enddo localrc = ESMF_SUCCESS end if @@ -440,7 +440,7 @@ subroutine block_array_copy_3d_r8_to_3d_r8(destin_ptr, source_arr, block, block_ jb = block%index(block_index)%jj(ix) i = ib - block%isc + 1 j = jb - block%jsc + 1 - destin_ptr(i,j,k) = factor * source_arr(ib,jb,k) + destin_ptr(i,j,k) = factor * source_arr(i,j,k) enddo enddo localrc = ESMF_SUCCESS @@ -523,7 +523,7 @@ subroutine block_array_copy_3dslice_r8_to_3d_r8(destin_ptr, source_arr, slice, b jb = block%index(block_index)%jj(ix) i = ib - block%isc + 1 j = jb - block%jsc + 1 - destin_ptr(i,j,k) = factor * source_arr(ib,jb,k,slice) + destin_ptr(i,j,k) = factor * source_arr(i,j,k,slice) enddo enddo localrc = ESMF_SUCCESS @@ -1004,7 +1004,7 @@ subroutine block_array_copy_2d_r4_to_2d_r8(destin_ptr, source_arr, block, block_ jb = block%index(block_index)%jj(ix) i = ib - block%isc + 1 j = jb - block%jsc + 1 - destin_ptr(i,j) = factor * source_arr(ib,jb) + destin_ptr(i,j) = factor * source_arr(i,j) enddo localrc = ESMF_SUCCESS end if @@ -1079,7 +1079,7 @@ subroutine block_array_copy_3d_r4_to_3d_r8(destin_ptr, source_arr, block, block_ jb = block%index(block_index)%jj(ix) i = ib - block%isc + 1 j = jb - block%jsc + 1 - destin_ptr(i,j,k) = factor * source_arr(ib,jb,k) + destin_ptr(i,j,k) = factor * source_arr(i,j,k) enddo enddo localrc = ESMF_SUCCESS @@ -1162,7 +1162,7 @@ subroutine block_array_copy_3dslice_r4_to_3d_r8(destin_ptr, source_arr, slice, b jb = block%index(block_index)%jj(ix) i = ib - block%isc + 1 j = jb - block%jsc + 1 - destin_ptr(i,j,k) = factor * source_arr(ib,jb,k,slice) + destin_ptr(i,j,k) = factor * source_arr(i,j,k,slice) enddo enddo localrc = ESMF_SUCCESS From 5b649b759d7e85ddee479c1741ffb90fa6befcdc Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Mon, 1 Apr 2024 07:30:27 -0500 Subject: [PATCH 058/192] Update atmos_cubed_sphere and add compile definition BYPASS_BREED_SLP_INLINE to dycore --- .gitmodules | 4 ++-- CMakeLists.txt | 3 ++- atmos_cubed_sphere | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 168ec30082..92563c6403 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere + branch = production/hafs.v2 [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d0dcf6f6c..928d493212 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF) # Determine whether or not to generate documentation. if(ENABLE_DOCS) find_package(Doxygen REQUIRED) - add_subdirectory(docs) + add_subdirectory(docs) endif() # Enable CI build & unit testing: @@ -37,6 +37,7 @@ if(MOVING_NEST) set(MOVING_NEST ON) endif() add_subdirectory(atmos_cubed_sphere) +target_compile_definitions(fv3 PRIVATE BYPASS_BREED_SLP_INLINE) ############################################################################### ### fv3atm diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 6fcbe1357d..4162fad68d 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 6fcbe1357dff6b5bdc4abd67c342b56ab2de935c +Subproject commit 4162fad68d84db507bf25d4502673bc608c86600 From 6cdff0a5f0f131cb23ed1ae1130953ba062916a4 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 9 Apr 2024 01:43:23 +0000 Subject: [PATCH 059/192] Update submodule ccpp/physic. --- .gitmodules | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 92563c6403..53629c7dc8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,8 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/ufs-community/ccpp-physics - branch = ufs/dev + url = https://github.com/hafs-community/ccpp-physics + branch = production/hafs.v2 [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index 51452b8b52..a4a2b9bc9f 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 51452b8b52d5f3ded391847aefc21b086bb27b64 +Subproject commit a4a2b9bc9f7edc1a909b26cf4f04e092736a86ae From 2688c155ec7f8bd916ae694c3337432ba33ba595 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 11 Apr 2024 16:01:23 +0000 Subject: [PATCH 060/192] Update physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index ecc0692581..4e83fdeda7 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ecc0692581b29045a0b547de142e17ba637cd02c +Subproject commit 4e83fdeda7267e65fbcfadcc6b2cd9b281fe0ff4 From 14ba97186fc2397420e8949e022bc23013cddcdc Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 12 Apr 2024 16:36:58 +0000 Subject: [PATCH 061/192] Some housekeeping in physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 4e83fdeda7..bdd44520b4 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 4e83fdeda7267e65fbcfadcc6b2cd9b281fe0ff4 +Subproject commit bdd44520b459a25a95847a1246090d45e6fb8972 From 02cd74fed5db82d3ac738e6bc1bf916d451d8129 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 12 Apr 2024 16:40:39 +0000 Subject: [PATCH 062/192] Revert "add GFDLMP v3" This reverts commit ce28fae5c160049ad4e02dd686924acf3a116030. --- ccpp/data/CCPP_typedefs.F90 | 18 ++++++------------ ccpp/data/CCPP_typedefs.meta | 8 ++++---- ccpp/data/GFS_typedefs.F90 | 16 +++------------- ccpp/data/GFS_typedefs.meta | 8 +------- 4 files changed, 14 insertions(+), 36 deletions(-) diff --git a/ccpp/data/CCPP_typedefs.F90 b/ccpp/data/CCPP_typedefs.F90 index da31d38735..83b6d4df00 100644 --- a/ccpp/data/CCPP_typedefs.F90 +++ b/ccpp/data/CCPP_typedefs.F90 @@ -829,10 +829,8 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model) end if ! ! Allocate arrays that are conditional on physics choices - if (Model%imp_physics == Model%imp_physics_gfdl & - .or. Model%imp_physics == Model%imp_physics_gfdl_v3 & - .or. Model%imp_physics == Model%imp_physics_thompson & - .or. Model%imp_physics == Model%imp_physics_nssl & + if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson & + .or. Model%imp_physics == Model%imp_physics_nssl & ) then allocate (Interstitial%graupelmp (IM)) allocate (Interstitial%icemp (IM)) @@ -990,8 +988,7 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model) Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 Interstitial%ntrwx = 4 - elseif (Model%imp_physics == Model%imp_physics_gfdl & - .or. Model%imp_physics == Model%imp_physics_gfdl_v3 ) then + elseif (Model%imp_physics == Model%imp_physics_gfdl) then Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 Interstitial%ntrwx = 4 @@ -1019,8 +1016,7 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model) else Interstitial%nvdiff = 10 endif - elseif (Model%imp_physics == Model%imp_physics_gfdl & - .or. Model%imp_physics == Model%imp_physics_gfdl_v3) then + elseif (Model%imp_physics == Model%imp_physics_gfdl) then Interstitial%nvdiff = 7 elseif (Model%imp_physics == Model%imp_physics_thompson) then if (Model%ltaerosol) then @@ -1442,10 +1438,8 @@ subroutine gfs_interstitial_phys_reset (Interstitial, Model) end if ! ! Reset fields that are conditional on physics choices - if (Model%imp_physics == Model%imp_physics_gfdl & - .or. Model%imp_physics == Model%imp_physics_gfdl_v3 & - .or. Model%imp_physics == Model%imp_physics_thompson & - .or. Model%imp_physics == Model%imp_physics_nssl & + if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson & + .or. Model%imp_physics == Model%imp_physics_nssl & ) then Interstitial%graupelmp = clear_val Interstitial%icemp = clear_val diff --git a/ccpp/data/CCPP_typedefs.meta b/ccpp/data/CCPP_typedefs.meta index cd40d57fe6..37201eb08c 100644 --- a/ccpp/data/CCPP_typedefs.meta +++ b/ccpp/data/CCPP_typedefs.meta @@ -1127,7 +1127,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_gfdl_microphysics_v3_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) [gwdcu] standard_name = tendency_of_x_wind_due_to_convective_gravity_wave_drag long_name = zonal wind tendency due to convective gravity wave drag @@ -1219,7 +1219,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_gfdl_microphysics_v3_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) [dry] standard_name = flag_nonzero_land_surface_fraction long_name = flag indicating presence of some land surface area fraction @@ -1726,7 +1726,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_gfdl_microphysics_v3_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) [rainp] standard_name = tendency_of_rain_water_mixing_ratio_due_to_microphysics long_name = tendency of rain water mixing ratio due to microphysics @@ -1982,7 +1982,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_gfdl_microphysics_v3_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) [snowmt] standard_name = surface_snow_melt long_name = snow melt during timestep diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index de2aef1113..07eecbe204 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -920,7 +920,6 @@ module GFS_typedefs !--- new microphysical switch integer :: imp_physics !< choice of microphysics scheme integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme - integer :: imp_physics_gfdl_v3 = 13 !< choice of GFDL microphysics version 3 scheme integer :: imp_physics_thompson = 8 !< choice of Thompson microphysics scheme integer :: imp_physics_wsm6 = 6 !< choice of WSMG microphysics scheme integer :: imp_physics_zhao_carr = 99 !< choice of Zhao-Carr microphysics scheme @@ -4765,9 +4764,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%use_ufo = use_ufo Model%exticeden = exticeden if (Model%exticeden .and. & - (Model%imp_physics /= Model%imp_physics_gfdl .and. & - Model%imp_physics /= Model%imp_physics_gfdl_v3 .and. & - Model%imp_physics /= Model%imp_physics_thompson .and. & + (Model%imp_physics /= Model%imp_physics_gfdl .and. Model%imp_physics /= Model%imp_physics_thompson .and. & Model%imp_physics /= Model%imp_physics_nssl )) then !see GFS_MP_generic_post.F90; exticeden is only compatible with GFDL, !Thompson, or NSSL MP @@ -6104,8 +6101,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' mg_alf=', Model%mg_alf, ' mg_qcmin=', Model%mg_qcmin, & ' mg_do_ice_gmao=', Model%mg_do_ice_gmao, ' mg_do_liq_liu=', Model%mg_do_liq_liu - elseif (Model%imp_physics == Model%imp_physics_gfdl .or. & - Model%imp_physics == Model%imp_physics_gfdl_v3) then !GFDL microphysics + elseif (Model%imp_physics == Model%imp_physics_gfdl) then !GFDL microphysics Model%npdf3d = 0 if(Model%effr_in) then Model%num_p3d = 5 @@ -6635,13 +6631,7 @@ subroutine control_print(Model) print *, ' ' endif if (Model%imp_physics == Model%imp_physics_gfdl) then - print *, ' GFDL microphysical parameters v1' - print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad - print *, ' lrefres : ', Model%lrefres - print *, ' ' - endif - if (Model%imp_physics == Model%imp_physics_gfdl_v3) then - print *, ' GFDL microphysical parameters v3' + print *, ' GFDL microphysical parameters' print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad print *, ' lrefres : ', Model%lrefres print *, ' ' diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 1d92163a79..92e2cdf374 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4245,12 +4245,6 @@ units = flag dimensions = () type = integer -[imp_physics_gfdl_v3] - standard_name = identifier_for_gfdl_microphysics_v3_scheme - long_name = choice of GFDL microphysics v3 scheme - units = flag - dimensions = () - type = integer [imp_physics_thompson] standard_name = identifier_for_thompson_microphysics_scheme long_name = choice of Thompson microphysics scheme @@ -10063,7 +10057,7 @@ dependencies = hooks/machine.F,hooks/physcons.F90 dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/h2o_def.f,photochem/module_ozphys.F90 - dependencies = MP/GFDL_parse_tracers.F90 + dependencies = MP/GFDL/GFDL_parse_tracers.F90 [ccpp-arg-table] name = GFS_typedefs From 62be093cbf1038daa09760f58f05c31f8e27b92c Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 12 Apr 2024 16:44:08 +0000 Subject: [PATCH 063/192] Update submodules in FV3 --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 7f2098b7c1..d23cb31652 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,8 +10,8 @@ path = ccpp/physics #url = https://github.com/ufs-community/ccpp-physics #branch = ufs/dev - url = https://github.com/RuiyuSun/ccpp-physics - branch = feature_gfdlmpv3 + url = https://github.com/dustinswales/ccpp-physics + branch = feature/gfdlmpv3 [submodule "upp"] path = upp From bf9efa404f055e2ba3d8595066294a555daa9881 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 12 Apr 2024 19:18:43 +0000 Subject: [PATCH 064/192] Some more changes --- ccpp/data/GFS_typedefs.meta | 2 +- ccpp/physics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 92e2cdf374..83a7926802 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10057,7 +10057,7 @@ dependencies = hooks/machine.F,hooks/physcons.F90 dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/h2o_def.f,photochem/module_ozphys.F90 - dependencies = MP/GFDL/GFDL_parse_tracers.F90 + dependencies = MP/GFDL_parse_tracers.F90 [ccpp-arg-table] name = GFS_typedefs diff --git a/ccpp/physics b/ccpp/physics index bdd44520b4..153c9a1dd9 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit bdd44520b459a25a95847a1246090d45e6fb8972 +Subproject commit 153c9a1dd9e8023a7021e35375fcf5f11b3fff75 From e2ea42719e4c2c4492e2ff6306aa65d93e68c2a7 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 12 Apr 2024 21:44:55 +0000 Subject: [PATCH 065/192] Some reorg --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 153c9a1dd9..8b2d73e226 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 153c9a1dd9e8023a7021e35375fcf5f11b3fff75 +Subproject commit 8b2d73e226daf29dce4a7c92d1f5c3c8dcaf32ea From d766a641041a4d50b1c82fac1f5bb251f31b674c Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 22 Apr 2024 18:08:41 +0000 Subject: [PATCH 066/192] Some more cleanup. Nearly done --- ccpp/data/GFS_typedefs.F90 | 38 +++++++++++++++++++--- ccpp/data/GFS_typedefs.meta | 8 +++++ ccpp/physics | 2 +- ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml | 4 +-- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 07eecbe204..9a2eb6fa41 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -16,6 +16,8 @@ module GFS_typedefs use module_radlw_parameters, only: topflw_type, sfcflw_type use h2o_def, only: levh2o, h2o_coeff use module_ozphys, only: ty_ozphys + use module_gfdl_cloud_microphys, only: module_gfdl_cloud_microphys_init + use module_gfdl_cloud_microphys_v3, only: module_gfdl_cloud_microphys_v3_init implicit none @@ -919,7 +921,8 @@ module GFS_typedefs !< and if yes, perform them; hardcoded to .true. for now !--- new microphysical switch integer :: imp_physics !< choice of microphysics scheme - integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme + integer :: imp_physics_gfdl = 11 !< choice of GFDL v1 microphysics scheme + integer :: imp_physics_gfdl_v3 = 12 !< choice of GFDL v3 microphysics scheme integer :: imp_physics_thompson = 8 !< choice of Thompson microphysics scheme integer :: imp_physics_wsm6 = 6 !< choice of WSMG microphysics scheme integer :: imp_physics_zhao_carr = 99 !< choice of Zhao-Carr microphysics scheme @@ -4148,6 +4151,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- NRL ozone physics character(len=128) :: err_message +!--- GFDL Microphysics + character(len=128) :: ccpp_errmsg + integer :: ccpp_errflg + ! dtend selection: default is to match all variables: dtend_select(1)='*' do ipat=2,pat_count @@ -4669,6 +4676,20 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- GFDL MP parameters Model%lgfdlmprad = lgfdlmprad + if (Model%imp_physics == Model%imp_physics_gfdl) then + call module_gfdl_cloud_microphys_init(Model%me, Model%master, Model%nlunit, Model%input_nml_file, & + Model%logunit, Model%fn_nml, ccpp_errmsg, ccpp_errflg) + end if + if (Model%imp_physics == Model%imp_physics_gfdl_v3) then + call module_gfdl_cloud_microphys_v3_init(Model%me, Model%master, Model%nlunit, Model%input_nml_file, & + Model%logunit, Model%fn_nml, hydrostatic, ccpp_errmsg, ccpp_errflg) + Model%imp_physics = Model%imp_physics_gfdl !DJS2024 We only need to distinguish v1/v3 for this step. + end if + if (ccpp_errflg .ne. 0) then + write(0,*) 'ERROR initializing GFDL Microphysics: ',ccpp_errmsg + stop + endif + !--- Thompson,GFDL,NSSL MP parameter Model%lrefres = lrefres @@ -4765,7 +4786,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%exticeden = exticeden if (Model%exticeden .and. & (Model%imp_physics /= Model%imp_physics_gfdl .and. Model%imp_physics /= Model%imp_physics_thompson .and. & - Model%imp_physics /= Model%imp_physics_nssl )) then + Model%imp_physics /= Model%imp_physics_nssl .and. Model%imp_physics /= Model%imp_physics_gfdl_v3)) then !see GFS_MP_generic_post.F90; exticeden is only compatible with GFDL, !Thompson, or NSSL MP print *,' Using exticeden = T is only valid when using GFDL, Thompson, or NSSL microphysics.' @@ -6101,8 +6122,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' mg_alf=', Model%mg_alf, ' mg_qcmin=', Model%mg_qcmin, & ' mg_do_ice_gmao=', Model%mg_do_ice_gmao, ' mg_do_liq_liu=', Model%mg_do_liq_liu - elseif (Model%imp_physics == Model%imp_physics_gfdl) then !GFDL microphysics - Model%npdf3d = 0 + elseif (Model%imp_physics == Model%imp_physics_gfdl .or. & + Model%imp_physics == Model%imp_physics_gfdl_v3) then !GFDL microphysics + Model%npdf3d = 0 if(Model%effr_in) then Model%num_p3d = 5 Model%nleffr = 1 @@ -6631,11 +6653,17 @@ subroutine control_print(Model) print *, ' ' endif if (Model%imp_physics == Model%imp_physics_gfdl) then - print *, ' GFDL microphysical parameters' + print *, ' GFDL microphysical parameters (version 1)' print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad print *, ' lrefres : ', Model%lrefres print *, ' ' endif + if (Model%imp_physics == Model%imp_physics_gfdl_v3) then + print *, ' GFDL microphysical parameters (version 3)' + print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad + print *, ' lrefres : ', Model%lrefres + print *, ' ' + endif if (Model%imp_physics == Model%imp_physics_fer_hires) then print *, ' Ferrier-Aligo microphysical parameters' print *, ' spec_adv : ', Model%spec_adv diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 83a7926802..dc65cfb806 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4245,6 +4245,12 @@ units = flag dimensions = () type = integer +[imp_physics_gfdl_v3] + standard_name = identifier_for_gfdl_microphysics_v3_scheme + long_name = choice of GFDL microphysics scheme version 3 + units = flag + dimensions = () + type = integer [imp_physics_thompson] standard_name = identifier_for_thompson_microphysics_scheme long_name = choice of Thompson microphysics scheme @@ -10058,6 +10064,8 @@ dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/h2o_def.f,photochem/module_ozphys.F90 dependencies = MP/GFDL_parse_tracers.F90 + dependencies = MP/GFDL/v1_2019/module_gfdl_cloud_microphys.F90 + dependencies = MP/GFDL/v3_2022/module_gfdl_cloud_microphys_v3.F90 [ccpp-arg-table] name = GFS_typedefs diff --git a/ccpp/physics b/ccpp/physics index 8b2d73e226..8aee3daaf7 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 8b2d73e226daf29dce4a7c92d1f5c3c8dcaf32ea +Subproject commit 8aee3daaf70994e0dfa5116f176f5e705b729ae6 diff --git a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml index c3d8c3b23b..280d437ced 100644 --- a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml +++ b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml @@ -4,7 +4,7 @@ - fv_sat_adj_v3 + fv_sat_adj @@ -77,7 +77,7 @@ GFS_suite_interstitial_4 cnvc90 GFS_MP_generic_pre - gfdl_cld_mp_v3 + gfdl_cloud_microphys_v3 GFS_MP_generic_post maximum_hourly_diagnostics GFS_physics_post From ed205db6432a4345f9278444f0a2fd0a947aad5e Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Mon, 29 Apr 2024 15:32:58 +0000 Subject: [PATCH 067/192] pointing new upp branch --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 1bf1163a5b..bee2891b25 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 1bf1163a5bd0b32ee6854bf4a43dbbd526ccf481 +Subproject commit bee2891b2508a8dabd60c048a6675127747559f4 From a609ad7974bca303877ec9481152d6eaa31be320 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 23 May 2024 14:24:29 +0000 Subject: [PATCH 068/192] Move gfdlmp init call to fv_sat_adj init(). --- ccpp/data/GFS_typedefs.F90 | 19 ------------------- ccpp/data/GFS_typedefs.meta | 2 -- ccpp/physics | 2 +- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 9a2eb6fa41..e1a8dc52ac 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -16,8 +16,6 @@ module GFS_typedefs use module_radlw_parameters, only: topflw_type, sfcflw_type use h2o_def, only: levh2o, h2o_coeff use module_ozphys, only: ty_ozphys - use module_gfdl_cloud_microphys, only: module_gfdl_cloud_microphys_init - use module_gfdl_cloud_microphys_v3, only: module_gfdl_cloud_microphys_v3_init implicit none @@ -4151,10 +4149,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- NRL ozone physics character(len=128) :: err_message -!--- GFDL Microphysics - character(len=128) :: ccpp_errmsg - integer :: ccpp_errflg - ! dtend selection: default is to match all variables: dtend_select(1)='*' do ipat=2,pat_count @@ -4676,19 +4670,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- GFDL MP parameters Model%lgfdlmprad = lgfdlmprad - if (Model%imp_physics == Model%imp_physics_gfdl) then - call module_gfdl_cloud_microphys_init(Model%me, Model%master, Model%nlunit, Model%input_nml_file, & - Model%logunit, Model%fn_nml, ccpp_errmsg, ccpp_errflg) - end if - if (Model%imp_physics == Model%imp_physics_gfdl_v3) then - call module_gfdl_cloud_microphys_v3_init(Model%me, Model%master, Model%nlunit, Model%input_nml_file, & - Model%logunit, Model%fn_nml, hydrostatic, ccpp_errmsg, ccpp_errflg) - Model%imp_physics = Model%imp_physics_gfdl !DJS2024 We only need to distinguish v1/v3 for this step. - end if - if (ccpp_errflg .ne. 0) then - write(0,*) 'ERROR initializing GFDL Microphysics: ',ccpp_errmsg - stop - endif !--- Thompson,GFDL,NSSL MP parameter Model%lrefres = lrefres diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index dc65cfb806..4723bf7324 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10064,8 +10064,6 @@ dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/h2o_def.f,photochem/module_ozphys.F90 dependencies = MP/GFDL_parse_tracers.F90 - dependencies = MP/GFDL/v1_2019/module_gfdl_cloud_microphys.F90 - dependencies = MP/GFDL/v3_2022/module_gfdl_cloud_microphys_v3.F90 [ccpp-arg-table] name = GFS_typedefs diff --git a/ccpp/physics b/ccpp/physics index 8aee3daaf7..174f598fd9 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 8aee3daaf70994e0dfa5116f176f5e705b729ae6 +Subproject commit 174f598fd9661c5edb0b1545eaa3db8ff4beebc5 From e42e1ce37ecb55f0adc91d585b0d78d4e4c29d04 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 23 May 2024 16:26:10 +0000 Subject: [PATCH 069/192] Revert mp init move. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 174f598fd9..45e99c9735 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 174f598fd9661c5edb0b1545eaa3db8ff4beebc5 +Subproject commit 45e99c97352a0423e7c0e3e4b7a55f50ee70da83 From f8ac2dae1c086777aa5bc8ea27e2efa6abab37f2 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 23 May 2024 16:27:56 +0000 Subject: [PATCH 070/192] Revert "Move gfdlmp init call to fv_sat_adj init()." This reverts commit a609ad7974bca303877ec9481152d6eaa31be320. --- ccpp/data/GFS_typedefs.F90 | 19 +++++++++++++++++++ ccpp/data/GFS_typedefs.meta | 2 ++ 2 files changed, 21 insertions(+) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 45646060e9..cd29d70da9 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -16,6 +16,8 @@ module GFS_typedefs use module_radlw_parameters, only: topflw_type, sfcflw_type use h2o_def, only: levh2o, h2o_coeff use module_ozphys, only: ty_ozphys + use module_gfdl_cloud_microphys, only: module_gfdl_cloud_microphys_init + use module_gfdl_cloud_microphys_v3, only: module_gfdl_cloud_microphys_v3_init implicit none @@ -4152,6 +4154,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- NRL ozone physics character(len=128) :: err_message +!--- GFDL Microphysics + character(len=128) :: ccpp_errmsg + integer :: ccpp_errflg + ! dtend selection: default is to match all variables: dtend_select(1)='*' do ipat=2,pat_count @@ -4673,6 +4679,19 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- GFDL MP parameters Model%lgfdlmprad = lgfdlmprad + if (Model%imp_physics == Model%imp_physics_gfdl) then + call module_gfdl_cloud_microphys_init(Model%me, Model%master, Model%nlunit, Model%input_nml_file, & + Model%logunit, Model%fn_nml, ccpp_errmsg, ccpp_errflg) + end if + if (Model%imp_physics == Model%imp_physics_gfdl_v3) then + call module_gfdl_cloud_microphys_v3_init(Model%me, Model%master, Model%nlunit, Model%input_nml_file, & + Model%logunit, Model%fn_nml, hydrostatic, ccpp_errmsg, ccpp_errflg) + Model%imp_physics = Model%imp_physics_gfdl !DJS2024 We only need to distinguish v1/v3 for this step. + end if + if (ccpp_errflg .ne. 0) then + write(0,*) 'ERROR initializing GFDL Microphysics: ',ccpp_errmsg + stop + endif !--- Thompson,GFDL,NSSL MP parameter Model%lrefres = lrefres diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 7423db8245..764424cf7a 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10033,6 +10033,8 @@ dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/h2o_def.f,photochem/module_ozphys.F90 dependencies = MP/GFDL_parse_tracers.F90 + dependencies = MP/GFDL/v1_2019/module_gfdl_cloud_microphys.F90 + dependencies = MP/GFDL/v3_2022/module_gfdl_cloud_microphys_v3.F90 [ccpp-arg-table] name = GFS_typedefs From 1fc27e55f370b96781ca9a36e5e8dc44cc849e90 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Fri, 21 Jun 2024 08:44:33 -0500 Subject: [PATCH 071/192] modulefiles/libraries updates for OS Rocky9 upgrade(Orion) --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 0cf0c81796..07daead315 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 0cf0c817969760633b1ad45525038f5d013fb350 +Subproject commit 07daead315d9c7723b94f945c360627c75dab2c7 From ae1da2200566e5a7bc6dcf04c8cd2400f44cf32e Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Thu, 4 Jul 2024 05:26:03 +0000 Subject: [PATCH 072/192] Update submodule upp. --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 3fff136857..1c2f8758e5 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 3fff136857a88fd62e23b4aa83022a9572c1a11e +Subproject commit 1c2f8758e571187e1e7d138a0399810a633f9028 From 5f310e5ca26da32214be14b320f7766c0dc9609f Mon Sep 17 00:00:00 2001 From: AndrewHazelton Date: Thu, 11 Jul 2024 13:47:50 +0000 Subject: [PATCH 073/192] Added SDF Files for Tiedtke Convection for HAFS (With and Without NSST) - Andy Hazelton 7/11/2024 --- ccpp/physics | 2 +- .../suite_FV3_HAFS_v1_thompson_tiedtke.xml | 90 +++++++++++++++++++ ...te_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml | 88 ++++++++++++++++++ 3 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke.xml create mode 100644 ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml diff --git a/ccpp/physics b/ccpp/physics index b09f85a4b0..c700e1b099 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit b09f85a4b0200cd5dff66558ab4ef775fc8d86c2 +Subproject commit c700e1b09977972b86e369a19ab551607a8e319d diff --git a/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke.xml b/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke.xml new file mode 100644 index 0000000000..ff41a91712 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke.xml @@ -0,0 +1,90 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + cu_ntiedtke_pre + cu_ntiedtke + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + cu_ntiedtke_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml new file mode 100644 index 0000000000..1b545286f7 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml @@ -0,0 +1,88 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_ocean + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + cu_ntiedtke_pre + cu_ntiedtke + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + cu_ntiedtke_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + From 79930a2bd565dd503978937c561a057a357a6bf7 Mon Sep 17 00:00:00 2001 From: Weiguo Wang Date: Fri, 12 Jul 2024 14:16:15 +0000 Subject: [PATCH 074/192] Update submodule ccpp/physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index c700e1b099..24a908e395 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c700e1b09977972b86e369a19ab551607a8e319d +Subproject commit 24a908e395b8df0ccbf6f33ba7428f7db34304bc From 6ffa16c39805ca9ed2731f01e4ce71500a1f85b1 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 12 Jul 2024 15:54:31 +0000 Subject: [PATCH 075/192] Update submodule ccpp/physics, which cherry-picked the following PR changes from @lisa-bengtsson: HR4 and SFS baseline update: Improve convection/radiation interaction in the GFS physics suite #216 --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 24a908e395..3e2b5753f1 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 24a908e395b8df0ccbf6f33ba7428f7db34304bc +Subproject commit 3e2b5753f18c624984b1b1a8ec66cb69b0f5bfa5 From 5a8c9be0f335cfd418ead1ec8c34159ebb650e13 Mon Sep 17 00:00:00 2001 From: XuLu-NOAA Date: Fri, 12 Jul 2024 18:36:03 +0000 Subject: [PATCH 076/192] Add IAU related changes for HAFS regional DA. --- atmos_cubed_sphere | 2 +- ccpp/data/GFS_typedefs.F90 | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index e255823550..3bdb6a1cfc 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit e2558235508396b687978d8fd07dbcb316735ac8 +Subproject commit 3bdb6a1cfc2894814c5a9473963f6759eff3ecaf diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 40c33cfc5b..45ed0710da 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1605,6 +1605,8 @@ module GFS_typedefs real(kind=kind_phys) :: iau_delthrs ! iau time interval (to scale increments) in hours character(len=240) :: iau_inc_files(7)! list of increment files real(kind=kind_phys) :: iaufhrs(7) ! forecast hours associated with increment files + logical :: iau_regional !< doing IAU for the nested domain for regional model + real :: iau_inc_scale !< increase IAU weight for 3DIAU logical :: iau_filter_increments, iau_drymassfixer ! From physcons.F90, updated/set in control_initialize @@ -3895,6 +3897,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: iau_delthrs = 0 !< iau time interval (to scale increments) character(len=240) :: iau_inc_files(7) = '' !< list of increment files real(kind=kind_phys) :: iaufhrs(7) = -1 !< forecast hours associated with increment files + logical :: iau_regional = .false. !< doing IAU for the nested domain for regional model + real :: iau_inc_scale = 1. !< increase IAU weight for 3DIAU logical :: iau_filter_increments = .false. !< filter IAU increments logical :: iau_drymassfixer = .false. !< IAU dry mass fixer @@ -4111,7 +4115,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & nspinup,ca_amplitude,nsmooth,ca_closure,ca_entr,ca_trigger, & !--- IAU iau_delthrs,iaufhrs,iau_inc_files,iau_filter_increments, & - iau_drymassfixer, & + iau_drymassfixer,iau_regional,iau_inc_scale, & !--- debug options debug, pre_rad, print_diff_pgr, & !--- parameter range for critical relative humidity @@ -5121,6 +5125,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%iaufhrs = iaufhrs Model%iau_inc_files = iau_inc_files Model%iau_delthrs = iau_delthrs + Model%iau_regional = iau_regional + Model%iau_inc_scale = iau_inc_scale Model%iau_filter_increments = iau_filter_increments Model%iau_drymassfixer = iau_drymassfixer if(Model%me==0) print *,' model init,iaufhrs=',Model%iaufhrs From 7867eddd3cd8e6939a65a4ec81a63bcf93cb8ab1 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Fri, 12 Jul 2024 18:37:52 +0000 Subject: [PATCH 077/192] Revise atmos_model.F90 for atmosphere-wave coupling. --- atmos_model.F90 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index 92fa597420..1f17ac3248 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -1963,14 +1963,17 @@ subroutine assign_importdata(jdat, rc) do i=isc,iec nb = Atm_block%blkno(i,j) ix = Atm_block%ixp(i,j) - if (GFS_data(nb)%Sfcprop%oceanfrac(ix) > zero .and. datar8(i,j) > zorlmin) then - tem = 100.0_GFS_kind_phys * min(0.1_GFS_kind_phys, datar8(i,j)) -! GFS_data(nb)%Coupling%zorlwav_cpl(ix) = tem - GFS_data(nb)%Sfcprop%zorlwav(ix) = tem - GFS_data(nb)%Sfcprop%zorlw(ix) = tem - else - GFS_data(nb)%Sfcprop%zorlwav(ix) = -999.0_GFS_kind_phys - +! if (GFS_data(nb)%Sfcprop%oceanfrac(ix) > zero .and. datar8(i,j) > zorlmin) then + if (GFS_data(nb)%Sfcprop%oceanfrac(ix) > zero) then + if (mergeflg(i,j)) datar8(i,j)=GFS_data(nb)%Sfcprop%zorlw(ix) ! use initial value + if (datar8(i,j) > zorlmin) then + tem = 100.0_GFS_kind_phys * min(0.1_GFS_kind_phys, datar8(i,j)) +! GFS_data(nb)%Coupling%zorlwav_cpl(ix) = tem + GFS_data(nb)%Sfcprop%zorlwav(ix) = tem + GFS_data(nb)%Sfcprop%zorlw(ix) = tem + else + GFS_data(nb)%Sfcprop%zorlwav(ix) = -999.0_GFS_kind_phys + endif endif enddo enddo From a09d142ccc5dd0524adecdae306643b110f52430 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sat, 13 Jul 2024 22:37:02 +0000 Subject: [PATCH 078/192] Update submodules of atmos_cubed_sphere and ccpp/physics. --- atmos_cubed_sphere | 2 +- ccpp/physics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 3bdb6a1cfc..1a8f38b699 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 3bdb6a1cfc2894814c5a9473963f6759eff3ecaf +Subproject commit 1a8f38b69953912385f502821c2e55345c3b3fd4 diff --git a/ccpp/physics b/ccpp/physics index 3e2b5753f1..24a908e395 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 3e2b5753f18c624984b1b1a8ec66cb69b0f5bfa5 +Subproject commit 24a908e395b8df0ccbf6f33ba7428f7db34304bc From fc741ca44997b6a2da6de5d450f0783be8c30fb0 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Mon, 15 Jul 2024 21:36:02 +0000 Subject: [PATCH 079/192] Update submodule ccpp/physics, which reverted TTE-based EMDF PBL changes. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 24a908e395..c700e1b099 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 24a908e395b8df0ccbf6f33ba7428f7db34304bc +Subproject commit c700e1b09977972b86e369a19ab551607a8e319d From 1d7b0c8b90ad38c5c34b79c978518853f0db8eaf Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 16 Jul 2024 17:37:58 +0000 Subject: [PATCH 080/192] Update submodule ccpp/physics. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index c700e1b099..11d3071f4d 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c700e1b09977972b86e369a19ab551607a8e319d +Subproject commit 11d3071f4d9dfbf581fb3d2a70d7ecff2975d385 From 88a34197f1eea1132f782f139efeacac40f46e27 Mon Sep 17 00:00:00 2001 From: JungHoon Shin Date: Mon, 29 Jul 2024 16:42:53 +0000 Subject: [PATCH 081/192] Updating ccpp/physics submodule: Increasing the absolute value of entrainment/detrainment coefficients. Simply changed 1.75e-3 to 2.50e-3 in line 2303 (entrainment part) and -1.75e-3 to -2.50e-3 in line 2179 (detrainment part) of the code --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 11d3071f4d..4f8f61501f 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 11d3071f4d9dfbf581fb3d2a70d7ecff2975d385 +Subproject commit 4f8f61501ff9ec315557718e851a4c81d6a373ea From 31ad5da8f0022f1a498047f511d08126c7c7bf5a Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Fri, 16 Aug 2024 14:09:39 -0400 Subject: [PATCH 082/192] Enable Gaea C6 support for hafs_post --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 1c2f8758e5..7d98b42d83 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 1c2f8758e571187e1e7d138a0399810a633f9028 +Subproject commit 7d98b42d83a2921ceebac1d89002c6ae225a6990 From c162e035dd7c511a56045b45a59a67c71d0b6934 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 26 Aug 2024 15:33:55 +0000 Subject: [PATCH 083/192] Some more changes. --- CMakeLists.txt | 1 + ccpp/physics | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd8eef7e54..28fbbd1eb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ set(use_WRTCOMP ON) set(GFS_PHYS ON) set(GFS_TYPES ON) set(USE_GFSL63 ON) +set(GFDLMP_V3 ON) if(MOVING_NEST) set(MOVING_NEST ON) endif() diff --git a/ccpp/physics b/ccpp/physics index 45e99c9735..b740df016d 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 45e99c97352a0423e7c0e3e4b7a55f50ee70da83 +Subproject commit b740df016d76751573cf900e3ecebc29dcdb9149 From ae5eb943063eb1413f494cf15002f7aa001668a9 Mon Sep 17 00:00:00 2001 From: Biju Date: Fri, 30 Aug 2024 14:14:46 +0000 Subject: [PATCH 084/192] Changes related to /lfs5 migration on Jet --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 1c2f8758e5..d7e7293b81 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 1c2f8758e571187e1e7d138a0399810a633f9028 +Subproject commit d7e7293b81c395e1f15f0ef097d651359ab5b625 From a0c9760fc954f8006880ed7126d76898d002faeb Mon Sep 17 00:00:00 2001 From: Biju Date: Mon, 9 Sep 2024 18:48:29 +0000 Subject: [PATCH 085/192] Updating new impi version, impi/2024.2.1 on Jet --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index d7e7293b81..8e7c37d00d 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit d7e7293b81c395e1f15f0ef097d651359ab5b625 +Subproject commit 8e7c37d00d65310fa209381cdf010dfddd6b2721 From 89d27ebfa460f6389e0df561dbc822075ec5f7b4 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Mon, 7 Oct 2024 09:55:20 -0500 Subject: [PATCH 086/192] Pointing upp branch with lfs4 to lfs5 change on Jet --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 7d98b42d83..cb8464d3a7 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 7d98b42d83a2921ceebac1d89002c6ae225a6990 +Subproject commit cb8464d3a71dab530ae71014d6da699ae736e115 From 299d0a20e5520266f9832a90ba3de229f0858825 Mon Sep 17 00:00:00 2001 From: Biju Date: Thu, 17 Oct 2024 19:51:14 +0000 Subject: [PATCH 087/192] Reverting to old impi version(2022.1.2) on Jet --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 8e7c37d00d..d4141894d4 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 8e7c37d00d65310fa209381cdf010dfddd6b2721 +Subproject commit d4141894d455d99a2b0faf40c5d7091e0f5fe6ef From 1c2df6bba24773a1dbf2adb21b5400d1e1839844 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 22 Oct 2024 14:56:42 +0000 Subject: [PATCH 088/192] Some mroe changes --- CMakeLists.txt | 1 - ccpp/data/GFS_typedefs.F90 | 33 +++------------------------------ ccpp/data/GFS_typedefs.meta | 8 -------- ccpp/physics | 2 +- 4 files changed, 4 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1f7954111..cdf597df28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,6 @@ set(use_WRTCOMP ON) set(GFS_PHYS ON) set(GFS_TYPES ON) set(USE_GFSL63 ON) -set(GFDLMP_V3 ON) if(MOVING_NEST) set(MOVING_NEST ON) endif() diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 4e889b704b..e8e9b9a8a2 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -16,8 +16,6 @@ module GFS_typedefs use module_radlw_parameters, only: topflw_type, sfcflw_type use h2o_def, only: levh2o, h2o_coeff use module_ozphys, only: ty_ozphys - use module_gfdl_cloud_microphys, only: module_gfdl_cloud_microphys_init - use module_gfdl_cloud_microphys_v3, only: module_gfdl_cloud_microphys_v3_init implicit none @@ -926,8 +924,7 @@ module GFS_typedefs !< and if yes, perform them; hardcoded to .true. for now !--- new microphysical switch integer :: imp_physics !< choice of microphysics scheme - integer :: imp_physics_gfdl = 11 !< choice of GFDL v1 microphysics scheme - integer :: imp_physics_gfdl_v3 = 12 !< choice of GFDL v3 microphysics scheme + integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme integer :: imp_physics_thompson = 8 !< choice of Thompson microphysics scheme integer :: imp_physics_wsm6 = 6 !< choice of WSMG microphysics scheme integer :: imp_physics_zhao_carr = 99 !< choice of Zhao-Carr microphysics scheme @@ -4159,10 +4156,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- NRL ozone physics character(len=128) :: err_message -!--- GFDL Microphysics - character(len=128) :: ccpp_errmsg - integer :: ccpp_errflg - ! dtend selection: default is to match all variables: dtend_select(1)='*' do ipat=2,pat_count @@ -4699,19 +4692,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- GFDL MP parameters Model%lgfdlmprad = lgfdlmprad - if (Model%imp_physics == Model%imp_physics_gfdl) then - call module_gfdl_cloud_microphys_init(Model%me, Model%master, Model%nlunit, Model%input_nml_file, & - Model%logunit, Model%fn_nml, ccpp_errmsg, ccpp_errflg) - end if - if (Model%imp_physics == Model%imp_physics_gfdl_v3) then - call module_gfdl_cloud_microphys_v3_init(Model%me, Model%master, Model%nlunit, Model%input_nml_file, & - Model%logunit, Model%fn_nml, hydrostatic, ccpp_errmsg, ccpp_errflg) - Model%imp_physics = Model%imp_physics_gfdl !DJS2024 We only need to distinguish v1/v3 for this step. - end if - if (ccpp_errflg .ne. 0) then - write(0,*) 'ERROR initializing GFDL Microphysics: ',ccpp_errmsg - stop - endif !--- Thompson,GFDL,NSSL MP parameter Model%lrefres = lrefres @@ -4809,7 +4789,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%exticeden = exticeden if (Model%exticeden .and. & (Model%imp_physics /= Model%imp_physics_gfdl .and. Model%imp_physics /= Model%imp_physics_thompson .and. & - Model%imp_physics /= Model%imp_physics_nssl .and. Model%imp_physics /= Model%imp_physics_gfdl_v3)) then + Model%imp_physics /= Model%imp_physics_nssl)) then !see GFS_MP_generic_post.F90; exticeden is only compatible with GFDL, !Thompson, or NSSL MP print *,' Using exticeden = T is only valid when using GFDL, Thompson, or NSSL microphysics.' @@ -6153,8 +6133,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' mg_alf=', Model%mg_alf, ' mg_qcmin=', Model%mg_qcmin, & ' mg_do_ice_gmao=', Model%mg_do_ice_gmao, ' mg_do_liq_liu=', Model%mg_do_liq_liu - elseif (Model%imp_physics == Model%imp_physics_gfdl .or. & - Model%imp_physics == Model%imp_physics_gfdl_v3) then !GFDL microphysics + elseif (Model%imp_physics == Model%imp_physics_gfdl) then !GFDL microphysics Model%npdf3d = 0 if(Model%effr_in) then Model%num_p3d = 5 @@ -6691,12 +6670,6 @@ subroutine control_print(Model) print *, ' lrefres : ', Model%lrefres print *, ' ' endif - if (Model%imp_physics == Model%imp_physics_gfdl_v3) then - print *, ' GFDL microphysical parameters (version 3)' - print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad - print *, ' lrefres : ', Model%lrefres - print *, ' ' - endif if (Model%imp_physics == Model%imp_physics_fer_hires) then print *, ' Ferrier-Aligo microphysical parameters' print *, ' spec_adv : ', Model%spec_adv diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 20d2268a76..62a981c46a 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4271,12 +4271,6 @@ long_name = choice of GFDL microphysics scheme units = flag dimensions = () - type = integer -[imp_physics_gfdl_v3] - standard_name = identifier_for_gfdl_microphysics_v3_scheme - long_name = choice of GFDL microphysics scheme version 3 - units = flag - dimensions = () type = integer [imp_physics_thompson] standard_name = identifier_for_thompson_microphysics_scheme @@ -10020,8 +10014,6 @@ dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/h2o_def.f,photochem/module_ozphys.F90 dependencies = MP/GFDL_parse_tracers.F90 - dependencies = MP/GFDL/v1_2019/module_gfdl_cloud_microphys.F90 - dependencies = MP/GFDL/v3_2022/module_gfdl_cloud_microphys_v3.F90 [ccpp-arg-table] name = GFS_typedefs diff --git a/ccpp/physics b/ccpp/physics index b740df016d..c9d4dcaa8c 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit b740df016d76751573cf900e3ecebc29dcdb9149 +Subproject commit c9d4dcaa8ca8556b23a4905e894cffa6d1055371 From 20de3c698ad863c399c53590caf49298be564af7 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 22 Oct 2024 15:18:17 +0000 Subject: [PATCH 089/192] Remove unecessary changes --- ccpp/data/GFS_typedefs.F90 | 7 +++---- ccpp/data/GFS_typedefs.meta | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 11d0156403..9e8bfc7d38 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -4728,7 +4728,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- GFDL MP parameters Model%lgfdlmprad = lgfdlmprad - !--- Thompson,GFDL,NSSL MP parameter Model%lrefres = lrefres @@ -4825,7 +4824,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%exticeden = exticeden if (Model%exticeden .and. & (Model%imp_physics /= Model%imp_physics_gfdl .and. Model%imp_physics /= Model%imp_physics_thompson .and. & - Model%imp_physics /= Model%imp_physics_nssl)) then + Model%imp_physics /= Model%imp_physics_nssl )) then !see GFS_MP_generic_post.F90; exticeden is only compatible with GFDL, !Thompson, or NSSL MP print *,' Using exticeden = T is only valid when using GFDL, Thompson, or NSSL microphysics.' @@ -6171,7 +6170,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' mg_do_ice_gmao=', Model%mg_do_ice_gmao, ' mg_do_liq_liu=', Model%mg_do_liq_liu elseif (Model%imp_physics == Model%imp_physics_gfdl) then !GFDL microphysics - Model%npdf3d = 0 + Model%npdf3d = 0 if(Model%effr_in) then Model%num_p3d = 5 Model%nleffr = 1 @@ -6703,7 +6702,7 @@ subroutine control_print(Model) print *, ' ' endif if (Model%imp_physics == Model%imp_physics_gfdl) then - print *, ' GFDL microphysical parameters (version 1)' + print *, ' GFDL microphysical parameters' print *, ' GFDL MP radiation inter: ', Model%lgfdlmprad print *, ' lrefres : ', Model%lrefres print *, ' ' diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 40619a1cb7..2fee7ba12e 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4301,7 +4301,7 @@ long_name = choice of GFDL microphysics scheme units = flag dimensions = () - type = integer + type = integer [imp_physics_thompson] standard_name = identifier_for_thompson_microphysics_scheme long_name = choice of Thompson microphysics scheme From d2cf08a15ce68b66c1b0bc6e1d4c66b89b4fa855 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 22 Oct 2024 15:23:09 +0000 Subject: [PATCH 090/192] Update GFDLMPV3 based SDFs --- ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml | 2 +- ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml index 280d437ced..a812035b4f 100644 --- a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml +++ b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml @@ -65,7 +65,7 @@ cires_ugwp_post GFS_GWD_generic_post GFS_suite_stateout_update - h2ophys + GFS_photochemistry get_phi_fv3 GFS_suite_interstitial_3 GFS_DCNV_generic_pre diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml index a1c57f46c4..11def51761 100644 --- a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml +++ b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml @@ -4,7 +4,7 @@ - fv_sat_adj_v3 + fv_sat_adj @@ -65,7 +65,7 @@ unified_ugwp_post GFS_GWD_generic_post GFS_suite_stateout_update - h2ophys + GFS_photochemistry get_phi_fv3 GFS_suite_interstitial_3 GFS_DCNV_generic_pre @@ -77,7 +77,7 @@ GFS_suite_interstitial_4 cnvc90 GFS_MP_generic_pre - gfdl_cld_mp_v3 + gfdl_cloud_microphys_v3 GFS_MP_generic_post maximum_hourly_diagnostics GFS_physics_post From 5296fb7f5b3b3e77ca73afa6c9c9606f876a01e6 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 1 Nov 2024 16:51:24 +0000 Subject: [PATCH 091/192] Update .gitmodules. --- .gitmodules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6423291d7d..ce466d152a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere - branch = feature/hafs.v2.0.1 + branch = support/HAFS [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework @@ -9,8 +9,8 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics - branch = feature/hafs.v2.0.1 + branch = support/HAFS [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP - branch = feature/hafs.v2.0.1 + branch = support/HAFS From 2f91520ede1848610ec95e09eb860b268d8d61eb Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 7 Nov 2024 20:24:52 +0000 Subject: [PATCH 092/192] Some of the last changes --- ccpp/data/GFS_typedefs.meta | 2 +- ccpp/physics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 2fee7ba12e..76109c9a16 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10073,7 +10073,7 @@ dependencies = hooks/machine.F,hooks/physcons.F90 dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/module_ozphys.F90,photochem/module_h2ophys.F90 - dependencies = MP/GFDL/GFDL_parse_tracers.F90 + dependencies = MP/GFDL_parse_tracers.F90 [ccpp-arg-table] name = GFS_typedefs diff --git a/ccpp/physics b/ccpp/physics index c9d4dcaa8c..ec607766a6 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c9d4dcaa8ca8556b23a4905e894cffa6d1055371 +Subproject commit ec607766a676471c6862cc54e88999de2c18bf37 From bfeff8f4c1f587e717a806a0d899b33321a88918 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 7 Nov 2024 20:37:47 +0000 Subject: [PATCH 093/192] More changes! --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index ec607766a6..c05ed51d6a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ec607766a676471c6862cc54e88999de2c18bf37 +Subproject commit c05ed51d6affc53c2ac621bb073c4d8b909632da From cf0c7766248b8d02c12773500635ed54fe691a5c Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 13 Nov 2024 17:23:46 +0000 Subject: [PATCH 094/192] Add call the GFDLMP register in FV3 --- .gitmodules | 7 ++----- atmos_cubed_sphere | 2 +- ccpp/physics | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.gitmodules b/.gitmodules index d23cb31652..620d66a2d7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,18 +1,15 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/dustinswales/GFDL_atmos_cubed_sphere + branch = feature/gfdlmpv3 [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework branch = main [submodule "ccpp/physics"] path = ccpp/physics - #url = https://github.com/ufs-community/ccpp-physics - #branch = ufs/dev url = https://github.com/dustinswales/ccpp-physics branch = feature/gfdlmpv3 - [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index e36e8572e7..aab96734b8 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit e36e8572e7643d7e59a3979a61bdd83743ff7b00 +Subproject commit aab96734b8a0fbab6de46701d2ecfbbdec68f6a4 diff --git a/ccpp/physics b/ccpp/physics index c05ed51d6a..f7d8dbe3b5 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c05ed51d6affc53c2ac621bb073c4d8b909632da +Subproject commit f7d8dbe3b5babbb71ae7e01d075c7139487d5845 From 311bf52e41d69d987b246af180c4c0058db05875 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 13 Nov 2024 17:25:45 +0000 Subject: [PATCH 095/192] Updated physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index f7d8dbe3b5..ab9aa26bf2 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit f7d8dbe3b5babbb71ae7e01d075c7139487d5845 +Subproject commit ab9aa26bf24a3dd13421ba3b69c0e560d3ee272d From 0f7d5e0f02688dc47a3d3d83f9d04a901d7b54f5 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 18 Nov 2024 17:45:14 +0000 Subject: [PATCH 096/192] Bugfix in physics --- .gitmodules | 4 ++-- atmos_cubed_sphere | 2 +- ccpp/physics | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 620d66a2d7..b863cbc999 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/dustinswales/GFDL_atmos_cubed_sphere - branch = feature/gfdlmpv3 + url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere + branch = dev/emc [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index aab96734b8..e36e8572e7 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit aab96734b8a0fbab6de46701d2ecfbbdec68f6a4 +Subproject commit e36e8572e7643d7e59a3979a61bdd83743ff7b00 diff --git a/ccpp/physics b/ccpp/physics index ab9aa26bf2..768161a44a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ab9aa26bf24a3dd13421ba3b69c0e560d3ee272d +Subproject commit 768161a44a0f622a1a8b52c784a8202287feeedf From 7c46b87f12fe89c729bce6433bf051be242f2ca9 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 18 Nov 2024 20:13:57 +0000 Subject: [PATCH 097/192] Updated physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 768161a44a..b67bdbe7fa 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 768161a44a0f622a1a8b52c784a8202287feeedf +Subproject commit b67bdbe7fa5994bffea96374e9222f8c657a0de1 From 7193dbd3f1ca3015e87aabe0913ed5d61a531893 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 18 Nov 2024 22:53:09 +0000 Subject: [PATCH 098/192] Updated physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index b67bdbe7fa..a352eb3f02 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit b67bdbe7fa5994bffea96374e9222f8c657a0de1 +Subproject commit a352eb3f02f41c7093bda2116c0dfc895d3119a3 From 0c4529cd9e1e9f358e668660c80e5470b125fef0 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 19 Nov 2024 17:03:50 +0000 Subject: [PATCH 099/192] Bug fix from GNU compile. Bug fix from merge. --- ccpp/data/GFS_typedefs.meta | 2 +- ccpp/physics | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index ca845658c3..400940a5a8 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10088,7 +10088,7 @@ dependencies = hooks/machine.F,hooks/physcons.F90 dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f dependencies = photochem/module_ozphys.F90,photochem/module_h2ophys.F90 - dependencies = SFC_Models/Land/Noahmp/lnd_iau_mod.F90,MP/GFDL/GFDL_parse_tracers.F90 + dependencies = SFC_Models/Land/Noahmp/lnd_iau_mod.F90,MP/GFDL_parse_tracers.F90 [ccpp-arg-table] name = GFS_typedefs diff --git a/ccpp/physics b/ccpp/physics index a352eb3f02..96e5198d87 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit a352eb3f02f41c7093bda2116c0dfc895d3119a3 +Subproject commit 96e5198d87fd691d368c237ef9d5f6d14536dad7 From 59164a6c79eb61aff360ad54f0a6fbe7d15660be Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 21 Nov 2024 15:33:36 +0000 Subject: [PATCH 100/192] Doh! --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 96e5198d87..7496933c91 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 96e5198d87fd691d368c237ef9d5f6d14536dad7 +Subproject commit 7496933c91af8bea3b8b283f88bcb71f4ff5d2f5 From e51cb6aa66a1af893e005a51ad32c17d5a1d3bb1 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Fri, 13 Dec 2024 09:14:38 -0600 Subject: [PATCH 101/192] Pointing the new commit in upp(Reverting to old impi version(2022.1.2) on Jet) --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index cb8464d3a7..4d0f3ef076 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit cb8464d3a71dab530ae71014d6da699ae736e115 +Subproject commit 4d0f3ef0766e82b0279ac8566f95f80aa14b7b66 From dd0c88a2973b117384f1688f67752a66ecad1d60 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 16 Dec 2024 19:37:12 +0000 Subject: [PATCH 102/192] Update physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 7496933c91..945bd99921 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 7496933c91af8bea3b8b283f88bcb71f4ff5d2f5 +Subproject commit 945bd999211b01dcfec925698174d6b2cb4abadb From 35ee71143063df3bfe769da95c2c6cb2cf0bb8a9 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Wed, 18 Dec 2024 11:55:23 -0500 Subject: [PATCH 103/192] Rename Gaea C6 platform name from gaeaC6 to gaeac6 consistent with UFS name convention --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 8265f9ff6d..5b24c88503 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 8265f9ff6d534656ce6c9159c749bf1e6a8eb5c0 +Subproject commit 5b24c88503288444545fd799bf64ad886afb6463 From 850800816a438d84352328c7974bf1847a872adb Mon Sep 17 00:00:00 2001 From: Rongqian Yang Date: Mon, 6 Jan 2025 20:00:43 -0600 Subject: [PATCH 104/192] Change ccpp to feature branch --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6423291d7d..c3c9ff009a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,8 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/hafs-community/ccpp-physics - branch = feature/hafs.v2.0.1 + url = https://github.com/RongqianYang-NOAA/ccpp-physics + branch = feature/EMC_mn_noahmp [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP From bf314fd1ee8fd9e62ec17e4e732da10c4cc74bc0 Mon Sep 17 00:00:00 2001 From: Rongqian Yang Date: Mon, 6 Jan 2025 20:29:27 -0600 Subject: [PATCH 105/192] Fix main zsns_default bug --- moving_nest/fv_moving_nest_main.F90 | 186 +++++++++++++++------------- 1 file changed, 102 insertions(+), 84 deletions(-) diff --git a/moving_nest/fv_moving_nest_main.F90 b/moving_nest/fv_moving_nest_main.F90 index fd656a9a01..c47144eb72 100644 --- a/moving_nest/fv_moving_nest_main.F90 +++ b/moving_nest/fv_moving_nest_main.F90 @@ -813,7 +813,7 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, !! For NOAHMP ! (/0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0/) -- 3 snow levels, 4 soil levels real :: zsns_default(-2:4) - zsns_default = [0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0 ] + zsns_default = [0.0, 0.0, 0.0, -0.1,-0.4,-1.0,-2.0 ] rad2deg = 180.0 / pi @@ -1309,149 +1309,169 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, ! Regular physics variables do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. maxSkinTempK ) then - print '("[INFO] WDR NOAHMP reset soil temp values npe=",I0," i=",I0," j=",I0," stc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%stc(i,j,k) Moving_nest(n)%mn_phys%stc(i,j,k) = 298.0 endif if (Moving_nest(n)%mn_phys%smc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%smc(i,j,k) .gt. 1000.0 ) then - print '("[INFO] WDR NOAHMP reset soil moisture values npe=",I0," i=",I0," j=",I0," smc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%smc(i,j,k) Moving_nest(n)%mn_phys%smc(i,j,k) = 0.3 endif if (Moving_nest(n)%mn_phys%slc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%slc(i,j,k) .gt. 1000.0 ) then - print '("[INFO] WDR NOAHMP reset soil liquid values npe=",I0," i=",I0," j=",I0," slc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%slc(i,j,k) Moving_nest(n)%mn_phys%slc(i,j,k) = 0.3 endif enddo if (Moving_nest(n)%mn_phys%canopy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%canopy(i,j) .gt. 100.0 ) then - print '("[INFO] WDR NOAHMP reset canopy water values npe=",I0," i=",I0," j=",I0," canopy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%canopy(i,j) Moving_nest(n)%mn_phys%canopy(i,j) = 0.0 ! Zero out if no other information endif if (Moving_nest(n)%mn_phys%vegfrac(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%vegfrac(i,j) .gt. 100.0 ) then - print '("[INFO] WDR NOAHMP reset vegfrac values npe=",I0," i=",I0," j=",I0," vegfrac=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%vegfrac(i,j) Moving_nest(n)%mn_phys%vegfrac(i,j) = 0.5 ! Default to half. Confirmed that values are fractions. endif + if (move_noahmp) then + if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1) then + ! NOAH MP Variables - if (move_noahmp) then + if (Moving_nest(n)%mn_phys%snowd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snowd(i,j) .gt. 1000.0 ) then + Moving_nest(n)%mn_phys%snowd(i,j) = 0.0 ! Cold start value in meters + endif - !! Patch to reset slmsk - !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1 .and. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. 1e+10) then - ! print '("[INFO] WDR NOAHMP reset land to water for lake npe=",I0," i=",I0," j=",I0," tgxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tgxy(i,j) - ! Moving_nest(n)%mn_phys%slmsk(i,j) = 0 - !endif + if (Moving_nest(n)%mn_phys%weasd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%weasd(i,j) .gt. 1000.0 ) then + Moving_nest(n)%mn_phys%weasd(i,j) = 0.0 ! Cold start value in mm + endif - ! slmsk(:,:) !< land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + Moving_nest(n)%mn_phys%snowxy(i,j) = 0.0 ! init all 5 to 0 first and snowd <=0.025 - !if (this_pe .eq. 89) then - ! print '("[INFO] WDR NOAHMP debug npe=",I0," i=",I0," j=",I0," shdmax=",E12.5," shdmin=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%shdmax(i,j), Moving_nest(n)%mn_phys%shdmin(i,j) - ! print '("[INFO] WDR NOAHMP debug npe=",I0," i=",I0," j=",I0," tsfc=",E12.5," tsfcl=",E12.5," tsfco=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tsfc(i,j), Moving_nest(n)%mn_phys%tsfcl(i,j), Moving_nest(n)%mn_phys%tsfco(i,j) - !endif + do k=lbound(Moving_nest(n)%mn_phys%zsnsoxy,3), ubound(Moving_nest(n)%mn_phys%zsnsoxy,3) + Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) = 0.0 + enddo + + do k=lbound(Moving_nest(n)%mn_phys%tsnoxy,3),ubound(Moving_nest(n)%mn_phys%tsnoxy,3) + Moving_nest(n)%mn_phys%tsnoxy(i,j,k) = 0.0 + Moving_nest(n)%mn_phys%snicexy(i,j,k) = 0.0 + Moving_nest(n)%mn_phys%snliqxy(i,j,k) = 0.0 + enddo + if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.025 .and. Moving_nest(n)%mn_phys%snowd(i,j) .le. 0.05) then + Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) - if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1) then - ! NOAH MP Variables - ! This is normally a negative number - if (Moving_nest(n)%mn_phys%snowxy(i,j) .lt. -9.0 .or. Moving_nest(n)%mn_phys%snowxy(i,j) .gt. 9.0 ) then - print '("[INFO] WDR NOAHMP reset negative values npe=",I0," i=",I0," j=",I0," snowxy=",E12.5," alboldoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowxy(i,j), Moving_nest(n)%mn_phys%alboldxy(i,j) - print '("[INFO] WDR NOAHMP reset snowxy npe=",I0," i=",I0," j=",I0," land_frac=",E19.12," nint(land_frac)=",I0)', mpp_pe(), i, j, mn_static%fp_ls%land_frac_grid((ioffset-1)*x_refine+i, (joffset-1)*y_refine+j), nint(mn_static%fp_ls%land_frac_grid((ioffset-1)*x_refine+i, (joffset-1)*y_refine+j)) + Moving_nest(n)%mn_phys%snowxy(i,j) = -1.0 + Moving_nest(n)%mn_phys%zsnsoxy(i,j,0) = Moving_nest(n)%mn_phys%snowd(i,j) + Moving_nest(n)%mn_phys%snicexy(i,j,0) = Moving_nest(n)%mn_phys%weasd(i,j) - do k=lbound(Moving_nest(n)%mn_phys%hprime,3),ubound(Moving_nest(n)%mn_phys%hprime,3) - print '("[INFO] WDR NOAHMP reset show hprime values npe=",I0," i=",I0," j=",I0," k=",I0," hprime=",E12.5)', mpp_pe(), i, j, k, Moving_nest(n)%mn_phys%hprime(i,j,k) - enddo + else if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.05 .and. Moving_nest(n)%mn_phys%snowd(i,j) .le. 0.1) then + Moving_nest(n)%mn_phys%tsnoxy(i,j,-1) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%snowxy(i,j) = -2.0 + Moving_nest(n)%mn_phys%zsnsoxy(i,j,-1) = Moving_nest(n)%mn_phys%snowd(i,j) + Moving_nest(n)%mn_phys%zsnsoxy(i,j,0) = Moving_nest(n)%mn_phys%snowd(i,j) /2.0 - Moving_nest(n)%mn_phys%snowxy(i,j) = 0.0 - endif + Moving_nest(n)%mn_phys%snicexy(i,j,-1) = Moving_nest(n)%mn_phys%weasd(i,j)/2.0 + Moving_nest(n)%mn_phys%snicexy(i,j,0) = Moving_nest(n)%mn_phys%weasd(i,j)/2.0 - if (Moving_nest(n)%mn_phys%soilcolor(i,j) .lt. 1.0 .or. Moving_nest(n)%mn_phys%soilcolor(i,j) .gt. 19.0 ) then - print '("[INFO] WDR NOAHMP reset soilcolor values npe=",I0," i=",I0," j=",I0," soilcolor=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%soilcolor(i,j) - ! Default changed to 10 based on suggestion from Mike Barlage; more middle of the spectrum value. - Moving_nest(n)%mn_phys%soilcolor(i,j) = 10.0 - endif + else if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.1 .and. Moving_nest(n)%mn_phys%snowd(i,j) .le. 0.25) then + Moving_nest(n)%mn_phys%tsnoxy(i,j,-1) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) - if (Moving_nest(n)%mn_phys%alboldxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%alboldxy(i,j) .gt. 1.0 ) then - print '("[INFO] WDR NOAHMP reset old albedo alboldxy values npe=",I0," i=",I0," j=",I0," alboldxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%alboldxy(i,j) - Moving_nest(n)%mn_phys%alboldxy(i,j) = 0.65 ! Cold start value - endif + Moving_nest(n)%mn_phys%snowxy(i,j) = -2.0 - do k=lbound(Moving_nest(n)%mn_phys%snicexy,3),ubound(Moving_nest(n)%mn_phys%snicexy,3) - if (Moving_nest(n)%mn_phys%snicexy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snicexy(i,j,k) .gt. 100.0 ) then - print '("[INFO] WDR NOAHMP reset ice thickness values npe=",I0," a_step=",I0," i=",I0," j=",I0," k=",I0," lat,lon=",F9.5,",",F10.5," snicexy=",E12.5," lsnow=",I0,"-",I0)', mpp_pe(), a_step, i, j, k, Atm(n)%gridstruct%agrid(i,j,2)*rad2deg, Atm(n)%gridstruct%agrid(i,j,1)*rad2deg - 360.0, Moving_nest(n)%mn_phys%snicexy(i,j,k), IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound + Moving_nest(n)%mn_phys%zsnsoxy(i,j,-1) = Moving_nest(n)%mn_phys%snowd(i,j) ! dzsn(-1) = 0.05 + Moving_nest(n)%mn_phys%zsnsoxy(i,j,0) = Moving_nest(n)%mn_phys%snowd(i,j) - 0.05 - !print '("[INFO] WDR NOAHMP snicexy reset ice thickness values npe=",I0," isd-ied=",I0,"-",I0," jsd-jed",I0,"-",I0," k=",I0,"-",I0)', mpp_pe(), isd, ied, jsd, jed, lbound(Moving_nest(n)%mn_phys%snicexy,3), ubound(Moving_nest(n)%mn_phys%snicexy,3) + Moving_nest(n)%mn_phys%snicexy(i,j,-1) = 0.05* & + Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) + Moving_nest(n)%mn_phys%snicexy(i,j,0) = (Moving_nest(n)%mn_phys%snowd(i,j)-0.05)* & + Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - Moving_nest(n)%mn_phys%snicexy(i,j,k) = 0.0 ! Cold start value - endif - enddo + else if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.25 .and. Moving_nest(n)%mn_phys%snowd(i,j) .le. 0.35) then + Moving_nest(n)%mn_phys%tsnoxy(i,j,-2) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%tsnoxy(i,j,-1) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%snowxy(i,j) = -3.0 - do k=lbound(Moving_nest(n)%mn_phys%snliqxy,3),ubound(Moving_nest(n)%mn_phys%snliqxy,3) - if (Moving_nest(n)%mn_phys%snliqxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snliqxy(i,j,k) .gt. 100.0 ) then - print '("[INFO] WDR NOAHMP reset liq thickness values npe=",I0," i=",I0," j=",I0," snliqxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snliqxy(i,j,k) - Moving_nest(n)%mn_phys%snliqxy(i,j,k) = 0.0 ! Cold start value - endif - enddo + Moving_nest(n)%mn_phys%zsnsoxy(i,j,-2) = Moving_nest(n)%mn_phys%snowd(i,j) !dzsn(-2) = 0.05 + Moving_nest(n)%mn_phys%zsnsoxy(i,j,-1) = Moving_nest(n)%mn_phys%snowd(i,j) -0.05 + Moving_nest(n)%mn_phys%zsnsoxy(i,j, 0) = (Moving_nest(n)%mn_phys%snowd(i,j) -0.05)/2.0 - ! (/0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0/) -- 3 snow levels, 4 soil levels - do k=lbound(Moving_nest(n)%mn_phys%zsnsoxy,3),ubound(Moving_nest(n)%mn_phys%zsnsoxy,3) - if (Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) .lt. -80.0 .or. Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) .gt. 100.0 ) then - print '("[INFO] WDR NOAHMP reset snow surface depth values npe=",I0," i=",I0," j=",I0," k=",I0," zsnsoxy=",E12.5)', mpp_pe(), i, j, k, Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) - !Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) = 0.0 ! Cold start value - Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) = zsns_default(k) ! Cold start value - endif - enddo + Moving_nest(n)%mn_phys%snicexy(i,j,-2) = 0.05* & + Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - if (Moving_nest(n)%mn_phys%snowd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snowd(i,j) .gt. 1000.0 ) then - print '("[INFO] WDR NOAHMP reset snow thickness values npe=",I0," i=",I0," j=",I0," snowd=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%snowd(i,j) - Moving_nest(n)%mn_phys%snowd(i,j) = 0.0 ! Cold start value + Moving_nest(n)%mn_phys%snicexy(i,j,-1) = (Moving_nest(n)%mn_phys%snowd(i,j)-0.05)/2.0* & + Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) + Moving_nest(n)%mn_phys%snicexy(i,j,0) = (Moving_nest(n)%mn_phys%snowd(i,j)-0.05)/2.0* & + Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) + + else if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.35 ) then + Moving_nest(n)%mn_phys%tsnoxy(i,j,-2) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%tsnoxy(i,j,-1) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) + Moving_nest(n)%mn_phys%snowxy(i,j) = -3.0 + + Moving_nest(n)%mn_phys%zsnsoxy(i,j,-2) = Moving_nest(n)%mn_phys%snowd(i,j) !dzsn(-2)=0.05 + Moving_nest(n)%mn_phys%zsnsoxy(i,j,-1) = Moving_nest(n)%mn_phys%snowd(i,j) - 0.05 !dzsno(-1) = 0.10 + Moving_nest(n)%mn_phys%zsnsoxy(i,j, 0) = Moving_nest(n)%mn_phys%snowd(i,j) - 0.05 - 0.10 + + Moving_nest(n)%mn_phys%snicexy(i,j,-2) = 0.05* & + Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) + + Moving_nest(n)%mn_phys%snicexy(i,j,-1) = 0.10* & + Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) + + Moving_nest(n)%mn_phys%snicexy(i,j,0) = (Moving_nest(n)%mn_phys%snowd(i,j)-0.05 - 0.10)* & + Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) + endif + + + Moving_nest(n)%mn_phys%zsnsoxy(i,j,1) = -0.10 + Moving_nest(n)%mn_phys%zsnsoxy(i,j,2) = -0.40 + Moving_nest(n)%mn_phys%zsnsoxy(i,j,3) = -1.00 + Moving_nest(n)%mn_phys%zsnsoxy(i,j,4) = -2.00 + + + if (Moving_nest(n)%mn_phys%soilcolor(i,j) .lt. 1.0 .or. Moving_nest(n)%mn_phys%soilcolor(i,j) .gt. 19.0 ) then + ! Default changed to 10 based on suggestion from Mike Barlage; more middle of the spectrum value. + Moving_nest(n)%mn_phys%soilcolor(i,j) = 10.0 endif - if (Moving_nest(n)%mn_phys%weasd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%weasd(i,j) .gt. 1000.0 ) then - print '("[INFO] WDR NOAHMP reset snow thickness values npe=",I0," i=",I0," j=",I0," weasd=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%weasd(i,j) - Moving_nest(n)%mn_phys%weasd(i,j) = 0.0 ! Cold start value + if (Moving_nest(n)%mn_phys%alboldxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%alboldxy(i,j) .gt. 1.0 ) then + Moving_nest(n)%mn_phys%alboldxy(i,j) = 0.65 ! Cold start value endif - do k=lbound(Moving_nest(n)%mn_phys%tsnoxy,3),ubound(Moving_nest(n)%mn_phys%tsnoxy,3) - if (Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tsnoxy(i,j,k) .gt. maxSkinTempK ) then - print '("[INFO] WDR NOAHMP reset snow temp values npe=",I0," i=",I0," j=",I0," tsnoxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tsnoxy(i,j,k) - Moving_nest(n)%mn_phys%tsnoxy(i,j,k) = 0.0 ! Cold start value - endif - enddo + do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) + if (Moving_nest(n)%mn_phys%smoiseq(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%smoiseq(i,j,k) .gt. 1000.0) then + Moving_nest(n)%mn_phys%smoiseq(i,j,k) = 0.3 + + endif + enddo + if (Moving_nest(n)%mn_phys%tvxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tvxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset vegetation canopy temp values npe=",I0," i=",I0," j=",I0," tvxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tvxy(i,j) - Moving_nest(n)%mn_phys%tvxy(i,j) = 298.0 ! skin temperature + Moving_nest(n)%mn_phys%tvxy(i,j) = Moving_nest(n)%mn_phys%ts(i,j) ! skin temperature endif if (Moving_nest(n)%mn_phys%tgxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset ground temp values npe=",I0," i=",I0," j=",I0," tgxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tgxy(i,j) - Moving_nest(n)%mn_phys%tgxy(i,j) = 298.0 ! skin temperature + Moving_nest(n)%mn_phys%tgxy(i,j) = Moving_nest(n)%mn_phys%ts(i,j) ! skin temperature endif if (Moving_nest(n)%mn_phys%tahxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tahxy(i,j) .gt. maxSkinTempK ) then print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," tahxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tahxy(i,j) - Moving_nest(n)%mn_phys%tahxy(i,j) = 298.0 ! skin temperature + Moving_nest(n)%mn_phys%tahxy(i,j) = Moving_nest(n)%mn_phys%ts(i,j) ! skin temperature endif - do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) - if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. maxSkinTempK ) then - print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," stc=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%stc(i,j,k) - Moving_nest(n)%mn_phys%stc(i,j,k) = 298.0 ! skin temperature - endif - enddo - if (Moving_nest(n)%mn_phys%cmxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%cmxy(i,j) .gt. 100 ) then print '("[INFO] WDR NOAHMP reset drag coeff values npe=",I0," i=",I0," j=",I0," cmxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%cmxy(i,j) - Moving_nest(n)%mn_phys%cmxy(i,j) = 2.4D-3 + Moving_nest(n)%mn_phys%cmxy(i,j) = 0.0 endif if (Moving_nest(n)%mn_phys%chxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%chxy(i,j) .gt. 100 ) then print '("[INFO] WDR NOAHMP reset drag coeff values npe=",I0," i=",I0," j=",I0," chxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%chxy(i,j) - Moving_nest(n)%mn_phys%chxy(i,j) = 2.4D-3 + Moving_nest(n)%mn_phys%chxy(i,j) = 0.0 endif if (Moving_nest(n)%mn_phys%lakefrac(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%lakefrac(i,j) .gt. 100 ) then @@ -1465,8 +1485,6 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, IPD_control, IPD_data, delta_i_c, endif - - endif ! if slmsk=1 endif ! if move_noahmp enddo ! do j From cfd0787974cd4a2db9eb90bbb75dee230b2276b5 Mon Sep 17 00:00:00 2001 From: Rongqian Yang Date: Mon, 6 Jan 2025 20:37:21 -0600 Subject: [PATCH 106/192] Add smoiseq to the moving variables --- moving_nest/fv_moving_nest_physics.F90 | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/moving_nest/fv_moving_nest_physics.F90 b/moving_nest/fv_moving_nest_physics.F90 index 57d66cf1eb..0942925b7b 100644 --- a/moving_nest/fv_moving_nest_physics.F90 +++ b/moving_nest/fv_moving_nest_physics.F90 @@ -429,6 +429,8 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field if (.not. associated(IPD_Data(nb)%Sfcprop%zsnsoxy)) err_field = 35 if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field + if (.not. associated(IPD_Data(nb)%Sfcprop%smoiseq)) err_field = 36 + if (err_field .gt. 0) print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field if (err_field .gt. 0) then print '("[ERROR] WDR NOAH MP variable is not associated npe=",I0," err_field=",I0)', this_pe, err_field @@ -567,6 +569,10 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n, mn_phys%deeprechxy(i,j) = IPD_Data(nb)%Sfcprop%deeprechxy(ix) mn_phys%rechxy(i,j) = IPD_Data(nb)%Sfcprop%rechxy(ix) + do k = 1, IPD_Control%lsoil + mn_phys%smoiseq(i,j,k) = IPD_Data(nb)%Sfcprop%smoiseq(ix,k) + enddo + ! lsnow_lsm_lbound is a negative value, lsnow_ubound is usually 0 do k = IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound mn_phys%snicexy(i,j,k) = IPD_Data(nb)%Sfcprop%snicexy(ix,k) @@ -814,6 +820,11 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, IPD_Control, IPD_Data, n IPD_Data(nb)%Sfcprop%deeprechxy(ix) = mn_phys%deeprechxy(i,j) IPD_Data(nb)%Sfcprop%rechxy(ix) = mn_phys%rechxy(i,j) + do k = 1, IPD_Control%lsoil + IPD_Data(nb)%Sfcprop%smoiseq(ix,k) = mn_phys%smoiseq(i,j,k) + enddo + + do k = IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound IPD_Data(nb)%Sfcprop%snicexy(ix,k) = mn_phys%snicexy(i,j,k) IPD_Data(nb)%Sfcprop%snliqxy(ix,k) = mn_phys%snliqxy(i,j,k) @@ -880,7 +891,7 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st real(kind=kind_phys) :: zsns_default(-2:4) if (IPD_Control%lsm == IPD_Control%lsm_noahmp) then - zsns_default = [0.0, 0.0, 0.0, 0.1,0.4,1.0,2.0 ] + zsns_default = [0.0, 0.0, 0.0, -0.1,-0.4,-1.0,-2.0 ] else ! Expect that zsns_default is not used in this case, but just to be safe, set to 0 zsns_default = 0.0 @@ -1352,6 +1363,12 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, IPD_Control, IPD_Data, mn_st Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) + call fill_nest_halos_from_parent_masked("smoiseq", mn_phys%smoiseq, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, & + x_refine, y_refine, & + is_fine_pe, nest_domain, position, 1, IPD_Control%lsoil, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.3D0) + + call fill_nest_halos_from_parent_masked("zsnsoxy", mn_phys%zsnsoxy, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsoil, & @@ -1484,6 +1501,7 @@ subroutine mn_phys_fill_intern_nest_halos(moving_nest, IPD_Control, IPD_Data, do call mn_var_fill_intern_nest_halos(mn_phys%snowd, domain_fine, is_fine_pe) call mn_var_fill_intern_nest_halos(mn_phys%tsnoxy, domain_fine, is_fine_pe) call mn_var_fill_intern_nest_halos(mn_phys%weasd, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%smoiseq, domain_fine, is_fine_pe) call mn_var_fill_intern_nest_halos(mn_phys%zsnsoxy, domain_fine, is_fine_pe) endif @@ -1711,6 +1729,9 @@ subroutine mn_phys_shift_data(Atm, IPD_Control, IPD_Data, n, child_grid_num, wt_ delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) call mn_var_shift_data(mn_phys%rechxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%smoiseq, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, IPD_Control%lsoil) + call mn_var_shift_data(mn_phys%snicexy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, IPD_Control%lsnow_lsm_lbound, IPD_Control%lsnow_lsm_ubound) From 10800a922a9784d0ce10560b148233aa05fdd34d Mon Sep 17 00:00:00 2001 From: Rongqian Yang Date: Mon, 6 Jan 2025 20:40:10 -0600 Subject: [PATCH 107/192] Add smoiseq to the nest types --- moving_nest/fv_moving_nest_types.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/moving_nest/fv_moving_nest_types.F90 b/moving_nest/fv_moving_nest_types.F90 index b4ef79badd..1347b97f44 100644 --- a/moving_nest/fv_moving_nest_types.F90 +++ b/moving_nest/fv_moving_nest_types.F90 @@ -261,6 +261,7 @@ module fv_moving_nest_types_mod real (kind=kind_phys), _ALLOCATABLE :: deeprechxy (:,:) _NULL !< recharge to the water table when deep real (kind=kind_phys), _ALLOCATABLE :: rechxy (:,:) _NULL !< recharge to the water table + real (kind=kind_phys), _ALLOCATABLE :: smoiseq (:,:,:) _NULL !< equvi. soil moisture real (kind=kind_phys), _ALLOCATABLE :: snicexy (:,:,:) _NULL !< liq water equiv thickness of ice in surface snow real (kind=kind_phys), _ALLOCATABLE :: snliqxy (:,:,:) _NULL !< liq water equiv thickness of liquid water in surface snow real (kind=kind_phys), _ALLOCATABLE :: snowd (:,:) _NULL !< surface snow thickness water equivalent over land @@ -709,6 +710,7 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p allocate ( mn_phys%snicexy(isd:ied, jsd:jed, lsnow_lbound:lsnow_ubound) ) allocate ( mn_phys%snliqxy(isd:ied, jsd:jed, lsnow_lbound:lsnow_ubound) ) + allocate ( mn_phys%smoiseq(isd:ied, jsd:jed, lsoil) ) allocate ( mn_phys%snowd(isd:ied, jsd:jed) ) allocate ( mn_phys%tsnoxy(isd:ied, jsd:jed, lsnow_lbound:lsnow_ubound) ) allocate ( mn_phys%weasd(isd:ied, jsd:jed) ) @@ -839,6 +841,7 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p mn_phys%snicexy = +99999.9 mn_phys%snliqxy = +99999.9 + mn_phys%smoiseq = +99999.9 mn_phys%snowd = +99999.9 mn_phys%tsnoxy = +99999.9 mn_phys%weasd = +99999.9 @@ -982,6 +985,7 @@ subroutine deallocate_fv_moving_nest_physics_type(mn_phys) deallocate ( mn_phys%snicexy ) deallocate ( mn_phys%snliqxy ) + deallocate ( mn_phys%smoiseq ) deallocate ( mn_phys%snowd ) deallocate ( mn_phys%tsnoxy ) deallocate ( mn_phys%weasd ) From 934c4fd0ca5bef90ecfc5a8ffebcba8b19887b70 Mon Sep 17 00:00:00 2001 From: Rongqian Yang Date: Tue, 7 Jan 2025 09:12:54 -0600 Subject: [PATCH 108/192] Update .gitmodule branch --- ccpp/framework | 2 +- upp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/framework b/ccpp/framework index ccfefcd0b4..feaca346f8 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit ccfefcd0b426e011f94137031d5f7c2a4dda2659 +Subproject commit feaca346f814e1a98b4eb37db60538b6fd32897d diff --git a/upp b/upp index 1c2f8758e5..d4141894d4 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 1c2f8758e571187e1e7d138a0399810a633f9028 +Subproject commit d4141894d455d99a2b0faf40c5d7091e0f5fe6ef From 37fa05ca5dc80d259f5b7618f1a41ad0b5cfb81e Mon Sep 17 00:00:00 2001 From: Rongqian Yang Date: Tue, 7 Jan 2025 09:53:47 -0600 Subject: [PATCH 109/192] Update ccpp module --- ccpp/framework | 2 +- upp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/framework b/ccpp/framework index feaca346f8..ccfefcd0b4 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit feaca346f814e1a98b4eb37db60538b6fd32897d +Subproject commit ccfefcd0b426e011f94137031d5f7c2a4dda2659 diff --git a/upp b/upp index d4141894d4..1c2f8758e5 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit d4141894d455d99a2b0faf40c5d7091e0f5fe6ef +Subproject commit 1c2f8758e571187e1e7d138a0399810a633f9028 From d92b604faa92b6828e6b7e0e3518cf3a94377350 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 24 Jan 2025 16:44:22 +0000 Subject: [PATCH 110/192] Update physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 945bd99921..d797cdd1bc 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 945bd999211b01dcfec925698174d6b2cb4abadb +Subproject commit d797cdd1bcf9f1b348806ab6538ba2076212fb91 From c510d826072ec5b735f3a6aec44560ce036c8185 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 24 Jan 2025 22:03:54 +0000 Subject: [PATCH 111/192] Address reviewers comments --- ccpp/data/GFS_typedefs.F90 | 3 ++- ccpp/data/GFS_typedefs.meta | 21 +++++++++++++++++++++ ccpp/physics | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 4614c087b9..974e744178 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -11,7 +11,8 @@ module GFS_typedefs con_omega, con_rerth, con_psat, karman, rainmin,& con_c, con_plnk, con_boltz, con_solr_2008, & con_solr_2002, con_thgni, con_1ovg, con_rgas, & - con_avgd, con_amd, con_amw + con_avgd, con_amd, con_amw, con_one, con_p001, & + con_secinday use module_radsw_parameters, only: topfsw_type, sfcfsw_type use module_radlw_parameters, only: topflw_type, sfcflw_type diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 3d9867dd5c..362ff6083c 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10513,3 +10513,24 @@ dimensions = () type = real kind = kind_phys +[con_one] + standard_name = constant_one + long_name = mathematical constant of one + units = 1 + dimensions = () + type = real + kind = kind_phys +[con_p001] + standard_name = constant_one_hundredth + long_name = mathematical constant for one hundredth + units = 1 + dimensions = () + type = real + kind = kind_phys +[con_secinday] + standard_name = seconds_in_a_day + long_name = number of seconds in a day + units = s + dimensions = () + type = real + kind = kind_phys diff --git a/ccpp/physics b/ccpp/physics index d797cdd1bc..b43e52de90 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d797cdd1bcf9f1b348806ab6538ba2076212fb91 +Subproject commit b43e52de90f05955b37fba67988309a9f761036c From 2b9dbcfeea49e95bc2a85495fe6086ea7e320143 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 31 Jan 2025 21:26:43 +0000 Subject: [PATCH 112/192] Initial TEMPO commit --- ccpp/config/ccpp_prebuild_config.py | 8 ++ ccpp/data/GFS_typedefs.F90 | 18 ++-- ccpp/data/GFS_typedefs.meta | 12 +++ ccpp/physics | 2 +- .../suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml | 94 +++++++++++++++++++ 5 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py index 5e91f3ef61..69a2431bc9 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/ccpp/config/ccpp_prebuild_config.py @@ -20,6 +20,7 @@ 'physics/physics/Radiation/RRTMG/radsw_param.f', 'physics/physics/Radiation/RRTMG/radlw_param.f', 'physics/physics/photochem/module_ozphys.F90', + 'physics/physics/MP/TEMPO/TEMPO/module_mp_tempo_params.F90', 'physics/physics/photochem/module_h2ophys.F90', 'physics/physics/SFC_Models/Land/Noahmp/lnd_iau_mod.F90', 'data/CCPP_typedefs.F90', @@ -46,6 +47,10 @@ 'module_ozphys' : '', 'ty_ozphys' : '', }, + 'module_mp_tempo_params' : { + 'module_mp_tempo_params' : '', + 'ty_tempo_cfg' : '', + }, 'module_h2ophys' : { 'module_h2ophys' : '', 'ty_h2ophys' : '', @@ -174,6 +179,9 @@ 'physics/physics/MP/Thompson/mp_thompson_pre.F90', 'physics/physics/MP/Thompson/mp_thompson.F90', 'physics/physics/MP/Thompson/mp_thompson_post.F90', + 'physics/physics/MP/TEMPO/mp_tempo_pre.F90', + 'physics/physics/MP/TEMPO/mp_tempo.F90', + 'physics/physics/MP/TEMPO/mp_tempo_post.F90', 'physics/physics/MP/Zhao_Carr/zhaocarr_gscond.f', 'physics/physics/MP/Zhao_Carr/zhaocarr_precpd.f', 'physics/physics/PBL/HEDMF/hedmf.f', diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 4614c087b9..23457dc7e1 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -15,6 +15,7 @@ module GFS_typedefs use module_radsw_parameters, only: topfsw_type, sfcfsw_type use module_radlw_parameters, only: topflw_type, sfcflw_type + use module_mp_tempo_params, only: ty_tempo_cfg use module_ozphys, only: ty_ozphys use module_h2ophys, only: ty_h2ophys use land_iau_mod, only: land_iau_external_data_type, land_iau_control_type, & @@ -943,6 +944,7 @@ module GFS_typedefs integer :: imp_physics !< choice of microphysics scheme integer :: imp_physics_gfdl = 11 !< choice of GFDL microphysics scheme integer :: imp_physics_thompson = 8 !< choice of Thompson microphysics scheme + integer :: imp_physics_tempo = 88 !< choice of TEMPO microphysics scheme integer :: imp_physics_wsm6 = 6 !< choice of WSMG microphysics scheme integer :: imp_physics_zhao_carr = 99 !< choice of Zhao-Carr microphysics scheme integer :: imp_physics_zhao_carr_pdf = 98 !< choice of Zhao-Carr microphysics scheme with PDF clouds @@ -1035,6 +1037,7 @@ module GFS_typedefs real(kind=kind_phys) :: dt_inner !< time step for the inner loop in s logical :: sedi_semi !< flag for semi Lagrangian sedi of rain integer :: decfl !< deformed CFL factor + type(ty_tempo_cfg) :: tempo_cfg !< Thompson MP configuration information. logical :: thompson_mp_is_init=.false. !< Local scheme initialization flag !--- GFDL microphysical paramters @@ -4874,7 +4877,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%exticeden = exticeden if (Model%exticeden .and. & (Model%imp_physics /= Model%imp_physics_gfdl .and. Model%imp_physics /= Model%imp_physics_thompson .and. & - Model%imp_physics /= Model%imp_physics_nssl )) then + Model%imp_physics /= Model%imp_physics_nssl .and. Model%imp_physics /= Model%imp_physics_tempo)) then !see GFS_MP_generic_post.F90; exticeden is only compatible with GFDL, !Thompson, or NSSL MP print *,' Using exticeden = T is only valid when using GFDL, Thompson, or NSSL microphysics.' @@ -5793,8 +5796,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- BEGIN CODE FROM COMPNS_PHYSICS !--- shoc scheme if (do_shoc) then - if (Model%imp_physics == Model%imp_physics_thompson) then - print *,'SHOC is not currently compatible with Thompson MP -- shutting down' + if ((Model%imp_physics == Model%imp_physics_thompson) .or. & + (Model%imp_physics == Model%imp_physics_tempo)) then + print *,'SHOC is not currently compatible with Thompson/TEMPO MP -- shutting down' stop endif Model%nshoc_3d = 3 @@ -6154,7 +6158,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' num_p2d =',Model%num_p2d - elseif (Model%imp_physics == Model%imp_physics_thompson) then !Thompson microphysics + elseif ((Model%imp_physics == Model%imp_physics_thompson) .or. & + (Model%imp_physics == Model%imp_physics_tempo)) then !Thompson/TEMPO microphysics Model%npdf3d = 0 Model%num_p3d = 3 Model%num_p2d = 1 @@ -6171,7 +6176,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & print *,' Thompson MP requires effr_in to be set to .true. - job aborted' stop end if - if (Model%me == Model%master) print *,' Using Thompson double moment microphysics', & + if (Model%me == Model%master) print *,' Using Thompson/TEMPO double moment microphysics', & ' ltaerosol = ',Model%ltaerosol, & ' mraerosol = ',Model%mraerosol, & ' ttendlim =',Model%ttendlim, & @@ -6728,7 +6733,8 @@ subroutine control_print(Model) print *, ' wminco : ', Model%wminco print *, ' ' endif - if (Model%imp_physics == Model%imp_physics_wsm6 .or. Model%imp_physics == Model%imp_physics_thompson) then + if ((Model%imp_physics == Model%imp_physics_wsm6) .or. (Model%imp_physics == Model%imp_physics_thompson) .or. & + (Model%imp_physics == Model%imp_physics_tempo)) then print *, ' Thompson microphysical parameters' print *, ' ltaerosol : ', Model%ltaerosol print *, ' mraerosol : ', Model%mraerosol diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index bd0e349750..a6217bd4da 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4337,6 +4337,12 @@ units = flag dimensions = () type = integer +[imp_physics_tempo] + standard_name = identifier_for_tempo_microphysics_scheme + long_name = choice of TEMPO microphysics scheme + units = flag + dimensions = () + type = integer [imp_physics_wsm6] standard_name = identifier_for_wsm6_microphysics_scheme long_name = choice of WSM6 microphysics scheme @@ -4911,6 +4917,12 @@ units = count dimensions = () type = integer +[tempo_cfg] + standard_name = configuration_for_TEMPO_microphysics + long_name = configuration information for TEMPO microphysics + units = mixed + dimensions = () + type = ty_tempo_cfg [thompson_mp_is_init] standard_name = flag_for_thompson_mp_scheme_initialization long_name = flag carrying scheme initialization status diff --git a/ccpp/physics b/ccpp/physics index 50a7846db9..fb11da522d 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 50a7846db918ec01fb001afb6a9dd8c76d5c0070 +Subproject commit fb11da522d31cb44c1f97c37d80c9d910f927c1a diff --git a/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml b/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml new file mode 100644 index 0000000000..22f8a402d1 --- /dev/null +++ b/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml @@ -0,0 +1,94 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + noahmpdrv + sfc_land + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + ugwpv1_gsldrag + ugwpv1_gsldrag_post + GFS_GWD_generic_post + GFS_suite_stateout_update + GFS_photochemistry + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_tempo_pre + + + mp_tempo + + + mp_tempo_post + GFS_MP_generic_post + maximum_hourly_diagnostics + + + + + GFS_stochastics + GFS_physics_post + + + + From 7db11e77455375122117ebfcf58253d4bc073238 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Sat, 1 Feb 2025 23:58:31 +0000 Subject: [PATCH 113/192] Changes for TEMPO to be called with imp_physics option 88 --- ccpp/data/CCPP_typedefs.F90 | 13 ++++++++----- ccpp/data/CCPP_typedefs.meta | 8 ++++---- ccpp/physics | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ccpp/data/CCPP_typedefs.F90 b/ccpp/data/CCPP_typedefs.F90 index 1f5deaec2a..1d45700b0f 100644 --- a/ccpp/data/CCPP_typedefs.F90 +++ b/ccpp/data/CCPP_typedefs.F90 @@ -818,7 +818,7 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model) ! ! Allocate arrays that are conditional on physics choices if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson & - .or. Model%imp_physics == Model%imp_physics_nssl & + .or. Model%imp_physics == Model%imp_physics_tempo .or. Model%imp_physics == Model%imp_physics_nssl & ) then allocate (Interstitial%graupelmp (IM)) allocate (Interstitial%icemp (IM)) @@ -906,7 +906,8 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model) ! perform aerosol convective transport and PBL diffusion Interstitial%trans_aero = Model%cplchm .and. Model%trans_trac - if (Model%imp_physics == Model%imp_physics_thompson) then + if (Model%imp_physics == Model%imp_physics_thompson .or. & + Model%imp_physics == Model%imp_physics_tempo) then if (Model%ltaerosol) then Interstitial%nvdiff = 12 else if (Model%mraerosol) then @@ -959,7 +960,8 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model) if (Model%imp_physics == Model%imp_physics_wsm6) then Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 - elseif (Model%imp_physics == Model%imp_physics_thompson) then + elseif (Model%imp_physics == Model%imp_physics_thompson .or. & + Model%imp_physics == Model%imp_physics_tempo) then Interstitial%ntcwx = 2 Interstitial%ntiwx = 3 Interstitial%ntrwx = 4 @@ -997,7 +999,8 @@ subroutine gfs_interstitial_setup_tracers(Interstitial, Model) endif elseif (Model%imp_physics == Model%imp_physics_gfdl) then Interstitial%nvdiff = 7 - elseif (Model%imp_physics == Model%imp_physics_thompson) then + elseif (Model%imp_physics == Model%imp_physics_thompson .or. & + Model%imp_physics == Model%imp_physics_tempo) then if (Model%ltaerosol) then Interstitial%nvdiff = 12 else if (Model%mraerosol) then @@ -1409,7 +1412,7 @@ subroutine gfs_interstitial_phys_reset (Interstitial, Model) ! ! Reset fields that are conditional on physics choices if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson & - .or. Model%imp_physics == Model%imp_physics_nssl & + .or. Model%imp_physics == Model%imp_physics_tempo .or. Model%imp_physics == Model%imp_physics_nssl & ) then Interstitial%graupelmp = clear_val Interstitial%icemp = clear_val diff --git a/ccpp/data/CCPP_typedefs.meta b/ccpp/data/CCPP_typedefs.meta index e8ec56b8dd..f0f2068c46 100644 --- a/ccpp/data/CCPP_typedefs.meta +++ b/ccpp/data/CCPP_typedefs.meta @@ -1128,7 +1128,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_tempo_microphysics_scheme) [gwdcu] standard_name = tendency_of_x_wind_due_to_convective_gravity_wave_drag long_name = zonal wind tendency due to convective gravity wave drag @@ -1220,7 +1220,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_tempo_microphysics_scheme) [dry] standard_name = flag_nonzero_land_surface_fraction long_name = flag indicating presence of some land surface area fraction @@ -1711,7 +1711,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_tempo_microphysics_scheme) [rainp] standard_name = tendency_of_rain_water_mixing_ratio_due_to_microphysics long_name = tendency of rain water mixing ratio due to microphysics @@ -1967,7 +1967,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme) + active = (control_for_microphysics_scheme == identifier_for_gfdl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_nssl_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_tempo_microphysics_scheme) [snowmt] standard_name = surface_snow_melt long_name = snow melt during timestep diff --git a/ccpp/physics b/ccpp/physics index fb11da522d..a42db1d506 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit fb11da522d31cb44c1f97c37d80c9d910f927c1a +Subproject commit a42db1d5066fe2c2e0eada2d1d5a184805146075 From d0f07536e73f7cb31937b4e7d97563d2333220e6 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Sun, 2 Feb 2025 16:57:40 +0000 Subject: [PATCH 114/192] Support for TEMPO aerosol-aware in CCPP --- ccpp/data/GFS_typedefs.F90 | 4 +++- ccpp/data/GFS_typedefs.meta | 4 ++-- ccpp/driver/GFS_diagnostics.F90 | 2 +- ccpp/driver/GFS_restart.F90 | 6 ++++-- ccpp/physics | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 23457dc7e1..23d32239db 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -3264,7 +3264,9 @@ subroutine coupling_create (Coupling, Model) endif !--- needed for Thompson's aerosol option - if(Model%imp_physics == Model%imp_physics_thompson .and. (Model%ltaerosol .or. Model%mraerosol)) then + if((Model%imp_physics == Model%imp_physics_thompson .or. & + Model%imp_physics == Model%imp_physics_tempo) .and. & + (Model%ltaerosol .or. Model%mraerosol)) then allocate (Coupling%nwfa2d (IM)) allocate (Coupling%nifa2d (IM)) Coupling%nwfa2d = clear_val diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index a6217bd4da..51d7a282d4 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -3155,7 +3155,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .and. (flag_for_aerosol_physics .or. do_merra2_aerosol_awareness)) + active = ((control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_tempo_microphysics_scheme) .and. (flag_for_aerosol_physics .or. do_merra2_aerosol_awareness)) [nifa2d] standard_name = tendency_of_nonhygroscopic_ice_nucleating_aerosols_at_surface_adjacent_layer long_name = instantaneous ice-friendly sfc aerosol source @@ -3163,7 +3163,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .and. (flag_for_aerosol_physics .or. do_merra2_aerosol_awareness)) + active = ((control_for_microphysics_scheme == identifier_for_thompson_microphysics_scheme .or. control_for_microphysics_scheme == identifier_for_tempo_microphysics_scheme) .and. (flag_for_aerosol_physics .or. do_merra2_aerosol_awareness)) [ebu_smoke] standard_name = ebu_smoke long_name = buffer of vertical fire emission diff --git a/ccpp/driver/GFS_diagnostics.F90 b/ccpp/driver/GFS_diagnostics.F90 index d2a8bdf5ae..a637f42603 100644 --- a/ccpp/driver/GFS_diagnostics.F90 +++ b/ccpp/driver/GFS_diagnostics.F90 @@ -5044,7 +5044,7 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop ! Cloud effective radii from Microphysics if (Model%imp_physics == Model%imp_physics_thompson .or. Model%imp_physics == Model%imp_physics_fer_hires .or. & - Model%imp_physics == Model%imp_physics_nssl ) then + Model%imp_physics == Model%imp_physics_nssl .or. Model%imp_physics == Model%imp_physics_tempo ) then idx = idx + 1 ExtDiag(idx)%axes = 3 ExtDiag(idx)%name = 'cleffr' diff --git a/ccpp/driver/GFS_restart.F90 b/ccpp/driver/GFS_restart.F90 index d82a1b89fa..76ff662bf5 100644 --- a/ccpp/driver/GFS_restart.F90 +++ b/ccpp/driver/GFS_restart.F90 @@ -145,7 +145,8 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & Restart%num2d = Restart%num2d + 2 endif ! Thompson aerosol-aware - if (Model%imp_physics == Model%imp_physics_thompson .and. Model%ltaerosol) then + if ((Model%imp_physics == Model%imp_physics_thompson .or. & + Model%imp_physics == Model%imp_physics_tempo) .and. (Model%ltaerosol)) then Restart%num2d = Restart%num2d + 2 endif if (Model%do_cap_suppress .and. Model%num_dfi_radar>0) then @@ -458,7 +459,8 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & enddo endif ! Thompson aerosol-aware - if (Model%imp_physics == Model%imp_physics_thompson .and. Model%ltaerosol) then + if ((Model%imp_physics == Model%imp_physics_thompson .or. & + Model%imp_physics == Model%imp_physics_tempo) .and. (Model%ltaerosol)) then num = num + 1 Restart%name2d(num) = 'thompson_2d_nwfa2d' do nb = 1,nblks diff --git a/ccpp/physics b/ccpp/physics index a42db1d506..dcda3f987c 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit a42db1d5066fe2c2e0eada2d1d5a184805146075 +Subproject commit dcda3f987c0dd03f46086c94dbcaddd87309d9a5 From 858ac8412a7691633be900f9574aeced2e4812cf Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Mon, 3 Feb 2025 01:01:50 +0000 Subject: [PATCH 115/192] Couple TEMPO to radiation --- ccpp/data/GFS_typedefs.F90 | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 23d32239db..2ad59222e8 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -6160,8 +6160,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & ' num_p2d =',Model%num_p2d - elseif ((Model%imp_physics == Model%imp_physics_thompson) .or. & - (Model%imp_physics == Model%imp_physics_tempo)) then !Thompson/TEMPO microphysics + elseif (Model%imp_physics == Model%imp_physics_thompson .or. & + Model%imp_physics == Model%imp_physics_tempo) then !Thompson/TEMPO microphysics Model%npdf3d = 0 Model%num_p3d = 3 Model%num_p2d = 1 diff --git a/ccpp/physics b/ccpp/physics index dcda3f987c..a2fc440be9 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit dcda3f987c0dd03f46086c94dbcaddd87309d9a5 +Subproject commit a2fc440be9086594cb5bdc45457c79f79f15e70c From 41350c1175241f508156d3117b60f57a71f9465a Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Mon, 3 Feb 2025 17:17:27 +0000 Subject: [PATCH 116/192] TEMPO radiation buxfix --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index a2fc440be9..d8d35a6320 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit a2fc440be9086594cb5bdc45457c79f79f15e70c +Subproject commit d8d35a632089e7ad1825a600daa37ae14260e8a5 From a64b4b0c06529ddd793b4d4d345b72987e1e19a8 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Mon, 3 Feb 2025 20:52:28 +0000 Subject: [PATCH 117/192] Support for TEMPO hail-aware --- ccpp/data/GFS_typedefs.F90 | 19 +++++++++++++++++-- ccpp/data/GFS_typedefs.meta | 7 +++++++ ccpp/physics | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 2ad59222e8..5e6cc1d73f 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1029,6 +1029,7 @@ module GFS_typedefs !--- Thompson's microphysical parameters logical :: ltaerosol !< flag for aerosol version logical :: mraerosol !< flag for merra2_aerosol_aware + logical :: lthailaware !< flag for TEMPO hail-aware logical :: lradar !< flag for radar reflectivity real(kind=kind_phys) :: nsfullradar_diag!< seconds between resetting radar reflectivity calculation real(kind=kind_phys) :: ttendlim !< temperature tendency limiter per time step in K/s @@ -3593,6 +3594,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- Thompson microphysical parameters logical :: ltaerosol = .false. !< flag for aerosol version logical :: mraerosol = .false. !< flag for merra2_aerosol_aware + logical :: lthailaware = .false. !< flag for TEMPO hail-aware logical :: lradar = .false. !< flag for radar reflectivity real(kind=kind_phys) :: nsfullradar_diag = -999.0 !< seconds between resetting radar reflectivity calculation, set to <0 for every time step real(kind=kind_phys) :: ttendlim = -999.0 !< temperature tendency limiter, set to <0 to deactivate @@ -4100,8 +4102,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & mg_do_graupel, mg_do_hail, mg_nccons, mg_nicons, mg_ngcons, & mg_ncnst, mg_ninst, mg_ngnst, sed_supersat, do_sb_physics, & mg_alf, mg_qcmin, mg_do_ice_gmao, mg_do_liq_liu, & - ltaerosol, lradar, nsfullradar_diag, lrefres, ttendlim, & - ext_diag_thompson, dt_inner, lgfdlmprad, & + ltaerosol, lthailaware, lradar, nsfullradar_diag, lrefres, & + ttendlim, ext_diag_thompson, dt_inner, lgfdlmprad, & sedi_semi, decfl, & nssl_cccn, nssl_alphah, nssl_alphahl, & nssl_alphar, nssl_ehw0, nssl_ehlw0, & @@ -4761,6 +4763,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- Thompson MP parameters Model%ltaerosol = ltaerosol Model%mraerosol = mraerosol + Model%lthailaware = lthailaware if (Model%ltaerosol .and. Model%mraerosol) then write(0,*) 'Logic error: Only one Thompson aerosol option can be true, either ltaerosol or mraerosol)' stop @@ -4776,6 +4779,16 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & endif Model%sedi_semi = sedi_semi Model%decfl = decfl + +!--- TEMPO MP parameters + ! DJS to Anders: Maybe we put more of these nml options into the TEMPO configuration type? + Model%tempo_cfg%aerosol_aware = (ltaerosol .or. mraerosol) + Model%tempo_cfg%hail_aware = lthailaware + if (Model%ltaerosol .and. Model%mraerosol) then + write(0,*) 'Logic error: Only one TEMPO aerosol option can be true, either ltaerosol or mraerosol)' + stop + end if + !--- F-A MP parameters Model%rhgrd = rhgrd Model%spec_adv = spec_adv @@ -6181,6 +6194,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & if (Model%me == Model%master) print *,' Using Thompson/TEMPO double moment microphysics', & ' ltaerosol = ',Model%ltaerosol, & ' mraerosol = ',Model%mraerosol, & + ' lthailaware = ',Model%lthailaware, & ' ttendlim =',Model%ttendlim, & ' ext_diag_thompson =',Model%ext_diag_thompson, & ' dt_inner =',Model%dt_inner, & @@ -6740,6 +6754,7 @@ subroutine control_print(Model) print *, ' Thompson microphysical parameters' print *, ' ltaerosol : ', Model%ltaerosol print *, ' mraerosol : ', Model%mraerosol + print *, ' lthailaware : ', Model%lthailaware print *, ' lradar : ', Model%lradar print *, ' nsfullradar_diag : ', Model%nsfullradar_diag print *, ' lrefres : ', Model%lrefres diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 51d7a282d4..4b326c3ccb 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4867,6 +4867,12 @@ units = flag dimensions = () type = logical +[lthailaware] + standard_name = flag_for_hail_physics + long_name = flag for hail physics + units = flag + dimensions = () + type = logical [mraerosol] standard_name = do_merra2_aerosol_awareness long_name = flag for merra2 aerosol-aware physics for example the thompson microphysics @@ -10145,6 +10151,7 @@ relative_path = ../physics/physics/ dependencies = hooks/machine.F,hooks/physcons.F90 dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f + dependencies = MP/TEMPO/TEMPO/module_mp_tempo_params.F90 dependencies = photochem/module_ozphys.F90,photochem/module_h2ophys.F90 dependencies = SFC_Models/Land/Noahmp/lnd_iau_mod.F90,MP/GFDL/GFDL_parse_tracers.F90 diff --git a/ccpp/physics b/ccpp/physics index d8d35a6320..f46ecf217b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d8d35a632089e7ad1825a600daa37ae14260e8a5 +Subproject commit f46ecf217bc3d2d70630d53b064649f087be8b58 From 18e9871edb5363e54d82385665e7ad459848c6d2 Mon Sep 17 00:00:00 2001 From: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:53:37 -0400 Subject: [PATCH 118/192] Fix dumpfields=true option by using ESMF_FieldBundleWrite (#856) * Update diagnose_cplFields routine to use FieldBundleWrite. Needs esmf v8.6.0 * Fixed bug in aux2d dimensions for GFS meta file. * Pass return code from diagnose_cplFields back to caller * Skip 'cpl_scalars' field when dumping export state * fix fhzero for GEFS * fix cpl_scalars (#6) * fix issues w/ cplscalars * error out of all 3 spatial indices are not present * add check for scalar_id = 0 * modify for timeslices and times (#7) --- atmos_model.F90 | 2 +- ccpp/data/GFS_typedefs.meta | 2 +- cpl/module_cap_cpl.F90 | 212 ++++++++++++++++++++++++++++-------- cpl/module_cplscalars.F90 | 2 +- fv3_cap.F90 | 30 +++-- module_fcst_grid_comp.F90 | 9 +- 6 files changed, 197 insertions(+), 60 deletions(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index 1f17ac3248..eb41fb0d76 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -815,7 +815,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) if (mpp_pe() == mpp_root_pe()) print *,'in atmos_model, fhzero=',GFS_Control%fhzero, 'fhour=',sec/3600.,sec_lastfhzerofh/3600 if (mod((sec-sec_lastfhzerofh),int(GFS_Control%fhzero*3600.)) /= 0) then - diag_time = Time - real_to_time_type(mod(int((GFS_Control%kdt - 1)*dt_phys-sec_lastfhzerofh),int(GFS_Control%fhzero))*3600.0) + diag_time = Time - real_to_time_type(real(mod(int((GFS_Control%kdt - 1)*dt_phys-sec_lastfhzerofh),int(GFS_Control%fhzero*3600.0)))) if (mpp_pe() == mpp_root_pe()) print *,'Warning: in atmos_init,start at non multiple of fhzero' endif if (Atmos%iau_offset > zero) then diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 5ac00e403d..7354412d69 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -9907,7 +9907,7 @@ standard_name = auxiliary_2d_arrays long_name = auxiliary 2d arrays to output (for debugging) units = none - dimensions = (horizontal_loop_extent,number_of_xyz_dimensioned_auxiliary_arrays) + dimensions = (horizontal_loop_extent,number_of_xy_dimensioned_auxiliary_arrays) type = real kind = kind_phys active = (number_of_xy_dimensioned_auxiliary_arrays > 0) diff --git a/cpl/module_cap_cpl.F90 b/cpl/module_cap_cpl.F90 index cd92532d72..f91e953844 100644 --- a/cpl/module_cap_cpl.F90 +++ b/cpl/module_cap_cpl.F90 @@ -17,27 +17,29 @@ module module_cap_cpl !----------------------------------------------------------------------------- subroutine diagnose_cplFields(gcomp, clock_fv3, fcstpe, & - statewrite_flag, stdiagnose_flag, state_tag) + statewrite_flag, stdiagnose_flag, state_tag, rc) type(ESMF_GridComp), intent(in) :: gcomp type(ESMF_Clock),intent(in) :: clock_fv3 logical, intent(in) :: fcstpe logical, intent(in) :: statewrite_flag integer, intent(in) :: stdiagnose_flag - character(len=*), intent(in) :: state_tag !< Import or export. + character(len=*), intent(in) :: state_tag !< "import" or "export". + integer, intent(out) :: rc character(len=*),parameter :: subname='(module_cap_cpl:diagnose_cplFields)' type(ESMF_Time) :: currTime type(ESMF_State) :: state - character(len=240) :: timestr - integer :: timeslice = 1 + type(ESMF_TimeInterval) :: timeStep + character(len=240) :: import_timestr, export_timestr character(len=160) :: nuopcMsg character(len=160) :: filename - integer :: rc ! - call ESMF_ClockGet(clock_fv3, currTime=currTime, rc=rc) + call ESMF_ClockGet(clock_fv3, currTime=currTime, timeStep=timestep, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + call ESMF_TimeGet(currTime, timestring=import_timestr, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - call ESMF_TimeGet(currTime, timestring=timestr, rc=rc) + call ESMF_TimeGet(currTime+timestep, timestring=export_timestr, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return call ESMF_ClockPrint(clock_fv3, options="currTime", preString="current time: ", unit=nuopcMsg) @@ -53,8 +55,8 @@ subroutine diagnose_cplFields(gcomp, clock_fv3, fcstpe, & ! Dump Fields out if (statewrite_flag) then - write(filename,'(A)') 'fv3_cap_import_'//trim(timestr)//'_' - call State_RWFields_tiles(state,trim(filename), timeslice, rc=rc) + write(filename,'(A)') 'fv3_cap_import_'//trim(import_timestr)//'.tile*.nc' + call State_RWFields_tiles(state,trim(filename), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return end if end if @@ -69,8 +71,8 @@ subroutine diagnose_cplFields(gcomp, clock_fv3, fcstpe, & ! Dump Fields out if (statewrite_flag) then - write(filename,'(A)') 'fv3_cap_export_'//trim(timestr)//'_' - call State_RWFields_tiles(state,trim(filename), timeslice, rc=rc) + write(filename,'(A)') 'fv3_cap_export_'//trim(export_timestr)//'.tile*.nc' + call State_RWFields_tiles(state,trim(filename), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return end if end if @@ -80,28 +82,36 @@ end subroutine diagnose_cplFields !----------------------------------------------------------------------------- ! This subroutine requires ESMFv8 - for coupled FV3 - subroutine State_RWFields_tiles(state,filename,timeslice,rc) + subroutine State_RWFields_tiles(state,filename,rc) type(ESMF_State), intent(in) :: state character(len=*), intent(in) :: fileName - integer, intent(in) :: timeslice integer, intent(out) :: rc - ! local - type(ESMF_Field) :: firstESMFFLD - type(ESMF_Field),allocatable :: flds(:) - type(ESMF_GridComp) :: IOComp - type(ESMF_Grid) :: gridFv3 - - character(len=256) :: msgString - integer :: i, icount, ifld + ! local variables + type(ESMF_Array) :: array + type(ESMF_Grid) :: grid + type(ESMF_FieldBundle) :: fieldbundle + type(ESMF_Field), allocatable :: flds(:) + type(ESMF_DistGrid) :: distgrid + integer :: i, icount, ifld, id integer :: fieldcount, firstfld + integer :: fieldDimCount, gridDimCount, dimCount, tileCount, ungriddedDimCount character(64), allocatable :: itemNameList(:), fldNameList(:) type(ESMF_StateItem_Flag), allocatable :: typeList(:) + integer, allocatable :: minIndexPTile(:,:), maxIndexPTile(:,:) + integer, allocatable :: ungriddedLBound(:), ungriddedUBound(:) + integer, allocatable :: fieldDimLen(:) + character(len=32), allocatable :: gridded_dim_labels(:), ungridded_dim_labels(:) - character(len=*),parameter :: subname='(module_cap_cpl:State_RWFields_tiles)' + character(16), parameter :: convention = 'NetCDF' + character(16), parameter :: purpose = 'FV3' - ! local variables + integer, parameter :: max_n_axes = 4 + integer, parameter :: max_n_dim = 16 + integer, dimension(max_n_axes, max_n_dim) :: axes_dimcount = 0 + + character(len=*),parameter :: subname='(module_cap_cpl:State_RWFields_tiles)' rc = ESMF_SUCCESS !call ESMF_LogWrite(trim(subname)//trim(filename)//": called", ESMF_LOGMSG_INFO, rc=rc) @@ -118,9 +128,6 @@ subroutine State_RWFields_tiles(state,filename,timeslice,rc) if(typeList(i) == ESMF_STATEITEM_FIELD) firstfld = i if(typeList(i) == ESMF_STATEITEM_FIELD) fieldcount = fieldcount + 1 enddo - !write(msgString,*) trim(subname)//' icount = ',icount," fieldcount = - !",fieldcount," firstfld = ",firstfld - !call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO, rc=rc) allocate(flds(fieldCount),fldNameList(fieldCount)) ifld = 1 @@ -131,37 +138,152 @@ subroutine State_RWFields_tiles(state,filename,timeslice,rc) endif enddo - call ESMF_LogWrite(trim(subname)//": write "//trim(filename)//"tile1-tile6", ESMF_LOGMSG_INFO, rc=rc) - ! get first field - call ESMF_StateGet(state, itemName=itemNameList(firstfld), field=firstESMFFLD, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, file=__FILE__)) return ! bail out - - call ESMF_FieldGet(firstESMFFLD, grid=gridFv3, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, file=__FILE__)) return ! bail out + fieldbundle = ESMF_FieldBundleCreate(rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - IOComp = ESMFIO_Create(gridFv3, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, file=__FILE__)) return ! bail out + call ESMF_LogWrite(trim(subname)//": write "//trim(filename), ESMF_LOGMSG_INFO, rc=rc) do ifld=1, fieldCount call ESMF_StateGet(state, itemName=fldNameList(ifld), field=flds(ifld), rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + call ESMF_FieldGet(flds(ifld), grid=grid, dimCount=fieldDimCount, array=array, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + if (fieldDimCount > 4) then + call ESMF_LogWrite(trim(subname)//": fieldDimCount > 4 unsupported", ESMF_LOGMSG_ERROR, rc=rc) + end if + + call ESMF_GridGet(grid, dimCount=gridDimCount, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + if (gridDimCount > 2) then + call ESMF_LogWrite(trim(subname)//": gridDimCount > 2 unsupported", ESMF_LOGMSG_ERROR, rc=rc) + end if + + call ESMF_ArrayGet(array, distgrid=distgrid, dimCount=dimCount, tileCount=tileCount, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + ! skip 'cpl_scalars' field because it has tileCount == 1, while all other fields have 6. + ! This causes the following error: + ! 20240705 134459.788 ERROR PET000 ESMCI_IO.C:1614 ESMCI::IO::checkNtiles() Wrong data value - New number of tiles (6) does not match previously-set number of tiles (1) for this IO object. All arrays handled by a given IO object must have the same number of tiles. + if (trim(fldNameList(ifld)) == 'cpl_scalars') then + cycle + endif + + allocate(fieldDimLen(fieldDimCount)) + + allocate(minIndexPTile(dimCount, tileCount)) + allocate(maxIndexPTile(dimCount, tileCount)) + call ESMF_DistGridGet(distgrid, minIndexPTile=minIndexPTile, maxIndexPTile=maxIndexPTile, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + allocate(gridded_dim_labels(gridDimCount)) + do i = 1, gridDimCount + fieldDimLen(i) = maxIndexPTile(i,1) - minIndexPTile(i,1) + 1 + id = find_axis_id_for_axis_count(i,fieldDimLen(i)) + if (id < 1) then + call ESMF_LogWrite(trim(subname)//": id < 1", ESMF_LOGMSG_ERROR, rc=rc) + endif + if (i == 1) write(gridded_dim_labels(i),'(A,I0)') 'xaxis_',id + if (i == 2) write(gridded_dim_labels(i),'(A,I0)') 'yaxis_',id + end do + + deallocate(minIndexPTile) + deallocate(maxIndexPTile) + + ungriddedDimCount = fieldDimCount - gridDimCount + allocate(ungridded_dim_labels(ungriddedDimCount)) + if (fieldDimCount > gridDimCount) then + allocate(ungriddedLBound(ungriddedDimCount)) + allocate(ungriddedUBound(ungriddedDimCount)) + call ESMF_FieldGet(flds(ifld), ungriddedLBound=ungriddedLBound, ungriddedUBound=ungriddedUBound, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + do i=1,ungriddedDimCount + fieldDimLen(i+gridDimCount) = ungriddedUBound(i) - ungriddedLBound(i) + 1 + id = find_axis_id_for_axis_count(i+gridDimCount, fieldDimLen(i+gridDimCount)) + if (id < 1) then + write(0,*)'stop error', id, i, fieldDimLen(i+gridDimCount) + endif + if (i==1) write(ungridded_dim_labels(i),'(A,I0)') 'zaxis_',id + if (i==2) write(ungridded_dim_labels(i),'(A,I0)') 'taxis_',id + end do + deallocate(ungriddedLBound) + deallocate(ungriddedUBound) + end if + + call ESMF_AttributeAdd(grid, convention=convention, purpose=purpose, attrList=(/ ESMF_ATT_GRIDDED_DIM_LABELS /), rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + call ESMF_AttributeSet(grid, convention=convention, purpose=purpose, & + name=ESMF_ATT_GRIDDED_DIM_LABELS, valueList=gridded_dim_labels, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + if (ungriddedDimCount > 0) then + call ESMF_AttributeAdd(flds(ifld), convention=convention, purpose=purpose, & + attrList=(/ ESMF_ATT_UNGRIDDED_DIM_LABELS /), rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + + call ESMF_AttributeSet(flds(ifld), convention=convention, purpose=purpose, & + name=ESMF_ATT_UNGRIDDED_DIM_LABELS, valueList=ungridded_dim_labels, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + end if + + deallocate(fieldDimLen) + deallocate(gridded_dim_labels) + deallocate(ungridded_dim_labels) + + call ESMF_FieldBundleAdd(fieldbundle, (/flds(ifld)/), rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + enddo - call ESMFIO_Write(IOComp, filename, flds, filePath='./', rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, file=__FILE__)) return ! bail out + call ESMF_FieldBundleWrite(fieldbundle, fileName=trim(filename), convention=convention, purpose=purpose, & + timeslice=1, overwrite=.true., rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return -! -- Finalize ESMFIO +! -- Finalize deallocate(flds) deallocate(fldNameList) - call ESMFIO_Destroy(IOComp, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, file=__FILE__)) call ESMF_Finalize() + + call ESMF_FieldBundleDestroy(fieldbundle, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return !call ESMF_LogWrite(trim(subname)//trim(filename)//": finished", ESMF_LOGMSG_INFO, rc=rc) + contains + + function find_axis_id_for_axis_count(axis, count) result(id) + integer, intent(in) :: axis, count + + integer :: id + integer :: i + + id = -1 ! not found + + if (axis > max_n_axes) then + call ESMF_LogWrite('axis > max_n_axes. Increase max_n_axes in '//trim(subname), ESMF_LOGMSG_ERROR) + return + end if + + do i =1, max_n_dim + if (axes_dimcount(axis, i) == 0) then + axes_dimcount(axis, i) = count + id = i + return + else + if (axes_dimcount(axis, i) == count) then + id = i + return + end if + end if + end do + + call ESMF_LogWrite('Increase max_n_dim in '//trim(subname), ESMF_LOGMSG_ERROR) + + end function find_axis_id_for_axis_count + end subroutine State_RWFields_tiles !----------------------------------------------------------------------------- diff --git a/cpl/module_cplscalars.F90 b/cpl/module_cplscalars.F90 index 2b3e5869eb..481de02be2 100644 --- a/cpl/module_cplscalars.F90 +++ b/cpl/module_cplscalars.F90 @@ -116,7 +116,7 @@ subroutine State_SetScalar(scalar_value, scalar_id, State, flds_scalar_name, fld if (mytask == 0) then call ESMF_FieldGet(lfield, farrayPtr = farrayptr, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - if (scalar_id < 0 .or. scalar_id > flds_scalar_num) then + if (scalar_id <= 0 .or. scalar_id > flds_scalar_num) then call ESMF_LogWrite(trim(subname)//": ERROR in scalar_id", ESMF_LOGMSG_INFO) rc = ESMF_FAILURE return diff --git a/fv3_cap.F90 b/fv3_cap.F90 index 20c2bcc7a7..4d3f999d2b 100644 --- a/fv3_cap.F90 +++ b/fv3_cap.F90 @@ -288,7 +288,6 @@ subroutine InitializeAdvertise(gcomp, rc) call ESMF_LogWrite(trim(subname)//' flds_scalar_name = '//trim(flds_scalar_name), ESMF_LOGMSG_INFO) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return endif - call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldCount", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return if (isPresent .and. isSet) then @@ -313,14 +312,23 @@ subroutine InitializeAdvertise(gcomp, rc) call ESMF_LogWrite(trim(subname)//' : flds_scalar_index_ny = '//trim(msgString), ESMF_LOGMSG_INFO) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return endif - call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxGridNTile", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - if (isPresent .and. isSet) then - read(cvalue,*) flds_scalar_index_ntile - write(msgString,*) flds_scalar_index_ntile - call ESMF_LogWrite(trim(subname)//' : flds_scalar_index_ntile = '//trim(msgString), ESMF_LOGMSG_INFO) + ! tile index must be present if indices for nx and ny are non-zero + if (flds_scalar_index_nx /= 0 .and. flds_scalar_index_ny /=0 ) then + call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxGridNTile", isPresent=isPresent, isSet=isSet, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return - endif + if (.not. isPresent .and. .not. isSet) then + if (mype == 0)write(*,*)'ERROR : ScalarFieldIdxGridNTile must be set' + call ESMF_LogWrite('ERROR : ScalarFieldIdxGridNTile must be set', ESMF_LOGMSG_ERROR) + rc = ESMF_FAILURE + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + else + call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldIdxGridNTile", value=cvalue, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return + read(cvalue,*) flds_scalar_index_ntile + write(msgString,*) flds_scalar_index_ntile + call ESMF_LogWrite(trim(subname)//' : flds_scalar_index_ntile = '//trim(msgString), ESMF_LOGMSG_INFO) + endif + end if !------------------------------------------------------------------------ ! get config variables @@ -1081,7 +1089,8 @@ subroutine ModelAdvance_phase1(gcomp, rc) if( dbug > 0 .or. cplprint_flag ) then fcstpe = .false. if( mype < num_pes_fcst ) fcstpe = .true. - call diagnose_cplFields(gcomp, clock, fcstpe, cplprint_flag, dbug, 'import') + call diagnose_cplFields(gcomp, clock, fcstpe, cplprint_flag, dbug, 'import', rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return endif timep1re = MPI_Wtime() @@ -1235,7 +1244,8 @@ subroutine ModelAdvance_phase2(gcomp, rc) if( dbug > 0 .or. cplprint_flag ) then fcstpe = .false. if( mype < num_pes_fcst ) fcstpe = .true. - call diagnose_cplFields(gcomp, clock_out, fcstpe, cplprint_flag, dbug, 'export') + call diagnose_cplFields(gcomp, clock_out, fcstpe, cplprint_flag, dbug, 'export', rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return end if timep2re = MPI_Wtime() diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 27cdf955f3..4b79c34af8 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -293,8 +293,13 @@ subroutine SetServicesNest(nest, rc) ! Write grid to netcdf file if( cplprint_flag ) then write (myGridStr,"(I0)") mygrid - call wrt_fcst_grid(grid, "diagnostic_FV3_fcstGrid"//trim(mygridStr)//".nc", & - regridArea=.TRUE., rc=rc) + if (trim(name)=="global") then + call wrt_fcst_grid(grid, "diagnostic_FV3_fcstGrid"//trim(mygridStr)//".tile*.nc", & + regridArea=.TRUE., rc=rc) + else + call wrt_fcst_grid(grid, "diagnostic_FV3_fcstGrid"//trim(mygridStr)//".nc", & + regridArea=.TRUE., rc=rc) + end if if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return endif From 44a6126bfe4d79202d35178b755b9ef4f6a96962 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Mon, 3 Feb 2025 21:43:50 +0000 Subject: [PATCH 119/192] Adding upp updates(Addressing NCO's bugzilla; run-time warning/failures with debug built executables) --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 5b24c88503..66150303a0 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 5b24c88503288444545fd799bf64ad886afb6463 +Subproject commit 66150303a06efe54fe1d768cba9db562b2cf82e8 From 9373e48efbea22bd3bf029a57f11c7efe6924269 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Tue, 4 Feb 2025 03:16:50 +0000 Subject: [PATCH 120/192] hail-aware variables and renamed module variables --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index f46ecf217b..e1b64e470b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit f46ecf217bc3d2d70630d53b064649f087be8b58 +Subproject commit e1b64e470bb04df67d05806f4a2c220dd26594a4 From 6fb354c5eef3f98bdd83741bd4cca60e67802c6b Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Tue, 4 Feb 2025 15:54:31 +0000 Subject: [PATCH 121/192] Update pointer to ccpp --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index e1b64e470b..d568900240 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit e1b64e470bb04df67d05806f4a2c220dd26594a4 +Subproject commit d568900240e8cd13778817372899da3a4e67c946 From 034fa88d96aaf5569e75d3663026be2faadafae1 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Tue, 4 Feb 2025 16:13:11 +0000 Subject: [PATCH 122/192] update to NCAR TEMPO repo --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index d568900240..857cd4045b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d568900240e8cd13778817372899da3a4e67c946 +Subproject commit 857cd4045b57c379a2f781f708a1bd03fa5ebe13 From 3f2026c061c3d1abd627209209ee5eed98a349c0 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Tue, 4 Feb 2025 14:45:00 -0600 Subject: [PATCH 123/192] Add an option to use liquid potential temperature in temperature equation of GFS PBL scheme. (from @WeiguoWang-NOAA) --- .gitmodules | 2 +- ccpp/data/GFS_typedefs.F90 | 6 +++++- ccpp/data/GFS_typedefs.meta | 6 ++++++ ccpp/physics | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 41ee3c4566..3aa6e4b13e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics - branch = support/HAFS + branch = feature/hafsv2p1_phase3 [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 45ed0710da..1e27c3d902 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1346,6 +1346,7 @@ module GFS_typedefs real(kind=kind_phys) :: elmx !< maximum allowed dissipation mixing length in boundary layer mass flux scheme integer :: sfc_rlm !< choice of near surface mixing length in boundary layer mass flux scheme integer :: tc_pbl !< control for TC applications in the PBL scheme + integer :: use_lpt !< control for using Liquid Potential Temp for TC applications in the GFSPBL scheme !--- parameters for canopy heat storage (CHS) parameterization real(kind=kind_phys) :: h0facu !< CHS factor for sensible heat flux in unstable surface layer @@ -3863,6 +3864,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: elmx = 300. !< maximum allowed dissipation mixing length in boundary layer mass flux scheme integer :: sfc_rlm = 0 !< choice of near surface mixing length in boundary layer mass flux scheme integer :: tc_pbl = 0 !< control for TC applications in the PBL scheme + integer :: use_lpt = 0 !< control for using Liquid Potential Temp for TC applications in the GFSPBL scheme !--- parameters for canopy heat storage (CHS) parameterization real(kind=kind_phys) :: h0facu = 0.25 @@ -4105,7 +4107,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & diag_flux, diag_log, & ! vertical diffusion xkzm_m, xkzm_h, xkzm_s, xkzminv, moninq_fac, dspfac, & - bl_upfr, bl_dnfr, rlmx, elmx, sfc_rlm, tc_pbl, & + bl_upfr, bl_dnfr, rlmx, elmx, sfc_rlm, tc_pbl, use_lpt, & !--- canopy heat storage parameterization h0facu, h0facs, & !--- cellular automata @@ -5052,6 +5054,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%elmx = elmx Model%sfc_rlm = sfc_rlm Model%tc_pbl = tc_pbl + Model%use_lpt = use_lpt !--- canopy heat storage parametrization Model%h0facu = h0facu @@ -6866,6 +6869,7 @@ subroutine control_print(Model) print *, ' elmx : ', Model%elmx print *, ' sfc_rlm : ', Model%sfc_rlm print *, ' tc_pbl : ', Model%tc_pbl + print *, ' use_lpt : ', Model%use_lpt print *, ' ' print *, 'parameters for canopy heat storage parametrization' print *, ' h0facu : ', Model%h0facu diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 7354412d69..3d489c7033 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -5938,6 +5938,12 @@ units = none dimensions = () type = integer +[use_lpt] + standard_name = control_for_using_LPT_for_TC_applications_in_the_PBL_scheme + long_name = control for using LPT in TC applications in the PBL scheme + units = none + dimensions = () + type = integer [h0facu] standard_name = multiplicative_tuning_parameter_for_reduced_surface_heat_fluxes_due_to_canopy_heat_storage long_name = canopy heat storage factor for sensible heat flux in unstable surface layer diff --git a/ccpp/physics b/ccpp/physics index 4f8f61501f..fbee827769 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 4f8f61501ff9ec315557718e851a4c81d6a373ea +Subproject commit fbee827769efe0ea3f74e052dec0bbcc71a8874f From 61a41dc2f6c8a176fd79361eaa6f715f516433b2 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Thu, 18 Jul 2024 12:58:59 -0500 Subject: [PATCH 124/192] 3D-TKE EMDF GFS PBL scheme related changes from FIU (Ping Zhu, Ping.Zhu@noaa.gov). --- atmos_cubed_sphere | 2 +- ccpp/data/GFS_typedefs.F90 | 16 +++++++++++++++- ccpp/data/GFS_typedefs.meta | 34 ++++++++++++++++++++++++++++++++++ ccpp/physics | 2 +- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 0519df1af7..cf28e1fad7 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 0519df1af731548b1e35aa5685a35605e3e66d5a +Subproject commit cf28e1fad74c30a34e69576f6e5fefe577263040 diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index d67c263edd..0b47c9e9d0 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -169,6 +169,9 @@ module GFS_typedefs real (kind=kind_phys), pointer :: vvl (:,:) => null() !< layer mean vertical velocity in pa/sec real (kind=kind_phys), pointer :: tgrs (:,:) => null() !< model layer mean temperature in k real (kind=kind_phys), pointer :: qgrs (:,:,:) => null() !< layer mean tracer concentration +! scale-aware 3d TKE scheme + real (kind=kind_phys), pointer :: def_1 (:,:) => null() !< deformation 1 + real (kind=kind_phys), pointer :: def_2 (:,:) => null() !< deformation 2 ! dissipation estimate real (kind=kind_phys), pointer :: diss_est(:,:) => null() !< model layer mean temperature in k ! soil state variables - for soil SPPT - sfc-perts, mgehne @@ -1181,6 +1184,7 @@ module GFS_typedefs logical :: shinhong !< flag for scale-aware Shinhong vertical turbulent mixing scheme logical :: do_ysu !< flag for YSU turbulent mixing scheme logical :: dspheat !< flag for tke dissipative heating + logical :: sa3dtke !< flag for scale-aware 3D tke scheme logical :: hurr_pbl !< flag for hurricane-specific options in PBL scheme logical :: lheatstrg !< flag for canopy heat storage parameterization logical :: lseaspray !< flag for sea spray parameterization @@ -2270,12 +2274,17 @@ subroutine statein_create (Statein, Model) allocate (Statein%wgrs (IM,Model%levs)) endif allocate (Statein%qgrs (IM,Model%levs,Model%ntrac)) + allocate (Statein%def_1 (IM,Model%levs)) + allocate (Statein%def_2 (IM,Model%levs)) Statein%qgrs = clear_val Statein%pgr = clear_val Statein%ugrs = clear_val Statein%vgrs = clear_val + Statein%def_1 = clear_val + Statein%def_2 = clear_val + if(Model%lightning_threat) then Statein%wgrs = clear_val endif @@ -3733,6 +3742,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & logical :: shinhong = .false. !< flag for scale-aware Shinhong vertical turbulent mixing scheme logical :: do_ysu = .false. !< flag for YSU vertical turbulent mixing scheme logical :: dspheat = .false. !< flag for tke dissipative heating + logical :: sa3dtke = .false. !< flag for scale-aware 3D tke scheme logical :: hurr_pbl = .false. !< flag for hurricane-specific options in PBL scheme logical :: lheatstrg = .false. !< flag for canopy heat storage parameterization logical :: lseaspray = .false. !< flag for sea spray parameterization @@ -4156,6 +4166,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & do_spp, n_var_spp, & lndp_type, n_var_lndp, lndp_each_step, & pert_mp,pert_clds,pert_radtend, & + !--- Scale-aware 3D TKE scheme + sa3dtke, & !--- Rayleigh friction prslrd0, ral_ts, ldiag_ugwp, do_ugwp, do_tofd, & ! --- Ferrier-Aligo @@ -5128,7 +5140,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%diag_flux = diag_flux !--- flux method in 2-m diagnostics (for stable conditions) Model%diag_log = diag_log - +!--- vertical diffusion + Model%sa3dtke = sa3dtke !--- vertical diffusion Model%xkzm_m = xkzm_m Model%xkzm_h = xkzm_h @@ -6890,6 +6903,7 @@ subroutine control_print(Model) print *, ' shinhong : ', Model%shinhong print *, ' do_ysu : ', Model%do_ysu print *, ' dspheat : ', Model%dspheat + print *, ' sa3dtke : ', Model%sa3dtke print *, ' lheatstrg : ', Model%lheatstrg print *, ' lseaspray : ', Model%lseaspray print *, ' cnvcld : ', Model%cnvcld diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 8adaadaa41..325f30e22d 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -119,6 +119,34 @@ type = real kind = kind_phys active = (do_lightning_threat_index_calculations) +[def_1] + standard_name = shear_prod + long_name = 3D shear production + units = m2 s-2 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys +[def_1(:,1)] + standard_name = shear_prod_at_surface_adjacent_layer + long_name = 3D shear production at lowest model layer + units = m2 s-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys +[def_2] + standard_name = TKE_transfer + long_name = TKE transfer and pressure correlation + units = m2 s-2 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys +[def_2(:,1)] + standard_name = TKE_transfer_at_surface_adjacent_layer + long_name = TKE transfer and pressure correlation at lowest model layer + units = m2 s-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys [vvl] standard_name = lagrangian_tendency_of_air_pressure long_name = layer mean vertical velocity @@ -5510,6 +5538,12 @@ units = flag dimensions = () type = logical +[sa3dtke] + standard_name = flag_sa_3d_tke_scheme + long_name = flag for scale-aware 3d tke scheme + units = flag + dimensions = () + type = logical [hurr_pbl] standard_name = flag_hurricane_PBL long_name = flag for hurricane-specific options in PBL scheme diff --git a/ccpp/physics b/ccpp/physics index 1d0bcdc1cf..0cadf76d78 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 1d0bcdc1cf5b6ecf940556e56791ee6d8e6216a3 +Subproject commit 0cadf76d78567ffec6b25467d97ca6410b87f7d4 From e4cca289230c1bec304334c3c0da3093d38f45d6 Mon Sep 17 00:00:00 2001 From: Ping Zhu Date: Fri, 4 Oct 2024 13:01:27 -0500 Subject: [PATCH 125/192] Update changes in 3d TKE scheme --- ccpp/data/GFS_typedefs.F90 | 31 +++++++++++++++++++++----- ccpp/data/GFS_typedefs.meta | 44 ++++++++++++++++++++++++++++++------- 2 files changed, 61 insertions(+), 14 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 0b47c9e9d0..8cdd2860f2 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -169,9 +169,11 @@ module GFS_typedefs real (kind=kind_phys), pointer :: vvl (:,:) => null() !< layer mean vertical velocity in pa/sec real (kind=kind_phys), pointer :: tgrs (:,:) => null() !< model layer mean temperature in k real (kind=kind_phys), pointer :: qgrs (:,:,:) => null() !< layer mean tracer concentration -! scale-aware 3d TKE scheme - real (kind=kind_phys), pointer :: def_1 (:,:) => null() !< deformation 1 - real (kind=kind_phys), pointer :: def_2 (:,:) => null() !< deformation 2 +!3D-SA-TKE + real (kind=kind_phys), pointer :: def_1 (:,:) => null() !< deformation + real (kind=kind_phys), pointer :: def_2 (:,:) => null() !< deformation + real (kind=kind_phys), pointer :: def_3 (:,:) => null() !< deformation +!3D-SA-TKE-end ! dissipation estimate real (kind=kind_phys), pointer :: diss_est(:,:) => null() !< model layer mean temperature in k ! soil state variables - for soil SPPT - sfc-perts, mgehne @@ -1799,6 +1801,11 @@ module GFS_typedefs real (kind=kind_phys), pointer :: hpbl (:) => null() !< Planetary boundary layer height real (kind=kind_phys), pointer :: ud_mf (:,:) => null() !< updraft mass flux +!-- Diagnostic variable that passes to dyn_core (Samuel) + real (kind=kind_phys), pointer :: dku3d_h (:,:) => null() !< Horizontal eddy diffusitivity for momentum + real (kind=kind_phys), pointer :: dku3d_e (:,:) => null() !< Eddy diffusitivity for momentum for tke + + !--- dynamical forcing variables for Grell-Freitas convection real (kind=kind_phys), pointer :: forcet (:,:) => null() !< real (kind=kind_phys), pointer :: forceq (:,:) => null() !< @@ -2274,16 +2281,21 @@ subroutine statein_create (Statein, Model) allocate (Statein%wgrs (IM,Model%levs)) endif allocate (Statein%qgrs (IM,Model%levs,Model%ntrac)) +!3D-SA-TKE allocate (Statein%def_1 (IM,Model%levs)) allocate (Statein%def_2 (IM,Model%levs)) + allocate (Statein%def_3 (IM,Model%levs)) +!3D-SA-TKE-end Statein%qgrs = clear_val Statein%pgr = clear_val Statein%ugrs = clear_val Statein%vgrs = clear_val - +!3D-SA-TKE Statein%def_1 = clear_val Statein%def_2 = clear_val + Statein%def_3 = clear_val +!3D-SA-TKE-end if(Model%lightning_threat) then Statein%wgrs = clear_val @@ -3742,7 +3754,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & logical :: shinhong = .false. !< flag for scale-aware Shinhong vertical turbulent mixing scheme logical :: do_ysu = .false. !< flag for YSU vertical turbulent mixing scheme logical :: dspheat = .false. !< flag for tke dissipative heating - logical :: sa3dtke = .false. !< flag for scale-aware 3D tke scheme + logical :: sa3dtke = .false. !< flag for scale-aware 3D tke scheme logical :: hurr_pbl = .false. !< flag for hurricane-specific options in PBL scheme logical :: lheatstrg = .false. !< flag for canopy heat storage parameterization logical :: lseaspray = .false. !< flag for sea spray parameterization @@ -5140,8 +5152,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%diag_flux = diag_flux !--- flux method in 2-m diagnostics (for stable conditions) Model%diag_log = diag_log -!--- vertical diffusion +!--- 3D vertical diffusion option Model%sa3dtke = sa3dtke + !--- vertical diffusion Model%xkzm_m = xkzm_m Model%xkzm_h = xkzm_h @@ -7350,6 +7363,12 @@ subroutine tbd_create (Tbd, Model) allocate (Tbd%hpbl (IM)) Tbd%hpbl = clear_val +! Allocate dku for dyn_core (Samuel) + allocate (Tbd%dku3d_h (IM,Model%levs)) + Tbd%dku3d_h = clear_val + allocate (Tbd%dku3d_e (IM,Model%levs)) + Tbd%dku3d_e = clear_val + if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke .or. Model%imfdeepcnv == Model%imfdeepcnv_samf .or. Model%imfshalcnv == Model%imfshalcnv_samf .or. Model%imfdeepcnv == Model%imfdeepcnv_c3 .or. Model%imfshalcnv == Model%imfshalcnv_c3) then allocate (Tbd%prevsq(IM, Model%levs)) Tbd%prevsq = clear_val diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 325f30e22d..75adbe4768 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -120,33 +120,47 @@ kind = kind_phys active = (do_lightning_threat_index_calculations) [def_1] - standard_name = shear_prod - long_name = 3D shear production + standard_name = vert_shear_square + long_name = square of vertical shear units = m2 s-2 dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys [def_1(:,1)] - standard_name = shear_prod_at_surface_adjacent_layer - long_name = 3D shear production at lowest model layer + standard_name = vert_shear_square_at_surface_adjacent_layer + long_name = square of vertical shear at lowest model layer units = m2 s-2 dimensions = (horizontal_loop_extent) type = real kind = kind_phys [def_2] - standard_name = TKE_transfer - long_name = TKE transfer and pressure correlation + standard_name = hori_shear_square + long_name = square of horizontal shear units = m2 s-2 dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys [def_2(:,1)] - standard_name = TKE_transfer_at_surface_adjacent_layer - long_name = TKE transfer and pressure correlation at lowest model layer + standard_name = hori_shear_square_at_surface_adjacent_layer + long_name = square of horizontal shear at lowest model layer units = m2 s-2 dimensions = (horizontal_loop_extent) type = real kind = kind_phys +[def_3] + standard_name = TKE_transfer_rate + long_name = rate of TKE transfer and pressure correlation + units = m2 s-3 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys +[def_3(:,1)] + standard_name = TKE_transfer_rate_at_surface_adjacent_layer + long_name = rate of TKE transfer and pressure correlation at lowest model layer + units = m2 s-3 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys [vvl] standard_name = lagrangian_tendency_of_air_pressure long_name = layer mean vertical velocity @@ -8006,6 +8020,20 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys +[dku3d_h] + standard_name = horizontal_atmosphere_momentum_diffusivity_dyncore + long_name = horizontal atmospheric momentum diffusivity + units = m2 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys +[dku3d_e] + standard_name = atmosphere_momentum_diffusivity_tke_dyncore + long_name = atmospheric momentum diffusivity for tke + units = m2 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt From d67a88cad71b5f5de9857d8649253ba4516d539b Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 14 Feb 2025 09:19:47 -0600 Subject: [PATCH 126/192] Update submodules related to feature/3dtke_gfspbl --- .gitmodules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 22c723ac12..33b97c4e20 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,15 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere + branch = feature/3dtke_gfspbl [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/ufs-community/ccpp-physics - branch = ufs/dev + url = https://github.com/hafs-community/ccpp-physics + branch = feature/3dtke_gfspbl [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP From fc814496c16cd2d9ec86f5a88a27f02eb160f955 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 14 Feb 2025 20:26:08 +0000 Subject: [PATCH 127/192] Update physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index b43e52de90..d9d3bcf957 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit b43e52de90f05955b37fba67988309a9f761036c +Subproject commit d9d3bcf957805db0ce8a19c484293901f5f3e458 From 3a7cd3c68feb1a9774c67d7d03ce1ff5676e9d8a Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 27 Feb 2025 21:49:38 +0000 Subject: [PATCH 128/192] Sync physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index d9d3bcf957..e412ed3558 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d9d3bcf957805db0ce8a19c484293901f5f3e458 +Subproject commit e412ed35589225d0be7de4ceecb788a5b23c6e5e From 5fd8e5b675e040dce0f8398c3daebf58e0ae5faf Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 28 Feb 2025 15:32:27 +0000 Subject: [PATCH 129/192] Bugfix for name conflict in physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index e412ed3558..704ee9243f 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit e412ed35589225d0be7de4ceecb788a5b23c6e5e +Subproject commit 704ee9243f83aa4a488aa2e770c6e3d39b20a7e1 From ff656826738c65c1679feae5d183f7232e24ec90 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 3 Mar 2025 20:11:51 +0000 Subject: [PATCH 130/192] Add import reassignments to avoid error --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 704ee9243f..450a15f057 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 704ee9243f83aa4a488aa2e770c6e3d39b20a7e1 +Subproject commit 450a15f0579901c97857f635f3b18bef205e46c8 From bac6ef3b8fc1949f3ff6d6357df6fb995e1dcc3d Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Wed, 5 Mar 2025 16:07:15 +0000 Subject: [PATCH 131/192] Pointing the updated upp(improved the comments in INITPOST_NETCDF.f) --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 66150303a0..af921932da 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 66150303a06efe54fe1d768cba9db562b2cf82e8 +Subproject commit af921932da2c120bc6927a3361075c5aa627c33d From 8308ec3f670a8c98f409255932ef3c492b615f56 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 7 Mar 2025 15:28:48 +0000 Subject: [PATCH 132/192] Synced physics w/ origin --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 450a15f057..51563ffa59 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 450a15f0579901c97857f635f3b18bef205e46c8 +Subproject commit 51563ffa597a06860ef863a0684e422df0cca797 From a68b6d921499b0668699af77b32c712cd42ff323 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 12 Mar 2025 20:18:57 +0000 Subject: [PATCH 133/192] Updated physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 51563ffa59..9b7f776776 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 51563ffa597a06860ef863a0684e422df0cca797 +Subproject commit 9b7f776776a7dd22ff8c9786389d8be7fbe1acc4 From 850f30f09b43b8adc54be97c7d718771e3af5b05 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sun, 16 Mar 2025 17:20:35 +0000 Subject: [PATCH 134/192] Update submodules of upp and atmos_cubed_sphere. Pointing to corresponding production/hafs.v2.1 branch. --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3aa6e4b13e..a7aa88ecfb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere - branch = support/HAFS + branch = production/hafs.v2.1 [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework @@ -13,4 +13,4 @@ [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP - branch = feature/hafsv2p1_baseline + branch = production/hafs.v2.1 From a3ad8aae34d960ea4aecfef32e94a6c410a55be8 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 25 Mar 2025 03:30:30 +0000 Subject: [PATCH 135/192] Update related submodules to use production/hafs.v2.1 branches. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index a7aa88ecfb..9bee0233c2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics - branch = feature/hafsv2p1_phase3 + branch = production/hafs.v2.1 [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP From 50995c0893d1e3a41ce55e7e67a44c8dcfe14d2c Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 25 Mar 2025 16:08:27 +0000 Subject: [PATCH 136/192] Update submodule upp. --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index af921932da..e96c6c2dbe 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit af921932da2c120bc6927a3361075c5aa627c33d +Subproject commit e96c6c2dbe5831b3c81723b1d8df26789fc43d14 From 312fa695a8574d665c4ec84d105aafe6a66771af Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 26 Mar 2025 14:14:41 -0400 Subject: [PATCH 137/192] point back to Anders branch in ccpp-physics --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0ecea086e6..843f069fc4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,8 +10,8 @@ path = ccpp/physics #url = https://github.com/ufs-community/ccpp-physics #branch = ufs/dev - url = https://github.com/grantfirl/ccpp-physics - branch = tempo_dev_gjf + url = https://github.com/AndersJensen-NOAA/ccpp-physics + branch = tempo_dev [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP From 053336837743f2c89541ddc3a4ca49c887dd411d Mon Sep 17 00:00:00 2001 From: "Kwun Y. Fung" Date: Fri, 28 Mar 2025 11:00:08 -0500 Subject: [PATCH 138/192] 3dtke changes at FV3 level for the updated ufs --- atmos_cubed_sphere | 2 +- atmos_model.F90 | 6 ++++-- ccpp/data/GFS_typedefs.F90 | 11 ++++++++--- ccpp/data/GFS_typedefs.meta | 22 ++++++++++++++-------- ccpp/physics | 2 +- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index cf28e1fad7..c494e46fbe 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit cf28e1fad74c30a34e69576f6e5fefe577263040 +Subproject commit c494e46fbefeb1144a9722b7091cb945423c2051 diff --git a/atmos_model.F90 b/atmos_model.F90 index 5468249f36..6d6a918205 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -270,7 +270,8 @@ subroutine update_atmos_radiation_physics (Atmos) call set_atmosphere_pelist() call mpp_clock_begin(getClock) if (GFS_control%do_skeb) call atmosphere_diss_est (GFS_control%skeb_npass) ! do smoothing for SKEB - call atmos_phys_driver_statein (GFS_Control, GFS_Statein, Atm_block, flip_vc) + ! SA-3D-TKE added GFS_Tbd (kyf) + call atmos_phys_driver_statein (GFS_Control, GFS_Statein, GFS_Tbd, Atm_block, flip_vc) call mpp_clock_end(getClock) !--- if dycore only run, set up the dummy physics output state as the input state @@ -753,7 +754,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) endif ! Populate the GFS_Statein container with the prognostic state ! in Atm_block, which contains the initial conditions/restart data. - call atmos_phys_driver_statein (GFS_control, GFS_statein, Atm_block, flip_vc) + ! SA-3D-TKE added GFS_Tbd (kyf) + call atmos_phys_driver_statein (GFS_control, GFS_statein, GFS_Tbd, Atm_block, flip_vc) ! When asked to calculate 3-dim. tendencies, set Stateout variables to ! Statein variables here in order to capture the first call to dycore diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 8cdd2860f2..3303400691 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1265,6 +1265,7 @@ module GFS_typedefs real(kind=kind_phys) :: betascu !< Tuning parameter for prog. closure shallow clouds real(kind=kind_phys) :: betamcu !< Tuning parameter for prog. closure midlevel clouds real(kind=kind_phys) :: betadcu !< Tuning parameter for prog. closure deep clouds + logical :: sigmab_coldstart !< flag to cold start sigmab !--- MYNN parameters/switches logical :: do_mynnedmf @@ -1801,7 +1802,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: hpbl (:) => null() !< Planetary boundary layer height real (kind=kind_phys), pointer :: ud_mf (:,:) => null() !< updraft mass flux -!-- Diagnostic variable that passes to dyn_core (Samuel) +!-- Diagnostic variable that passes to dyn_core (SA-3D-TKE) real (kind=kind_phys), pointer :: dku3d_h (:,:) => null() !< Horizontal eddy diffusitivity for momentum real (kind=kind_phys), pointer :: dku3d_e (:,:) => null() !< Eddy diffusitivity for momentum for tke @@ -3813,6 +3814,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: betascu = 8.0 !< Tuning parameter for prog. closure shallow clouds real(kind=kind_phys) :: betamcu = 1.0 !< Tuning parameter for prog. closure midlevel clouds real(kind=kind_phys) :: betadcu = 2.0 !< Tuning parameter for prog. closure deep clouds + logical :: sigmab_coldstart = .false. !< flag to cold start sigmab ! *DH logical :: do_myjsfc = .false. !< flag for MYJ surface layer scheme logical :: do_myjpbl = .false. !< flag for MYJ PBL scheme @@ -4167,6 +4169,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & do_myjsfc, do_myjpbl, & hwrf_samfdeep, hwrf_samfshal,progsigma,betascu,betamcu, & betadcu,h2o_phys, pdfcld, shcnvcw, redrag, hybedmf, satmedmf,& + sigmab_coldstart, & shinhong, do_ysu, dspheat, lheatstrg, lseaspray, cnvcld, & xr_cnvcld, random_clds, shal_cnv, imfshalcnv, imfdeepcnv, & isatmedmf, conv_cf_opt, do_deep, jcap, & @@ -4998,6 +5001,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%betascu = betascu Model%betamcu = betamcu Model%betadcu = betadcu + Model%sigmab_coldstart = sigmab_coldstart if (oz_phys .and. oz_phys_2015) then write(*,*) 'Logic error: can only use one ozone physics option (oz_phys or oz_phys_2015), not both. Exiting.' @@ -5152,7 +5156,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%diag_flux = diag_flux !--- flux method in 2-m diagnostics (for stable conditions) Model%diag_log = diag_log -!--- 3D vertical diffusion option +!--- SA-3D-TKE option Model%sa3dtke = sa3dtke !--- vertical diffusion @@ -7035,6 +7039,7 @@ subroutine control_print(Model) print *, 'betascu : ', Model%betascu print *, 'betamcu : ', Model%betamcu print *, 'betadcu : ', Model%betadcu + print *, 'sigmab_coldstart : ', Model%sigmab_coldstart print *, ' ' print *, 'cellular automata' print *, ' nca : ', Model%nca @@ -7363,7 +7368,7 @@ subroutine tbd_create (Tbd, Model) allocate (Tbd%hpbl (IM)) Tbd%hpbl = clear_val -! Allocate dku for dyn_core (Samuel) +! Allocate horizontal component of dku for dyn_core (SA-3D-TKE) allocate (Tbd%dku3d_h (IM,Model%levs)) Tbd%dku3d_h = clear_val allocate (Tbd%dku3d_e (IM,Model%levs)) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 75adbe4768..25b47e394a 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -123,42 +123,42 @@ standard_name = vert_shear_square long_name = square of vertical shear units = m2 s-2 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [def_1(:,1)] standard_name = vert_shear_square_at_surface_adjacent_layer long_name = square of vertical shear at lowest model layer units = m2 s-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [def_2] standard_name = hori_shear_square long_name = square of horizontal shear units = m2 s-2 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [def_2(:,1)] standard_name = hori_shear_square_at_surface_adjacent_layer long_name = square of horizontal shear at lowest model layer units = m2 s-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [def_3] standard_name = TKE_transfer_rate long_name = rate of TKE transfer and pressure correlation units = m2 s-3 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [def_3(:,1)] standard_name = TKE_transfer_rate_at_surface_adjacent_layer long_name = rate of TKE transfer and pressure correlation at lowest model layer units = m2 s-3 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [vvl] @@ -5729,6 +5729,12 @@ dimensions = () type = real kind = kind_phys +[sigmab_coldstart] + standard_name = flag_to_cold_start_for_sigmab_init + long_name = flag to cold start for sigmab initialization + units = flag + dimensions = () + type = logical [isatmedmf] standard_name = choice_of_scale_aware_TKE_moist_EDMF_PBL long_name = choice of scale-aware TKE moist EDMF PBL scheme @@ -8024,14 +8030,14 @@ standard_name = horizontal_atmosphere_momentum_diffusivity_dyncore long_name = horizontal atmospheric momentum diffusivity units = m2 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [dku3d_e] standard_name = atmosphere_momentum_diffusivity_tke_dyncore long_name = atmospheric momentum diffusivity for tke units = m2 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [ud_mf] diff --git a/ccpp/physics b/ccpp/physics index 0cadf76d78..3c2a6fe742 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 0cadf76d78567ffec6b25467d97ca6410b87f7d4 +Subproject commit 3c2a6fe7424e6c25971009ccddddf11cbd18690a From 2d6360712c9b42230bb94ea59723eaf8d84a410c Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 28 Mar 2025 13:35:56 -0400 Subject: [PATCH 139/192] update ccpp/physics submodule --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index cf80fd98cd..90d7d5415e 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit cf80fd98cdd5818826f29b11e062fb196d06163a +Subproject commit 90d7d5415e08f0a9fcc2de2dec7355917ee3459e From f95766daec8687511080c0e261443d8385c414cd Mon Sep 17 00:00:00 2001 From: BijuThomas-NOAA Date: Thu, 10 Apr 2025 13:38:41 +0000 Subject: [PATCH 140/192] Porting HAFS to the Ursa Platform --- atmos_cubed_sphere | 2 +- upp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 1a8f38b699..b7e4819db0 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 1a8f38b69953912385f502821c2e55345c3b3fd4 +Subproject commit b7e4819db07b82cd9587847a429688bfc08a6aa7 diff --git a/upp b/upp index e96c6c2dbe..1462448866 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit e96c6c2dbe5831b3c81723b1d8df26789fc43d14 +Subproject commit 1462448866e33fceec5dc67bc09e197447748dc8 From 2db909cd4a4a811faaf315008b82169550b70b5d Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 18 Apr 2025 14:49:54 +0000 Subject: [PATCH 141/192] sync physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 9b7f776776..ffcafd24da 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 9b7f776776a7dd22ff8c9786389d8be7fbe1acc4 +Subproject commit ffcafd24da9d147ac62178c0bad299e14e9dbf6c From 461b90c52ff4f49ebda6bb8ef424bd80a1968ca1 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 18 Apr 2025 19:36:51 +0000 Subject: [PATCH 142/192] Remove old pieces from new SDFs --- ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml | 2 -- ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml | 2 -- 2 files changed, 4 deletions(-) diff --git a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml index a812035b4f..f7153b2b80 100644 --- a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml +++ b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml @@ -17,7 +17,6 @@ - GFS_suite_interstitial_rad_reset GFS_rrtmg_pre GFS_radiation_surface rad_sw_pre @@ -30,7 +29,6 @@ - GFS_suite_interstitial_phys_reset GFS_suite_stateout_reset get_prs_fv3 GFS_suite_interstitial_1 diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml index 11def51761..b4103a860b 100644 --- a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml +++ b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml @@ -17,7 +17,6 @@ - GFS_suite_interstitial_rad_reset GFS_rrtmg_pre GFS_radiation_surface rad_sw_pre @@ -30,7 +29,6 @@ - GFS_suite_interstitial_phys_reset GFS_suite_stateout_reset get_prs_fv3 GFS_suite_interstitial_1 From de99c5413f00ec25e15ee40f01f1eccf0afcf3bc Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 23 Apr 2025 21:41:40 +0000 Subject: [PATCH 143/192] Update SDFs --- ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml | 6 +++++- ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml index f7153b2b80..604343d635 100644 --- a/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml +++ b/ccpp/suites/suite_FV3_GFS_v16_gfdlmpv3.xml @@ -27,7 +27,7 @@ GFS_rrtmg_post - + GFS_suite_stateout_reset get_prs_fv3 @@ -63,6 +63,10 @@ cires_ugwp_post GFS_GWD_generic_post GFS_suite_stateout_update + + + + GFS_photochemistry get_phi_fv3 GFS_suite_interstitial_3 diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml index b4103a860b..b222245f27 100644 --- a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml +++ b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf.xml @@ -27,7 +27,7 @@ GFS_rrtmg_post - + GFS_suite_stateout_reset get_prs_fv3 @@ -63,6 +63,10 @@ unified_ugwp_post GFS_GWD_generic_post GFS_suite_stateout_update + + + + GFS_photochemistry get_phi_fv3 GFS_suite_interstitial_3 From d95ef983f6f3043709709285e94fe3ec721b619b Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 25 Apr 2025 21:28:18 +0000 Subject: [PATCH 144/192] Update physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index ffcafd24da..f7fa2e2c04 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ffcafd24da9d147ac62178c0bad299e14e9dbf6c +Subproject commit f7fa2e2c0468b9ad340ba9a1971d7c85611e32ae From 14d1d0661d3ec23054dea53d57cdf35b08ec49b0 Mon Sep 17 00:00:00 2001 From: BijuThomas-NOAA Date: Mon, 28 Apr 2025 14:38:50 +0000 Subject: [PATCH 145/192] Porging HAFS to Ursa(updates in atmos_cubed_sphere) --- atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index b7e4819db0..f07cbaf955 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit b7e4819db07b82cd9587847a429688bfc08a6aa7 +Subproject commit f07cbaf955486420575610e32891c9173efd082a From 181f402ef7da4caaa812e605bf79325b4da40280 Mon Sep 17 00:00:00 2001 From: BijuThomas-NOAA Date: Wed, 30 Apr 2025 15:49:50 +0000 Subject: [PATCH 146/192] Updates in upp(Porting HAFS to real Ursa) --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 1462448866..0543c7d3a1 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 1462448866e33fceec5dc67bc09e197447748dc8 +Subproject commit 0543c7d3a1026da8f6e4e64058445257f7d2c29d From 7c81bb45774ce3580311680eef7ac9f42b37ad86 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 2 May 2025 16:01:45 +0000 Subject: [PATCH 147/192] Synced physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index f7fa2e2c04..98ac97610f 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit f7fa2e2c0468b9ad340ba9a1971d7c85611e32ae +Subproject commit 98ac97610f12c0e606925cfe592caf04ba8677a6 From dedbd4899ef614e46ffa099e52028fc58071c4c5 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 9 May 2025 08:27:58 -0500 Subject: [PATCH 148/192] Update submodule fv3/atmos_cubed_sphere. --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 7c9a1932ac..c1b9a06b29 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 7c9a1932ac0ed6754bd3c5318b3735928c225bb5 +Subproject commit c1b9a06b2942abed4df2b1d055601855504d2912 From c49635680f329e5c3f55c7c7c7136b87eb4075b4 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 9 May 2025 09:55:50 -0500 Subject: [PATCH 149/192] Update submodules fv3/atmos_cubed_sphere and ccpp/physics. --- ccpp/physics | 2 +- fv3/atmos_cubed_sphere | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/physics b/ccpp/physics index 1ac659e4ee..9c4545fe79 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 1ac659e4ee36571837463f71b4d64260c7c93ca1 +Subproject commit 9c4545fe79fff4e7a8f7814ecb23c88fa2af17ce diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index c1b9a06b29..7bdc2c6f57 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit c1b9a06b2942abed4df2b1d055601855504d2912 +Subproject commit 7bdc2c6f579e60f6417d525d58b47b2ec4b5f9bb From a389bcd10860edca095e57aa234703dfa615e3bd Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 15 May 2025 16:18:11 -0600 Subject: [PATCH 150/192] Remove PP directive --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 98ac97610f..73b851bd1c 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 98ac97610f12c0e606925cfe592caf04ba8677a6 +Subproject commit 73b851bd1cf2c2685381a13f1b1392c016ed9a6a From c32c8fd4c802c4f762fa7141320fe367bedf14ba Mon Sep 17 00:00:00 2001 From: "Kwun Y. Fung" Date: Fri, 23 May 2025 15:16:50 -0500 Subject: [PATCH 151/192] Update submodules fv3/atmos_cubed_sphere 3dtke data structure --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 7bdc2c6f57..c50e3397fc 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 7bdc2c6f579e60f6417d525d58b47b2ec4b5f9bb +Subproject commit c50e3397fc5b74e30aca031e606396e4d6cbc9f0 From 6929959453544dc94b8a13a6e28b1d0c91d355ba Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sat, 31 May 2025 23:48:48 +0000 Subject: [PATCH 152/192] Update .gitmodules. --- .gitmodules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9bee0233c2..ce466d152a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "atmos_cubed_sphere"] path = atmos_cubed_sphere url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere - branch = production/hafs.v2.1 + branch = support/HAFS [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework @@ -9,8 +9,8 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics - branch = production/hafs.v2.1 + branch = support/HAFS [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP - branch = production/hafs.v2.1 + branch = support/HAFS From b6bdc1defeeb1fe5b458daa46278917b9ff058c8 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Mon, 2 Jun 2025 15:26:32 +0000 Subject: [PATCH 153/192] Add an option to use liquid potential temperature in temperature equation of GFS PBL scheme. (from @WeiguoWang-NOAA) --- .gitmodules | 4 ++-- ccpp/data/GFS_typedefs.F90 | 6 +++++- ccpp/data/GFS_typedefs.meta | 6 ++++++ ccpp/physics | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index a012324010..19905b3418 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,8 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/ufs-community/ccpp-physics - branch = ufs/dev + url = https://github.com/hafs-community/ccpp-physics + branch = feature/gfspbl_lpt [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 8d90054332..0615f8fdc2 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1377,6 +1377,7 @@ module GFS_typedefs real(kind=kind_phys) :: elmx !< maximum allowed dissipation mixing length in boundary layer mass flux scheme integer :: sfc_rlm !< choice of near surface mixing length in boundary layer mass flux scheme integer :: tc_pbl !< control for TC applications in the PBL scheme + integer :: use_lpt !< control for using Liquid Potential Temp for TC applications in the GFSPBL scheme !--- parameters for canopy heat storage (CHS) parameterization real(kind=kind_phys) :: h0facu !< CHS factor for sensible heat flux in unstable surface layer @@ -3918,6 +3919,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: elmx = 300. !< maximum allowed dissipation mixing length in boundary layer mass flux scheme integer :: sfc_rlm = 0 !< choice of near surface mixing length in boundary layer mass flux scheme integer :: tc_pbl = 0 !< control for TC applications in the PBL scheme + integer :: use_lpt = 0 !< control for using Liquid Potential Temp for TC applications in the GFSPBL scheme !--- parameters for canopy heat storage (CHS) parameterization real(kind=kind_phys) :: h0facu = 0.25 @@ -4184,7 +4186,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & diag_flux, diag_log, & ! vertical diffusion xkzm_m, xkzm_h, xkzm_s, xkzminv, moninq_fac, dspfac, & - bl_upfr, bl_dnfr, rlmx, elmx, sfc_rlm, tc_pbl, & + bl_upfr, bl_dnfr, rlmx, elmx, sfc_rlm, tc_pbl, use_lpt, & !--- canopy heat storage parameterization h0facu, h0facs, & !--- cellular automata @@ -5155,6 +5157,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%elmx = elmx Model%sfc_rlm = sfc_rlm Model%tc_pbl = tc_pbl + Model%use_lpt = use_lpt !--- canopy heat storage parametrization Model%h0facu = h0facu @@ -7000,6 +7003,7 @@ subroutine control_print(Model) print *, ' elmx : ', Model%elmx print *, ' sfc_rlm : ', Model%sfc_rlm print *, ' tc_pbl : ', Model%tc_pbl + print *, ' use_lpt : ', Model%use_lpt print *, ' ' print *, 'parameters for canopy heat storage parametrization' print *, ' h0facu : ', Model%h0facu diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 04562b7db7..67e95bccaa 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -6112,6 +6112,12 @@ units = none dimensions = () type = integer +[use_lpt] + standard_name = control_for_using_LPT_for_TC_applications_in_the_PBL_scheme + long_name = control for using LPT in TC applications in the PBL scheme + units = none + dimensions = () + type = integer [h0facu] standard_name = multiplicative_tuning_parameter_for_reduced_surface_heat_fluxes_due_to_canopy_heat_storage long_name = canopy heat storage factor for sensible heat flux in unstable surface layer diff --git a/ccpp/physics b/ccpp/physics index 8d1a0bf67e..dfa39f6bac 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 8d1a0bf67e0c3e916bfd02be66136d7b6fbda173 +Subproject commit dfa39f6baca358b6348e247a63455c64beb543a3 From 73af13e8258a712f8b54c6f30183ec89c83015fc Mon Sep 17 00:00:00 2001 From: "Kwun Y. Fung" Date: Mon, 2 Jun 2025 23:57:40 -0500 Subject: [PATCH 154/192] Update sa3dtke variables standard names --- ccpp/data/GFS_typedefs.meta | 32 ++++++++++++++++---------------- ccpp/physics | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index e81e361577..3aa89ea83b 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -120,43 +120,43 @@ kind = kind_phys active = (do_lightning_threat_index_calculations) [def_1] - standard_name = vert_shear_square - long_name = square of vertical shear + standard_name = square_of_vertical_shear_due_to_dynamics + long_name = square of vertical shear calculated from dynamics units = m2 s-2 dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [def_1(:,1)] - standard_name = vert_shear_square_at_surface_adjacent_layer - long_name = square of vertical shear at lowest model layer + standard_name = square_of_vertical_shear_due_to_dynamics_at_surface_adjacent_layer + long_name = square of vertical shear calculated from dynamics at lowest model layer units = m2 s-2 dimensions = (horizontal_dimension) type = real kind = kind_phys [def_2] - standard_name = hori_shear_square - long_name = square of horizontal shear + standard_name = square_of_horizontal_shear_due_to_dynamics + long_name = square of horizontal shear calculated from dynamics units = m2 s-2 dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [def_2(:,1)] - standard_name = hori_shear_square_at_surface_adjacent_layer - long_name = square of horizontal shear at lowest model layer + standard_name = square_of_horizontal_shear_due_to_dynamics_at_surface_adjacent_layer + long_name = square of horizontal shear calculated from dynamics at lowest model layer units = m2 s-2 dimensions = (horizontal_dimension) type = real kind = kind_phys [def_3] - standard_name = TKE_transfer_rate - long_name = rate of TKE transfer and pressure correlation + standard_name = transfer_rate_of_tke_due_to_dynamics + long_name = rate of TKE transfer and pressure correlation calculated from dynamics units = m2 s-3 dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [def_3(:,1)] standard_name = TKE_transfer_rate_at_surface_adjacent_layer - long_name = rate of TKE transfer and pressure correlation at lowest model layer + long_name = rate of TKE transfer and pressure correlation calculated from dynamics at lowest model layer units = m2 s-3 dimensions = (horizontal_dimension) type = real @@ -5568,7 +5568,7 @@ dimensions = () type = logical [sa3dtke] - standard_name = flag_sa_3d_tke_scheme + standard_name = do_scale_aware_3d_tke long_name = flag for scale-aware 3d tke scheme units = flag dimensions = () @@ -8054,15 +8054,15 @@ type = real kind = kind_phys [dku3d_h] - standard_name = horizontal_atmosphere_momentum_diffusivity_dyncore - long_name = horizontal atmospheric momentum diffusivity + standard_name = horizontal_atmosphere_momentum_diffusivity_for_dyanmics + long_name = horizontal atmospheric momentum diffusivity for dynamics units = m2 s-1 dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [dku3d_e] - standard_name = atmosphere_momentum_diffusivity_tke_dyncore - long_name = atmospheric momentum diffusivity for tke + standard_name = horizontal_atmosphere_tke_diffusivity_for_dyanmics + long_name = horizontal atmospheric tke diffusivity for dynamics units = m2 s-1 dimensions = (horizontal_dimension,vertical_layer_dimension) type = real diff --git a/ccpp/physics b/ccpp/physics index 9c4545fe79..9f259053ac 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 9c4545fe79fff4e7a8f7814ecb23c88fa2af17ce +Subproject commit 9f259053ac220e7ebce9d305ca832c06bbc6ba4d From 303ad6bc48bda8e1a7caadafbf0dade7a1832259 Mon Sep 17 00:00:00 2001 From: "Kwun Y. Fung" Date: Tue, 3 Jun 2025 00:04:22 -0500 Subject: [PATCH 155/192] Update based on stylistic comments and mpi use in dyn_core --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index c50e3397fc..bd0e4141fc 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit c50e3397fc5b74e30aca031e606396e4d6cbc9f0 +Subproject commit bd0e4141fccd40335c133ebe39768834b8056544 From 01bdaa3e2d987193fd6c498b93e549b62601370b Mon Sep 17 00:00:00 2001 From: "Kwun Y. Fung" Date: Wed, 4 Jun 2025 17:03:45 -0500 Subject: [PATCH 156/192] Update submodule physics for sa3dtke nonlocal mixing and stylistic coding --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 9f259053ac..a6c6bbdc82 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 9f259053ac220e7ebce9d305ca832c06bbc6ba4d +Subproject commit a6c6bbdc829937721da9bef82f84b2162bdfb581 From a1563856597e2002594093628421e864516fdf7e Mon Sep 17 00:00:00 2001 From: "Kwun Y. Fung" Date: Mon, 16 Jun 2025 09:42:41 -0500 Subject: [PATCH 157/192] Update submodules physics for SA3DTKE non-local mixing --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 97b38cb58d..0eb443ba0d 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 97b38cb58d1b9f9d712d4acfc2b86846d17aeaf5 +Subproject commit 0eb443ba0d48a273265f8b95dfe8f17d748ee01a From 3c0493b70794bcee2140cf7703dda56ccd290f04 Mon Sep 17 00:00:00 2001 From: "Kwun Y. Fung" Date: Mon, 16 Jun 2025 09:47:02 -0500 Subject: [PATCH 158/192] Update SA3DTKE variables names --- ccpp/data/GFS_typedefs.meta | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 3aa89ea83b..5d6fca0285 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -148,15 +148,15 @@ type = real kind = kind_phys [def_3] - standard_name = transfer_rate_of_tke_due_to_dynamics - long_name = rate of TKE transfer and pressure correlation calculated from dynamics + standard_name = horizontal_transfer_rate_of_tke_due_to_dynamics + long_name = rate of horizontal TKE transfer and pressure correlation calculated from dynamics units = m2 s-3 dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [def_3(:,1)] - standard_name = TKE_transfer_rate_at_surface_adjacent_layer - long_name = rate of TKE transfer and pressure correlation calculated from dynamics at lowest model layer + standard_name = horizontal_transfer_rate_tke_due_to_dynamics_at_surface_adjacent_layer + long_name = rate of horizontal TKE transfer and pressure correlation calculated from dynamics at lowest model layer units = m2 s-3 dimensions = (horizontal_dimension) type = real @@ -8054,14 +8054,14 @@ type = real kind = kind_phys [dku3d_h] - standard_name = horizontal_atmosphere_momentum_diffusivity_for_dyanmics + standard_name = horizontal_atmosphere_momentum_diffusivity_for_dynamics long_name = horizontal atmospheric momentum diffusivity for dynamics units = m2 s-1 dimensions = (horizontal_dimension,vertical_layer_dimension) type = real kind = kind_phys [dku3d_e] - standard_name = horizontal_atmosphere_tke_diffusivity_for_dyanmics + standard_name = horizontal_atmosphere_tke_diffusivity_for_dynamics long_name = horizontal atmospheric tke diffusivity for dynamics units = m2 s-1 dimensions = (horizontal_dimension,vertical_layer_dimension) From 4f27d873343e24ef133879632808949a9dd2944c Mon Sep 17 00:00:00 2001 From: "Kwun Y. Fung" Date: Tue, 17 Jun 2025 12:19:03 -0500 Subject: [PATCH 159/192] Update submodules physics for SA3DTKE nonlocal mass-flux transport --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 0eb443ba0d..11a126b156 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 0eb443ba0d48a273265f8b95dfe8f17d748ee01a +Subproject commit 11a126b1568d3d527c96d8cf888016abf89778a4 From eeaec64368ba1375ee03f6ae936d5634a012d355 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 27 Jun 2025 01:26:57 +0000 Subject: [PATCH 160/192] Update submodule fv3/atmos_cubed_sphere. --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 219f701b40..ec21a2a5e0 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 219f701b403f3b667ac4ca08eb66cdeedf3e61b3 +Subproject commit ec21a2a5e0e70d167041f75f1470c1b223aaf063 From 4e53d29680f3db8e6ba211b3750727e68cb5b1bc Mon Sep 17 00:00:00 2001 From: BinLiu-NOAA Date: Sun, 29 Jun 2025 01:20:29 +0000 Subject: [PATCH 161/192] Add corresponding suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml. --- ...uite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml new file mode 100644 index 0000000000..0c07e76404 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml @@ -0,0 +1,92 @@ + + + + + + + fv_sat_adj + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_ocean + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + + + + + GFS_photochemistry + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + gfdl_cloud_microphys_v3 + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + From 5bc31040c8d5683674d9b68eb8f9b97c0f88eea9 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 30 Jun 2025 16:41:53 +0000 Subject: [PATCH 162/192] Update physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 6eea755c55..6e920220a3 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 6eea755c555a18de8521ffcbe7eb9f67e077938b +Subproject commit 6e920220a3fd20fb8f2e1f8260a9f7f36e5f0bb2 From ff08721d907b0d0e0a208585d1dde74794235d42 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 2 Jul 2025 15:27:39 +0000 Subject: [PATCH 163/192] Sync physics. Update TEMPO hash --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 7c956664e2..6e1a2ba481 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 7c956664e228806a7607979ee632bd802ea09c5d +Subproject commit 6e1a2ba4812f22810421ae27408a6f9665330417 From 7a971dfc64ecd41371a9eb401e2b527e5dda1069 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 2 Jul 2025 16:02:48 +0000 Subject: [PATCH 164/192] Update TEMPO SDF --- ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml b/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml index 22f8a402d1..cd1d1aff56 100644 --- a/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml +++ b/ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1_tempo.xml @@ -12,7 +12,6 @@ - GFS_suite_interstitial_rad_reset GFS_rrtmg_pre GFS_radiation_surface rad_sw_pre @@ -23,9 +22,8 @@ GFS_rrtmg_post - + - GFS_suite_interstitial_phys_reset GFS_suite_stateout_reset get_prs_fv3 GFS_suite_interstitial_1 @@ -61,6 +59,10 @@ ugwpv1_gsldrag_post GFS_GWD_generic_post GFS_suite_stateout_update + + + + GFS_photochemistry get_phi_fv3 GFS_suite_interstitial_3 From 479740a72334b009cd41fcf76687c2113a6420ea Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 2 Jul 2025 18:46:19 +0000 Subject: [PATCH 165/192] ccpp-physics TEMPO --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 6e920220a3..214f46a238 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 6e920220a3fd20fb8f2e1f8260a9f7f36e5f0bb2 +Subproject commit 214f46a238caec7532171ff8fe28c316c6132af3 From b0a33c549e186878e673ca529a783f771730e906 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 11 Jul 2025 08:36:43 -0500 Subject: [PATCH 166/192] Update submodule fv3/atmos_cubed_sphere with fixes. --- .gitmodules | 12 ++++++++---- fv3/atmos_cubed_sphere | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index a012324010..7b945c84f7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,19 @@ [submodule "fv3/atmos_cubed_sphere"] path = fv3/atmos_cubed_sphere - url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere - branch = dev/emc + url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere + branch = feature/3dtke_update +# url = https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere +# branch = dev/emc [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/ufs-community/ccpp-physics - branch = ufs/dev + url = https://github.com/hafs-community/ccpp-physics + branch = feature/3dtke_update +# url = https://github.com/ufs-community/ccpp-physics +# branch = ufs/dev [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 4f1a5ef4b8..fc06b5cc13 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 4f1a5ef4b83461a79a62c8d965ebc2b26cf5eba8 +Subproject commit fc06b5cc136c0f04ccaadbfe969376e309d1f8c0 From ffa12ead3d74394fa243046f7391ca1de3cde661 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Fri, 11 Jul 2025 13:46:16 +0000 Subject: [PATCH 167/192] Update submodule fv3/atmos_cubed_sphere. --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 9307933f03..9ee6243fcf 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 9307933f03981d5980dfcba4df2757d1a994dc5b +Subproject commit 9ee6243fcf3131e2540287dba960278b318ce8bb From 1eaa9bd298f4ad143c34643feb7330832cc4de37 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 11 Jul 2025 08:56:39 -0500 Subject: [PATCH 168/192] Update submodule ccpp/physics. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 65a25474e9..d033868f75 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 65a25474e96977737532f86d199c39dc74b5dc28 +Subproject commit d033868f75d1225a64f2a0fc0e2674ad94f413fd From 600ab618488cae6cd1ed86924e98aed75b39d906 Mon Sep 17 00:00:00 2001 From: BinLiu-NOAA Date: Wed, 16 Jul 2025 18:57:13 +0000 Subject: [PATCH 169/192] From @RongqianYang-NOAA: Remove the redundant special treatment for NoahMP LSM related variable initialization in fv_moving_nest_main.F90. --- fv3/moving_nest/fv_moving_nest_main.F90 | 235 ++---------------------- 1 file changed, 16 insertions(+), 219 deletions(-) diff --git a/fv3/moving_nest/fv_moving_nest_main.F90 b/fv3/moving_nest/fv_moving_nest_main.F90 index 6f57141a2a..be3dd395ef 100644 --- a/fv3/moving_nest/fv_moving_nest_main.F90 +++ b/fv3/moving_nest/fv_moving_nest_main.F90 @@ -1302,225 +1302,22 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, GFS_control, GFS_sfcprop, GFS_tbd !!===================================================================================== if (use_timers) call mpp_clock_begin (id_movnest7_3) - if (is_fine_pe) then - !print '("[INFO] WDR NOAHMP reset negative values npe=",I0)', mpp_pe() - ! do i=isd,ied - ! do j=jsd,jed - ! This just needs to check in the compute domain. While the mn_phys fields extend into the halo, the GFS structure from CCPP only covers the compute domain. - do i=isc,iec - do j=jsc,jec - - ! Regular physics variables - do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) - if (Moving_nest(n)%mn_phys%stc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%stc(i,j,k) .gt. maxSkinTempK ) then - Moving_nest(n)%mn_phys%stc(i,j,k) = 298.0 - endif - if (Moving_nest(n)%mn_phys%smc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%smc(i,j,k) .gt. 1000.0 ) then - Moving_nest(n)%mn_phys%smc(i,j,k) = 0.3 - endif - if (Moving_nest(n)%mn_phys%slc(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%slc(i,j,k) .gt. 1000.0 ) then - Moving_nest(n)%mn_phys%slc(i,j,k) = 0.3 - endif - enddo - - - if (Moving_nest(n)%mn_phys%canopy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%canopy(i,j) .gt. 100.0 ) then - Moving_nest(n)%mn_phys%canopy(i,j) = 0.0 ! Zero out if no other information - endif - if (Moving_nest(n)%mn_phys%vegfrac(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%vegfrac(i,j) .gt. 100.0 ) then - Moving_nest(n)%mn_phys%vegfrac(i,j) = 0.5 ! Default to half. Confirmed that values are fractions. - endif - - - if (move_noahmp) then - - if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1) then - ! NOAH MP Variables - - if (Moving_nest(n)%mn_phys%snowd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%snowd(i,j) .gt. 1000.0 ) then - Moving_nest(n)%mn_phys%snowd(i,j) = 0.0 ! Cold start value in meters - endif - - if (Moving_nest(n)%mn_phys%weasd(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%weasd(i,j) .gt. 1000.0 ) then - Moving_nest(n)%mn_phys%weasd(i,j) = 0.0 ! Cold start value in mm - endif - - Moving_nest(n)%mn_phys%snowxy(i,j) = 0.0 ! init all 5 to 0 first and snowd <=0.025 - - do k=lbound(Moving_nest(n)%mn_phys%zsnsoxy,3), ubound(Moving_nest(n)%mn_phys%zsnsoxy,3) - Moving_nest(n)%mn_phys%zsnsoxy(i,j,k) = 0.0 - enddo - - do k=lbound(Moving_nest(n)%mn_phys%tsnoxy,3),ubound(Moving_nest(n)%mn_phys%tsnoxy,3) - Moving_nest(n)%mn_phys%tsnoxy(i,j,k) = 0.0 - Moving_nest(n)%mn_phys%snicexy(i,j,k) = 0.0 - Moving_nest(n)%mn_phys%snliqxy(i,j,k) = 0.0 - enddo - - if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.025 .and. Moving_nest(n)%mn_phys%snowd(i,j) .le. 0.05) then - Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) - - Moving_nest(n)%mn_phys%snowxy(i,j) = -1.0 - Moving_nest(n)%mn_phys%zsnsoxy(i,j,0) = Moving_nest(n)%mn_phys%snowd(i,j) - - Moving_nest(n)%mn_phys%snicexy(i,j,0) = Moving_nest(n)%mn_phys%weasd(i,j) - - else if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.05 .and. Moving_nest(n)%mn_phys%snowd(i,j) .le. 0.1) then - Moving_nest(n)%mn_phys%tsnoxy(i,j,-1) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%snowxy(i,j) = -2.0 - - Moving_nest(n)%mn_phys%zsnsoxy(i,j,-1) = Moving_nest(n)%mn_phys%snowd(i,j) - Moving_nest(n)%mn_phys%zsnsoxy(i,j,0) = Moving_nest(n)%mn_phys%snowd(i,j) /2.0 - - Moving_nest(n)%mn_phys%snicexy(i,j,-1) = Moving_nest(n)%mn_phys%weasd(i,j)/2.0 - Moving_nest(n)%mn_phys%snicexy(i,j,0) = Moving_nest(n)%mn_phys%weasd(i,j)/2.0 - - else if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.1 .and. Moving_nest(n)%mn_phys%snowd(i,j) .le. 0.25) then - Moving_nest(n)%mn_phys%tsnoxy(i,j,-1) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) - - Moving_nest(n)%mn_phys%snowxy(i,j) = -2.0 - - Moving_nest(n)%mn_phys%zsnsoxy(i,j,-1) = Moving_nest(n)%mn_phys%snowd(i,j) ! dzsn(-1) = 0.05 - Moving_nest(n)%mn_phys%zsnsoxy(i,j,0) = Moving_nest(n)%mn_phys%snowd(i,j) - 0.05 - - Moving_nest(n)%mn_phys%snicexy(i,j,-1) = 0.05* & - Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - - Moving_nest(n)%mn_phys%snicexy(i,j,0) = (Moving_nest(n)%mn_phys%snowd(i,j)-0.05)* & - Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - - else if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.25 .and. Moving_nest(n)%mn_phys%snowd(i,j) .le. 0.35) then - Moving_nest(n)%mn_phys%tsnoxy(i,j,-2) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%tsnoxy(i,j,-1) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%snowxy(i,j) = -3.0 - - Moving_nest(n)%mn_phys%zsnsoxy(i,j,-2) = Moving_nest(n)%mn_phys%snowd(i,j) !dzsn(-2) = 0.05 - Moving_nest(n)%mn_phys%zsnsoxy(i,j,-1) = Moving_nest(n)%mn_phys%snowd(i,j) -0.05 - Moving_nest(n)%mn_phys%zsnsoxy(i,j, 0) = (Moving_nest(n)%mn_phys%snowd(i,j) -0.05)/2.0 - - Moving_nest(n)%mn_phys%snicexy(i,j,-2) = 0.05* & - Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - - Moving_nest(n)%mn_phys%snicexy(i,j,-1) = (Moving_nest(n)%mn_phys%snowd(i,j)-0.05)/2.0* & - Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - Moving_nest(n)%mn_phys%snicexy(i,j,0) = (Moving_nest(n)%mn_phys%snowd(i,j)-0.05)/2.0* & - Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - - else if (Moving_nest(n)%mn_phys%snowd(i,j) .gt. 0.35 ) then - Moving_nest(n)%mn_phys%tsnoxy(i,j,-2) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%tsnoxy(i,j,-1) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%tsnoxy(i,j,0) = Moving_nest(n)%mn_phys%ts(i,j) - Moving_nest(n)%mn_phys%snowxy(i,j) = -3.0 - - Moving_nest(n)%mn_phys%zsnsoxy(i,j,-2) = Moving_nest(n)%mn_phys%snowd(i,j) !dzsn(-2)=0.05 - Moving_nest(n)%mn_phys%zsnsoxy(i,j,-1) = Moving_nest(n)%mn_phys%snowd(i,j) - 0.05 !dzsno(-1) = 0.10 - Moving_nest(n)%mn_phys%zsnsoxy(i,j, 0) = Moving_nest(n)%mn_phys%snowd(i,j) - 0.05 - 0.10 - - Moving_nest(n)%mn_phys%snicexy(i,j,-2) = 0.05* & - Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - - Moving_nest(n)%mn_phys%snicexy(i,j,-1) = 0.10* & - Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - - Moving_nest(n)%mn_phys%snicexy(i,j,0) = (Moving_nest(n)%mn_phys%snowd(i,j)-0.05 - 0.10)* & - Moving_nest(n)%mn_phys%weasd(i,j)/Moving_nest(n)%mn_phys%snowd(i,j) - endif - - - Moving_nest(n)%mn_phys%zsnsoxy(i,j,1) = -0.10 - Moving_nest(n)%mn_phys%zsnsoxy(i,j,2) = -0.40 - Moving_nest(n)%mn_phys%zsnsoxy(i,j,3) = -1.00 - Moving_nest(n)%mn_phys%zsnsoxy(i,j,4) = -2.00 - - - if (Moving_nest(n)%mn_phys%soilcolor(i,j) .lt. 1.0 .or. Moving_nest(n)%mn_phys%soilcolor(i,j) .gt. 19.0 ) then - ! Default changed to 10 based on suggestion from Mike Barlage; more middle of the spectrum value. - Moving_nest(n)%mn_phys%soilcolor(i,j) = 10.0 - endif - - if (Moving_nest(n)%mn_phys%alboldxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%alboldxy(i,j) .gt. 1.0 ) then - Moving_nest(n)%mn_phys%alboldxy(i,j) = 0.65 ! Cold start value - endif - - do k=lbound(Moving_nest(n)%mn_phys%stc,3),ubound(Moving_nest(n)%mn_phys%stc,3) - if (Moving_nest(n)%mn_phys%smoiseq(i,j,k) .lt. 0.0 .or. Moving_nest(n)%mn_phys%smoiseq(i,j,k) .gt. 1000.0) then - Moving_nest(n)%mn_phys%smoiseq(i,j,k) = 0.3 - - endif - enddo - - - if (Moving_nest(n)%mn_phys%tvxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tvxy(i,j) .gt. maxSkinTempK ) then - print '("[INFO] WDR NOAHMP reset vegetation canopy temp values npe=",I0," i=",I0," j=",I0," tvxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tvxy(i,j) - Moving_nest(n)%mn_phys%tvxy(i,j) = Moving_nest(n)%mn_phys%ts(i,j) ! skin temperature - endif - - if (Moving_nest(n)%mn_phys%tgxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tgxy(i,j) .gt. maxSkinTempK ) then - print '("[INFO] WDR NOAHMP reset ground temp values npe=",I0," i=",I0," j=",I0," tgxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tgxy(i,j) - Moving_nest(n)%mn_phys%tgxy(i,j) = Moving_nest(n)%mn_phys%ts(i,j) ! skin temperature - endif - - if (Moving_nest(n)%mn_phys%tahxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%tahxy(i,j) .gt. maxSkinTempK ) then - print '("[INFO] WDR NOAHMP reset air temp in canopy values npe=",I0," i=",I0," j=",I0," tahxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%tahxy(i,j) - Moving_nest(n)%mn_phys%tahxy(i,j) = Moving_nest(n)%mn_phys%ts(i,j) ! skin temperature - endif - - - if (Moving_nest(n)%mn_phys%cmxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%cmxy(i,j) .gt. 100 ) then - print '("[INFO] WDR NOAHMP reset drag coeff values npe=",I0," i=",I0," j=",I0," cmxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%cmxy(i,j) - Moving_nest(n)%mn_phys%cmxy(i,j) = 0.0 - endif - if (Moving_nest(n)%mn_phys%chxy(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%chxy(i,j) .gt. 100 ) then - print '("[INFO] WDR NOAHMP reset drag coeff values npe=",I0," i=",I0," j=",I0," chxy=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%chxy(i,j) - Moving_nest(n)%mn_phys%chxy(i,j) = 0.0 - endif - - if (Moving_nest(n)%mn_phys%lakefrac(i,j) .lt. 0.0 .or. Moving_nest(n)%mn_phys%lakefrac(i,j) .gt. 100 ) then - print '("[INFO] WDR NOAHMP reset lake frac values npe=",I0," i=",I0," j=",I0," lakefrac=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%lakefrac(i,j) - Moving_nest(n)%mn_phys%lakefrac(i,j) = 0.0 - endif - - if (Moving_nest(n)%mn_phys%lakedepth(i,j) .lt. -1.0e+04 .or. Moving_nest(n)%mn_phys%lakedepth(i,j) .gt. 2000 ) then - print '("[INFO] WDR NOAHMP reset lake depth values npe=",I0," i=",I0," j=",I0," lakedepth=",E12.5)', mpp_pe(), i, j, Moving_nest(n)%mn_phys%lakedepth(i,j) - Moving_nest(n)%mn_phys%lakedepth(i,j) = 0.0 - endif - - - endif ! if slmsk=1 - endif ! if move_noahmp - enddo ! do j - enddo ! do i - endif ! if is_fine_pe - - - if (is_fine_pe) then - do i=isc,iec - do j=jsc,jec - ! EMIS PATCH - Force to positive at all locations matching the landmask - !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1 .and. Moving_nest(n)%mn_phys%emis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_lnd(i,j) = 0.5 - !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 2 .and. Moving_nest(n)%mn_phys%emis_ice(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_ice(i,j) = 0.5 - !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 0 .and. Moving_nest(n)%mn_phys%emis_wat(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_wat(i,j) = 0.5 - !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1 .and. Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) = 0.5 - !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1 .and. Moving_nest(n)%mn_phys%albdirnir_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) = 0.5 - !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1 .and. Moving_nest(n)%mn_phys%albdifvis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdifvis_lnd(i,j) = 0.5 - !if (Moving_nest(n)%mn_phys%slmsk(i,j) .eq. 1 .and. Moving_nest(n)%mn_phys%albdifnir_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdifnir_lnd(i,j) = 0.5 - - ! EMIS PATCH - Force to positive at all locations. - if (Moving_nest(n)%mn_phys%emis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_lnd(i,j) = 0.5 - if (Moving_nest(n)%mn_phys%emis_ice(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_ice(i,j) = 0.5 - if (Moving_nest(n)%mn_phys%emis_wat(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_wat(i,j) = 0.5 - if (Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) = 0.5 - if (Moving_nest(n)%mn_phys%albdirnir_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) = 0.5 - if (Moving_nest(n)%mn_phys%albdifvis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdifvis_lnd(i,j) = 0.5 - if (Moving_nest(n)%mn_phys%albdifnir_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdifnir_lnd(i,j) = 0.5 - - - enddo - enddo - endif + if (is_fine_pe) then + do i=isc,iec + do j=jsc,jec + + ! EMIS PATCH - Force to positive at all locations. + if (Moving_nest(n)%mn_phys%emis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_lnd(i,j) = 0.5 + if (Moving_nest(n)%mn_phys%emis_ice(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_ice(i,j) = 0.5 + if (Moving_nest(n)%mn_phys%emis_wat(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%emis_wat(i,j) = 0.5 + if (Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) = 0.5 + if (Moving_nest(n)%mn_phys%albdirnir_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdirvis_lnd(i,j) = 0.5 + if (Moving_nest(n)%mn_phys%albdifvis_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdifvis_lnd(i,j) = 0.5 + if (Moving_nest(n)%mn_phys%albdifnir_lnd(i,j) .lt. 0.0) Moving_nest(n)%mn_phys%albdifnir_lnd(i,j) = 0.5 + + enddo + enddo + endif call mn_prog_apply_temp_variables(Atm, n, child_grid_num, is_fine_pe, npz) call mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop, GFS_tbd, GFS_cldprop, GFS_intdiag, n, child_grid_num, is_fine_pe, npz) From 4e4b2aa1ca53957746e42b777f3fa0b22aefa10f Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Sat, 19 Jul 2025 10:17:10 -0500 Subject: [PATCH 170/192] From @JongilHan66: GFS_typedefs.F90 and GFS_typedefs.meta are updated to include TTE-EDMF, which can be used in combination with sa3dtke and use_lpt. Update submodules: fv3/atmos_cubed_sphere and ccpp/physics. --- ccpp/data/GFS_typedefs.F90 | 21 +++++++++++++-------- ccpp/data/GFS_typedefs.meta | 6 ++++++ ccpp/physics | 2 +- fv3/atmos_cubed_sphere | 2 +- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 9ef11201b2..6bf6d75bbd 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -169,11 +169,11 @@ module GFS_typedefs real (kind=kind_phys), pointer :: vvl (:,:) => null() !< layer mean vertical velocity in pa/sec real (kind=kind_phys), pointer :: tgrs (:,:) => null() !< model layer mean temperature in k real (kind=kind_phys), pointer :: qgrs (:,:,:) => null() !< layer mean tracer concentration -!3D-SA-TKE +!SA-3D-TKE real (kind=kind_phys), pointer :: def_1 (:,:) => null() !< deformation real (kind=kind_phys), pointer :: def_2 (:,:) => null() !< deformation real (kind=kind_phys), pointer :: def_3 (:,:) => null() !< deformation -!3D-SA-TKE-end +!SA-3D-TKE-end ! dissipation estimate real (kind=kind_phys), pointer :: diss_est(:,:) => null() !< model layer mean temperature in k ! soil state variables - for soil SPPT - sfc-perts, mgehne @@ -1183,6 +1183,8 @@ module GFS_typedefs logical :: hybedmf !< flag for hybrid edmf pbl scheme logical :: satmedmf !< flag for scale-aware TKE-based moist edmf !< vertical turbulent mixing scheme + logical :: tte_edmf !< flag for scale-aware TTE-based moist edmf + !< vertical turbulent mixing scheme logical :: shinhong !< flag for scale-aware Shinhong vertical turbulent mixing scheme logical :: do_ysu !< flag for YSU turbulent mixing scheme logical :: dspheat !< flag for tke dissipative heating @@ -1809,7 +1811,6 @@ module GFS_typedefs real (kind=kind_phys), pointer :: dku3d_h (:,:) => null() !< Horizontal eddy diffusitivity for momentum real (kind=kind_phys), pointer :: dku3d_e (:,:) => null() !< Eddy diffusitivity for momentum for tke - !--- dynamical forcing variables for Grell-Freitas convection real (kind=kind_phys), pointer :: forcet (:,:) => null() !< real (kind=kind_phys), pointer :: forceq (:,:) => null() !< @@ -2285,21 +2286,21 @@ subroutine statein_create (Statein, Model) allocate (Statein%wgrs (IM,Model%levs)) endif allocate (Statein%qgrs (IM,Model%levs,Model%ntrac)) -!3D-SA-TKE +!SA-3D-TKE allocate (Statein%def_1 (IM,Model%levs)) allocate (Statein%def_2 (IM,Model%levs)) allocate (Statein%def_3 (IM,Model%levs)) -!3D-SA-TKE-end +!SA-3D-TKE-end Statein%qgrs = clear_val Statein%pgr = clear_val Statein%ugrs = clear_val Statein%vgrs = clear_val -!3D-SA-TKE +!SA-3D-TKE Statein%def_1 = clear_val Statein%def_2 = clear_val Statein%def_3 = clear_val -!3D-SA-TKE-end +!SA-3D-TKE-end if(Model%lightning_threat) then Statein%wgrs = clear_val @@ -3755,6 +3756,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & logical :: hybedmf = .false. !< flag for hybrid edmf pbl scheme logical :: satmedmf = .false. !< flag for scale-aware TKE-based moist edmf !< vertical turbulent mixing scheme + logical :: tte_edmf = .false. !< flag for scale-aware TTE-based moist edmf + !< vertical turbulent mixing scheme logical :: shinhong = .false. !< flag for scale-aware Shinhong vertical turbulent mixing scheme logical :: do_ysu = .false. !< flag for YSU vertical turbulent mixing scheme logical :: dspheat = .false. !< flag for tke dissipative heating @@ -4174,7 +4177,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & do_myjsfc, do_myjpbl, & hwrf_samfdeep, hwrf_samfshal,progsigma,progomega,betascu, & betamcu, betadcu,h2o_phys, pdfcld, shcnvcw, redrag, & - hybedmf, satmedmf, sigmab_coldstart, & + hybedmf, satmedmf, tte_edmf, sigmab_coldstart, & shinhong, do_ysu, dspheat, lheatstrg, lseaspray, cnvcld, & xr_cnvcld, random_clds, shal_cnv, imfshalcnv, imfdeepcnv, & isatmedmf, conv_cf_opt, do_deep, jcap, & @@ -5027,6 +5030,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%redrag = redrag Model%hybedmf = hybedmf Model%satmedmf = satmedmf + Model%tte_edmf = tte_edmf Model%shinhong = shinhong Model%do_ysu = do_ysu Model%dspheat = dspheat @@ -6929,6 +6933,7 @@ subroutine control_print(Model) print *, ' redrag : ', Model%redrag print *, ' hybedmf : ', Model%hybedmf print *, ' satmedmf : ', Model%satmedmf + print *, ' tte_edmf : ', Model%tte_edmf print *, ' isatmedmf : ', Model%isatmedmf print *, ' shinhong : ', Model%shinhong print *, ' do_ysu : ', Model%do_ysu diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 0037163db6..dda4464dbb 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -5447,6 +5447,12 @@ units = flag dimensions = () type = logical +[tte_edmf] + standard_name = flag_for_scale_aware_TTE_moist_EDMF_PBL + long_name = flag for scale-aware TTE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical [shinhong] standard_name = flag_for_scale_aware_Shinhong_PBL long_name = flag for scale-aware Shinhong PBL scheme diff --git a/ccpp/physics b/ccpp/physics index d033868f75..7a341b8022 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d033868f75d1225a64f2a0fc0e2674ad94f413fd +Subproject commit 7a341b8022bc234bec1751a5b911a630955cb7f9 diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index fc06b5cc13..a6fba32cae 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit fc06b5cc136c0f04ccaadbfe969376e309d1f8c0 +Subproject commit a6fba32cae791f95e02bf06deff36dbadaed6b23 From 9e0ff9b1ac85857d4fe13e0d32c5a918205e5104 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Sat, 19 Jul 2025 10:17:10 -0500 Subject: [PATCH 171/192] From @JongilHan66: GFS_typedefs.F90 and GFS_typedefs.meta are updated to include TTE-EDMF, which can be used in combination with sa3dtke and use_lpt. Update submodules: fv3/atmos_cubed_sphere and ccpp/physics. --- ccpp/data/GFS_typedefs.F90 | 21 +++++++++++++-------- ccpp/data/GFS_typedefs.meta | 6 ++++++ ccpp/physics | 2 +- fv3/atmos_cubed_sphere | 2 +- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 4c7141eebc..9e1b6b7287 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -171,11 +171,11 @@ module GFS_typedefs real (kind=kind_phys), pointer :: vvl (:,:) => null() !< layer mean vertical velocity in pa/sec real (kind=kind_phys), pointer :: tgrs (:,:) => null() !< model layer mean temperature in k real (kind=kind_phys), pointer :: qgrs (:,:,:) => null() !< layer mean tracer concentration -!3D-SA-TKE +!SA-3D-TKE real (kind=kind_phys), pointer :: def_1 (:,:) => null() !< deformation real (kind=kind_phys), pointer :: def_2 (:,:) => null() !< deformation real (kind=kind_phys), pointer :: def_3 (:,:) => null() !< deformation -!3D-SA-TKE-end +!SA-3D-TKE-end ! dissipation estimate real (kind=kind_phys), pointer :: diss_est(:,:) => null() !< model layer mean temperature in k ! soil state variables - for soil SPPT - sfc-perts, mgehne @@ -1188,6 +1188,8 @@ module GFS_typedefs logical :: hybedmf !< flag for hybrid edmf pbl scheme logical :: satmedmf !< flag for scale-aware TKE-based moist edmf !< vertical turbulent mixing scheme + logical :: tte_edmf !< flag for scale-aware TTE-based moist edmf + !< vertical turbulent mixing scheme logical :: shinhong !< flag for scale-aware Shinhong vertical turbulent mixing scheme logical :: do_ysu !< flag for YSU turbulent mixing scheme logical :: dspheat !< flag for tke dissipative heating @@ -1816,7 +1818,6 @@ module GFS_typedefs real (kind=kind_phys), pointer :: dku3d_h (:,:) => null() !< Horizontal eddy diffusitivity for momentum real (kind=kind_phys), pointer :: dku3d_e (:,:) => null() !< Eddy diffusitivity for momentum for tke - !--- dynamical forcing variables for Grell-Freitas convection real (kind=kind_phys), pointer :: forcet (:,:) => null() !< real (kind=kind_phys), pointer :: forceq (:,:) => null() !< @@ -2292,21 +2293,21 @@ subroutine statein_create (Statein, Model) allocate (Statein%wgrs (IM,Model%levs)) endif allocate (Statein%qgrs (IM,Model%levs,Model%ntrac)) -!3D-SA-TKE +!SA-3D-TKE allocate (Statein%def_1 (IM,Model%levs)) allocate (Statein%def_2 (IM,Model%levs)) allocate (Statein%def_3 (IM,Model%levs)) -!3D-SA-TKE-end +!SA-3D-TKE-end Statein%qgrs = clear_val Statein%pgr = clear_val Statein%ugrs = clear_val Statein%vgrs = clear_val -!3D-SA-TKE +!SA-3D-TKE Statein%def_1 = clear_val Statein%def_2 = clear_val Statein%def_3 = clear_val -!3D-SA-TKE-end +!SA-3D-TKE-end if(Model%lightning_threat) then Statein%wgrs = clear_val @@ -3765,6 +3766,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & logical :: hybedmf = .false. !< flag for hybrid edmf pbl scheme logical :: satmedmf = .false. !< flag for scale-aware TKE-based moist edmf !< vertical turbulent mixing scheme + logical :: tte_edmf = .false. !< flag for scale-aware TTE-based moist edmf + !< vertical turbulent mixing scheme logical :: shinhong = .false. !< flag for scale-aware Shinhong vertical turbulent mixing scheme logical :: do_ysu = .false. !< flag for YSU vertical turbulent mixing scheme logical :: dspheat = .false. !< flag for tke dissipative heating @@ -4186,7 +4189,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & do_myjsfc, do_myjpbl, & hwrf_samfdeep, hwrf_samfshal,progsigma,progomega,betascu, & betamcu, betadcu,h2o_phys, pdfcld, shcnvcw, redrag, & - hybedmf, satmedmf, sigmab_coldstart, & + hybedmf, satmedmf, tte_edmf, sigmab_coldstart, & shinhong, do_ysu, dspheat, lheatstrg, lseaspray, cnvcld, & xr_cnvcld, random_clds, shal_cnv, imfshalcnv, imfdeepcnv, & isatmedmf, conv_cf_opt, do_deep, jcap, & @@ -5050,6 +5053,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%redrag = redrag Model%hybedmf = hybedmf Model%satmedmf = satmedmf + Model%tte_edmf = tte_edmf Model%shinhong = shinhong Model%do_ysu = do_ysu Model%dspheat = dspheat @@ -6959,6 +6963,7 @@ subroutine control_print(Model) print *, ' redrag : ', Model%redrag print *, ' hybedmf : ', Model%hybedmf print *, ' satmedmf : ', Model%satmedmf + print *, ' tte_edmf : ', Model%tte_edmf print *, ' isatmedmf : ', Model%isatmedmf print *, ' shinhong : ', Model%shinhong print *, ' do_ysu : ', Model%do_ysu diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index f13faf8614..7140c187d9 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -5465,6 +5465,12 @@ units = flag dimensions = () type = logical +[tte_edmf] + standard_name = flag_for_scale_aware_TTE_moist_EDMF_PBL + long_name = flag for scale-aware TTE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical [shinhong] standard_name = flag_for_scale_aware_Shinhong_PBL long_name = flag for scale-aware Shinhong PBL scheme diff --git a/ccpp/physics b/ccpp/physics index cac9ec394c..658dd21580 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit cac9ec394c9ad86d7784da521192b58f07ce5ec1 +Subproject commit 658dd21580dd5dd898e7b744ce19e0f5a7f4350d diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 9ee6243fcf..92c06d0310 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 9ee6243fcf3131e2540287dba960278b318ce8bb +Subproject commit 92c06d03109dc57620c0983b52b178d73df4c135 From e0eeee13509034b818a9088c29d204b85af28acf Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sun, 27 Jul 2025 17:18:56 +0000 Subject: [PATCH 172/192] Add suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml and suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml Move suite_FV3_HAFS_v1_thompson_noahmp*.xml from suites_not_used to suites. --- .../suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml | 94 +++++++++++++++++++ ...ite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml | 92 ++++++++++++++++++ .../suite_FV3_HAFS_v1_thompson_noahmp.xml | 0 ...ite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml | 0 4 files changed, 186 insertions(+) create mode 100644 ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml create mode 100644 ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml rename ccpp/{suites_not_used => suites}/suite_FV3_HAFS_v1_thompson_noahmp.xml (100%) rename ccpp/{suites_not_used => suites}/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml (100%) diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml new file mode 100644 index 0000000000..60df45b702 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml @@ -0,0 +1,94 @@ + + + + + + + fv_sat_adj + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + noahmpdrv + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + + + + + GFS_photochemistry + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + gfdl_cloud_microphys_v3 + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml new file mode 100644 index 0000000000..108f854d01 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml @@ -0,0 +1,92 @@ + + + + + + + fv_sat_adj + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_ocean + noahmpdrv + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + + + + + GFS_photochemistry + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + gfdl_cloud_microphys_v3 + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp.xml b/ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp.xml similarity index 100% rename from ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp.xml rename to ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp.xml diff --git a/ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml similarity index 100% rename from ccpp/suites_not_used/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml rename to ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml From 4932362b8f22647d13b5df0ea57688fbd0ec58c8 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Mon, 28 Jul 2025 13:01:03 -0500 Subject: [PATCH 173/192] Update submodules: fv3/atmos_cubed_sphere and ccpp/physics, which have 3DTKE related updates from @JongilHan66. --- ccpp/physics | 2 +- fv3/atmos_cubed_sphere | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/physics b/ccpp/physics index 7a341b8022..b385926991 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 7a341b8022bc234bec1751a5b911a630955cb7f9 +Subproject commit b385926991709ec4719fb65b47ef8e6ca0b02c3d diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index a6fba32cae..3370a88098 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit a6fba32cae791f95e02bf06deff36dbadaed6b23 +Subproject commit 3370a880983abf8086715e0867506f521cb7a30f From 91a566b4829ba87dc541e1e40b56e2144d6e938b Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Mon, 28 Jul 2025 13:01:03 -0500 Subject: [PATCH 174/192] Update submodules: fv3/atmos_cubed_sphere and ccpp/physics, which have 3DTKE related updates from @JongilHan66. --- ccpp/physics | 2 +- fv3/atmos_cubed_sphere | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/physics b/ccpp/physics index 658dd21580..b3832fe8b8 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 658dd21580dd5dd898e7b744ce19e0f5a7f4350d +Subproject commit b3832fe8b8bce75b85cb87b1c651052e519efe77 diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 5971069783..9a32e89b41 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 5971069783e948965d8b6d9913b0753ab4050000 +Subproject commit 9a32e89b41b2b684f0450a5734d92ad226892d78 From 6873adcd02fac8d79591d27f615589e3b35498d8 Mon Sep 17 00:00:00 2001 From: Junghoon Shin Date: Wed, 30 Jul 2025 14:23:58 +0000 Subject: [PATCH 175/192] Update submodule ccpp/physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index b3832fe8b8..74583790cf 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit b3832fe8b8bce75b85cb87b1c651052e519efe77 +Subproject commit 74583790cf85e41ff72e2cf762b6946a440551e1 From fc458019bed18cadc1deb961e4f754970c297239 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Thu, 7 Aug 2025 09:01:04 +0000 Subject: [PATCH 176/192] Update submodule fv3/atmos_cubed_sphere. --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 9a32e89b41..d7b9939b68 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 9a32e89b41b2b684f0450a5734d92ad226892d78 +Subproject commit d7b9939b6812f7d8b06e87807b4968cec301df0e From 2bc91474394c3fd114efb00bb424af2e451fca5e Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Thu, 7 Aug 2025 11:11:53 -0500 Subject: [PATCH 177/192] Update submodule fv3/atmos_cubed_sphere. --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 3370a88098..d35735dfe3 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 3370a880983abf8086715e0867506f521cb7a30f +Subproject commit d35735dfe3c07cee114b1a757bb6fcc39e34dbee From 59fd5ad8d4cfa3d26cbfacd290ab5e5b67d79df6 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Thu, 28 Aug 2025 11:59:35 -0400 Subject: [PATCH 178/192] Poining to the subumodule level updates(upp) --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 20a8db1c96..70ffb6eeb5 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 20a8db1c96a9c492fcaeca768df36f1285d7d7fe +Subproject commit 70ffb6eeb5e145c0f1fbea69e5237d12ef122dd0 From dab63d1324d33c11c33afbb2a089dad303f24560 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Tue, 2 Sep 2025 13:53:37 +0000 Subject: [PATCH 179/192] Pointing to the submodule level update(Hera:upp) --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 70ffb6eeb5..fa41e51f30 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 70ffb6eeb5e145c0f1fbea69e5237d12ef122dd0 +Subproject commit fa41e51f309d422e6f7027b902a4351304f21cef From e5edae94c2292fe1c3709f43ec0bb5f263da492a Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Wed, 17 Sep 2025 15:03:35 +0000 Subject: [PATCH 180/192] submodule level update(upp) --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index fa41e51f30..3c1e95447d 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit fa41e51f309d422e6f7027b902a4351304f21cef +Subproject commit 3c1e95447d15d75b68a1bce4a4142fbf03ba5485 From 47cc1b9057b1e1997161c8a925e160ca05b0e3ee Mon Sep 17 00:00:00 2001 From: BinLiu-NOAA Date: Fri, 21 Nov 2025 09:51:01 +0000 Subject: [PATCH 181/192] Add the following two suite definition files for HAFS, which uses thompson_noahmp_rrtmgp schemes. - suite_FV3_HAFS_v2_coupled.xml - suite_FV3_HAFS_v2.xml Note: There is a 37-character length limit for suite names. --- ccpp/suites/suite_FV3_HAFS_v2.xml | 92 +++++++++++++++++++++++ ccpp/suites/suite_FV3_HAFS_v2_coupled.xml | 90 ++++++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 ccpp/suites/suite_FV3_HAFS_v2.xml create mode 100644 ccpp/suites/suite_FV3_HAFS_v2_coupled.xml diff --git a/ccpp/suites/suite_FV3_HAFS_v2.xml b/ccpp/suites/suite_FV3_HAFS_v2.xml new file mode 100644 index 0000000000..40bdc9f5a2 --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v2.xml @@ -0,0 +1,92 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmgp_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_rrtmgp_pre + GFS_radiation_surface + GFS_rrtmgp_cloud_mp + GFS_rrtmgp_cloud_overlap + GFS_cloud_diagnostics + rrtmgp_aerosol_optics + rrtmgp_sw_main + rrtmgp_lw_main + GFS_radiation_post + + + + + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + noahmpdrv + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + + + + + GFS_photochemistry + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_FV3_HAFS_v2_coupled.xml b/ccpp/suites/suite_FV3_HAFS_v2_coupled.xml new file mode 100644 index 0000000000..9da81a47ce --- /dev/null +++ b/ccpp/suites/suite_FV3_HAFS_v2_coupled.xml @@ -0,0 +1,90 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmgp_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_rrtmgp_pre + GFS_radiation_surface + GFS_rrtmgp_cloud_mp + GFS_rrtmgp_cloud_overlap + GFS_cloud_diagnostics + rrtmgp_aerosol_optics + rrtmgp_sw_main + rrtmgp_lw_main + GFS_radiation_post + + + + + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_ocean + noahmpdrv + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + unified_ugwp + unified_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + + + + + GFS_photochemistry + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + GFS_physics_post + + + + + GFS_stochastics + + + + From 4d02e7ff8e08254f04206d0376d90505df5d412c Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Sat, 22 Nov 2025 19:29:54 +0000 Subject: [PATCH 182/192] Update submodule ccpp-physics with RRTMGP related changes for nesting configurations. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index c447381ab3..9ae1de35e8 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c447381ab301d32f726f6990f6cfe7c9d3e66a11 +Subproject commit 9ae1de35e80f3359909054be6d10ae9de6e49e81 From 36c0b3e502b95caf2c0614574642680b71483637 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 25 Nov 2025 15:42:52 -0500 Subject: [PATCH 183/192] NoahMP LSM and sea ice related updates for HAFS moving nesting (#16) The following changes are from @RongqianYang-NOAA, @barlage, and @wramstrom, to address NoahMP LSM and sea-ice related moving-nesting issues. - Add snow layer and snow soil layer thickness to GFS_type. - Add checks for soil moisture for Noah MP. - Changes for distinguishing between new and old points for snow-related fields reset in moving nest physics. - Add leading_edge logical array to indicate which nest points have been interpolated. Needed for NOAH MP moving nest upgrades. - NOAHMP moving nest sea ice and cryosphere fixes and added variables tiice, tisfc, sncovr, fice, hice. Notes: Lots of contribution (discussions/diagnostics/debugging/testing) from @ChuankaiWang-NOAA, @yonghuiweng, ZhanZhang-NOAA, @helin.wei@noaa.gov, @fanglin.yang@noaa.gov, @BinLiu-NOAA as well. --- fv3/moving_nest/fv_moving_nest.F90 | 18 +- fv3/moving_nest/fv_moving_nest_main.F90 | 8 +- fv3/moving_nest/fv_moving_nest_physics.F90 | 323 +++++++++++++++++++-- fv3/moving_nest/fv_moving_nest_types.F90 | 69 ++++- 4 files changed, 389 insertions(+), 29 deletions(-) diff --git a/fv3/moving_nest/fv_moving_nest.F90 b/fv3/moving_nest/fv_moving_nest.F90 index 13261b760c..9c639cf3c3 100644 --- a/fv3/moving_nest/fv_moving_nest.F90 +++ b/fv3/moving_nest/fv_moving_nest.F90 @@ -763,7 +763,10 @@ subroutine mn_static_filename(surface_dir, tile_num, tag, refine, grid_filename) write(parent_str, '(I0)'), tile_num - if (refine .eq. 1 .and. (tag .eq. 'grid' .or. tag .eq. 'oro_data')) then + if (refine .eq. 1 .and. tag .eq. 'sfc_data') then + ! + grid_filename = trim(trim(surface_dir) // '/../' // trim(tag) // '.nc') + elseif (refine .eq. 1 .and. (tag .eq. 'grid' .or. tag .eq. 'oro_data')) then ! For 1x files in INPUT directory; go at the symbolic link grid_filename = trim(trim(surface_dir) // '/' // trim(tag) // '.tile' // trim(parent_str) // '.nc') else @@ -890,7 +893,16 @@ subroutine mn_static_read_ls(static_ls, npx, npy, refine, pelist, surface_dir, t endif ! Read in coarse resolution land sea mask to use for masked interpolations; factor in lakes as well - call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "oro_data", "slmsk", static_ls%ls_mask_grid, tile_num) + + if (refine .eq. 1 .and. tile_num .eq. 1) then + ! Read in coarse parent slmask from sfc_data.nc -- this will have land/sea/sea ice mask + print '("[INFO] WDR STATIC_READ_LS parent sfc_data npe=",I0)', mpp_pe() + call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "sfc_data", "slmsk", static_ls%ls_mask_grid, tile_num) + else + print '("[INFO] WDR STATIC_READ_LS other oro_data npe=",I0)', mpp_pe() + call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "oro_data", "slmsk", static_ls%ls_mask_grid, tile_num) + endif + call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "oro_data", "land_frac", static_ls%land_frac_grid, tile_num) !! Lat lons for debugging @@ -910,7 +922,7 @@ subroutine mn_static_read_fix(static_fix, npx, npy, refine, pelist, surface_dir, character(len=*), intent(in) :: surface_dir !< Surface directory integer, intent(in) :: npx, npy, refine, tile_num, month !< Number of x,y points and nest refinement, (parent) tile number - call mn_static_read_hires(npx, npy, refine, pelist, surface_dir, "substrate_temperature", "substrate_temperature", static_fix%deep_soil_temp_grid, tile_num) + call mn_static_read_hires(npx, npy, refine, pelist, trim(surface_dir), "substrate_temperature", "substrate_temperature", static_fix%deep_soil_temp_grid, tile_num) ! set any -999s to +4C call mn_replace_low_values(static_fix%deep_soil_temp_grid, -100.0, 277.0) diff --git a/fv3/moving_nest/fv_moving_nest_main.F90 b/fv3/moving_nest/fv_moving_nest_main.F90 index be3dd395ef..fceabff990 100644 --- a/fv3/moving_nest/fv_moving_nest_main.F90 +++ b/fv3/moving_nest/fv_moving_nest_main.F90 @@ -99,7 +99,7 @@ module fv_moving_nest_main_mod !------------------------------------ use fv_moving_nest_types_mod, only: allocate_fv_moving_nest_prog_type, allocate_fv_moving_nest_physics_type - use fv_moving_nest_types_mod, only: deallocate_fv_moving_nests + use fv_moving_nest_types_mod, only: deallocate_fv_moving_nests, mn_set_leading_edge use fv_moving_nest_types_mod, only: Moving_nest use fv_moving_nest_types_mod, only: mn_apply_lakes, mn_overwrite_with_nest_init_values, alloc_set_facwf use fv_moving_nest_types_mod, only: mn_static_overwrite_ls_from_nest, mn_static_overwrite_fix_from_nest @@ -951,7 +951,7 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, GFS_control, GFS_sfcprop, GFS_tbd allocate(wt_v(Atm(child_grid_num)%bd%isd:Atm(child_grid_num)%bd%ied+1, Atm(child_grid_num)%bd%jsd:Atm(child_grid_num)%bd%jed, 4)) wt_v = real_snan - ! Fill in the local weights with the ones from Atm just to be safe + ! Fill in the local weights with the ones from Atm just to be safe call fill_weight_grid(wt_h, Atm(n)%neststruct%wt_h) call fill_weight_grid(wt_u, Atm(n)%neststruct%wt_u) call fill_weight_grid(wt_v, Atm(n)%neststruct%wt_v) @@ -1319,6 +1319,10 @@ subroutine fv_moving_nest_exec(Atm, Atm_block, GFS_control, GFS_sfcprop, GFS_tbd enddo endif + if (is_fine_pe) then + call mn_set_leading_edge(Moving_nest(child_grid_num)%mn_phys, isd, ied, jsd, jed, delta_i_c, delta_j_c) + endif + call mn_prog_apply_temp_variables(Atm, n, child_grid_num, is_fine_pe, npz) call mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop, GFS_tbd, GFS_cldprop, GFS_intdiag, n, child_grid_num, is_fine_pe, npz) diff --git a/fv3/moving_nest/fv_moving_nest_physics.F90 b/fv3/moving_nest/fv_moving_nest_physics.F90 index e90ee5bc08..c7ead53b4f 100644 --- a/fv3/moving_nest/fv_moving_nest_physics.F90 +++ b/fv3/moving_nest/fv_moving_nest_physics.F90 @@ -119,6 +119,91 @@ module fv_moving_nest_physics_mod contains + subroutine mn_phys_apply_coarse_seaice(Atm, n, mn_static, ioffset, joffset, refine) + type(fv_atmos_type), intent(inout),allocatable :: Atm(:) !< Array of atmospheric data + integer, intent(in) :: n !< Current grid number + type(mn_surface_grids), intent(in) :: mn_static !< Static surface data + integer, intent(in) :: ioffset, joffset !< Current nest offset in i,j direction + integer, intent(in) :: refine !< Nest refinement ratio + + integer :: i_pe, j_pe ! indices of the nest on this PE + integer :: i_idx, j_idx + integer :: i_parent, j_parent ! parent indices + integer :: this_pe, halo + + integer :: i,j, num_seaice + + integer, parameter :: M_WATER = 0, M_LAND = 1, M_SEAICE = 2 + + this_pe = mpp_pe() + ! Should only be run for a fine PE + + !print '("[INFO] MASK BEGIN inside mn_phys_apply_coarse_seaice npe=",I0," n=",I0," refine=",I0," ioffset=",I0," joffset=",I0)', this_pe, n, refine, ioffset, joffset + ! Setup local land sea mask grid for masked interpolations + ! These are grid centers, not corners + + halo = 3 + + num_seaice = 0 + + do i = lbound(mn_static%parent_ls%ls_mask_grid,1), ubound(mn_static%parent_ls%ls_mask_grid,1) + do j = lbound(mn_static%parent_ls%ls_mask_grid,2), ubound(mn_static%parent_ls%ls_mask_grid,2) + if (mn_static%parent_ls%ls_mask_grid(i, j) .eq. M_SEAICE) num_seaice = num_seaice + 1 + enddo + enddo + + !print '("[INFO] MASK ICE npe=",I0," parent_ls num_seaice=",I0)',this_pe, num_seaice + + num_seaice = 0 + + do i = lbound(mn_static%fp_ls%ls_mask_grid,1), ubound(mn_static%fp_ls%ls_mask_grid,1) + do j = lbound(mn_static%fp_ls%ls_mask_grid,2), ubound(mn_static%fp_ls%ls_mask_grid,2) + if (mn_static%fp_ls%ls_mask_grid(i, j) .eq. M_SEAICE) num_seaice = num_seaice + 1 + enddo + enddo + + !print '("[INFO] MASK ICE npe=",I0," fp_ls num_seaice=",I0)',this_pe, num_seaice + + do i_pe = Atm(n)%bd%isd, Atm(n)%bd%ied + do j_pe = Atm(n)%bd%jsd, Atm(n)%bd%jed + i_idx = (ioffset-1)*refine + i_pe + j_idx = (joffset-1)*refine + j_pe + + ! Fortran integer division truncates the fractional parts + i_parent = ioffset + (i_pe + 3)/refine + j_parent = joffset + (j_pe + 3)/refine + if (Moving_nest(n)%mn_phys%slmsk(i_pe, j_pe) .eq. M_WATER) then + if (mn_static%parent_ls%ls_mask_grid(i_parent, j_parent) .eq. M_SEAICE) then + !print '("[INFO] WDR COARSE_SEAICE AA npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe + Moving_nest(n)%mn_phys%slmsk(i_pe, j_pe) = M_SEAICE + !print '("[INFO] WDR COARSE_SEAICE ZZ npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe + + !print '("[INFO] WDR COARSE_SEAICE Z1 npe=",I0," parent geolat_grid(",I0,"-",I0,",",I0,"-",I0,") i_parent=",I0," j_parent=",I0)', this_pe, lbound(mn_static%parent_ls%geolat_grid,1), ubound(mn_static%parent_ls%geolat_grid,1), lbound(mn_static%parent_ls%geolat_grid,2), ubound(mn_static%parent_ls%geolat_grid,2), i_parent, j_parent + + !print '("[INFO] WDR COARSE_SEAICE Z1 npe=",I0," fp geolat_grid(",I0,",",I0,")")', this_pe, ubound(mn_static%fp_ls%geolat_grid,1), ubound(mn_static%fp_ls%geolat_grid,2) + + !print '("[INFO] WDR COARSE_SEAICE Z1 npe=",I0," nest geolat_grid(",I0,"-",I0,",",I0,"-",I0,") i_pe=",I0," j_pe=",I0)', this_pe, lbound(mn_static%nest_ls%geolat_grid,1), ubound(mn_static%nest_ls%geolat_grid,1), lbound(mn_static%nest_ls%geolat_grid,2), ubound(mn_static%nest_ls%geolat_grid,2), i_pe, j_pe + + !if (i_pe .ge. lbound(mn_static%nest_ls%geolat_grid,1) .and. i_pe .le. ubound(mn_static%nest_ls%geolat_grid,1) .and. j_pe .ge. lbound(mn_static%nest_ls%geolat_grid,2) .and. j_pe .le. ubound(mn_static%nest_ls%geolat_grid,2) ) then + !print '("[INFO] WDR COARSE_SEAICE INSIDE npe=",I0," i_pe=",I0," j_pe=",I0)', this_pe, i_pe, j_pe + !print '("[INFO] WDR COARSE_SEAICE npe=",I0," parent latlon ",F8.3,","F8.3," nest latlon ",F8.3,","F8.3)', this_pe, & + ! mn_static%parent_ls%geolat_grid(i_parent, j_parent), mn_static%parent_ls%geolon_grid(i_parent, j_parent), & + ! mn_static%nest_ls%geolat_grid(i_pe, j_pe), mn_static%nest_ls%geolon_grid(i_pe, j_pe) + !endif + + + !print '("[INFO] WDR COARSE_SEAICE npe=",I0," parent cell ",F8.3,","F8.3," nest cell ",F8.3,","F8.3)', this_pe, & + ! mn_static%parent_ls%geolat_grid(i_parent, j_parent), mn_static%parent_ls%geolon_grid(i_parent, j_parent), & + ! mn_static%nest_ls%geolat_grid(i_parent, j_parent), mn_static%nest_ls%geolon_grid(i_parent, j_parent) + endif + endif + enddo + enddo + + !print '("[INFO] MASK END inside mn_phys_apply_coarse_seaice npe=",I0)', this_pe + + end subroutine mn_phys_apply_coarse_seaice + subroutine mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, refine) type(fv_atmos_type), intent(inout),allocatable :: Atm(:) !< Array of atmospheric data @@ -154,13 +239,20 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, GFS_Sfcprop, io integer, intent(in) :: ioffset, joffset !< Current nest offset in i,j direction integer, intent(in) :: refine !< Nest refinement ratio + integer, parameter :: M_WATER = 0, M_LAND = 1, M_SEAICE = 2 + ! For iterating through physics/surface vector data integer :: nb, blen, ix, i_pe, j_pe, i_idx, j_idx, im real(kind=kind_phys) :: phys_oro + integer :: cell_slmsk + integer :: this_pe + + this_pe = mpp_pe() !print '("[INFO] MASK inside mn_phys_reset_sfc_props npe=",I0)', mpp_pe() call mn_phys_set_slmsk(Atm, n, mn_static, ioffset, joffset, refine) + call mn_phys_apply_coarse_seaice(Atm, n, mn_static, ioffset, joffset, refine) ! Reset the variables from the fix_sfc files im = 0 do nb = 1,Atm_block%nblks @@ -175,19 +267,39 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, GFS_Sfcprop, io im = im + 1 ! Reset the land sea mask from the hires parent data - GFS_Sfcprop%slmsk(im) = mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) + !GFS_Sfcprop%slmsk(im) = mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) + cell_slmsk = Moving_nest(n)%mn_phys%slmsk(i_pe, j_pe) + GFS_Sfcprop%slmsk(im) = cell_slmsk ! IFD values are 0 for land, and 1 for oceans/lakes -- reverse of the land sea mask ! Land Sea Mask has values of 0 for oceans/lakes, 1 for land, 2 for sea ice ! TODO figure out what ifd should be for sea ice - if (mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) .eq. 1 ) then + + ! ICEFIX + ! ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F + ! sli .. land/sea/sea-ice mask. (1/0/2 respectively) + ! Seems to be slimsk + + ! Process land-sea-ice mask points + + !if (mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) .eq. M_LAND ) then ! Land + if (cell_slmsk .eq. M_LAND ) then ! Land if (move_nsst) GFS_Sfcprop%ifd(im) = 0 ! Land GFS_Sfcprop%oceanfrac(im) = 0 ! Land -- TODO permit fractions GFS_Sfcprop%landfrac(im) = 1 ! Land -- TODO permit fractions - else + GFS_Sfcprop%fice(im) = 0 ! ice fraction over open water grid + !else if (mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) .eq. M_WATER ) then ! Ocean + else if (cell_slmsk .eq. M_WATER ) then ! Ocean if (move_nsst) GFS_Sfcprop%ifd(im) = 1 ! Ocean GFS_Sfcprop%oceanfrac(im) = 1 ! Ocean -- TODO permit fractions GFS_Sfcprop%landfrac(im) = 0 ! Ocean -- TODO permit fractions + GFS_Sfcprop%fice(im) = 0 ! ice fraction over open water grid + !else if (mn_static%fp_ls%ls_mask_grid(i_idx, j_idx) .eq. M_SEAICE ) then ! Sea Ice + else if (cell_slmsk .eq. M_SEAICE ) then ! Sea Ice + if (move_nsst) GFS_Sfcprop%ifd(im) = 0 ! For Sea ice - ifd is set to Land 0, checked in sfc files + GFS_Sfcprop%oceanfrac(im) = 0 ! sea ice -- TODO permit fractions + GFS_Sfcprop%landfrac(im) = 0 ! sea ice -- TODO permit fractions + GFS_Sfcprop%fice(im) = 1 ! ice fraction over open water grid endif GFS_Sfcprop%tg3(im) = mn_static%fp_fix%deep_soil_temp_grid(i_idx, j_idx) @@ -206,7 +318,7 @@ subroutine mn_phys_reset_sfc_props(Atm, n, mn_static, Atm_block, GFS_Sfcprop, io GFS_Sfcprop%oceanfrac(im) = 1 ! Ocean -- TODO permit fractions GFS_Sfcprop%landfrac(im) = 0 ! Ocean -- TODO permit fractions - GFS_Sfcprop%stype(im) = 0 + GFS_Sfcprop%stype(im) = 14 ! change from 0 to 14 to avoid index conflict with porosity GFS_Sfcprop%slmsk(im) = 0 else GFS_Sfcprop%stype(im) = nint(mn_static%fp_ls%soil_type_grid(i_idx, j_idx)) @@ -499,6 +611,16 @@ subroutine mn_phys_fill_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop, mn_phys%tsnoxy(i,j,k) = GFS_sfcprop%tsnoxy(im,k) enddo + ! ICEFIX handle tiice + do k = 1, GFS_control%kice + mn_phys%tiice(i,j,k) = GFS_sfcprop%tiice(im,k) + enddo + mn_phys%tisfc(i,j) = GFS_sfcprop%tisfc(im) + mn_phys%sncovr(i,j) = GFS_sfcprop%sncovr(im) + + mn_phys%fice(i,j) = GFS_sfcprop%fice(im) + mn_phys%hice(i,j) = GFS_sfcprop%hice(im) + mn_phys%snowd(i,j) = GFS_sfcprop%snowd(im) mn_phys%weasd(i,j) = GFS_sfcprop%weasd(im) @@ -529,10 +651,23 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop integer :: is, ie, js, je integer :: this_pe integer :: nb, blen, i, j ,k, ix, nv, im + integer :: isnow !local for Noah MP + real(kind=kind_phys) :: dzs(1:4) !local for Noah MP + real(kind=kind_phys) :: dzsno(-2:0) !local for Noah MP + real(kind=kind_phys) :: dzsnso(-2:4) !local for Noah MP + real(kind=kind_phys) :: porosity(1:19) !local for Noah MP + real(kind=kind_phys) :: zsns_default(-2:4) !local for Noah MP type(fv_moving_nest_physics_type), pointer :: mn_phys this_pe = mpp_pe() mn_phys => Moving_nest(n)%mn_phys + dzs = (/0.1,0.3,0.6,1.0/) ! 4 layer soil thickness + dzsno = (/0.0,0.0,0.0/) ! 3 snow layer thichness + dzsnso = (/0.0,0.0,0.0,0.1,0.3,0.6,1.0/) ! dzs + dzsno + porosity = (/0.339,0.421,0.434,0.476,0.484,0.439,0.404,0.464, & + 0.465,0.406,0.468,0.468,0.439,1.000,0.200,0.421, & + 0.468,0.200,0.339/) + zsns_default = (/0.0, 0.0, 0.0, -0.1,-0.4,-1.0,-2.0 /) !depths from snow surface ! Needed to fill the local grids for parent and nest PEs in order to transmit/interpolate data from parent to nest ! But only the nest PE's have changed the values with nest motion, so they are the only ones that need to update the original arrays @@ -706,7 +841,6 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop if (GFS_control%lsm == GFS_control%lsm_noahmp) then GFS_sfcprop%scolor(im) = mn_phys%soilcolor(i,j) - GFS_sfcprop%snowxy(im) = mn_phys%snowxy(i,j) GFS_sfcprop%tvxy(im) = mn_phys%tvxy(i,j) GFS_sfcprop%tgxy(im) = mn_phys%tgxy(i,j) GFS_sfcprop%canicexy(im) = mn_phys%canicexy(i,j) @@ -735,45 +869,149 @@ subroutine mn_phys_apply_temp_variables(Atm, Atm_block, GFS_control, GFS_sfcprop GFS_sfcprop%smcwtdxy(im) = mn_phys%smcwtdxy(i,j) GFS_sfcprop%deeprechxy(im) = mn_phys%deeprechxy(i,j) GFS_sfcprop%rechxy(im) = mn_phys%rechxy(i,j) + GFS_sfcprop%snowd(im) = mn_phys%snowd(i,j) + GFS_sfcprop%weasd(im) = mn_phys%weasd(i,j) - do k = 1, GFS_control%lsoil - GFS_sfcprop%smoiseq(im,k) = mn_phys%smoiseq(i,j,k) + if (GFS_sfcprop%snowd(im) == 0.0 .and. GFS_sfcprop%weasd(im) /= 0.0) then + GFS_sfcprop%snowd(im) = GFS_sfcprop%weasd(im)/10.0 + endif + + ! ICEFIX handle tiice + do k = 1, GFS_control%kice + GFS_sfcprop%tiice(im,k) = mn_phys%tiice(i,j,k) enddo + if (mn_phys%tisfc(i,j) .lt. 240.0 .or. mn_phys%tisfc(i,j) .gt. 285.0 ) then + mn_phys%tisfc(i,j) = 273.15 - 5.0 + endif + GFS_sfcprop%tisfc(im) = mn_phys%tisfc(i,j) + GFS_sfcprop%sncovr(im) = mn_phys%sncovr(i,j) + GFS_sfcprop%fice(im) = mn_phys%fice(i,j) + GFS_sfcprop%hice(im) = mn_phys%hice(i,j) - do k = GFS_control%lsnow_lsm_lbound, GFS_control%lsnow_lsm_ubound - GFS_sfcprop%snicexy(im,k) = mn_phys%snicexy(i,j,k) - GFS_sfcprop%snliqxy(im,k) = mn_phys%snliqxy(i,j,k) - GFS_sfcprop%tsnoxy(im,k) = mn_phys%tsnoxy(i,j,k) - enddo - GFS_sfcprop%snowd(im) = mn_phys%snowd(i,j) - GFS_sfcprop%weasd(im) = mn_phys%weasd(i,j) - do k = GFS_control%lsnow_lsm_lbound, GFS_control%lsoil - GFS_sfcprop%zsnsoxy(im,k) = mn_phys%zsnsoxy(i,j,k) + do k = 1, GFS_control%lsoil + GFS_sfcprop%smoiseq(im,k) = mn_phys%smoiseq(i,j,k) enddo - endif + do k = 1, GFS_control%lsoil + GFS_sfcprop%smc(im,k) = min(GFS_sfcprop%smc(im,k),porosity(GFS_sfcprop%stype(im))-0.01) + GFS_sfcprop%slc(im,k) = min(GFS_sfcprop%slc(im,k),porosity(GFS_sfcprop%stype(im))-0.01) + enddo + + if (GFS_sfcprop%vtype(im) == 15) then ! glacier + do k = 1,GFS_control%lsoil + GFS_sfcprop%stc(im,k) = min(mn_phys%stc(i,j,k), min(GFS_Sfcprop%tg3(im), 263.15)) + GFS_sfcprop%smc(im,k) = 1.0 + GFS_sfcprop%slc(im,k) = 0.0 + enddo + GFS_sfcprop%weasd(im) = 600.0 ! 600mm SWE for glacier + GFS_sfcprop%snowd(im) = 2000.0 ! 2m snow depth for glacier, snowd/snwdph is in mm + endif + + if (mn_phys%leading_edge(i,j) == .True. .and. GFS_sfcprop%snowd(im) < 99999.0) then ! new land with snow + if (GFS_sfcprop%snowd(im)/1000.0 < 0.025) then + GFS_sfcprop%snowxy(im) = 0.0 + dzsno(-2:0) = 0.0 + elseif (GFS_sfcprop%snowd(im)/1000.0 >= 0.025 .and. GFS_sfcprop%snowd(im)/1000.0 <= 0.05) then + GFS_sfcprop%snowxy(im) = -1.0 + dzsno(0) = GFS_sfcprop%snowd(im)/1000.0 + elseif (GFS_sfcprop%snowd(im)/1000.0 > 0.05 .and. GFS_sfcprop%snowd(im)/1000.0 <= 0.10) then + GFS_sfcprop%snowxy(im) = -2.0 + dzsno(-1) = 0.5*GFS_sfcprop%snowd(im)/1000.0 + dzsno(0) = 0.5*GFS_sfcprop%snowd(im)/1000.0 + elseif (GFS_sfcprop%snowd(im)/1000.0> 0.10 .and. GFS_sfcprop%snowd(im)/1000.0 <= 0.25) then + GFS_sfcprop%snowxy(im) = -2.0 + dzsno(-1) = 0.05 + dzsno(0) = GFS_sfcprop%snowd(im)/1000.0 - 0.05 + elseif (GFS_sfcprop%snowd(im)/1000.0 > 0.25 .and. GFS_sfcprop%snowd(im)/1000.0 <= 0.45) then + GFS_sfcprop%snowxy(im) = -3.0 + dzsno(-2) = 0.05 + dzsno(-1) = 0.5*(GFS_sfcprop%snowd(im)/1000.0-0.05) + dzsno(0) = 0.5*(GFS_sfcprop%snowd(im)/1000.0-0.05) + elseif (GFS_sfcprop%snowd(im)/1000.0 > 0.45) then + GFS_sfcprop%snowxy(im) = -3.0 + dzsno(-2) = 0.05 + dzsno(-1) = 0.20 + dzsno(0) = GFS_sfcprop%snowd(im)/1000.0 - 0.05 - 0.20 + else + write(*,*) 'Error in fv_moving_nest_physics.F90 - Problem with the logic assigning snow layers' + stop + endif + isnow = nint(GFS_sfcprop%snowxy(im)) + 1 + do k = isnow, GFS_control%lsnow_lsm_ubound + GFS_sfcprop%tsnoxy(im,k) = GFS_sfcprop%tgxy(im) + ( (sum(dzsno(isnow:k))-0.5*dzsno(k)) / \ + GFS_sfcprop%snowd(im)/1000.0 ) * (GFS_sfcprop%stc(im,1)-GFS_sfcprop%tgxy(im)) + GFS_sfcprop%snliqxy(im,k) = 0.0 + GFS_sfcprop%snicexy(im,k) = 1.0 * dzsno(k) * GFS_sfcprop%weasd(im)/GFS_sfcprop%snowd(im) + enddo + do k = isnow,GFS_control%lsnow_lsm_ubound + dzsnso(k) = -dzsno(k) + enddo + do k = 1, GFS_control%lsoil + dzsnso(k) = -dzs(k) + enddo + GFS_sfcprop%zsnsoxy(im,isnow) = dzsnso(isnow) - ! Check if stype and vtype are properly set for land points. Set to reasonable values if they have fill values. - if ( (int(GFS_sfcprop%slmsk(im)) .eq. 1) ) then + do k = isnow + 1, GFS_control%lsoil + GFS_sfcprop%zsnsoxy(im, k) = GFS_sfcprop%zsnsoxy(im,k-1) + dzsnso(k) + enddo + else ! internal moving land points + GFS_sfcprop%snowxy(im) = mn_phys%snowxy(i,j) + isnow = nint(GFS_sfcprop%snowxy(im)) + 1 + if (abs(isnow) < GFS_control%lsoil) then ! only isnow /= fill value + do k = GFS_control%lsnow_lsm_lbound, GFS_control%lsnow_lsm_ubound + GFS_sfcprop%snicexy(im,k) = mn_phys%snicexy(i,j,k) + GFS_sfcprop%snliqxy(im,k) = mn_phys%snliqxy(i,j,k) + GFS_sfcprop%tsnoxy(im,k) = mn_phys%tsnoxy(i,j,k) + enddo + do k = isnow, GFS_control%lsoil + GFS_sfcprop%zsnsoxy(im,k) = mn_phys%zsnsoxy(i,j,k) + enddo + endif + ! reset snow-related fields over the old glacier points to be consistent with the new glacier land points + ! for the next iteration + if (GFS_sfcprop%vtype(im) == 15) then + GFS_sfcprop%snowxy(im) = -3.0 + dzsno(-2) = 0.05 + dzsno(-1) = 0.20 + dzsno(0) = 2.0 - 0.05 - 0.20 + isnow = -2 + do k = isnow, GFS_control%lsnow_lsm_ubound + GFS_sfcprop%tsnoxy(im,k) = GFS_sfcprop%tgxy(im) + ( (sum(dzsno(isnow:k))-0.5*dzsno(k)) / \ + GFS_sfcprop%snowd(im)/1000.0 ) * (GFS_sfcprop%stc(im,1)-GFS_sfcprop%tgxy(im)) + GFS_sfcprop%snliqxy(im,k) = 0.0 + GFS_sfcprop%snicexy(im,k) = 1.0 * dzsno(k) * GFS_sfcprop%weasd(im)/GFS_sfcprop%snowd(im) + enddo + do k = isnow, GFS_control%lsnow_lsm_ubound + dzsnso(k) = -dzsno(k) + enddo + do k = 1, GFS_control%lsoil + dzsnso(k) = -dzs(k) + enddo + GFS_sfcprop%zsnsoxy(im,isnow) = dzsnso(isnow) + do k = isnow + 1, GFS_control%lsoil + GFS_sfcprop%zsnsoxy(im, k) = GFS_sfcprop%zsnsoxy(im,k-1) + dzsnso(k) + enddo + endif + endif + endif + ! Check if stype and vtype are properly set for land points. Set to reasonable values if they have fill values. + if ( (int(GFS_sfcprop%slmsk(im)) .eq. 1) ) then if (GFS_sfcprop%vtype(im) .lt. 0.5) then GFS_sfcprop%vtype(im) = 7 ! Force to grassland endif - if (GFS_sfcprop%stype(im) .lt. 0.5) then GFS_sfcprop%stype(im) = 3 ! Force to sandy loam endif - if (GFS_sfcprop%vtype_save(im) .lt. 0.5) then GFS_sfcprop%vtype_save(im) = 7 ! Force to grassland endif if (GFS_sfcprop%stype_save(im) .lt. 0.5) then GFS_sfcprop%stype_save(im) = 3 ! Force to sandy loam endif - endif enddo enddo @@ -1278,7 +1516,7 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, GFS_control, mn_static, n, c is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) call fill_nest_halos_from_parent_masked("smoiseq", mn_phys%smoiseq, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & - Atm(child_grid_num)%neststruct%ind_h, & + Atm(child_grid_num)%neststruct%ind_h, & x_refine, y_refine, & is_fine_pe, nest_domain, position, 1, GFS_control%lsoil, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.3D0) @@ -1288,6 +1526,26 @@ subroutine mn_phys_fill_nest_halos_from_parent(Atm, GFS_control, mn_static, n, c is_fine_pe, nest_domain, position, GFS_control%lsnow_lsm_lbound, GFS_control%lsoil, & mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, zsns_default) + + ! ICEFIX tiice + call fill_nest_halos_from_parent_masked("tiice", mn_phys%tiice, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, 1, 2, & !! kice + mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_SEAICE, mn_phys%ts) + call fill_nest_halos_from_parent_masked("tisfc", mn_phys%tisfc, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_SEAICE, mn_phys%ts) + call fill_nest_halos_from_parent_masked("sncovr", mn_phys%sncovr, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_LAND, 0.0D0) + + call fill_nest_halos_from_parent_masked("fice", mn_phys%fice, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_SEAICE, 1.0D0) + call fill_nest_halos_from_parent_masked("hice", mn_phys%hice, interp_type_lmask, Atm(child_grid_num)%neststruct%wt_h, & + Atm(child_grid_num)%neststruct%ind_h, x_refine, y_refine, & + is_fine_pe, nest_domain, position, mn_phys%slmsk, mn_static%parent_ls%ls_mask_grid, M_SEAICE, 0.1D0) + endif end subroutine mn_phys_fill_nest_halos_from_parent @@ -1417,6 +1675,13 @@ subroutine mn_phys_fill_intern_nest_halos(moving_nest, GFS_control, domain_fine, call mn_var_fill_intern_nest_halos(mn_phys%smoiseq, domain_fine, is_fine_pe) call mn_var_fill_intern_nest_halos(mn_phys%zsnsoxy, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%tiice, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%tisfc, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%sncovr, domain_fine, is_fine_pe) + + call mn_var_fill_intern_nest_halos(mn_phys%fice, domain_fine, is_fine_pe) + call mn_var_fill_intern_nest_halos(mn_phys%hice, domain_fine, is_fine_pe) + endif end subroutine mn_phys_fill_intern_nest_halos @@ -1658,6 +1923,18 @@ subroutine mn_phys_shift_data(Atm, GFS_control, n, child_grid_num, wt_h, wt_u, w call mn_var_shift_data(mn_phys%zsnsoxy, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, GFS_control%lsnow_lsm_lbound, GFS_control%lsoil) + ! ICEFIX + call mn_var_shift_data(mn_phys%tiice, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position, 1, GFS_control%kice) + call mn_var_shift_data(mn_phys%tisfc, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%sncovr, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%fice, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + call mn_var_shift_data(mn_phys%hice, interp_type, wt_h, Atm(child_grid_num)%neststruct%ind_h, & + delta_i_c, delta_j_c, x_refine, y_refine, is_fine_pe, nest_domain, position) + endif diff --git a/fv3/moving_nest/fv_moving_nest_types.F90 b/fv3/moving_nest/fv_moving_nest_types.F90 index 1bdc384cff..e40010cdd0 100644 --- a/fv3/moving_nest/fv_moving_nest_types.F90 +++ b/fv3/moving_nest/fv_moving_nest_types.F90 @@ -80,7 +80,7 @@ module fv_moving_nest_types_mod type mn_land_mask_grids real, allocatable :: orog_grid(:,:) _NULL ! orography -- raw or filtered depending on namelist option, in meters real, allocatable :: orog_std_grid(:,:) _NULL ! terrain standard deviation for gravity wave drag, in meters (?) - real, allocatable :: ls_mask_grid(:,:) _NULL ! land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + real, allocatable :: ls_mask_grid(:,:) _NULL ! land sea mask -- 0 for ocean/lakes, 1, for land. 2 for sea ice. real, allocatable :: soil_type_grid(:,:) _NULL ! STATSGO soil type ! Land frac needs to be kind_phys because CCPP defines it that way. Can have rounding mismatches around 0.5 if types don't match. real(kind=kind_phys), allocatable :: land_frac_grid(:,:) _NULL ! Continuous land fraction - 0.0 ocean, 0.5 half of each, 1.0 all land @@ -144,6 +144,9 @@ module fv_moving_nest_types_mod type fv_moving_nest_physics_type real, _ALLOCATABLE :: ts(:,:) _NULL !< 2D skin temperature/SST real, _ALLOCATABLE :: slmsk(:,:) _NULL !< land sea mask -- 0 for ocean/lakes, 1, for land. Perhaps 2 for sea ice. + + logical, _ALLOCATABLE :: leading_edge(:,:) _NULL !< logical array -- at each nest move timestep, is this point getting interpolated values at the leading edge + real (kind=kind_phys), _ALLOCATABLE :: smc (:,:,:) _NULL !< soil moisture content real (kind=kind_phys), _ALLOCATABLE :: stc (:,:,:) _NULL !< soil temperature real (kind=kind_phys), _ALLOCATABLE :: slc (:,:,:) _NULL !< soil liquid water content @@ -269,6 +272,15 @@ module fv_moving_nest_types_mod real (kind=kind_phys), _ALLOCATABLE :: weasd (:,:) _NULL !< water equivalent accumulated snow depth over land real (kind=kind_phys), _ALLOCATABLE :: zsnsoxy (:,:,:) _NULL !< depth from snow surface at bottom interface + ! ICEFIX Additional cryosphere variables Sept 2025 + real (kind=kind_phys), _ALLOCATABLE :: tiice (:,:,:) _NULL !< sea ice internal temperature, 2 layers [K] + real (kind=kind_phys), _ALLOCATABLE :: tisfc (:,:) _NULL !< surface skin temperature over ice [K] + real (kind=kind_phys), _ALLOCATABLE :: sncovr (:,:) _NULL !< snow cover in fraction over land + + real (kind=kind_phys), _ALLOCATABLE :: fice (:,:) _NULL !< sea ice fraction + real (kind=kind_phys), _ALLOCATABLE :: hice (:,:) _NULL !< sea ice thickness + + end type fv_moving_nest_physics_type type fv_moving_nest_type @@ -314,6 +326,36 @@ module fv_moving_nest_types_mod contains + subroutine mn_set_leading_edge(mn_phys, isd, ied, jsd, jed, ioffset, joffset) + type(fv_moving_nest_physics_type), intent(inout) :: mn_phys + integer, intent(in) :: isd, ied, jsd, jed + integer, intent(in) :: ioffset, joffset + + mn_phys%leading_edge = .False. + + mn_phys%leading_edge(isd:isd+2,:) = .True. + mn_phys%leading_edge(ied-2:ied,:) = .True. + + mn_phys%leading_edge(:, jsd:jsd+2) = .True. + mn_phys%leading_edge(:, jed-2:jed) = .True. + + if (ioffset .eq. 1) then + mn_phys%leading_edge(isd+3:isd+5, :) = .True. + endif + if (ioffset .eq. -1) then + mn_phys%leading_edge(ied-5:ied-3, :) = .True. + endif + + if (joffset .eq. 1) then + mn_phys%leading_edge(: ,jsd+3:jsd+5) = .True. + endif + if (joffset .eq. -1) then + mn_phys%leading_edge(:, jed-5:jed-3) = .True. + endif + + + end subroutine mn_set_leading_edge + subroutine fv_moving_nest_init(Atm, this_grid) type(fv_atmos_type), allocatable, intent(in) :: Atm(:) integer, intent(in) :: this_grid @@ -592,6 +634,8 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p !print '("[INFO] WDR allocate_fv_moving_nest_physics_type npe=",I0," lsnow_lbound=",I0," lsnow_ubound=",I0," lsoil=",I0)', mpp_pe(), lsnow_lbound, lsnow_ubound, lsoil if (move_physics) then + allocate ( mn_phys%leading_edge (isd:ied, jsd:jed) ) + allocate ( mn_phys%slmsk(isd:ied, jsd:jed) ) allocate ( mn_phys%smc(isd:ied, jsd:jed, lsoil) ) allocate ( mn_phys%stc(isd:ied, jsd:jed, lsoil) ) @@ -716,11 +760,20 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p allocate ( mn_phys%weasd(isd:ied, jsd:jed) ) allocate ( mn_phys%zsnsoxy(isd:ied, jsd:jed, lsnow_lbound:lsoil) ) + ! ICEFIX + allocate ( mn_phys%tiice(isd:ied, jsd:jed, 2) ) + allocate ( mn_phys%tisfc(isd:ied, jsd:jed) ) + allocate ( mn_phys%sncovr(isd:ied, jsd:jed) ) + allocate ( mn_phys%fice(isd:ied, jsd:jed) ) + allocate ( mn_phys%hice(isd:ied, jsd:jed) ) + !allocate ( mn_phys%ustar1(isd:ied, jsd:jed) ) endif mn_phys%ts = +99999.9 if (move_physics) then + mn_phys%leading_edge = .false. + mn_phys%slmsk = +99999.9 mn_phys%smc = +99999.9 mn_phys%stc = +99999.9 @@ -847,6 +900,13 @@ subroutine allocate_fv_moving_nest_physics_type(isd, ied, jsd, jed, npz, move_p mn_phys%weasd = +99999.9 mn_phys%zsnsoxy = +99999.9 + mn_phys%tiice = +99999.9 + mn_phys%tisfc = +99999.9 + mn_phys%sncovr = +99999.9 + + mn_phys%fice = +99999.9 + mn_phys%hice = +99999.9 + !mn_phys%ustar1 = +99999.9 endif @@ -865,6 +925,7 @@ subroutine deallocate_fv_moving_nest_physics_type(mn_phys) ! if move_phys if (allocated(mn_phys%smc)) then + deallocate( mn_phys%leading_edge ) deallocate( mn_phys%slmsk ) deallocate( mn_phys%smc ) deallocate( mn_phys%stc ) @@ -991,6 +1052,12 @@ subroutine deallocate_fv_moving_nest_physics_type(mn_phys) deallocate ( mn_phys%weasd ) deallocate ( mn_phys%zsnsoxy ) + deallocate ( mn_phys%tiice ) + deallocate ( mn_phys%tisfc ) + deallocate ( mn_phys%sncovr ) + deallocate ( mn_phys%fice ) + deallocate ( mn_phys%hice ) + endif end subroutine deallocate_fv_moving_nest_physics_type From eeea9160787db5cf5d6db07f84ad90a6768ffbd9 Mon Sep 17 00:00:00 2001 From: XuLu-NOAA Date: Wed, 10 Dec 2025 17:30:37 +0000 Subject: [PATCH 184/192] Using the FV3 read_cubed_sphere_inc function to read in the regional IAU increments. --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 2dfba59d7b..9660070f42 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 2dfba59d7ba8447dbbbbc7b724204b70b6fb5b5d +Subproject commit 9660070f42bb945dd5d9a620fb3283a87975eed2 From 964d65fe5f7df82ebd6dd00db3cfffc2ad953795 Mon Sep 17 00:00:00 2001 From: XuLu-NOAA Date: Wed, 10 Dec 2025 21:45:34 +0000 Subject: [PATCH 185/192] Change Regional 3DIAU from even weighting to linear decaying weighting --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 9660070f42..147de57106 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 9660070f42bb945dd5d9a620fb3283a87975eed2 +Subproject commit 147de571066703078fe3a6972c55d9a22c73f45f From 5fb328eb9c32ce2604cc917a9a509d12970d51d1 Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Thu, 11 Dec 2025 00:58:03 +0000 Subject: [PATCH 186/192] From @WeiguoWang-NOAA: Introduce two Thompson MP related namelist options of tc_rain and tc_snow for adjustments of max terminal fall speeds of rain and snow under TC conditions. --- .gitmodules | 4 ++-- ccpp/data/GFS_typedefs.F90 | 13 ++++++++++++- ccpp/data/GFS_typedefs.meta | 16 ++++++++++++++++ ccpp/physics | 2 +- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 03c74779f0..aff25a2a7d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "fv3/atmos_cubed_sphere"] path = fv3/atmos_cubed_sphere url = https://github.com/hafs-community/GFDL_atmos_cubed_sphere - branch = feature/hafsv2p2_baseline + branch = feature/hafsv2p2_phase2 [submodule "ccpp/framework"] path = ccpp/framework url = https://github.com/NCAR/ccpp-framework @@ -9,7 +9,7 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/hafs-community/ccpp-physics - branch = feature/hafsv2p2_baseline + branch = feature/hafsv2p2_phase2 [submodule "upp"] path = upp url = https://github.com/hafs-community/UPP diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 26dafd9bac..6ee5e1f83c 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1057,6 +1057,8 @@ module GFS_typedefs real(kind=kind_phys) :: ssati_min !< minimum supersaturation over ice threshold for deposition nucleation real(kind=kind_phys) :: Nt_i_max !< maximum threshold number concentration of cloud ice water crystals in air real(kind=kind_phys) :: rr_min !< multiplicative tuning parameter for microphysical sedimentation minimum threshold + real(kind=kind_phys) :: tc_rain !< TC adjustment for rain fall speed + real(kind=kind_phys) :: tc_snow !< TC adjustment for snow fall speed !--- GFDL microphysical paramters @@ -3670,6 +3672,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & real(kind=kind_phys) :: ssati_min = 0.15 !< minimum supersaturation over ice threshold for deposition nucleation real(kind=kind_phys) :: Nt_i_max = 4999.e3 !< maximum threshold number concentration of cloud ice water crystals in air real(kind=kind_phys) :: rr_min = 1000.0 !< multiplicative tuning parameter for microphysical sedimentation minimum threshold + real(kind=kind_phys) :: tc_rain = 1.0 !< TC adjustment for rain fall speed + real(kind=kind_phys) :: tc_snow = 1.0 !< TC adjustment for snow fall speed !--- GFDL microphysical parameters logical :: lgfdlmprad = .false. !< flag for GFDLMP radiation interaction @@ -4182,7 +4186,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & mg_alf, mg_qcmin, mg_do_ice_gmao, mg_do_liq_liu, & ltaerosol, lthailaware, lradar, nsfullradar_diag, lrefres, & ttendlim, ext_diag_thompson, nt_c_l, nt_c_o, av_i, xnc_max, & - ssati_min, Nt_i_max, rr_min, dt_inner, lgfdlmprad, & + ssati_min, Nt_i_max, rr_min, tc_rain, tc_snow, & + dt_inner, lgfdlmprad, & sedi_semi, decfl, & nssl_cccn, nssl_alphah, nssl_alphahl, & nssl_alphar, nssl_ehw0, nssl_ehlw0, & @@ -4910,6 +4915,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%ssati_min = ssati_min Model%Nt_i_max = Nt_i_max Model%rr_min = rr_min + Model%tc_rain = tc_rain + Model%tc_snow = tc_snow !--- TEMPO MP parameters ! DJS to Anders: Maybe we put more of these nml options into the TEMPO configuration type? @@ -6369,6 +6376,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & ' ssati_min',ssati_min, & ' Nt_i_max',Nt_i_max, & ' rr_min',rr_min, & + ' tc_rain',tc_rain, & + ' tc_snow',tc_snow, & ' effr_in =',Model%effr_in, & ' lradar =',Model%lradar, & ' nsfullradar_diag =',Model%nsfullradar_diag, & @@ -6935,6 +6944,8 @@ subroutine control_print(Model) print *, ' ssati_min : ', Model%ssati_min print *, ' Nt_i_max : ', Model%Nt_i_max print *, ' rr_min : ', Model%rr_min + print *, ' tc_rain : ', Model%tc_rain + print *, ' tc_snow : ', Model%tc_snow print *, ' ' endif if (Model%imp_physics == Model%imp_physics_nssl) then diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 0b9ae7fe3d..2859de2322 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -5048,6 +5048,22 @@ dimensions = () type = real kind = kind_phys +[tc_rain] + standard_name = tc_adjustment_rain_fall_speed + long_name = tc adjustment rain fall speed + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[tc_snow] + standard_name = tc_adjustment_snow_fall_speed + long_name = tc adjustment snow fall speed + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [gfs_phys_time_vary_is_init] standard_name = flag_for_gfs_phys_time_vary_interstitial_initialization long_name = flag carrying interstitial initialization status diff --git a/ccpp/physics b/ccpp/physics index 9ae1de35e8..6b391997b8 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 9ae1de35e80f3359909054be6d10ae9de6e49e81 +Subproject commit 6b391997b8fcf113872ff68ff6d4c3bc3d71bdaa From 95e9bf47c036c6c50a82d753670b7b0c709fd600 Mon Sep 17 00:00:00 2001 From: XuLu-NOAA Date: Fri, 12 Dec 2025 03:23:09 +0000 Subject: [PATCH 187/192] Revert the linear decaying weighting function in 3DIAU. Switch to the Lanczos-like temporal filter --- fv3/atmos_cubed_sphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fv3/atmos_cubed_sphere b/fv3/atmos_cubed_sphere index 147de57106..9fc595be67 160000 --- a/fv3/atmos_cubed_sphere +++ b/fv3/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 147de571066703078fe3a6972c55d9a22c73f45f +Subproject commit 9fc595be672f2d829fa99fdf5cce2812362e1d9e From 195b00586e9f0cc8393e4fd36abac73c998c4cb7 Mon Sep 17 00:00:00 2001 From: "Bin.Liu" Date: Fri, 12 Dec 2025 13:19:57 -0600 Subject: [PATCH 188/192] Remove some HAFSv1 suite definition files. --- .../suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml | 94 ------------------- ...ite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml | 92 ------------------ ...uite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml | 92 ------------------ .../suite_FV3_HAFS_v1_thompson_noahmp.xml | 91 ------------------ ...ite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml | 89 ------------------ .../suite_FV3_HAFS_v1_thompson_tiedtke.xml | 92 ------------------ ...te_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml | 90 ------------------ 7 files changed, 640 deletions(-) delete mode 100644 ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml delete mode 100644 ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml delete mode 100644 ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml delete mode 100644 ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp.xml delete mode 100644 ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml delete mode 100644 ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke.xml delete mode 100644 ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml deleted file mode 100644 index 64b995f0c0..0000000000 --- a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - fv_sat_adj - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_nst_pre - sfc_nst - sfc_nst_post - noahmpdrv - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - unified_ugwp - unified_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - samfdeepcnv - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - samfshalcnv - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - gfdl_cloud_microphys_v3 - GFS_MP_generic_post - maximum_hourly_diagnostics - GFS_physics_post - - - - - GFS_stochastics - - - - diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml deleted file mode 100644 index 64ab889256..0000000000 --- a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_noahmp_nonsst.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - fv_sat_adj - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_ocean - noahmpdrv - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - unified_ugwp - unified_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - samfdeepcnv - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - samfshalcnv - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - gfdl_cloud_microphys_v3 - GFS_MP_generic_post - maximum_hourly_diagnostics - GFS_physics_post - - - - - GFS_stochastics - - - - diff --git a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml deleted file mode 100644 index 6fef7ff2fc..0000000000 --- a/ccpp/suites/suite_FV3_HAFS_v1_gfdlmpv3_tedmf_nonsst.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - fv_sat_adj - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_ocean - lsm_noah - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - unified_ugwp - unified_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - samfdeepcnv - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - samfshalcnv - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - gfdl_cloud_microphys_v3 - GFS_MP_generic_post - maximum_hourly_diagnostics - GFS_physics_post - - - - - GFS_stochastics - - - - diff --git a/ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp.xml b/ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp.xml deleted file mode 100644 index 4a8945a279..0000000000 --- a/ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_nst_pre - sfc_nst - sfc_nst_post - noahmpdrv - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - unified_ugwp - unified_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - samfdeepcnv - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - samfshalcnv - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - mp_thompson_pre - mp_thompson - mp_thompson_post - GFS_MP_generic_post - maximum_hourly_diagnostics - GFS_physics_post - - - - - GFS_stochastics - - - - diff --git a/ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml deleted file mode 100644 index f5290eec24..0000000000 --- a/ccpp/suites/suite_FV3_HAFS_v1_thompson_noahmp_nonsst.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_ocean - noahmpdrv - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - unified_ugwp - unified_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - samfdeepcnv - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - samfshalcnv - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - mp_thompson_pre - mp_thompson - mp_thompson_post - GFS_MP_generic_post - maximum_hourly_diagnostics - GFS_physics_post - - - - - GFS_stochastics - - - - diff --git a/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke.xml b/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke.xml deleted file mode 100644 index d76fb0eeee..0000000000 --- a/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_nst_pre - sfc_nst - sfc_nst_post - lsm_noah - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - unified_ugwp - unified_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - cu_ntiedtke_pre - cu_ntiedtke - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - mp_thompson_pre - mp_thompson - mp_thompson_post - GFS_MP_generic_post - cu_ntiedtke_post - maximum_hourly_diagnostics - GFS_physics_post - - - - - GFS_stochastics - - - - diff --git a/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml b/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml deleted file mode 100644 index 8e8f9e2bdc..0000000000 --- a/ccpp/suites/suite_FV3_HAFS_v1_thompson_tiedtke_nonsst.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - GFS_time_vary_pre - GFS_rrtmg_setup - GFS_rad_time_vary - GFS_phys_time_vary - - - - - GFS_rrtmg_pre - GFS_radiation_surface - rad_sw_pre - rrtmg_sw - rrtmg_sw_post - rrtmg_lw - rrtmg_lw_post - GFS_radiation_post - - - - - GFS_suite_stateout_reset - get_prs_fv3 - GFS_suite_interstitial_1 - GFS_surface_generic_pre - GFS_surface_composites_pre - dcyc2t3 - GFS_surface_composites_inter - GFS_suite_interstitial_2 - - - - sfc_diff - GFS_surface_loop_control_part1 - sfc_ocean - lsm_noah - sfc_sice - GFS_surface_loop_control_part2 - - - - GFS_surface_composites_post - sfc_diag - sfc_diag_post - GFS_surface_generic_post - GFS_PBL_generic_pre - satmedmfvdifq - GFS_PBL_generic_post - GFS_GWD_generic_pre - unified_ugwp - unified_ugwp_post - GFS_GWD_generic_post - GFS_suite_stateout_update - - - - - GFS_photochemistry - get_phi_fv3 - GFS_suite_interstitial_3 - GFS_DCNV_generic_pre - cu_ntiedtke_pre - cu_ntiedtke - GFS_DCNV_generic_post - GFS_SCNV_generic_pre - GFS_SCNV_generic_post - GFS_suite_interstitial_4 - cnvc90 - GFS_MP_generic_pre - mp_thompson_pre - mp_thompson - mp_thompson_post - GFS_MP_generic_post - cu_ntiedtke_post - maximum_hourly_diagnostics - GFS_physics_post - - - - - GFS_stochastics - - - - From 81b8b759821ac22be2e48e77431530241cd6242a Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 15 Jan 2026 09:19:55 -0700 Subject: [PATCH 189/192] Add RRTMGP initialization flags and revert hardcoding of mpiroot. (#17) Add RRTMGP initialization flags and revert hardcoding of mpiroot. --- ccpp/data/GFS_typedefs.F90 | 4 ++++ ccpp/data/GFS_typedefs.meta | 24 ++++++++++++++++++++++++ ccpp/physics | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index bad2de2793..b6755471c2 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -957,6 +957,10 @@ module GFS_typedefs logical :: top_at_1 !< Vertical ordering flag. integer :: iSFC !< Vertical index for surface integer :: iTOA !< Vertical index for TOA + logical :: is_init_lw_gas_optics = .false. + logical :: is_init_sw_gas_optics = .false. + logical :: is_init_lw_cloud_optics = .false. + logical :: is_init_sw_cloud_optics = .false. !--- microphysical switch logical :: convert_dry_rho = .true. !< flag for converting mass/number concentrations from moist to dry diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index e6698596e3..6d10979fa6 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -4458,6 +4458,30 @@ units = flag dimensions = () type = integer +[is_init_sw_gas_optics] + standard_name = flag_for_rrmtgp_sw_gas_optics_initialization + long_name = flag carrying scheme initialization status + units = flag + dimensions = () + type = logical +[is_init_sw_cloud_optics] + standard_name = flag_for_rrmtgp_sw_cloud_optics_initialization + long_name = flag carrying scheme initialization status + units = flag + dimensions = () + type = logical +[is_init_lw_gas_optics] + standard_name = flag_for_rrmtgp_lw_gas_optics_initialization + long_name = flag carrying scheme initialization status + units = flag + dimensions = () + type = logical +[is_init_lw_cloud_optics] + standard_name = flag_for_rrmtgp_lw_cloud_optics_initialization + long_name = flag carrying scheme initialization status + units = flag + dimensions = () + type = logical [convert_dry_rho] standard_name = flag_for_converting_hydrometeors_from_moist_to_dry_air long_name = flag for converting hydrometeors from moist to dry air diff --git a/ccpp/physics b/ccpp/physics index 330755ab99..2aa85baeb7 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 330755ab996e134f46e4aa8b5a99c00554577765 +Subproject commit 2aa85baeb7b10e88e092384bacba5964918ade9f From f1f5f85955c83a9c4541384441aa3a5772abedff Mon Sep 17 00:00:00 2001 From: Junghoon Shin Date: Wed, 31 Dec 2025 01:26:29 +0000 Subject: [PATCH 190/192] Modifying samfdeepcnv.f, samfdeepcnv.meta, samfshalcnv.f, samfshalcnv.meta, GFS_typedefs.F90, GFS_typedefs.meta so that convective adjustment time can be tunable, introducing two parameters cat_adj_deep and cat_adj_shal for this --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 2aa85baeb7..d1772749a2 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 2aa85baeb7b10e88e092384bacba5964918ade9f +Subproject commit d1772749a2cb1c9d79f0d00b52d48dbe47844ee2 From 1c636c670c4b457e6443318e2c50c869cfa0c31e Mon Sep 17 00:00:00 2001 From: Weiguo Wang Date: Fri, 16 Jan 2026 11:54:05 -0500 Subject: [PATCH 191/192] Updated variable names for optional tuning factors for fall speeds of rain and snow in Thompson MP scheme --- ccpp/data/GFS_typedefs.F90 | 22 +++++++++++----------- ccpp/data/GFS_typedefs.meta | 12 ++++++------ ccpp/physics | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index b6755471c2..8b6500fa98 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1077,8 +1077,8 @@ module GFS_typedefs real(kind=kind_phys) :: ssati_min !< minimum supersaturation over ice threshold for deposition nucleation real(kind=kind_phys) :: Nt_i_max !< maximum threshold number concentration of cloud ice water crystals in air real(kind=kind_phys) :: rr_min !< multiplicative tuning parameter for microphysical sedimentation minimum threshold - real(kind=kind_phys) :: tc_rain !< TC adjustment for rain fall speed - real(kind=kind_phys) :: tc_snow !< TC adjustment for snow fall speed + real(kind=kind_phys) :: fs_fac_rain !< adjustment for rain fall speed + real(kind=kind_phys) :: fs_fac_snow !< adjustment for snow fall speed !--- GFDL microphysical paramters @@ -3696,8 +3696,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & real(kind=kind_phys) :: ssati_min = 0.15 !< minimum supersaturation over ice threshold for deposition nucleation real(kind=kind_phys) :: Nt_i_max = 4999.e3 !< maximum threshold number concentration of cloud ice water crystals in air real(kind=kind_phys) :: rr_min = 1000.0 !< multiplicative tuning parameter for microphysical sedimentation minimum threshold - real(kind=kind_phys) :: tc_rain = 1.0 !< TC adjustment for rain fall speed - real(kind=kind_phys) :: tc_snow = 1.0 !< TC adjustment for snow fall speed + real(kind=kind_phys) :: fs_fac_rain = 1.0 !< adjustment for rain fall speed + real(kind=kind_phys) :: fs_fac_snow = 1.0 !< adjustment for snow fall speed !--- GFDL microphysical parameters logical :: lgfdlmprad = .false. !< flag for GFDLMP radiation interaction @@ -4210,7 +4210,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & mg_alf, mg_qcmin, mg_do_ice_gmao, mg_do_liq_liu, & ltaerosol, lthailaware, lradar, nsfullradar_diag, lrefres, & ttendlim, ext_diag_thompson, nt_c_l, nt_c_o, av_i, xnc_max, & - ssati_min, Nt_i_max, rr_min, tc_rain, tc_snow, & + ssati_min, Nt_i_max, rr_min, fs_fac_rain, fs_fac_snow, & dt_inner, lgfdlmprad, & sedi_semi, decfl, & nssl_cccn, nssl_alphah, nssl_alphahl, & @@ -4952,8 +4952,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%ssati_min = ssati_min Model%Nt_i_max = Nt_i_max Model%rr_min = rr_min - Model%tc_rain = tc_rain - Model%tc_snow = tc_snow + Model%fs_fac_rain = fs_fac_rain + Model%fs_fac_snow = fs_fac_snow !--- TEMPO MP parameters ! DJS to Anders: Maybe we put more of these nml options into the TEMPO configuration type? @@ -6422,8 +6422,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & ' ssati_min',ssati_min, & ' Nt_i_max',Nt_i_max, & ' rr_min',rr_min, & - ' tc_rain',tc_rain, & - ' tc_snow',tc_snow, & + ' fs_fac_rain',fs_fac_rain, & + ' fs_fac_snow',fs_fac_snow, & ' effr_in =',Model%effr_in, & ' lradar =',Model%lradar, & ' nsfullradar_diag =',Model%nsfullradar_diag, & @@ -7021,8 +7021,8 @@ subroutine control_print(Model) print *, ' ssati_min : ', Model%ssati_min print *, ' Nt_i_max : ', Model%Nt_i_max print *, ' rr_min : ', Model%rr_min - print *, ' tc_rain : ', Model%tc_rain - print *, ' tc_snow : ', Model%tc_snow + print *, ' fs_fac_rain : ', Model%fs_fac_rain + print *, ' fs_fac_snow : ', Model%fs_fac_snow print *, ' ' endif if (Model%imp_physics == Model%imp_physics_nssl) then diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 6d10979fa6..29921dd289 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -5165,17 +5165,17 @@ dimensions = () type = real kind = kind_phys -[tc_rain] - standard_name = tc_adjustment_rain_fall_speed - long_name = tc adjustment rain fall speed +[fs_fac_rain] + standard_name = multiplicative_tuning_parameter_for_rain_fall_speed + long_name = multiplicative tuning parameter for rain fall speed units = none dimensions = () type = real kind = kind_phys intent = in -[tc_snow] - standard_name = tc_adjustment_snow_fall_speed - long_name = tc adjustment snow fall speed +[fs_fac_snow] + standard_name = multiplicative_tuning_parameter_for_snow_fall_speed + long_name = multiplicative tuning parameter_for snow fall speed units = none dimensions = () type = real diff --git a/ccpp/physics b/ccpp/physics index d1772749a2..1430d38d7c 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d1772749a2cb1c9d79f0d00b52d48dbe47844ee2 +Subproject commit 1430d38d7c289311f4205374f82569610b97b74b From a7326eebc6565d4d27510fad52b0675cb9833673 Mon Sep 17 00:00:00 2001 From: Junghoon Shin Date: Wed, 31 Dec 2025 01:23:06 +0000 Subject: [PATCH 192/192] Modifying GFS_typedefs.F90, GFS_typedefs.meta so that convective adjustment time can be tunable, introducing two parameters cat_adj_deep and cat_adj_shal for this --- ccpp/data/GFS_typedefs.F90 | 11 ++++++++++- ccpp/data/GFS_typedefs.meta | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 8b6500fa98..d322aef938 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1361,6 +1361,7 @@ module GFS_typedefs !< Nccn: CCN number concentration in cm^(-3) !< Until a realistic Nccn is provided, Nccns are assumed !< as Nccn=100 for sea and Nccn=1000 for land + real(kind=kind_phys) :: cat_adj_deep !< Adjustment for convective advection time for deep convection !--- mass flux shallow convection real(kind=kind_phys) :: clam_shal !< c_e for shallow convection (Han and Pan, 2011, eq(6)) @@ -1375,6 +1376,7 @@ module GFS_typedefs !< Nccn: CCN number concentration in cm^(-3) !< Until a realistic Nccn is provided, Nccns are assumed !< as Nccn=100 for sea and Nccn=1000 for land + real(kind=kind_phys) :: cat_adj_shal !< Adjustment for convective advection time for shallow convection !--- near surface temperature model logical :: nst_anl !< flag for NSSTM analysis in gcycle/sfcsub @@ -3951,6 +3953,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & !< Nccn: CCN number concentration in cm^(-3) !< Until a realistic Nccn is provided, Nccns are assumed !< as Nccn=100 for sea and Nccn=1000 for land + real(kind=kind_phys) :: cat_adj_deep = 1.0 !< Adjustment for convective advection time for deep convection !--- mass flux shallow convection real(kind=kind_phys) :: clam_shal = 0.3 !< c_e for shallow convection (Han and Pan, 2011, eq(6)) @@ -3965,6 +3968,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & !< Nccn: CCN number concentration in cm^(-3) !< Until a realistic Nccn is provided, Nccns are assumed !< as Nccn=100 for sea and Nccn=1000 for land + real(kind=kind_phys) :: cat_adj_shal = 1.0 !< Adjustment for convective advection time for shallow convection !--- near surface sea temperature model logical :: nst_anl = .false. !< flag for NSSTM analysis in gcycle/sfcsub @@ -4277,9 +4281,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & !--- mass flux deep convection clam_deep, c0s_deep, c1_deep, betal_deep, & betas_deep, evef, evfact_deep, evfactl_deep, pgcon_deep, & - asolfac_deep, & + asolfac_deep, cat_adj_deep, & !--- mass flux shallow convection clam_shal, c0s_shal, c1_shal, pgcon_shal, asolfac_shal, & + cat_adj_shal, & !--- near surface sea temperature model nst_anl, lsea, nstf_name, & frac_grid, min_lakeice, min_seaice, min_lake_height, & @@ -5299,6 +5304,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%evfactl_deep = evfactl_deep Model%pgcon_deep = pgcon_deep Model%asolfac_deep = asolfac_deep + Model%cat_adj_deep = cat_adj_deep !--- mass flux shallow convection Model%clam_shal = clam_shal @@ -5306,6 +5312,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, & Model%c1_shal = c1_shal Model%pgcon_shal = pgcon_shal Model%asolfac_shal = asolfac_shal + Model%cat_adj_shal = cat_adj_shal !--- near surface sea temperature model Model%nst_anl = nst_anl @@ -7236,6 +7243,7 @@ subroutine control_print(Model) print *, ' evfactl_deep : ', Model%evfactl_deep print *, ' pgcon_deep : ', Model%pgcon_deep print *, ' asolfac_deep : ', Model%asolfac_deep + print *, ' cat_adj_deep : ', Model%cat_adj_deep print *, ' ' endif if (Model%imfshalcnv >= 0) then @@ -7245,6 +7253,7 @@ subroutine control_print(Model) print *, ' c1_shal : ', Model%c1_shal print *, ' pgcon_shal : ', Model%pgcon_shal print *, ' asolfac_shal : ', Model%asolfac_shal + print *, ' cat_adj_shal : ', Model%cat_adj_shal endif print *, ' ' print *, 'near surface sea temperature model' diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 29921dd289..a6cb1bf541 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -6193,6 +6193,14 @@ dimensions = () type = real kind = kind_phys +[cat_adj_deep] + standard_name = Adjustment_for_convective_advection_time_for_deep + long_name = Adjustment for convective advection time for deep + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [clam_shal] standard_name = entrainment_rate_coefficient_for_shallow_convection long_name = entrainment rate coefficient for shallow convection @@ -6228,6 +6236,14 @@ dimensions = () type = real kind = kind_phys +[cat_adj_shal] + standard_name = Adjustment_for_convective_advection_time_for_shallow + long_name = Adjustment for convective advection time for shallow + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [xkzm_m] standard_name = atmosphere_momentum_diffusivity_due_to_background long_name = background vertical diffusion for momentum