From ce7fde9a21da438a87e54e011540b973b2d13d82 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 27 Feb 2024 10:52:16 -0700 Subject: [PATCH 01/16] Update physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.* to use chunked GFS DDTs --- .../UFS_SCM_NEPTUNE/GFS_debug.F90 | 154 +++++----- .../UFS_SCM_NEPTUNE/GFS_debug.meta | 266 ++++++++++++++++-- 2 files changed, 328 insertions(+), 92 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 index ed26b795f..0a7a8983d 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 @@ -303,6 +303,16 @@ module GFS_diagtoscreen use print_var_chksum, only: print_var + use machine, only: kind_phys + + use GFS_typedefs, only: GFS_control_type, GFS_statein_type, & + GFS_stateout_type, GFS_sfcprop_type, & + GFS_coupling_type, GFS_grid_type, & + GFS_tbd_type, GFS_cldprop_type, & + GFS_radtend_type, GFS_diag_type + + use CCPP_typedefs, only: GFS_interstitial_type + implicit none private @@ -314,66 +324,70 @@ module GFS_diagtoscreen !> \section arg_table_GFS_diagtoscreen_init Argument Table !! \htmlinclude GFS_diagtoscreen_init.html !! - subroutine GFS_diagtoscreen_init (Model, Data, Interstitial, errmsg, errflg) - - use GFS_typedefs, only: GFS_control_type, GFS_data_type - use CCPP_typedefs, only: GFS_interstitial_type + subroutine GFS_diagtoscreen_init (Model, Statein, Stateout, Sfcprop, Coupling, & + Grid, Tbd, Cldprop, Radtend, Diag, Interstitial, & + errmsg, errflg) implicit none !--- interface variables type(GFS_control_type), intent(in) :: Model - type(GFS_data_type), intent(in) :: Data(:) + type(GFS_statein_type), intent(in) :: Statein + type(GFS_stateout_type), intent(in) :: Stateout + type(GFS_sfcprop_type), intent(in) :: Sfcprop + type(GFS_coupling_type), intent(in) :: Coupling + type(GFS_grid_type), intent(in) :: Grid + type(GFS_tbd_type), intent(in) :: Tbd + type(GFS_cldprop_type), intent(in) :: Cldprop + type(GFS_radtend_type), intent(in) :: Radtend + type(GFS_diag_type), intent(in) :: Diag type(GFS_interstitial_type), intent(in) :: Interstitial(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - !--- local variables - integer :: i - ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - do i=1,size(Data) - call GFS_diagtoscreen_run (Model, Data(i)%Statein, Data(i)%Stateout, Data(i)%Sfcprop, & - Data(i)%Coupling, Data(i)%Grid, Data(i)%Tbd, Data(i)%Cldprop, & - Data(i)%Radtend, Data(i)%Intdiag, Interstitial(1), & - size(Interstitial), i, errmsg, errflg) - end do + call GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, & + Coupling, Grid, Tbd, Cldprop, & + Radtend, Diag, Interstitial(1), & + size(Interstitial), -999, errmsg, errflg) end subroutine GFS_diagtoscreen_init !> \section arg_table_GFS_diagtoscreen_timestep_init Argument Table !! \htmlinclude GFS_diagtoscreen_timestep_init.html !! - subroutine GFS_diagtoscreen_timestep_init (Model, Data, Interstitial, errmsg, errflg) - - use GFS_typedefs, only: GFS_control_type, GFS_data_type - use CCPP_typedefs, only: GFS_interstitial_type + subroutine GFS_diagtoscreen_timestep_init (Model, Statein, Stateout, Sfcprop, Coupling, & + Grid, Tbd, Cldprop, Radtend, Diag, Interstitial, & + errmsg, errflg) implicit none !--- interface variables type(GFS_control_type), intent(in) :: Model - type(GFS_data_type), intent(in) :: Data(:) + type(GFS_statein_type), intent(in) :: Statein + type(GFS_stateout_type), intent(in) :: Stateout + type(GFS_sfcprop_type), intent(in) :: Sfcprop + type(GFS_coupling_type), intent(in) :: Coupling + type(GFS_grid_type), intent(in) :: Grid + type(GFS_tbd_type), intent(in) :: Tbd + type(GFS_cldprop_type), intent(in) :: Cldprop + type(GFS_radtend_type), intent(in) :: Radtend + type(GFS_diag_type), intent(in) :: Diag type(GFS_interstitial_type), intent(in) :: Interstitial(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - !--- local variables - integer :: i - ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - do i=1,size(Data) - call GFS_diagtoscreen_run (Model, Data(i)%Statein, Data(i)%Stateout, Data(i)%Sfcprop, & - Data(i)%Coupling, Data(i)%Grid, Data(i)%Tbd, Data(i)%Cldprop, & - Data(i)%Radtend, Data(i)%Intdiag, Interstitial(1), & - size(Interstitial), i, errmsg, errflg) - end do + call GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, & + Coupling, Grid, Tbd, Cldprop, & + Radtend, Diag, Interstitial(1), & + size(Interstitial), -999, errmsg, errflg) end subroutine GFS_diagtoscreen_timestep_init @@ -390,12 +404,6 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, #ifdef _OPENMP use omp_lib #endif - use GFS_typedefs, only: GFS_control_type, GFS_statein_type, & - GFS_stateout_type, GFS_sfcprop_type, & - GFS_coupling_type, GFS_grid_type, & - GFS_tbd_type, GFS_cldprop_type, & - GFS_radtend_type, GFS_diag_type - use CCPP_typedefs, only: GFS_interstitial_type implicit none @@ -619,7 +627,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%in_nm' , Tbd%in_nm) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%ccn_nm' , Tbd%ccn_nm) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%aer_nm' , Tbd%aer_nm) - if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_unified) then + if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%cactiv' , Tbd%cactiv) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%cactiv_m' , Tbd%cactiv_m) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Tbd%aod_gf' , Tbd%aod_gf) @@ -877,13 +885,6 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%v10mi_cpl ', Coupling%v10mi_cpl ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%tsfci_cpl ', Coupling%tsfci_cpl ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%psurfi_cpl ', Coupling%psurfi_cpl ) - if (Model%use_med_flux) then - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%dusfcino_cpl ', Coupling%dusfcino_cpl ) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%dvsfcino_cpl ', Coupling%dvsfcino_cpl ) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%dtsfcino_cpl ', Coupling%dtsfcino_cpl ) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%dqsfcino_cpl ', Coupling%dqsfcino_cpl ) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%ulwsfcino_cpl', Coupling%ulwsfcino_cpl ) - end if end if if (Model%cplchm) then call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Coupling%rainc_cpl', Coupling%rainc_cpl) @@ -971,6 +972,17 @@ module GFS_interstitialtoscreen use print_var_chksum, only: print_var + use machine, only: kind_phys + + use GFS_typedefs, only: GFS_control_type, GFS_statein_type, & + GFS_stateout_type, GFS_sfcprop_type, & + GFS_coupling_type, GFS_grid_type, & + GFS_tbd_type, GFS_cldprop_type, & + GFS_radtend_type, GFS_diag_type + + use CCPP_typedefs, only: GFS_interstitial_type + + implicit none private @@ -982,16 +994,23 @@ module GFS_interstitialtoscreen !> \section arg_table_GFS_interstitialtoscreen_init Argument Table !! \htmlinclude GFS_interstitialtoscreen_init.html !! - subroutine GFS_interstitialtoscreen_init (Model, Data, Interstitial, errmsg, errflg) - - use GFS_typedefs, only: GFS_control_type, GFS_data_type - use CCPP_typedefs, only: GFS_interstitial_type + subroutine GFS_interstitialtoscreen_init (Model, Statein, Stateout, Sfcprop, Coupling, & + Grid, Tbd, Cldprop, Radtend, Diag, Interstitial, & + errmsg, errflg) implicit none !--- interface variables type(GFS_control_type), intent(in) :: Model - type(GFS_data_type), intent(in) :: Data(:) + type(GFS_statein_type), intent(in) :: Statein + type(GFS_stateout_type), intent(in) :: Stateout + type(GFS_sfcprop_type), intent(in) :: Sfcprop + type(GFS_coupling_type), intent(in) :: Coupling + type(GFS_grid_type), intent(in) :: Grid + type(GFS_tbd_type), intent(in) :: Tbd + type(GFS_cldprop_type), intent(in) :: Cldprop + type(GFS_radtend_type), intent(in) :: Radtend + type(GFS_diag_type), intent(in) :: Diag type(GFS_interstitial_type), intent(in) :: Interstitial(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -1003,11 +1022,9 @@ subroutine GFS_interstitialtoscreen_init (Model, Data, Interstitial, errmsg, err errmsg = '' errflg = 0 - do i=1,size(Interstitial) - call GFS_interstitialtoscreen_run (Model, Data(1)%Statein, Data(1)%Stateout, Data(1)%Sfcprop, & - Data(1)%Coupling, Data(1)%Grid, Data(1)%Tbd, Data(1)%Cldprop, & - Data(1)%Radtend, Data(1)%Intdiag, Interstitial(i), & + call GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, & + Grid, Tbd, Cldprop, Radtend, Diag, Interstitial(i), & size(Interstitial), -999, errmsg, errflg) end do @@ -1016,16 +1033,23 @@ end subroutine GFS_interstitialtoscreen_init !> \section arg_table_GFS_interstitialtoscreen_timestep_init Argument Table !! \htmlinclude GFS_interstitialtoscreen_timestep_init.html !! - subroutine GFS_interstitialtoscreen_timestep_init (Model, Data, Interstitial, errmsg, errflg) - - use GFS_typedefs, only: GFS_control_type, GFS_data_type - use CCPP_typedefs, only: GFS_interstitial_type + subroutine GFS_interstitialtoscreen_timestep_init (Model, Statein, Stateout, Sfcprop, Coupling, & + Grid, Tbd, Cldprop, Radtend, Diag, Interstitial, & + errmsg, errflg) implicit none !--- interface variables type(GFS_control_type), intent(in) :: Model - type(GFS_data_type), intent(in) :: Data(:) + type(GFS_statein_type), intent(in) :: Statein + type(GFS_stateout_type), intent(in) :: Stateout + type(GFS_sfcprop_type), intent(in) :: Sfcprop + type(GFS_coupling_type), intent(in) :: Coupling + type(GFS_grid_type), intent(in) :: Grid + type(GFS_tbd_type), intent(in) :: Tbd + type(GFS_cldprop_type), intent(in) :: Cldprop + type(GFS_radtend_type), intent(in) :: Radtend + type(GFS_diag_type), intent(in) :: Diag type(GFS_interstitial_type), intent(in) :: Interstitial(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -1039,9 +1063,8 @@ subroutine GFS_interstitialtoscreen_timestep_init (Model, Data, Interstitial, er do i=1,size(Interstitial) - call GFS_interstitialtoscreen_run (Model, Data(1)%Statein, Data(1)%Stateout, Data(1)%Sfcprop, & - Data(1)%Coupling, Data(1)%Grid, Data(1)%Tbd, Data(1)%Cldprop, & - Data(1)%Radtend, Data(1)%Intdiag, Interstitial(i), & + call GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, & + Grid, Tbd, Cldprop, Radtend, Diag, Interstitial(i), & size(Interstitial), -999, errmsg, errflg) end do @@ -1060,14 +1083,6 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup #ifdef _OPENMP use omp_lib #endif - use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type, GFS_statein_type, & - GFS_stateout_type, GFS_sfcprop_type, & - GFS_coupling_type, GFS_grid_type, & - GFS_tbd_type, GFS_cldprop_type, & - GFS_radtend_type, GFS_diag_type - use CCPP_typedefs, only: GFS_interstitial_type - implicit none !--- interface variables @@ -1293,7 +1308,6 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_ice ', Interstitial%qss_ice ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_land ', Interstitial%qss_land ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_water ', Interstitial%qss_water ) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%radar_reset ', Interstitial%radar_reset ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raddt ', Interstitial%raddt ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raincd ', Interstitial%raincd ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raincs ', Interstitial%raincs ) @@ -1322,8 +1336,6 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%sigmafrac ', Interstitial%sigmafrac ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%sigmatot ', Interstitial%sigmatot ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%snowc ', Interstitial%snowc ) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%snowd_ice ', Interstitial%snowd_ice ) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%snowd_land ', Interstitial%snowd_land ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%snohf ', Interstitial%snohf ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%snowmt ', Interstitial%snowmt ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%stress ', Interstitial%stress ) @@ -1535,7 +1547,7 @@ module GFS_checkland !! \htmlinclude GFS_checkland_run.html !! subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_guess, & - flag_init, flag_restart, frac_grid, isot, ivegsrc, stype,scolor, vtype, slope, & + flag_init, flag_restart, frac_grid, isot, ivegsrc, stype,scolor, vtype, slope, & dry, icy, wet, lake, ocean, oceanfrac, landfrac, lakefrac, slmsk, islmsk, & zorl, zorlw, zorll, zorli, fice, errmsg, errflg ) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta index 10eb43671..0d12b2bbb 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta @@ -9,17 +9,73 @@ type = scheme [Model] standard_name = GFS_control_type_instance - long_name = instance of derived type GFS_control_type in FV3 + long_name = instance of derived type GFS_control_type units = DDT dimensions = () type = GFS_control_type intent = in -[Data] - standard_name = GFS_data_type_instance_all_blocks - long_name = instance of derived type GFS_data_type +[Statein] + standard_name = GFS_statein_type_instance + long_name = prognostic state data in from dycore + units = DDT + dimensions = () + type = GFS_statein_type + intent = in +[Stateout] + standard_name = GFS_stateout_type_instance + long_name = prognostic state or tendencies return to dycore + units = DDT + dimensions = () + type = GFS_stateout_type + intent = in +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = instance of derived type GFS_sfcprop_type + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = in +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = instance of derived type GFS_coupling_type + units = DDT + dimensions = () + type = GFS_coupling_type + intent = in +[Grid] + standard_name = GFS_grid_type_instance + long_name = instance of derived type GFS_grid_type + units = DDT + dimensions = () + type = GFS_grid_type + intent = in +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = instance of derived type GFS_tbd_type + units = DDT + dimensions = () + type = GFS_tbd_type + intent = in +[Cldprop] + standard_name = GFS_cldprop_type_instance + long_name = instance of derived type GFS_cldprop_type + units = DDT + dimensions = () + type = GFS_cldprop_type + intent = in +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = instance of derived type GFS_radtend_type units = DDT - dimensions = (ccpp_block_count) - type = GFS_data_type + dimensions = () + type = GFS_radtend_type + intent = in +[Diag] + standard_name = GFS_diag_type_instance + long_name = instance of derived type GFS_diag_type + units = DDT + dimensions = () + type = GFS_diag_type intent = in [Interstitial] standard_name = GFS_interstitial_type_instance_all_threads @@ -55,12 +111,68 @@ dimensions = () type = GFS_control_type intent = in -[Data] - standard_name = GFS_data_type_instance_all_blocks - long_name = instance of derived type GFS_data_type +[Statein] + standard_name = GFS_statein_type_instance + long_name = prognostic state data in from dycore + units = DDT + dimensions = () + type = GFS_statein_type + intent = in +[Stateout] + standard_name = GFS_stateout_type_instance + long_name = prognostic state or tendencies return to dycore + units = DDT + dimensions = () + type = GFS_stateout_type + intent = in +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = instance of derived type GFS_sfcprop_type + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = in +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = instance of derived type GFS_coupling_type + units = DDT + dimensions = () + type = GFS_coupling_type + intent = in +[Grid] + standard_name = GFS_grid_type_instance + long_name = instance of derived type GFS_grid_type units = DDT - dimensions = (ccpp_block_count) - type = GFS_data_type + dimensions = () + type = GFS_grid_type + intent = in +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = instance of derived type GFS_tbd_type + units = DDT + dimensions = () + type = GFS_tbd_type + intent = in +[Cldprop] + standard_name = GFS_cldprop_type_instance + long_name = instance of derived type GFS_cldprop_type + units = DDT + dimensions = () + type = GFS_cldprop_type + intent = in +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = instance of derived type GFS_radtend_type + units = DDT + dimensions = () + type = GFS_radtend_type + intent = in +[Diag] + standard_name = GFS_diag_type_instance + long_name = instance of derived type GFS_diag_type + units = DDT + dimensions = () + type = GFS_diag_type intent = in [Interstitial] standard_name = GFS_interstitial_type_instance_all_threads @@ -213,12 +325,68 @@ dimensions = () type = GFS_control_type intent = in -[Data] - standard_name = GFS_data_type_instance_all_blocks - long_name = instance of derived type GFS_data_type +[Statein] + standard_name = GFS_statein_type_instance + long_name = prognostic state data in from dycore + units = DDT + dimensions = () + type = GFS_statein_type + intent = in +[Stateout] + standard_name = GFS_stateout_type_instance + long_name = prognostic state or tendencies return to dycore + units = DDT + dimensions = () + type = GFS_stateout_type + intent = in +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = instance of derived type GFS_sfcprop_type + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = in +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = instance of derived type GFS_coupling_type + units = DDT + dimensions = () + type = GFS_coupling_type + intent = in +[Grid] + standard_name = GFS_grid_type_instance + long_name = instance of derived type GFS_grid_type + units = DDT + dimensions = () + type = GFS_grid_type + intent = in +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = instance of derived type GFS_tbd_type + units = DDT + dimensions = () + type = GFS_tbd_type + intent = in +[Cldprop] + standard_name = GFS_cldprop_type_instance + long_name = instance of derived type GFS_cldprop_type + units = DDT + dimensions = () + type = GFS_cldprop_type + intent = in +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = instance of derived type GFS_radtend_type units = DDT - dimensions = (ccpp_block_count) - type = GFS_data_type + dimensions = () + type = GFS_radtend_type + intent = in +[Diag] + standard_name = GFS_diag_type_instance + long_name = instance of derived type GFS_diag_type + units = DDT + dimensions = () + type = GFS_diag_type intent = in [Interstitial] standard_name = GFS_interstitial_type_instance_all_threads @@ -254,12 +422,68 @@ dimensions = () type = GFS_control_type intent = in -[Data] - standard_name = GFS_data_type_instance_all_blocks - long_name = instance of derived type GFS_data_type +[Statein] + standard_name = GFS_statein_type_instance + long_name = prognostic state data in from dycore + units = DDT + dimensions = () + type = GFS_statein_type + intent = in +[Stateout] + standard_name = GFS_stateout_type_instance + long_name = prognostic state or tendencies return to dycore + units = DDT + dimensions = () + type = GFS_stateout_type + intent = in +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = instance of derived type GFS_sfcprop_type units = DDT - dimensions = (ccpp_block_count) - type = GFS_data_type + dimensions = () + type = GFS_sfcprop_type + intent = in +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = instance of derived type GFS_coupling_type + units = DDT + dimensions = () + type = GFS_coupling_type + intent = in +[Grid] + standard_name = GFS_grid_type_instance + long_name = instance of derived type GFS_grid_type + units = DDT + dimensions = () + type = GFS_grid_type + intent = in +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = instance of derived type GFS_tbd_type + units = DDT + dimensions = () + type = GFS_tbd_type + intent = in +[Cldprop] + standard_name = GFS_cldprop_type_instance + long_name = instance of derived type GFS_cldprop_type + units = DDT + dimensions = () + type = GFS_cldprop_type + intent = in +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = instance of derived type GFS_radtend_type + units = DDT + dimensions = () + type = GFS_radtend_type + intent = in +[Diag] + standard_name = GFS_diag_type_instance + long_name = instance of derived type GFS_diag_type + units = DDT + dimensions = () + type = GFS_diag_type intent = in [Interstitial] standard_name = GFS_interstitial_type_instance_all_threads From 14d0aadc114e7f10275480a157dd5891074011b4 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Tue, 12 Mar 2024 12:18:03 -0400 Subject: [PATCH 02/16] remove veg-dependent opt_diag used in hr3 --- physics/SFC_Layer/UFS/sfc_diag_post.F90 | 14 +------------- physics/SFC_Layer/UFS/sfc_diag_post.meta | 7 ------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/physics/SFC_Layer/UFS/sfc_diag_post.F90 b/physics/SFC_Layer/UFS/sfc_diag_post.F90 index 6945e48e9..de5e38aa4 100644 --- a/physics/SFC_Layer/UFS/sfc_diag_post.F90 +++ b/physics/SFC_Layer/UFS/sfc_diag_post.F90 @@ -14,7 +14,7 @@ module sfc_diag_post !! #endif subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, con_eps, con_epsm1, pgr,& - vegtype,t2mmp,q2mp, t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, & + t2mmp,q2mp, t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, & wind10mmax, u10mmax, v10mmax, dpt2m, errmsg, errflg) use machine, only: kind_phys, kind_dbl_prec @@ -22,7 +22,6 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, co implicit none integer, intent(in) :: im, lsm, lsm_noahmp,opt_diag - integer, dimension(:), intent(in) :: vegtype ! vegetation type (integer index) logical, intent(in) :: lssav real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 logical , dimension(:), intent(in) :: dry @@ -42,17 +41,6 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, co errflg = 0 if (lsm == lsm_noahmp) then -! over shrublands use opt_diag=2 - do i=1, im - if(dry(i)) then - if (vegtype(i) == 6 .or. vegtype(i) == 7 & - .or. vegtype(i) == 16) then - t2m(i) = t2mmp(i) - q2m(i) = q2mp(i) - endif - endif - enddo - if (opt_diag == 2 .or. opt_diag == 3) then do i=1,im if(dry(i)) then diff --git a/physics/SFC_Layer/UFS/sfc_diag_post.meta b/physics/SFC_Layer/UFS/sfc_diag_post.meta index 4abb3bac0..8c74e2154 100644 --- a/physics/SFC_Layer/UFS/sfc_diag_post.meta +++ b/physics/SFC_Layer/UFS/sfc_diag_post.meta @@ -82,13 +82,6 @@ type = real kind = kind_phys intent = in -[vegtype] - standard_name = vegetation_type_classification - long_name = vegetation type at each grid cell - units = index - dimensions = (horizontal_loop_extent) - type = integer - intent= in [t2mmp] standard_name = temperature_at_2m_from_noahmp long_name = 2 meter temperature from noahmp From 0ff86ac719fe84eeb796094c482abf9061284fa4 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Thu, 28 Mar 2024 12:56:07 -0400 Subject: [PATCH 03/16] use radiative temp as skin temp to the atmosphere --- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index c2c03d0de..0f2e4e717 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -658,6 +658,7 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: precip_freeze_frac_in ! used for penman calculation real (kind=kind_phys) :: virtfac1 ! virtual factor + real (kind=kind_phys) :: tflux ! surface flux temp real (kind=kind_phys) :: tvs1 ! surface virtual temp real (kind=kind_phys) :: vptemp ! virtual potential temp @@ -934,7 +935,8 @@ subroutine noahmpdrv_run & t2mmp(i) = temperature_bare_2m q2mp(i) = spec_humidity_bare_2m - tskin(i) = temperature_ground + tskin(i) = temperature_radiative + tflux = temperature_ground surface_temperature = temperature_ground vegetation_fraction = vegetation_frac ch_vegetated = 0.0 @@ -1024,7 +1026,8 @@ subroutine noahmpdrv_run & q2mp(i) = spec_humidity_veg_2m * vegetation_fraction + & spec_humidity_bare_2m * (1-vegetation_fraction) - tskin(i) = surface_temperature + tskin(i) = temperature_radiative + tflux = surface_temperature endif ! glacial split ends @@ -1170,9 +1173,9 @@ subroutine noahmpdrv_run & endif if(thsfc_loc) then ! Use local potential temperature - tvs1 = tskin(i) * virtfac1 + tvs1 = tflux * virtfac1 else ! Use potential temperature referenced to 1000 hPa - tvs1 = tskin(i)/prsik1(i) * virtfac1 + tvs1 = tflux/prsik1(i) * virtfac1 endif z0_total = max(min(z0_total,forcing_height),1.0e-6) From 9e5eeb83f70a2d6730684617306dc58c88fb2162 Mon Sep 17 00:00:00 2001 From: helin wei Date: Thu, 4 Apr 2024 15:09:44 +0000 Subject: [PATCH 04/16] create a single_loop_alternate for hr4_test3 --- .../Land/Noahmp/module_sf_noahmplsm.F90 | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 6abd59f69..d97a81ba2 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -4052,11 +4052,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & end if -! prepare for longwave rad. - - air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4 - cir = (2.-emv*(1.-emg))*emv*sb -! if(opt_sfc == 4) then gdx = sqrt(garea1) @@ -4203,6 +4198,11 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & end if end if +! prepare for longwave rad. + + air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4 + cir = (2.-emv*(1.-emg))*emv*sb + ! prepare for sensible heat flux above veg. cah = 1./rahc @@ -4265,7 +4265,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & ! update vegetation surface temperature tv = tv + dtv -! tah = ata + bta*tv ! canopy air t; update here for consistency + tah = ata + bta*tv ! canopy air t; update here for consistency ! for computing m-o length in the next iteration h = rhoair*cpair*(tah - sfctmp) /rahc @@ -4278,15 +4278,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & qfx = (qsfc-qair)*rhoair*caw endif - - if (liter == 1) then - exit loop1 - endif - if (iter >= 5 .and. abs(dtv) <= 0.01 .and. liter == 0) then - liter = 1 - endif - - end do loop1 ! end stability iteration +! after canopy balance, do the under-canopy ground balance ! under-canopy fluxes and tg @@ -4296,8 +4288,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & cev = rhoair*cpair / (gammag*(rawg+rsurf)) ! barlage: change to ground v3.6 cgh = 2.*df(isnow+1)/dzsnso(isnow+1) - loop2: do iter = 1, niterg - t = tdc(tg) call esat(t, esatw, esati, dsatw, dsati) if (t .gt. 0.) then @@ -4323,7 +4313,14 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & gh = gh + cgh*dtg tg = tg + dtg - end do loop2 + if (liter == 1) then + exit loop1 + endif + if (iter >= 5 .and. abs(dtv) <= 0.01 .and. abs(dtg) <= 0.01 .and. liter == 0) then + liter = 1 ! if conditions are met, then do one final loop + endif + + end do loop1 ! tah = (cah*sfctmp + cvh*tv + cgh*tg)/(cah + cvh + cgh) From e039a94ae1a718fe7e7c517c1f61c6d4fc100c8d Mon Sep 17 00:00:00 2001 From: helin wei Date: Mon, 8 Apr 2024 23:13:53 +0000 Subject: [PATCH 05/16] opt_trs bug fixed --- physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index d97a81ba2..e519e472c 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -5873,7 +5873,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, z0h_out = z0m_out - elseif (opt_trs == chen09 .or. opt_trs == tessel) then + elseif (opt_trs == tessel) then if (vegtyp <= 5) then z0h_out = z0m_out @@ -5881,7 +5881,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, z0h_out = z0m_out * 0.01 endif - elseif (opt_trs == blumel99) then + elseif (opt_trs == chen09 .or. opt_trs == blumel99) then reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c if (reyn > 2.0) then From 6f6175acdc789f1eba3aa2e455019423d453b997 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Sun, 12 May 2024 20:23:05 -0600 Subject: [PATCH 06/16] Update MPI communicator in GFS_debug.F90 --- .../UFS_SCM_NEPTUNE/GFS_debug.F90 | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 index e4caf708b..cdd3d8e2b 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 @@ -426,7 +426,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, !--- local variables integer :: impi, iomp, ierr, n, idtend, iprocess, itracer - integer :: mpirank, mpisize, mpicomm + integer :: mpirank, mpisize integer :: omprank, ompsize ! Initialize CCPP error handling variables @@ -434,13 +434,11 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, errflg = 0 #ifdef MPI - mpicomm = Model%communicator mpirank = Model%me mpisize = Model%ntasks #else mpirank = 0 mpisize = 1 - mpicomm = 0 #endif #ifdef _OPENMP omprank = OMP_GET_THREAD_NUM() @@ -454,7 +452,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, !$OMP BARRIER #endif #ifdef MPI -! call MPI_BARRIER(mpicomm,ierr) +! call MPI_BARRIER(Model%communicator,ierr) #endif do impi=0,mpisize-1 @@ -952,7 +950,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, #endif end do #ifdef MPI -! call MPI_BARRIER(mpicomm,ierr) +! call MPI_BARRIER(Model%communicator,ierr) #endif end do @@ -960,7 +958,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, !$OMP BARRIER #endif #ifdef MPI -! call MPI_BARRIER(mpicomm,ierr) +! call MPI_BARRIER(Model%communicator,ierr) #endif end subroutine GFS_diagtoscreen_run @@ -1104,7 +1102,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup !--- local variables integer :: impi, iomp, ierr - integer :: mpirank, mpisize, mpicomm + integer :: mpirank, mpisize integer :: omprank, ompsize integer :: istart, iend, kstart, kend @@ -1113,13 +1111,11 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup errflg = 0 #ifdef MPI - mpicomm = Model%communicator mpirank = Model%me - call MPI_COMM_SIZE(mpicomm, mpisize, ierr) + call MPI_COMM_SIZE(Model%communicator, mpisize, ierr) #else mpirank = 0 mpisize = 1 - mpicomm = 0 #endif #ifdef _OPENMP omprank = OMP_GET_THREAD_NUM() @@ -1133,7 +1129,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup !$OMP BARRIER #endif #ifdef MPI -! call MPI_BARRIER(mpicomm,ierr) +! call MPI_BARRIER(Model%communicator,ierr) #endif do impi=0,mpisize-1 @@ -1482,7 +1478,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup #endif end do #ifdef MPI -! call MPI_BARRIER(mpicomm,ierr) +! call MPI_BARRIER(Model%communicator,ierr) #endif end do @@ -1490,7 +1486,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup !$OMP BARRIER #endif #ifdef MPI -! call MPI_BARRIER(mpicomm,ierr) +! call MPI_BARRIER(Model%communicator,ierr) #endif end subroutine GFS_interstitialtoscreen_run From 31bca4e8fc5c41c01597a6d91d3718d72b581116 Mon Sep 17 00:00:00 2001 From: "helin.wei" Date: Wed, 22 May 2024 17:45:46 +0000 Subject: [PATCH 07/16] test 6-9 --- .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 | 18 +++++++++++++++++- .../Land/Noahmp/module_sf_noahmplsm.F90 | 11 ++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 index f53ab3928..6c810c622 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 @@ -593,8 +593,24 @@ subroutine GFS_phys_time_vary_init ( isnow = nint(snowxy(ix))+1 ! snowxy <=0.0, dzsno >= 0.0 +! using stc and tgxy to linearly interpolate the snow temp for each layer +!Calculate the total thickness +! total_thickness = sum(dzsno) +! Calculate the temperature difference +! temp_diff=tgxy(ix)-stc(ix,1) +! Calculate the mid-points and interpolate temperatures for each layer +! accumulated_thickness = 0.0 +! do is = isnow, 0 +! accumulated_thickness = accumulated_thickness + dzsno(is) +! mid_points(is) = accumulated_thickness - dzsno(is) / 2.0 +! layer_temp = tgxy(ix) + (mid_points(is) / total_thickness) * temp_diff +! tsnoxy(ix,is) = layer_temp +! end do + do is = isnow,0 - tsnoxy(ix,is) = tgxy(ix) +! tsnoxy(ix,is) = tgxy(ix) +! tsnoxy(ix,is) = tgxy(ix) + (( sum(dzsno(isnow:is)) -0.5*dzsno(is) )/snd)*(tgxy(ix)-stc(ix,1)) + tsnoxy(ix,is) = tgxy(ix) + (( sum(dzsno(isnow:is)) -0.5*dzsno(is) )/snd)*(stc(ix,1)-tgxy(ix)) snliqxy(ix,is) = zero snicexy(ix,is) = one * dzsno(is) * weasd(ix)/snd enddo diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index e519e472c..3451f807e 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -1989,7 +1989,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys), parameter :: mpe = 1.e-6 real (kind=kind_phys), parameter :: psiwlt = -150. !metric potential for wilting point (m) - real (kind=kind_phys), parameter :: z0 = 0.002 ! bare-soil roughness length (m) (i.e., under the canopy) + real (kind=kind_phys), parameter :: z0 = 0.015 ! bare-soil roughness length (m) (i.e., under the canopy) ! --------------------------------------------------------------------------------------------------- ! initialize fluxes from veg. fraction @@ -2626,10 +2626,10 @@ subroutine csnow (parameters,isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso ! thermal conductivity of snow do iz = isnow+1, 0 -! tksno(iz) = 3.2217e-6*bdsnoi(iz)**2. ! stieglitz(yen,1965) + tksno(iz) = 3.2217e-6*bdsnoi(iz)**2. ! stieglitz(yen,1965) ! tksno(iz) = 2e-2+2.5e-6*bdsnoi(iz)*bdsnoi(iz) ! anderson, 1976 ! tksno(iz) = 0.35 ! constant - tksno(iz) = 2.576e-6*bdsnoi(iz)**2. + 0.074 ! verseghy (1991) +! tksno(iz) = 2.576e-6*bdsnoi(iz)**2. + 0.074 ! verseghy (1991) ! tksno(iz) = 2.22*(bdsnoi(iz)/1000.)**1.88 ! douvill(yen, 1981) enddo @@ -5817,7 +5817,8 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, if (opt_trs == z0heqz0m) then - z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg)) +! z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg)) + z0m_out = fveg * z0m + (1.0 - fveg) * z0mg z0h_out = z0m_out elseif (opt_trs == chen09) then @@ -5834,7 +5835,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, endif z0h_out = exp( fveg * log(z0m * exp(-czil*0.4*258.2*sqrt(ustarx*z0m))) + & - (1.0 - fveg) * log(max(z0m/exp(kb_sigma_f0),1.0e-6)) ) + (1.0 - fveg) * log(max(z0mg/exp(kb_sigma_f0),1.0e-6)) ) elseif (opt_trs == tessel) then From 4ed1b4fdf6dd89005c4cd0fac4700f1b2c5729e7 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 3 Jun 2024 16:54:21 -0600 Subject: [PATCH 08/16] Bug fixes in Thompson MP and CLM Lake found by Dusan --- physics/MP/Thompson/module_mp_thompson.F90 | 2 +- physics/MP/Thompson/mp_thompson.F90 | 2 +- physics/SFC_Models/Lake/CLM/clm_lake.f90 | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/physics/MP/Thompson/module_mp_thompson.F90 b/physics/MP/Thompson/module_mp_thompson.F90 index aa1361c3b..3fc27ca4a 100644 --- a/physics/MP/Thompson/module_mp_thompson.F90 +++ b/physics/MP/Thompson/module_mp_thompson.F90 @@ -1048,7 +1048,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & INTEGER, INTENT(IN) :: rand_perturb_on, kme_stoch, n_var_spp REAL, DIMENSION(:,:), INTENT(IN), OPTIONAL :: rand_pert REAL, DIMENSION(:), INTENT(IN), OPTIONAL :: spp_prt_list - REAL, DIMENSION(:), INTENT(IN) :: spp_stddev_cutoff + REAL, DIMENSION(:), INTENT(IN), OPTIONAL :: spp_stddev_cutoff CHARACTER(len=10), DIMENSION(:), INTENT(IN), OPTIONAL :: spp_var_list INTEGER, INTENT(IN):: has_reqc, has_reqi, has_reqs #if ( WRF_CHEM == 1 ) diff --git a/physics/MP/Thompson/mp_thompson.F90 b/physics/MP/Thompson/mp_thompson.F90 index 3b99deec1..444790324 100644 --- a/physics/MP/Thompson/mp_thompson.F90 +++ b/physics/MP/Thompson/mp_thompson.F90 @@ -413,7 +413,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real(kind_phys), intent(in), optional :: spp_wts_mp(:,:) real(kind_phys), intent(in), optional :: spp_prt_list(:) character(len=10), intent(in), optional :: spp_var_list(:) - real(kind_phys), intent(in) :: spp_stddev_cutoff(:) + real(kind_phys), intent(in), optional :: spp_stddev_cutoff(:) logical, intent (in) :: cplchm ! ice and liquid water 3d precipitation fluxes - only allocated if cplchm is .true. diff --git a/physics/SFC_Models/Lake/CLM/clm_lake.f90 b/physics/SFC_Models/Lake/CLM/clm_lake.f90 index 8686221fa..94ad9d815 100644 --- a/physics/SFC_Models/Lake/CLM/clm_lake.f90 +++ b/physics/SFC_Models/Lake/CLM/clm_lake.f90 @@ -5388,7 +5388,8 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, INTEGER, DIMENSION(IM), INTENT(IN) :: ISLTYP REAL(KIND_PHYS), DIMENSION(IM), INTENT(INOUT) :: snowd,weasd - REAL(kind_phys), DIMENSION(IM,KM), INTENT(IN) :: gt0, prsi + REAL(kind_phys), DIMENSION(IM,KM), INTENT(IN) :: gt0 + REAL(kind_phys), DIMENSION(IM,KM+1), INTENT(IN) :: prsi real(kind_phys), intent(in) :: lakedepth_default real(kind_phys), dimension(IM),intent(inout) :: clm_lakedepth From afa2bc0632bd1e8a14740da484a431eadc56ec68 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 12 Jun 2024 18:21:54 -0600 Subject: [PATCH 09/16] Use assumed-size arrays in lakeini routine in physics/SFC_Models/Lake/CLM/clm_lake.f90 and remove OPTIONAL keyword from Fortran code to fix intel 19 runtime issues --- physics/SFC_Models/Lake/CLM/clm_lake.f90 | 60 +++++++++++------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/physics/SFC_Models/Lake/CLM/clm_lake.f90 b/physics/SFC_Models/Lake/CLM/clm_lake.f90 index 94ad9d815..565430a08 100644 --- a/physics/SFC_Models/Lake/CLM/clm_lake.f90 +++ b/physics/SFC_Models/Lake/CLM/clm_lake.f90 @@ -316,7 +316,7 @@ SUBROUTINE clm_lake_run( & REAL(KIND_PHYS), INTENT(IN) :: min_lakeice, lakedepth_default, dtp LOGICAL, INTENT(IN) :: use_lakedepth INTEGER, DIMENSION(:), INTENT(IN) :: use_lake_model - REAL(KIND_PHYS), INTENT(INOUT), OPTIONAL :: clm_lake_initialized(:) + REAL(KIND_PHYS), INTENT(INOUT) :: clm_lake_initialized(:) LOGICAL, INTENT(IN) :: frac_grid, frac_ice ! @@ -326,7 +326,7 @@ SUBROUTINE clm_lake_run( & tg3, pgr, zlvl, qvcurr, xlat_d, xlon_d, ch, cm, & dlwsfci, dswsfci, oro_lakedepth, wind, & t1, qv1, prsl1 - REAL(KIND_PHYS), DIMENSION(:), INTENT(IN), OPTIONAL :: & + REAL(KIND_PHYS), DIMENSION(:), INTENT(IN) :: & rainncprv, raincprv REAL(KIND_PHYS), DIMENSION(:,:), INTENT(in) :: gu0, gv0, prsi, gt0, phii LOGICAL, DIMENSION(:), INTENT(IN) :: flag_iter @@ -343,34 +343,34 @@ SUBROUTINE clm_lake_run( & weasdi, snodi, hice, qss_water, qss_ice, & cmm_water, cmm_ice, chh_water, chh_ice, & uustar_water, uustar_ice, zorlw, zorli, weasd, snowd, fice - REAL(KIND_PHYS), DIMENSION(:), INTENT(INOUT) , OPTIONAL :: & + REAL(KIND_PHYS), DIMENSION(:), INTENT(INOUT) :: & lake_t_snow, albedo, lake_t2m, lake_q2m LOGICAL, INTENT(INOUT) :: icy(:) ! ! Lake model internal state stored by caller: ! - INTEGER, DIMENSION( : ), INTENT(INOUT), OPTIONAL :: salty - INTEGER, DIMENSION( : ), INTENT(INOUT), OPTIONAL :: cannot_freeze + INTEGER, DIMENSION( : ), INTENT(INOUT) :: salty + INTEGER, DIMENSION( : ), INTENT(INOUT) :: cannot_freeze - real(kind_phys), dimension(: ), OPTIONAL ,intent(inout) :: savedtke12d, & + real(kind_phys), dimension(: ) ,intent(inout) :: savedtke12d, & snowdp2d, & h2osno2d, & snl2d, & t_grnd2d - real(kind_phys), dimension( :,: ), OPTIONAL, INTENT(inout) :: t_lake3d, & + real(kind_phys), dimension( :,: ), INTENT(inout) :: t_lake3d, & lake_icefrac3d - real(kind_phys), dimension( :,-nlevsnow+1: ) ,INTENT(inout), OPTIONAL :: t_soisno3d, & + real(kind_phys), dimension( :,-nlevsnow+1: ) ,INTENT(inout) :: t_soisno3d, & h2osoi_ice3d, & h2osoi_liq3d, & h2osoi_vol3d, & z3d, & dz3d - real(kind_phys), dimension( :,-nlevsnow+0: ) ,INTENT(inout), OPTIONAL :: zi3d + real(kind_phys), dimension( :,-nlevsnow+0: ) ,INTENT(inout) :: zi3d - REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT), OPTIONAL :: clm_lakedepth - REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT), OPTIONAL :: input_lakedepth + REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT) :: clm_lakedepth + REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT) :: input_lakedepth ! ! Error reporting: @@ -5377,43 +5377,39 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, INTEGER , INTENT (IN) :: im, me, master, km, kdt REAL(KIND_PHYS), INTENT(IN) :: min_lakeice, fhour - REAL(KIND_PHYS), DIMENSION(IM), INTENT(INOUT):: FICE, hice - REAL(KIND_PHYS), DIMENSION(IM), INTENT(IN):: TG3, xlat_d, xlon_d - REAL(KIND_PHYS), DIMENSION(IM), INTENT(IN):: tsfc - REAL(KIND_PHYS), DIMENSION(IM) ,INTENT(INOUT) :: clm_lake_initialized - integer, dimension(IM), intent(in) :: use_lake_model - !INTEGER , INTENT (IN) :: lakeflag - !INTEGER , INTENT (INOUT) :: lake_depth_flag + REAL(KIND_PHYS), DIMENSION(:), INTENT(INOUT):: FICE, hice + REAL(KIND_PHYS), DIMENSION(:), INTENT(IN):: TG3, xlat_d, xlon_d + REAL(KIND_PHYS), DIMENSION(:), INTENT(IN):: tsfc + REAL(KIND_PHYS), DIMENSION(:) ,INTENT(INOUT) :: clm_lake_initialized + integer, dimension(:), intent(in) :: use_lake_model LOGICAL, INTENT (IN) :: use_lakedepth - INTEGER, DIMENSION(IM), INTENT(IN) :: ISLTYP - REAL(KIND_PHYS), DIMENSION(IM), INTENT(INOUT) :: snowd,weasd - REAL(kind_phys), DIMENSION(IM,KM), INTENT(IN) :: gt0 - REAL(kind_phys), DIMENSION(IM,KM+1), INTENT(IN) :: prsi + INTEGER, DIMENSION(:), INTENT(IN) :: ISLTYP + REAL(KIND_PHYS), DIMENSION(:), INTENT(INOUT) :: snowd,weasd + REAL(kind_phys), DIMENSION(:,:), INTENT(IN) :: gt0 + REAL(kind_phys), DIMENSION(:,:), INTENT(IN) :: prsi real(kind_phys), intent(in) :: lakedepth_default - real(kind_phys), dimension(IM),intent(inout) :: clm_lakedepth - real(kind_phys), dimension(IM),intent(inout) :: input_lakedepth - real(kind_phys), dimension(IM),intent(in) :: oro_lakedepth - real(kind_phys), dimension(IM),intent(out) :: savedtke12d - real(kind_phys), dimension(IM),intent(out) :: snowdp2d, & + real(kind_phys), dimension(:),intent(inout) :: clm_lakedepth + real(kind_phys), dimension(:),intent(inout) :: input_lakedepth + real(kind_phys), dimension(:),intent(in) :: oro_lakedepth + real(kind_phys), dimension(:),intent(out) :: savedtke12d + real(kind_phys), dimension(:),intent(out) :: snowdp2d, & h2osno2d, & snl2d, & t_grnd2d - real(kind_phys), dimension(IM,nlevlake),INTENT(out) :: t_lake3d, & + real(kind_phys), dimension(:,:),INTENT(out) :: t_lake3d, & lake_icefrac3d - real(kind_phys), dimension(IM,-nlevsnow+1:nlevsoil ),INTENT(out) :: t_soisno3d, & + real(kind_phys), dimension(:,-nlevsnow+1:),INTENT(out) :: t_soisno3d, & h2osoi_ice3d, & h2osoi_liq3d, & h2osoi_vol3d, & z3d, & dz3d - real(kind_phys), dimension( IM,-nlevsnow+0:nlevsoil ),INTENT(out) :: zi3d + real(kind_phys), dimension(:,-nlevsnow+0:),INTENT(out) :: zi3d - !LOGICAL, DIMENSION( : ),intent(out) :: lake - !REAL(KIND_PHYS), OPTIONAL, DIMENSION( : ), INTENT(IN) :: lake_depth ! no separate variable for this in CCPP integer :: n,i,j,k,ib,lev,bottom ! indices real(kind_lake),dimension(1:im ) :: bd2d ! bulk density of dry soil material [kg/m^3] From 1816f724b64aae130beb531e9d2106ad11c3c863 Mon Sep 17 00:00:00 2001 From: helin wei Date: Thu, 20 Jun 2024 00:56:06 +0000 Subject: [PATCH 10/16] all changes from test6 to test11 --- physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 3451f807e..67426a319 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -2626,9 +2626,9 @@ subroutine csnow (parameters,isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso ! thermal conductivity of snow do iz = isnow+1, 0 - tksno(iz) = 3.2217e-6*bdsnoi(iz)**2. ! stieglitz(yen,1965) +! tksno(iz) = 3.2217e-6*bdsnoi(iz)**2. ! stieglitz(yen,1965) ! tksno(iz) = 2e-2+2.5e-6*bdsnoi(iz)*bdsnoi(iz) ! anderson, 1976 -! tksno(iz) = 0.35 ! constant + tksno(iz) = 0.35 ! constant ! tksno(iz) = 2.576e-6*bdsnoi(iz)**2. + 0.074 ! verseghy (1991) ! tksno(iz) = 2.22*(bdsnoi(iz)/1000.)**1.88 ! douvill(yen, 1981) enddo From 04074884c04139ecc86d02f0123a0aa2f5a8ccb1 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Thu, 20 Jun 2024 19:52:56 +0000 Subject: [PATCH 11/16] Output updraft value of convective cloud condensate --- physics/CONV/SAMF/samfdeepcnv.f | 5 ++++- physics/CONV/SAMF/samfshalcnv.f | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index 7c2d9acf8..90ff4dfd4 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -3430,7 +3430,10 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & do i = 1, im if (cnvflg(i) .and. rn(i) > 0.) then if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 endif endif enddo diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index f720c4701..41f0124c6 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -2405,7 +2405,10 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & if (cnvflg(i)) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - endif + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + endif endif enddo enddo From b73269fcd3660b5c69cc110f796ef4a4b4e227be Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 25 Jun 2024 18:08:51 +0000 Subject: [PATCH 12/16] update xkinv1 to 0.15 --- physics/PBL/SATMEDMF/satmedmfvdifq.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.F b/physics/PBL/SATMEDMF/satmedmfvdifq.F index 95a1e35e5..c0e43e809 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.F +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.F @@ -275,7 +275,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & parameter(elmfac=1.0,elefac=1.0,cql=100.) parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=1000.) parameter(qlcr=3.5e-5,zstblmax=2500.) - parameter(xkinv1=0.4,xkinv2=0.3) + parameter(xkinv1=0.15,xkinv2=0.3) parameter(h1=0.33333333,hcrinv=250.) parameter(vegflo=0.1,vegfup=1.0,z0lo=0.1,z0up=1.0) parameter(vc0=1.0,zc0=1.0) From 891959c2680b91ba745e4edbd7a7c98e17101d12 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 25 Jun 2024 21:03:28 +0000 Subject: [PATCH 13/16] add check if progsigma is true --- physics/CONV/SAMF/samfdeepcnv.f | 10 +++++++--- physics/CONV/SAMF/samfshalcnv.f | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index 90ff4dfd4..be43795b4 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -3431,9 +3431,13 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & if (cnvflg(i) .and. rn(i) > 0.) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 + if(progsigma)then + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + else + cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + endif endif endif enddo diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index 41f0124c6..fa9d77a53 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -2405,9 +2405,13 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & if (cnvflg(i)) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 + if(progsigma)then + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + else + cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + endif endif endif enddo From 3a361b2440e73f8c734d05a2ddcae2d69d7abc85 Mon Sep 17 00:00:00 2001 From: helin wei Date: Tue, 2 Jul 2024 16:32:04 +0000 Subject: [PATCH 14/16] update noahmp table for hr4 --- .../SFC_Models/Land/Noahmp/noahmptable.tbl | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmptable.tbl b/physics/SFC_Models/Land/Noahmp/noahmptable.tbl index 3ffd5b532..44531919e 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmptable.tbl +++ b/physics/SFC_Models/Land/Noahmp/noahmptable.tbl @@ -217,7 +217,7 @@ !--------------------------------------------------------------------------------------------------------------------------------------------------------------------- ch2op = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, dleaf = 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, - z0mvt = 1.09, 1.10, 0.85, 0.80, 0.80, 0.20, 0.06, 0.60, 0.50, 0.12, 0.30, 0.15, 1.00, 0.14, 0.00, 0.00, 0.00, 0.30, 0.20, 0.03, + z0mvt = 1.00, 1.50, 0.75, 0.90, 0.85, 0.20, 0.10, 0.90, 0.60, 0.20, 0.30, 0.25, 1.00, 0.25, 0.00, 0.015, 0.00, 0.30, 0.10, 0.05, hvt = 20.0, 20.0, 18.0, 16.0, 16.0, 1.10, 1.10, 13.0, 10.0, 1.00, 5.00, 2.00, 15.0, 1.50, 0.00, 0.00, 0.00, 4.00, 2.00, 0.50, hvb = 8.50, 8.00, 7.00, 11.5, 10.0, 0.10, 0.10, 0.10, 0.10, 0.05, 0.10, 0.10, 1.00, 0.10, 0.00, 0.00, 0.00, 0.30, 0.20, 0.10, z0mhvt= 0.0545, 0.055, 0.047, 0.050, 0.050, 0.182, 0.0545, 0.046, 0.050, 0.120, 0.060, 0.075, 0.067, 0.093, 0.000, 0.000, 0.000, 0.075, 0.100, 0.060, @@ -226,32 +226,34 @@ !mfsno = 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, ! c. he 12/17/2020: optimized mfsno values dependent on land type based on evaluation with snotel swe and modis scf, surface albedo mfsno = 1.00, 1.00, 1.00, 1.00, 1.00, 2.00, 2.00, 2.00, 2.00, 2.00, 3.00, 3.00, 4.00, 4.00, 2.50, 3.00, 3.00, 3.50, 3.50, 3.50, +!mfsno = 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, ! c. he 12/17/2020: optimized snow cover factor (m) in scf formulation to replace original constant 2.5*z0,z0=0.002m, based on evaluation with snotel swe and modis scf, surface albedo ! scffac = 0.008, 0.008, 0.008, 0.008, 0.008, 0.016, 0.016, 0.020, 0.020, 0.020, 0.020, 0.014, 0.042, 0.026, 0.030, 0.016, 0.030, 0.030, 0.030, 0.030, - scffac = 0.005, 0.005, 0.005, 0.005, 0.005, 0.008, 0.008, 0.010, 0.010, 0.010, 0.010, 0.007, 0.021, 0.013, 0.015, 0.008, 0.015, 0.015, 0.015, 0.015, + scffac = 0.005, 0.005, 0.005, 0.005, 0.005, 0.008, 0.008, 0.010, 0.010, 0.010, 0.010, 0.007, 0.021, 0.013, 0.015, 0.008, 0.015, 0.015, 0.015, 0.015, +! scffac = 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, cbiom = 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, ! row 1: vis ! row 2: near ir rhol_vis=0.07, 0.10, 0.07, 0.10, 0.10, 0.07, 0.07, 0.07, 0.10, 0.11, 0.105, 0.11, 0.00, 0.11, 0.00, 0.00, 0.00, 0.10, 0.10, 0.10, - rhol_nir=0.35, 0.45, 0.35, 0.45, 0.45, 0.35, 0.35, 0.35, 0.45, 0.58, 0.515, 0.58, 0.00, 0.58, 0.00, 0.00, 0.00, 0.45, 0.45, 0.45, + rhol_nir=0.35, 0.45, 0.35, 0.45, 0.45, 0.35, 0.35, 0.35, 0.45, 0.35, 0.515, 0.35, 0.00, 0.35, 0.00, 0.00, 0.00, 0.45, 0.45, 0.45, ! row 1: vis ! row 2: near ir - rhos_vis=0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.36, 0.26, 0.36, 0.00, 0.36, 0.00, 0.00, 0.00, 0.16, 0.16, 0.16, - rhos_nir=0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.58, 0.485, 0.58, 0.00, 0.58, 0.00, 0.00, 0.00, 0.39, 0.39, 0.39, + rhos_vis=0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.31, 0.26, 0.31, 0.00, 0.31, 0.00, 0.00, 0.00, 0.16, 0.16, 0.16, + rhos_nir=0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.53, 0.485, 0.53, 0.00, 0.53, 0.00, 0.00, 0.00, 0.39, 0.39, 0.39, ! row 1: vis ! row 2: near ir - taul_vis=0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.07, 0.06, 0.07, 0.00, 0.07, 0.00, 0.00, 0.00, 0.05, 0.05, 0.05, - taul_nir=0.10, 0.25, 0.10, 0.25, 0.25, 0.10, 0.10, 0.10, 0.25, 0.25, 0.25, 0.25, 0.00, 0.25, 0.00, 0.00, 0.00, 0.25, 0.25, 0.25, + taul_vis=0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.05, 0.00, 0.05, 0.00, 0.00, 0.00, 0.05, 0.05, 0.05, + taul_nir=0.10, 0.25, 0.10, 0.25, 0.25, 0.10, 0.10, 0.10, 0.25, 0.34, 0.25, 0.34, 0.00, 0.34, 0.00, 0.00, 0.00, 0.25, 0.25, 0.25, ! row 1: vis ! row 2: near ir - taus_vis=0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.220, 0.1105, 0.220, 0.000, 0.220, 0.000, 0.000, 0.000, 0.001, 0.001, 0.001, - taus_nir=0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.380, 0.1905, 0.380, 0.000, 0.380, 0.000, 0.000, 0.000, 0.001, 0.001, 0.001, + taus_vis=0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.120, 0.1105, 0.120, 0.000, 0.120, 0.000, 0.000, 0.000, 0.001, 0.001, 0.001, + taus_nir=0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.250, 0.1905, 0.250, 0.000, 0.250, 0.000, 0.000, 0.000, 0.001, 0.001, 0.001, - xl = 0.010, 0.010, 0.010, 0.250, 0.250, 0.010, 0.010, 0.010, 0.010, -0.30, -0.025, -0.30, 0.000, -0.30, 0.000, 0.000, 0.000, 0.250, 0.250, 0.250, + xl = 0.010, 0.10, 0.010, 0.250, 0.250, 0.010, 0.010, 0.010, 0.010, -0.30, -0.025, -0.30, 0.000, -0.30, 0.000, 0.000, 0.000, 0.250, 0.250, 0.250, ! make cwpvt vegetation dependent according to j. goudriaan, crop micrometeorology: a simulation study (simulation monographs), 1977). c. he, 12/17/2020 ! cwpvt = 0.18, 0.67, 0.18, 0.67, 0.29, 1.0, 2.0, 1.3, 1.0, 5.0, 1.17, 1.67, 1.67, 1.67, 0.18, 0.18, 0.18, 0.67, 1.0, 0.18, cwpvt = 0.09, 0.335, 0.09, 0.335, 0.145, 0.5, 1.0, 0.65, 0.5, 2.5, 0.585, 0.835, 0.835, 0.835, 0.09, 0.09, 0.09, 0.335, 0.5, 0.09, @@ -335,10 +337,10 @@ !-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 soil color index for soil albedo !-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - albsat_vis = 0.25, 0.23, 0.21, 0.20, 0.19, 0.18, 0.17, 0.16, 0.15, 0.14, 0.13, 0.12, 0.11, 0.10, 0.09, 0.08, 0.07, 0.06, 0.05, 0.04 ! saturated soil albedos - albsat_nir = 0.50, 0.46, 0.42, 0.40, 0.38, 0.36, 0.34, 0.32, 0.30, 0.28, 0.26, 0.24, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.08 ! saturated soil albedos - albdry_vis = 0.36, 0.34, 0.32, 0.31, 0.30, 0.29, 0.28, 0.27, 0.26, 0.25, 0.24, 0.23, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.08 ! dry soil albedos - albdry_nir = 0.61, 0.57, 0.53, 0.51, 0.49, 0.48, 0.45, 0.43, 0.41, 0.39, 0.37, 0.35, 0.33, 0.31, 0.29, 0.27, 0.25, 0.23, 0.21, 0.16 ! dry soil albedos + albsat_vis = 0.21, 0.20, 0.18, 0.17, 0.16, 0.15, 0.14, 0.13, 0.13, 0.12, 0.11, 0.10, 0.10, 0.09, 0.08, 0.08, 0.08, 0.07, 0.07, 0.06 ! saturated soil albedos + albsat_nir = 0.42, 0.40, 0.36, 0.34, 0.32, 0.30, 0.28, 0.26, 0.26, 0.24, 0.22, 0.20, 0.20, 0.18, 0.16, 0.16, 0.16, 0.14, 0.14, 0.13 ! saturated soil albedos + albdry_vis = 0.31, 0.30, 0.28, 0.27, 0.26, 0.24, 0.23, 0.22, 0.22, 0.22, 0.20, 0.19, 0.20, 0.18, 0.16, 0.16, 0.16, 0.14, 0.14, 0.13 ! dry soil albedos + albdry_nir = 0.52, 0.50, 0.46, 0.44, 0.42, 0.40, 0.38, 0.37, 0.36, 0.34, 0.32, 0.30, 0.30, 0.28, 0.27, 0.27, 0.27, 0.26, 0.25, 0.25 ! dry soil albedos albice = 0.80, 0.55 ! albedo land ice: 1=vis, 2=nir alblak = 0.60, 0.40 ! albedo frozen lakes: 1=vis, 2=nir omegas = 0.8 , 0.4 ! two-stream parameter omega for snow @@ -397,7 +399,7 @@ class_sno_age = 3600.0 ! snow aging e-folding time (s) in class albedo scheme class_alb_new = 0.84 ! fresh snow albedo in class scheme psiwlt = -150.0 !metric potential for wilting point (m) - z0soil = 0.002 ! bare-soil roughness length (m) (i.e., under the canopy) + z0soil = 0.015 ! bare-soil roughness length (m) (i.e., under the canopy) z0lake = 0.01 ! lake surface roughness length (m) / From 1e9b0dd6c9c9da577349e02c1bb6fc912d29ceba Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 16 Jul 2024 16:20:14 +0000 Subject: [PATCH 15/16] address seg fault if progsigma=F --- physics/CONV/SAMF/samfdeepcnv.f | 33 +++++++++++++++----------- physics/CONV/SAMF/samfshalcnv.f | 42 +++++++++++++++++---------------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index be43795b4..3ad067657 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -215,7 +215,8 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & ! ! parameters for prognostic sigma closure real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), - & omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im),qadv(im,km) + & omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im),qadv(im,km), + & sigmaoutx(im) real(kind=kind_phys) gravinv,invdelt,sigmind,sigminm,sigmins parameter(sigmind=0.01,sigmins=0.03,sigminm=0.01) logical flag_shallow, flag_mid @@ -3423,24 +3424,28 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & endif enddo c -c convective cloud water +! + if(progsigma)then + do i = 1, im + sigmaoutx(i)=max(sigmaout(i,1),0.0) + sigmaoutx(i)=min(sigmaoutx(i),1.0) + enddo + endif c !> - Calculate convective cloud water. do k = 1, km - do i = 1, im - if (cnvflg(i) .and. rn(i) > 0.) then - if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - if(progsigma)then - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 - else - cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + do i = 1, im + if (cnvflg(i) .and. rn(i) > 0.) then + if (k >= kbcon(i) .and. k < ktcon(i)) then + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + if(progsigma)then + cnvw(i,k) = cnvw(i,k) * sigmaoutx(i) + else + cnvw(i,k) = cnvw(i,k) * sigmagfm(i) + endif endif endif - endif - enddo + enddo enddo c c convective cloud cover diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index fa9d77a53..ce783ea15 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -162,7 +162,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & ! parameters for prognostic sigma closure real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), & omegac(im),zeta(im,km),dbyo1(im,km), - & sigmab(im),qadv(im,km) + & sigmab(im),qadv(im,km),sigmaoutx(im) real(kind=kind_phys) gravinv,dxcrtas,invdelt,sigmind,sigmins, & sigminm logical flag_shallow,flag_mid @@ -2397,27 +2397,29 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & endif enddo c -c convective cloud water -c -!> - Calculate shallow convective cloud water. + if(progsigma)then + do i = 1, im + sigmaoutx(i)=max(sigmaout(i,1),0.0) + sigmaoutx(i)=min(sigmaoutx(i),1.0) + enddo + endif + +c convective cloud water do k = 1, km - do i = 1, im - if (cnvflg(i)) then - if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - if(progsigma)then - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 - else - cnvw(i,k)=cnvw(i,k)*sigmagfm(i) - endif - endif - endif - enddo + do i = 1, im + if (cnvflg(i)) then + if (k >= kbcon(i) .and. k < ktcon(i)) then + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + if (progsigma) then + cnvw(i,k) = cnvw(i,k) * sigmaoutx(i) + else + cnvw(i,k) = cnvw(i,k) * sigmagfm(i) + endif + endif + endif + enddo enddo - -c +c c convective cloud cover c !> - Calculate convective cloud cover, which is used when pdf-based cloud fraction is used (i.e., pdfcld=.true.). From 35b15e3c499d6fa3ca742fa3f662286b2dd94990 Mon Sep 17 00:00:00 2001 From: helin wei Date: Tue, 16 Jul 2024 17:31:40 +0000 Subject: [PATCH 16/16] remove unnecessary comments for the snow temperature initialization --- .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 index c5e9c8dd9..08d1d0b49 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 @@ -594,22 +594,8 @@ subroutine GFS_phys_time_vary_init ( isnow = nint(snowxy(ix))+1 ! snowxy <=0.0, dzsno >= 0.0 ! using stc and tgxy to linearly interpolate the snow temp for each layer -!Calculate the total thickness -! total_thickness = sum(dzsno) -! Calculate the temperature difference -! temp_diff=tgxy(ix)-stc(ix,1) -! Calculate the mid-points and interpolate temperatures for each layer -! accumulated_thickness = 0.0 -! do is = isnow, 0 -! accumulated_thickness = accumulated_thickness + dzsno(is) -! mid_points(is) = accumulated_thickness - dzsno(is) / 2.0 -! layer_temp = tgxy(ix) + (mid_points(is) / total_thickness) * temp_diff -! tsnoxy(ix,is) = layer_temp -! end do do is = isnow,0 -! tsnoxy(ix,is) = tgxy(ix) -! tsnoxy(ix,is) = tgxy(ix) + (( sum(dzsno(isnow:is)) -0.5*dzsno(is) )/snd)*(tgxy(ix)-stc(ix,1)) tsnoxy(ix,is) = tgxy(ix) + (( sum(dzsno(isnow:is)) -0.5*dzsno(is) )/snd)*(stc(ix,1)-tgxy(ix)) snliqxy(ix,is) = zero snicexy(ix,is) = one * dzsno(is) * weasd(ix)/snd