From 402114344be189635624965eb967579baa3ed912 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Tue, 21 Dec 2021 00:54:36 +0000 Subject: [PATCH 01/24] HRRR-like radar-derived temperature tendencies --- .gitmodules | 4 +- ccpp/data/GFS_typedefs.F90 | 97 ++++++++++++++++++++++++++++++--- ccpp/data/GFS_typedefs.meta | 39 +++++++++++++ ccpp/driver/GFS_diagnostics.F90 | 21 ++++++- ccpp/driver/GFS_restart.F90 | 25 ++++++++- ccpp/physics | 2 +- 6 files changed, 176 insertions(+), 12 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6bb663df1..a361820cf 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/SamuelTrahanNOAA/ccpp-physics + branch = feature/gsl-develop-20211203-radar-tten [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 280f9aa76..977e8c9fb 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -802,6 +802,11 @@ module GFS_typedefs real(kind=kind_phys) :: tcr real(kind=kind_phys) :: tcrf ! + integer :: num_dfi_radar !< number of timespans with radar-prescribed temperature tendencies + real (kind=kind_phys) :: fh_dfi_radar(5) !< begin+end of timespans to receive radar-prescribed temperature tendencies + real (kind=kind_phys) :: radar_tten_limits(2) !< radar_tten values outside this range (min,max) are discarded + integer :: ix_dfi_radar(4) = -1 !< Index within dfi_radar_tten of each timespan (-1 means "none") + ! logical :: effr_in !< eg to turn on ffective radii for MG logical :: microp_uniform logical :: do_cldliq @@ -1197,6 +1202,7 @@ module GFS_typedefs integer :: index_of_process_conv_trans !< tracer changes caused by convective transport integer :: index_of_process_physics !< tracer changes caused by physics schemes integer :: index_of_process_non_physics !< tracer changes caused by everything except physics schemes + integer :: index_of_process_dfi_radar !< tracer changes caused by radar mp temperature tendency forcing integer :: index_of_process_photochem !< all changes to ozone logical, pointer :: is_photochem(:) => null()!< flags for which processes should be summed as photochemical @@ -1454,6 +1460,9 @@ module GFS_typedefs real (kind=kind_phys), pointer :: phy_myj_a1t(:) => null() ! real (kind=kind_phys), pointer :: phy_myj_a1q(:) => null() ! + !--- DFI Radar + real (kind=kind_phys), pointer :: dfi_radar_tten(:,:,:) => null() ! + contains procedure :: create => tbd_create !< allocate array data end type GFS_tbd_type @@ -3207,7 +3216,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & logical :: mg_do_hail = .false. !< set .true. to turn on prognostic hail (with fprcp=2) logical :: mg_do_ice_gmao = .false. !< set .true. to turn on gmao ice formulation logical :: mg_do_liq_liu = .true. !< set .true. to turn on liu liquid treatment - + real(kind=kind_phys) :: fh_dfi_radar(5) = -2e10 !< begin&end of four timespans over which radar_tten is applied !--- Thompson microphysical parameters logical :: ltaerosol = .false. !< flag for aerosol version @@ -3544,6 +3553,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & integer, parameter :: max_scav_factors = 25 character(len=40) :: fscav_aero(max_scav_factors) + real(kind=kind_phys), parameter :: limit_unspecified = 1e12 + real(kind=kind_phys) :: radar_tten_limits(2) = (/ limit_unspecified, limit_unspecified /) + integer :: itime + !--- END NAMELIST VARIABLES NAMELIST /gfs_physics_nml/ & @@ -3664,7 +3677,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & max_lon, max_lat, min_lon, min_lat, rhcmax, huge, & phys_version, & !--- aerosol scavenging factors ('name:value' string array) - fscav_aero + fscav_aero, & + !--- (DFI) time ranges with radar-prescribed microphysics tendencies + fh_dfi_radar, radar_tten_limits !--- other parameters integer :: nctp = 0 !< number of cloud types in CS scheme @@ -3738,6 +3753,49 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%flag_for_scnv_generic_tend = .true. Model%flag_for_dcnv_generic_tend = .true. + Model%fh_dfi_radar = fh_dfi_radar + Model%num_dfi_radar = 0 + + do i=1,4 + if(fh_dfi_radar(i)>-1e10 .and. fh_dfi_radar(i+1)>-1e10) then + Model%num_dfi_radar = Model%num_dfi_radar+1 + Model%ix_dfi_radar(i) = Model%num_dfi_radar + else + Model%ix_dfi_radar(i) = -1 + endif + enddo + + if(Model%num_dfi_radar>0) then + if(radar_tten_limits(1)==limit_unspecified) then + if(radar_tten_limits(2)==limit_unspecified) then + radar_tten_limits(1) = -19 + radar_tten_limits(2) = 19 + if(Model%me==Model%master) then + write(0,*) 'Warning: using internal defaults for radar_tten_limits. If the oceans boil, try different values.' + write(0,'(A,F12.4,A)') 'radar_tten_limits(1) = ',radar_tten_limits(1),' <-- lower limit' + write(0,'(A,F12.4,A)') 'radar_tten_limits(2) = ',radar_tten_limits(2),' <-- upper limit' + endif + else + radar_tten_limits(1) = -abs(radar_tten_limits(2)) + radar_tten_limits(2) = abs(radar_tten_limits(2)) + endif + else if(radar_tten_limits(2)==limit_unspecified) then + radar_tten_limits(1) = -abs(radar_tten_limits(1)) + radar_tten_limits(2) = abs(radar_tten_limits(1)) + else if(radar_tten_limits(1)>radar_tten_limits(2)) then + if(Model%me==Model%master) then + write(0,*) 'Error: radar_tten_limits lower limit is higher than upper!' + write(0,'(A,F12.4,A)') 'radar_tten_limits(1) = ',radar_tten_limits(1),' <-- lower limit' + write(0,'(A,F12.4,A)') 'radar_tten_limits(2) = ',radar_tten_limits(2),' <-- upper limit' + write(0,*) "If you do not want me to apply the prescribed tendencies, just say so! Remove fh_dfi_radar from your namelist." + stop + endif + else + !o! Rejoice !o! Radar_tten_limits had lower and upper bounds. + endif + Model%radar_tten_limits = radar_tten_limits + endif + if(gwd_opt==1) then if(me==master) & write(0,*) 'FLAG: gwd_opt==1 so gwd not generic' @@ -4506,17 +4564,18 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%index_of_process_rayleigh_damping = 12 Model%index_of_process_nonorographic_gwd = 13 Model%index_of_process_conv_trans = 14 + Model%index_of_process_dfi_radar = 15 ! Number of processes to sum (last index of prior set) - Model%nprocess_summed = 14 + Model%nprocess_summed = Model%index_of_process_dfi_radar ! Sums of other processes, which must be after nprocess_summed: - Model%index_of_process_physics = 15 - Model%index_of_process_non_physics = 16 - Model%index_of_process_photochem = 17 + Model%index_of_process_physics = Model%nprocess_summed+1 + Model%index_of_process_non_physics = Model%nprocess_summed+2 + Model%index_of_process_photochem = Model%nprocess_summed+3 ! Total number of processes (last index of prior set) - Model%nprocess = 17 + Model%nprocess = Model%index_of_process_photochem ! List which processes should be summed as photochemical: allocate(Model%is_photochem(Model%nprocess)) @@ -4631,6 +4690,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & call label_dtend_cause(Model,Model%index_of_process_ozmix,'o3mix','tendency due to ozone mixing ratio') call label_dtend_cause(Model,Model%index_of_process_temp,'temp','tendency due to temperature') call label_dtend_cause(Model,Model%index_of_process_overhead_ozone,'o3column','tendency due to overhead ozone column') + call label_dtend_cause(Model,Model%index_of_process_dfi_radar,'dfi_radar','tendency due to dfi radar mp temperature forcing') call label_dtend_cause(Model,Model%index_of_process_photochem,'photochem','tendency due to photochemical processes') call label_dtend_cause(Model,Model%index_of_process_physics,'phys','tendency due to physics') call label_dtend_cause(Model,Model%index_of_process_non_physics,'nophys','tendency due to non-physics processes', & @@ -4648,6 +4708,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_dcnv,have_dcnv) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_scnv,have_scnv) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_mp,have_mp) + call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_dfi_radar,have_mp .and. Model%num_dfi_radar>0) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_orographic_gwd) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_rayleigh_damping,have_rdamp) call fill_dtidx(Model,dtend_select,Model%index_of_temperature,Model%index_of_process_nonorographic_gwd) @@ -5402,6 +5463,9 @@ subroutine control_print(Model) !--- interface variables class(GFS_control_type) :: Model +!--- local variables + integer :: i + if (Model%me == Model%master) then print *, ' ' print *, 'basic control parameters' @@ -5569,6 +5633,17 @@ subroutine control_print(Model) print *, ' icloud : ', Model%icloud print *, ' ' endif + if (Model%num_dfi_radar>0) then + print *, ' num_dfi_radar : ', Model%num_dfi_radar + do i = 1, 5 +8888 format(' fh_dfi_radar(',I0,') :',F12.4) + if(Model%fh_dfi_radar(i)>-1e10) then + print 8888,i,Model%fh_dfi_radar(i) + endif + enddo +9999 format(' radar_tten_limits: ', F12.4, ' ... ',F12.4) + print 9999,Model%radar_tten_limits(1),Model%radar_tten_limits(2) + endif print *, 'land/surface model parameters' print *, ' lsm : ', Model%lsm print *, ' lsoil : ', Model%lsoil @@ -5948,6 +6023,14 @@ subroutine tbd_create (Tbd, IM, Model) Tbd%icsdlw = zero endif +!--- DFI radar forcing + nullify(Tbd%dfi_radar_tten) + if(Model%num_dfi_radar>0) then + allocate(Tbd%dfi_radar_tten(IM,Model%levs,Model%num_dfi_radar)) + Tbd%dfi_radar_tten = -20.0 + Tbd%dfi_radar_tten(:,1,:) = 0.0 + endif + !--- ozone and stratosphere h2o needs allocate (Tbd%ozpl (IM,levozp,oz_coeff)) allocate (Tbd%h2opl (IM,levh2o,h2o_coeff)) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index f95931c1b..6851d7726 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -3381,6 +3381,12 @@ dimensions = () type = real kind = kind_phys +[num_dfi_radar] + standard_name = num_dfi_radar + long_name = number of time ranges with dfi radar tendencies + units = count + dimensions = () + type = integer [effr_in] standard_name = flag_for_cloud_effective_radii long_name = flag for cloud effective radii calculations in GFDL microphysics @@ -3459,6 +3465,26 @@ units = flag dimensions = () type = logical +[radar_tten_limits] + standard_name = allowed_bounds_of_radar_prescribed_tendencies + long_name = allowed bounds of prescribed microphysics temperature tendencies + units = K + dimensions = (2) + type = real + kind = kind_phys +[fh_dfi_radar] + standard_name = times_at_which_dfi_radar_tten_is_available + long_name = times at which dfi_radar_tten is available + units = h + dimensions = (5) + type = real + kind = kind_phys +[ix_dfi_radar] + standard_name = time_indices_in_dfi_radar_tten + long_name = time indices in dfi radar tten + units = index + dimensions = (4) + type = integer [shoc_parm(1)] standard_name = pressure_threshold_for_increased_tke_dissipation long_name = pressure below which extra TKE diss. is applied in SHOC @@ -4720,6 +4746,12 @@ units = index dimensions = () type = integer +[index_of_process_dfi_radar] + standard_name = index_of_radar_mp_temperature_forcing_in_cumulative_change_index + long_name = index of radar mp temperature forcing in second dimension of array cumulative change index + units = index + dimensions = () + type = integer [index_of_process_physics] standard_name = index_of_all_physics_process_in_cumulative_change_index long_name = index of all physics transport process in second dimension of array cumulative change index @@ -6242,6 +6274,13 @@ type = real kind = kind_phys active = (flag_for_mellor_yamada_janjic_surface_layer_scheme .or. flag_for_mellor_yamada_janjic_pbl_scheme) +[dfi_radar_tten] + standard_name = dfi_radar_tten + long_name = prescribed microphysics temperature tendency from radar data + units = K s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension,num_dfi_radar) + type = real + kind = kind_phys ######################################################################## [ccpp-table-properties] diff --git a/ccpp/driver/GFS_diagnostics.F90 b/ccpp/driver/GFS_diagnostics.F90 index 8d9e67cdb..725766c8e 100644 --- a/ccpp/driver/GFS_diagnostics.F90 +++ b/ccpp/driver/GFS_diagnostics.F90 @@ -138,7 +138,7 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop type(GFS_init_type), intent(in) :: Init_parm !--- local variables - integer :: idt, idx, num, nb, nblks, NFXR, idtend, ichem, itrac, iprocess + integer :: idt, idx, num, nb, nblks, NFXR, idtend, ichem, itrac, iprocess, i character(len=2) :: xtra real(kind=kind_phys), parameter :: cn_one = 1._kind_phys real(kind=kind_phys), parameter :: cn_100 = 100._kind_phys @@ -3476,6 +3476,25 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop enddo end if thompson_extended_diagnostics + do i=1,Model%num_dfi_radar + idx = idx + 1 + ExtDiag(idx)%axes = 3 + if(i>1) then + write(ExtDiag(idx)%name,'(A,I0)') 'radar_tten_',i + else + ExtDiag(idx)%name = 'radar_tten' + endif + write(ExtDiag(idx)%desc,'(A,I0,A,I0)') 'temperature tendency due to dfi radar tendencies ',i,' of ',Model%num_dfi_radar + ExtDiag(idx)%unit = 'K s-1' + ExtDiag(idx)%mod_name = 'gfs_phys' + ExtDiag(idx)%time_avg = .FALSE. + + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var3 => Tbd(nb)%dfi_radar_tten(:,:,i) + enddo + enddo + !! Cloud effective radii from Microphysics !if (Model%imp_physics == Model%imp_physics_thompson .or. Model%imp_physics == Model%imp_physics_wsm6 .or. Model%imp_physics == Model%imp_physics_fer_hires) then ! idx = idx + 1 diff --git a/ccpp/driver/GFS_restart.F90 b/ccpp/driver/GFS_restart.F90 index e4c4061f1..d975848b9 100644 --- a/ccpp/driver/GFS_restart.F90 +++ b/ccpp/driver/GFS_restart.F90 @@ -60,7 +60,7 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & !--- local variables integer :: idx, ndiag_rst - integer :: ndiag_idx(20) + integer :: ndiag_idx(20), itime integer :: nblks, num, nb, max_rstrt, offset character(len=2) :: c2 = '' @@ -123,6 +123,9 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & endif Restart%num3d = Model%ntot3d + if (Model%num_dfi_radar>0) then + Restart%num3d = Restart%num3d + Model%num_dfi_radar + endif if(Model%lrefres) then Restart%num3d = Model%ntot3d+1 endif @@ -410,6 +413,26 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & enddo endif + ! DFI Radar + if (Model%num_dfi_radar > 0) then + print *,'have num dfi radar ',Model%num_dfi_radar + do itime=1,4 + if(Model%ix_dfi_radar(itime)>0) then + num = num + 1 + if(itime==1) then + Restart%name3d(num) = 'radar_tten' + else + write(Restart%name3d(num),'("radar_tten_",I0)') itime + endif + print *,'restart ',trim(Restart%name3d(num)) + do nb = 1,nblks + Restart%data(nb,num)%var3p => Tbd(nb)%dfi_radar_tten( & + :,:,Model%ix_dfi_radar(itime)) + enddo + endif + enddo + endif + end subroutine GFS_restart_populate end module GFS_restart diff --git a/ccpp/physics b/ccpp/physics index 84654b79d..f1a00a623 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 84654b79d526d5c2ce8f3851629d46152ee4936c +Subproject commit f1a00a62373d7004b505f85f3dcaa604ba7aabf9 From 663d5277d950d2c3ab75562eccc7d8cbb8ed9569 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 27 Dec 2021 17:59:50 +0000 Subject: [PATCH 02/24] Give a warning when convection is enabled with radar tten --- ccpp/data/GFS_typedefs.F90 | 8 ++++++++ ccpp/physics | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 977e8c9fb..9549bf8f0 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -3794,6 +3794,14 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !o! Rejoice !o! Radar_tten_limits had lower and upper bounds. endif Model%radar_tten_limits = radar_tten_limits + + if(me==master .and. imfdeepcnv>=0) then + if(imfdeepcnv/=3) then + write(0,*) 'Warning: untested configuration in use! Radar-derived convection suppression is only supported for the GF deep scheme. That feature will be inactive, but microphysics tendencies will still be enabled. This combination is untested. Beware!' + else + write(0,*) 'Warning: experimental configuration in use! Radar-derived convection suppression is experimental (GF deep scheme with fh_dfi_radar).' + endif + endif endif if(gwd_opt==1) then diff --git a/ccpp/physics b/ccpp/physics index 914482ab6..aae0d5f28 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 914482ab6424a9458bb21e87becded6b9de108d1 +Subproject commit aae0d5f281f4f9f41fa8287ac326823a9910207f From e3e0b7d1cc286ef11d00e6ca988c939fc22e25cd Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 27 Dec 2021 21:48:19 +0000 Subject: [PATCH 03/24] Point to the correct branch of ccpp-physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index aae0d5f28..914482ab6 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit aae0d5f281f4f9f41fa8287ac326823a9910207f +Subproject commit 914482ab6424a9458bb21e87becded6b9de108d1 From bcb4897a6ddcc77adc7728c1769271f94c4092c9 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 29 Dec 2021 08:53:08 -0700 Subject: [PATCH 04/24] Fix uninitialized variable zmtnblck in ccpp/data/GFS_typedefs.F90 --- ccpp/data/GFS_typedefs.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 3be66033f..50f4a02e9 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1650,8 +1650,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: tdomzr (:) => null() !< dominant accumulated freezing rain type real (kind=kind_phys), pointer :: tdomip (:) => null() !< dominant accumulated sleet type real (kind=kind_phys), pointer :: tdoms (:) => null() !< dominant accumulated snow type - - real (kind=kind_phys), pointer :: zmtnblck(:) => null() ! null() ! Date: Wed, 29 Dec 2021 08:53:32 -0700 Subject: [PATCH 05/24] Fix typo in CCPP standard name for ncnvwind in ccpp/data/GFS_typedefs.meta --- ccpp/data/GFS_typedefs.meta | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index f95931c1b..fa39dd6a1 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -5058,7 +5058,7 @@ dimensions = () type = integer [ncnvwind] - standard_name = index_of_enhancement_to_wind_speed_at_surface_adjacent_layer_due_to_convectionin_in_xy_dimensioned_restart_array + standard_name = index_of_enhancement_to_wind_speed_at_surface_adjacent_layer_due_to_convection_in_xy_dimensioned_restart_array long_name = the index of surface wind enhancement due to convection in phy f2d units = dimensions = () @@ -5900,14 +5900,14 @@ type = real kind = kind_phys active = (index_of_surface_air_pressure_on_previous_timestep_in_xyz_dimensioned_restart_array > 0) -[phy_f2d(:,index_of_enhancement_to_wind_speed_at_surface_adjacent_layer_due_to_convectionin_in_xy_dimensioned_restart_array)] +[phy_f2d(:,index_of_enhancement_to_wind_speed_at_surface_adjacent_layer_due_to_convection_in_xy_dimensioned_restart_array)] standard_name = enhancement_to_wind_speed_at_surface_adjacent_layer_due_to_convection long_name = surface wind enhancement due to convection units = m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (index_of_enhancement_to_wind_speed_at_surface_adjacent_layer_due_to_convectionin_in_xy_dimensioned_restart_array > 0) + active = (index_of_enhancement_to_wind_speed_at_surface_adjacent_layer_due_to_convection_in_xy_dimensioned_restart_array > 0) [phy_f3d(:,:,index_of_air_temperature_two_timesteps_back_in_xyz_dimensioned_restart_array)] standard_name = air_temperature_two_timesteps_back long_name = air temperature two timesteps back From a4ee4de5564061fbe2aeb586365640a994022ce2 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 29 Dec 2021 08:54:50 -0700 Subject: [PATCH 06/24] Add ten 2d variables required for MYNNSFC restart reproducibility to ccpp/driver/GFS_restart.F90 --- ccpp/driver/GFS_restart.F90 | 64 +++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/ccpp/driver/GFS_restart.F90 b/ccpp/driver/GFS_restart.F90 index e4c4061f1..235f3de82 100644 --- a/ccpp/driver/GFS_restart.F90 +++ b/ccpp/driver/GFS_restart.F90 @@ -115,7 +115,7 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & endif ! MYNN SFC if (Model%do_mynnsfclay) then - Restart%num2d = Restart%num2d + 1 + Restart%num2d = Restart%num2d + 13 endif ! Thompson aerosol-aware if (Model%imp_physics == Model%imp_physics_thompson .and. Model%ltaerosol) then @@ -130,7 +130,7 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & if (Model%imfdeepcnv == 3) then Restart%num3d = Restart%num3d + 3 endif - ! MYNN PBL + ! MYNN PBL if (Model%do_mynnedmf) then Restart%num3d = Restart%num3d + 9 endif @@ -305,6 +305,66 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & do nb = 1,nblks Restart%data(nb,num)%var2p => Sfcprop(nb)%uustar(:) enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_hpbl' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Tbd(nb)%hpbl(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_ustm' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%ustm(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_zol' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%zol(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_mol' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%mol(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_flhc' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%flhc(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_flqc' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%flqc(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_chs2' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%chs2(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_cqs2' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%cqs2(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_lh' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%lh(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_hflx' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%hflx(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_evap' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%evap(:) + enddo + num = num + 1 + Restart%name2d(num) = 'mynn_2d_qss' + do nb = 1,nblks + Restart%data(nb,num)%var2p => Sfcprop(nb)%qss(:) + enddo endif ! Thompson aerosol-aware if (Model%imp_physics == Model%imp_physics_thompson .and. Model%ltaerosol) then From 49cb29eefb2677b422567251922938b216572c53 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 29 Dec 2021 08:55:38 -0700 Subject: [PATCH 07/24] Update .gitmodules and submodule pointer for ccpp-physics for code review and testing --- .gitmodules | 6 ++++-- ccpp/physics | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6bb663df1..89ebfccd9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,10 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = main + #url = https://github.com/NCAR/ccpp-physics + #branch = main + url = https://github.com/climbfuji/ccpp-physics + branch = mynnsfc_restart [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index 4865cba04..68e366d34 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 4865cba04432d64f95b58b52428c18e8ef22d863 +Subproject commit 68e366d3471ccfdebf6d6cb63879e503dd117a6d From b1fa8c708b5b0bd964cbce1f237d52a949e36a09 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 29 Dec 2021 21:34:56 +0000 Subject: [PATCH 08/24] Update ccpp/physics to NCAR main --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 914482ab6..c2130005b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 914482ab6424a9458bb21e87becded6b9de108d1 +Subproject commit c2130005b557011deeccbb778eae07092e2f7942 From a4470b43a6ef90a16b9afafbcb88b149267292b8 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 29 Dec 2021 21:46:08 +0000 Subject: [PATCH 09/24] point to feature/radar-tten-ufs-community-20211229 branch of ccpp/physics --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index a361820cf..fa1f1f2f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/SamuelTrahanNOAA/ccpp-physics - branch = feature/gsl-develop-20211203-radar-tten + branch = feature/radar-tten-ufs-community-20211229 [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP From c5c5b434a0799928ee7e8bfdc85faa9ca639cb6b Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Wed, 29 Dec 2021 23:31:32 +0000 Subject: [PATCH 10/24] Remove an unneeded print statement --- ccpp/driver/GFS_restart.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/ccpp/driver/GFS_restart.F90 b/ccpp/driver/GFS_restart.F90 index d975848b9..9258fbf78 100644 --- a/ccpp/driver/GFS_restart.F90 +++ b/ccpp/driver/GFS_restart.F90 @@ -415,7 +415,6 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & ! DFI Radar if (Model%num_dfi_radar > 0) then - print *,'have num dfi radar ',Model%num_dfi_radar do itime=1,4 if(Model%ix_dfi_radar(itime)>0) then num = num + 1 @@ -424,7 +423,6 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & else write(Restart%name3d(num),'("radar_tten_",I0)') itime endif - print *,'restart ',trim(Restart%name3d(num)) do nb = 1,nblks Restart%data(nb,num)%var3p => Tbd(nb)%dfi_radar_tten( & :,:,Model%ix_dfi_radar(itime)) From d4a7589e7ac855cc4902624c76ed45b5b69501c3 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 30 Dec 2021 00:26:08 +0000 Subject: [PATCH 11/24] indicate dfi radar vars are only active if num_dfi_radar>0 --- ccpp/data/GFS_typedefs.meta | 1 + 1 file changed, 1 insertion(+) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 6851d7726..9bbbd5d09 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -6281,6 +6281,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,num_dfi_radar) type = real kind = kind_phys + active = (num_dfi_radar>0) ######################################################################## [ccpp-table-properties] From e9363d4a238cc70528a4094442f9bf7ca229ccc8 Mon Sep 17 00:00:00 2001 From: Denise Worthen Date: Mon, 3 Jan 2022 15:15:31 -0500 Subject: [PATCH 12/24] create initial p8 suites * P8 initial SDFs as copies of FV3_GFS_v16_coupled_nsstNoahmpUGWPv1 and FV3_GFS_v16_nsstNoahmpUGWPv1 --- ccpp/suites/suite_FV3_GFS_v16_coupled_p8.xml | 95 ++++++++++++++++++++ ccpp/suites/suite_FV3_GFS_v16_p8.xml | 28 ++---- 2 files changed, 104 insertions(+), 19 deletions(-) create mode 100644 ccpp/suites/suite_FV3_GFS_v16_coupled_p8.xml diff --git a/ccpp/suites/suite_FV3_GFS_v16_coupled_p8.xml b/ccpp/suites/suite_FV3_GFS_v16_coupled_p8.xml new file mode 100644 index 000000000..423d37f6d --- /dev/null +++ b/ccpp/suites/suite_FV3_GFS_v16_coupled_p8.xml @@ -0,0 +1,95 @@ + + + + + + + fv_sat_adj + + + + + 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 + rrtmg_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_cice + 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 + 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 + gfdl_cloud_microphys + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/ccpp/suites/suite_FV3_GFS_v16_p8.xml b/ccpp/suites/suite_FV3_GFS_v16_p8.xml index ef860e66d..8828f503a 100644 --- a/ccpp/suites/suite_FV3_GFS_v16_p8.xml +++ b/ccpp/suites/suite_FV3_GFS_v16_p8.xml @@ -10,7 +10,7 @@ GFS_time_vary_pre - GFS_rrtmgp_setup + GFS_rrtmg_setup GFS_rad_time_vary GFS_phys_time_vary @@ -18,25 +18,15 @@ GFS_suite_interstitial_rad_reset - GFS_rrtmgp_pre + GFS_rrtmg_pre GFS_radiation_surface - GFS_rrtmgp_gfdlmp_pre - GFS_rrtmgp_cloud_overlap_pre - GFS_cloud_diagnostics - GFS_rrtmgp_sw_pre - rrtmgp_sw_gas_optics - rrtmgp_sw_aerosol_optics - rrtmgp_sw_cloud_optics - rrtmgp_sw_cloud_sampling - rrtmgp_sw_rte - GFS_rrtmgp_sw_post - rrtmgp_lw_pre - rrtmgp_lw_gas_optics - rrtmgp_lw_aerosol_optics - rrtmgp_lw_cloud_optics - rrtmgp_lw_cloud_sampling - rrtmgp_lw_rte - GFS_rrtmgp_lw_post + rrtmg_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post From 9a5e4aafc4a2a0cbfa871feef85980ac1d34853f Mon Sep 17 00:00:00 2001 From: "Shrinivas.Moorthi" Date: Tue, 4 Jan 2022 19:07:08 +0000 Subject: [PATCH 13/24] updating .gitmodules --- .gitmodules | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6bb663df1..2e953b4ec 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/SMoorthi-emc/ccpp-physics + branch = SM_Nov222021 [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index 1f907e44a..baad60acf 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 1f907e44aa47224c22c7d34f19b0f840facd9eb8 +Subproject commit baad60acf203af20574f72da50ca435057a1a163 From 7faffc04a1dddd95fbca628c2296228949598e71 Mon Sep 17 00:00:00 2001 From: "Shrinivas.Moorthi" Date: Tue, 4 Jan 2022 19:08:46 +0000 Subject: [PATCH 14/24] creating a new branch for PR --- atmos_model.F90 | 2 +- io/FV3GFS_io.F90 | 78 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 57 insertions(+), 23 deletions(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index 29133471a..3ccc1a3ab 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -1572,7 +1572,7 @@ subroutine assign_importdata(jdat, rc) type(ESMF_Grid) :: grid type(ESMF_Field) :: dbgField character(19) :: currtimestring - real (kind=GFS_kind_phys), parameter :: z0ice=1.1 ! (in cm) + real (kind=GFS_kind_phys), parameter :: z0ice=1.0 ! (in cm) ! ! real(kind=GFS_kind_phys), parameter :: himax = 8.0 !< maximum ice thickness allowed diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index 3827ccb68..b907c698f 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -1462,7 +1462,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta do nb = 1, Atm_block%nblks do ix = 1, Atm_block%blksz(nb) if (Sfcprop(nb)%landfrac(ix) > zero) then - tem = one / Sfcprop(nb)%landfrac(ix) + tem = one / (Sfcprop(nb)%fice(ix)*(one-Sfcprop(nb)%landfrac(ix))+Sfcprop(nb)%landfrac(ix)) Sfcprop(nb)%snodl(ix) = Sfcprop(nb)%snowd(ix) * tem else Sfcprop(nb)%snodl(ix) = zero @@ -1477,7 +1477,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta do nb = 1, Atm_block%nblks do ix = 1, Atm_block%blksz(nb) if (Sfcprop(nb)%landfrac(ix) > zero) then - tem = one / Sfcprop(nb)%landfrac(ix) + tem = one / (Sfcprop(nb)%fice(ix)*(one-Sfcprop(nb)%landfrac(ix))+Sfcprop(nb)%landfrac(ix)) Sfcprop(nb)%weasdl(ix) = Sfcprop(nb)%weasd(ix) * tem else Sfcprop(nb)%weasdl(ix) = zero @@ -1501,7 +1501,9 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta !$omp parallel do default(shared) private(nb, ix) do nb = 1, Atm_block%nblks do ix = 1, Atm_block%blksz(nb) - Sfcprop(nb)%zorlw(ix) = Sfcprop(nb)%zorl(ix) !--- compute zorlw from existing variables + if (Sfcprop(nb)%landfrac(ix) < one .and. Sfcprop(nb)%fice(ix) < one) then + Sfcprop(nb)%zorlw(ix) = min(Sfcprop(nb)%zorl(ix), 0.317e-2) + endif enddo enddo endif @@ -1521,7 +1523,9 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta !$omp parallel do default(shared) private(nb, ix) do nb = 1, Atm_block%nblks do ix = 1, Atm_block%blksz(nb) - Sfcprop(nb)%zorli(ix) = Sfcprop(nb)%zorl(ix) !--- compute zorli from existing variables + if (Sfcprop(nb)%fice(ix)*(one-Sfcprop(nb)%landfrac(ix)) > zero) then + Sfcprop(nb)%zorli(ix) = one + endif enddo enddo endif @@ -1547,6 +1551,36 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta enddo endif + if (sfc_var2(i,j,47) < -9990.0_r8) then + if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing snodi') +!$omp parallel do default(shared) private(nb, ix, tem) + do nb = 1, Atm_block%nblks + do ix = 1, Atm_block%blksz(nb) + if (Sfcprop(nb)%fice(ix) > zero) then + tem = one / (Sfcprop(nb)%fice(ix)*(one-Sfcprop(nb)%landfrac(ix))+Sfcprop(nb)%landfrac(ix)) + Sfcprop(nb)%snodi(ix) = min(Sfcprop(nb)%snowd(ix) * tem, 3.0) + else + Sfcprop(nb)%snodi(ix) = zero + endif + enddo + enddo + endif + + if (sfc_var2(i,j,48) < -9990.0_r8) then + if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing weasdi') +!$omp parallel do default(shared) private(nb, ix, tem) + do nb = 1, Atm_block%nblks + do ix = 1, Atm_block%blksz(nb) + if (Sfcprop(nb)%fice(ix) > zero) then + tem = one / (Sfcprop(nb)%fice(ix)*(one-Sfcprop(nb)%landfrac(ix))+Sfcprop(nb)%landfrac(ix)) + Sfcprop(nb)%weasdi(ix) = Sfcprop(nb)%weasd(ix)*tem + else + Sfcprop(nb)%weasdi(ix) = zero + endif + enddo + enddo + endif + if (Model%use_cice_alb) then if (sfc_var2(i,j,49) < -9990.0_r8) then !$omp parallel do default(shared) private(nb, ix) @@ -3058,7 +3092,7 @@ subroutine fv_phys_bundle_setup(Diag, axes, phys_bundle, fcst_grid, quilting, nb ! implicit none ! - type(GFS_externaldiag_type),intent(in) :: Diag(:) + type(GFS_externaldiag_type),intent(in) :: Diag(:) integer, intent(in) :: axes(:) type(ESMF_FieldBundle),intent(inout) :: phys_bundle(:) type(ESMF_Grid),intent(inout) :: fcst_grid @@ -3099,7 +3133,7 @@ subroutine fv_phys_bundle_setup(Diag, axes, phys_bundle, fcst_grid, quilting, nb !------------------------------------------------------------ ! allocate(bdl_intplmethod(nbdlphys), outputfile(nbdlphys)) - if(mpp_pe()==mpp_root_pe())print *,'in fv_phys bundle,nbdl=',nbdlphys + if(mpp_pe()==mpp_root_pe()) print *,'in fv_phys bundle,nbdl=',nbdlphys do ibdl = 1, nbdlphys loutputfile = .false. call ESMF_FieldBundleGet(phys_bundle(ibdl), name=physbdl_name,rc=rc) @@ -3178,14 +3212,14 @@ subroutine fv_phys_bundle_setup(Diag, axes, phys_bundle, fcst_grid, quilting, nb allocate(udimList(udimCount)) call ESMF_AttributeGet(fcst_grid, convention="NetCDF", purpose="FV3", & name="vertical_dim_labels", valueList=udimList, rc=rc) -! if(mpp_pe()==mpp_root_pe())print *,'in fv3gfsio, vertical +! if(mpp_pe()==mpp_root_pe()) print *,'in fv3gfsio, vertical ! list=',udimList(1:udimCount),'rc=',rc if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return else - if(mpp_pe()==mpp_root_pe())print *,'in fv_dyn bundle,axis_name_vert=',axis_name_vert + if(mpp_pe()==mpp_root_pe()) print *,'in fv_dyn bundle,axis_name_vert=',axis_name_vert call ESMF_AttributeAdd(fcst_grid, convention="NetCDF", purpose="FV3", & attrList=(/"vertical_dim_labels"/), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return @@ -3207,13 +3241,13 @@ subroutine fv_phys_bundle_setup(Diag, axes, phys_bundle, fcst_grid, quilting, nb direction, edges, Domain, DomainU, axis_data, & num_attributes=num_attributes, attributes=attributes) ! - edgesS='' + edgesS = '' do i = 1,num_axes_phys if(axes(i) == edges) edgesS=axis_name(i) enddo ! Add vertical dimension Attributes to Grid if( id>2 ) then -! if(mpp_pe()==mpp_root_pe())print *,' in dyn add grid, axis_name=', & +! if(mpp_pe()==mpp_root_pe()) print *,' in dyn add grid, axis_name=', & ! trim(axis_name(id)),'axis_data=',axis_data if(trim(edgesS)/='') then call ESMF_AttributeAdd(fcst_grid, convention="NetCDF", purpose="FV3", & @@ -3415,62 +3449,62 @@ subroutine add_field_to_phybundle(var_name,long_name,units,cell_methods, axes,ph ! !*** add field attributes call ESMF_AttributeAdd(field, convention="NetCDF", purpose="FV3", & - attrList=(/"long_name"/), rc=rc) + attrList=(/"long_name"/), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeSet(field, convention="NetCDF", purpose="FV3", & - name='long_name',value=trim(long_name),rc=rc) + name='long_name',value=trim(long_name),rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeAdd(field, convention="NetCDF", purpose="FV3", & - attrList=(/"units"/), rc=rc) + attrList=(/"units"/), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeSet(field, convention="NetCDF", purpose="FV3", & - name='units',value=trim(units),rc=rc) + name='units',value=trim(units),rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeAdd(field, convention="NetCDF", purpose="FV3", & - attrList=(/"missing_value"/), rc=rc) + attrList=(/"missing_value"/), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & 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=missing_value,rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeAdd(field, convention="NetCDF", purpose="FV3", & - attrList=(/"_FillValue"/), rc=rc) + attrList=(/"_FillValue"/), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & 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=missing_value,rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeAdd(field, convention="NetCDF", purpose="FV3", & - attrList=(/"cell_methods"/), rc=rc) + attrList=(/"cell_methods"/), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeSet(field, convention="NetCDF", purpose="FV3", & - name='cell_methods',value=trim(cell_methods),rc=rc) + name='cell_methods',value=trim(cell_methods),rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) ! call ESMF_AttributeAdd(field, convention="NetCDF", purpose="FV3", & - attrList=(/"output_file"/), rc=rc) + attrList=(/"output_file"/), rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) call ESMF_AttributeSet(field, convention="NetCDF", purpose="FV3", & - name='output_file',value=trim(output_file),rc=rc) + name='output_file',value=trim(output_file),rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) From 73d9fd3e3a72cecc320e722ef29f5bd8349eb291 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Tue, 4 Jan 2022 23:51:36 +0000 Subject: [PATCH 15/24] changes requested by reviewers --- ccpp/data/GFS_typedefs.F90 | 46 ++++++++++++++++++++--------- ccpp/data/GFS_typedefs.meta | 58 +++++++++++++++++++++++++++---------- ccpp/driver/GFS_restart.F90 | 24 +++++++++++++-- ccpp/physics | 2 +- 4 files changed, 98 insertions(+), 32 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index f1e3a3168..51ea3a70d 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -48,6 +48,8 @@ module GFS_typedefs integer, parameter :: naux2dmax = 20 !< maximum number of auxiliary 2d arrays in output (for debugging) integer, parameter :: naux3dmax = 20 !< maximum number of auxiliary 3d arrays in output (for debugging) + integer, parameter :: dfi_radar_max_intervals = 4 !< Number of radar-derived temperature tendency and/or convection suppression intervals. Do not change. + !> \section arg_table_GFS_typedefs !! \htmlinclude GFS_typedefs.html !! @@ -803,9 +805,13 @@ module GFS_typedefs real(kind=kind_phys) :: tcrf ! integer :: num_dfi_radar !< number of timespans with radar-prescribed temperature tendencies - real (kind=kind_phys) :: fh_dfi_radar(5) !< begin+end of timespans to receive radar-prescribed temperature tendencies + real (kind=kind_phys) :: fh_dfi_radar(1+dfi_radar_max_intervals) !< begin+end of timespans to receive radar-prescribed temperature tendencies + logical :: do_cap_suppress !< enable convection suppression in GF scheme if fh_dfi_radar is specified real (kind=kind_phys) :: radar_tten_limits(2) !< radar_tten values outside this range (min,max) are discarded - integer :: ix_dfi_radar(4) = -1 !< Index within dfi_radar_tten of each timespan (-1 means "none") + integer :: ix_dfi_radar(dfi_radar_max_intervals) = -1 !< Index within dfi_radar_tten of each timespan (-1 means "none") + integer :: dfi_radar_max_intervals + integer :: dfi_radar_max_intervals_plus_one + ! logical :: effr_in !< eg to turn on ffective radii for MG logical :: microp_uniform @@ -1461,7 +1467,8 @@ module GFS_typedefs real (kind=kind_phys), pointer :: phy_myj_a1q(:) => null() ! !--- DFI Radar - real (kind=kind_phys), pointer :: dfi_radar_tten(:,:,:) => null() ! + real (kind=kind_phys), pointer :: dfi_radar_tten(:,:,:) => null() ! + real (kind=kind_phys), pointer :: cap_suppress(:,:) => null() ! contains procedure :: create => tbd_create !< allocate array data @@ -3216,7 +3223,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & logical :: mg_do_hail = .false. !< set .true. to turn on prognostic hail (with fprcp=2) logical :: mg_do_ice_gmao = .false. !< set .true. to turn on gmao ice formulation logical :: mg_do_liq_liu = .true. !< set .true. to turn on liu liquid treatment - real(kind=kind_phys) :: fh_dfi_radar(5) = -2e10 !< begin&end of four timespans over which radar_tten is applied + real(kind=kind_phys) :: fh_dfi_radar(1+dfi_radar_max_intervals) = -2e10 !< begin&end of four timespans over which radar_tten is applied + logical :: do_cap_suppress = .true. !< set .true. to turn on convection suppression in GF scheme during limited intervals when fh_dfi_radar is enabled !--- Thompson microphysical parameters logical :: ltaerosol = .false. !< flag for aerosol version @@ -3679,7 +3687,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- aerosol scavenging factors ('name:value' string array) fscav_aero, & !--- (DFI) time ranges with radar-prescribed microphysics tendencies - fh_dfi_radar, radar_tten_limits + ! and (maybe) convection suppression + fh_dfi_radar, radar_tten_limits, do_cap_suppress !--- other parameters integer :: nctp = 0 !< number of cloud types in CS scheme @@ -3755,8 +3764,11 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%fh_dfi_radar = fh_dfi_radar Model%num_dfi_radar = 0 + Model%dfi_radar_max_intervals = dfi_radar_max_intervals ! module-level parameter, top of file + Model%dfi_radar_max_intervals_plus_one = dfi_radar_max_intervals + 1 + Model%do_cap_suppress = do_cap_suppress - do i=1,4 + do i=1,dfi_radar_max_intervals if(fh_dfi_radar(i)>-1e10 .and. fh_dfi_radar(i+1)>-1e10) then Model%num_dfi_radar = Model%num_dfi_radar+1 Model%ix_dfi_radar(i) = Model%num_dfi_radar @@ -3795,11 +3807,13 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & endif Model%radar_tten_limits = radar_tten_limits - if(me==master .and. imfdeepcnv>=0) then - if(imfdeepcnv/=3) then - write(0,*) 'Warning: untested configuration in use! Radar-derived convection suppression is only supported for the GF deep scheme. That feature will be inactive, but microphysics tendencies will still be enabled. This combination is untested. Beware!' - else - write(0,*) 'Warning: experimental configuration in use! Radar-derived convection suppression is experimental (GF deep scheme with fh_dfi_radar).' + if(do_cap_suppress) then + if(me==master .and. imfdeepcnv>=0) then + if(imfdeepcnv/=3) then + write(0,*) 'Warning: untested configuration in use! Radar-derived convection suppression is only supported for the GF deep scheme. That feature will be inactive, but microphysics tendencies will still be enabled. This combination is untested. Beware!' + else + write(0,*) 'Warning: experimental configuration in use! Radar-derived convection suppression is experimental (GF deep scheme with fh_dfi_radar).' + endif endif endif endif @@ -5643,7 +5657,8 @@ subroutine control_print(Model) endif if (Model%num_dfi_radar>0) then print *, ' num_dfi_radar : ', Model%num_dfi_radar - do i = 1, 5 + print *, ' do_cap_suppress : ', Model%do_cap_suppress + do i = 1, dfi_radar_max_intervals+1 8888 format(' fh_dfi_radar(',I0,') :',F12.4) if(Model%fh_dfi_radar(i)>-1e10) then print 8888,i,Model%fh_dfi_radar(i) @@ -6033,10 +6048,15 @@ subroutine tbd_create (Tbd, IM, Model) !--- DFI radar forcing nullify(Tbd%dfi_radar_tten) + nullify(Tbd%cap_suppress) if(Model%num_dfi_radar>0) then allocate(Tbd%dfi_radar_tten(IM,Model%levs,Model%num_dfi_radar)) Tbd%dfi_radar_tten = -20.0 - Tbd%dfi_radar_tten(:,1,:) = 0.0 + Tbd%dfi_radar_tten(:,1,:) = zero + if(Model%do_cap_suppress) then + allocate(Tbd%cap_suppress(IM,Model%num_dfi_radar)) + Tbd%cap_suppress(:,:) = zero + endif endif !--- ozone and stratosphere h2o needs diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 9bbbd5d09..247ccc41f 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -3382,8 +3382,20 @@ type = real kind = kind_phys [num_dfi_radar] - standard_name = num_dfi_radar - long_name = number of time ranges with dfi radar tendencies + standard_name = number_of_radar_derived_temperature_or_convection_suppression_intervals + long_name = number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression + units = count + dimensions = () + type = integer +[dfi_radar_max_intervals] + standard_name = maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals + long_name = maximum allowed number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression + units = count + dimensions = () + type = integer +[dfi_radar_max_intervals_plus_one] + standard_name = maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals_plus_one + long_name = one more than the maximum allowed number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression units = count dimensions = () type = integer @@ -3468,22 +3480,28 @@ [radar_tten_limits] standard_name = allowed_bounds_of_radar_prescribed_tendencies long_name = allowed bounds of prescribed microphysics temperature tendencies - units = K + units = K s-1 dimensions = (2) type = real kind = kind_phys +[do_cap_suppress] + standard_name = flag_for_radar_derived_convection_suppression + long_name = flag for radar-derived convection suppression + units = flag + dimensions = () + type = logical [fh_dfi_radar] - standard_name = times_at_which_dfi_radar_tten_is_available - long_name = times at which dfi_radar_tten is available + standard_name = forecast_lead_times_bounding_radar_derived_temperature_or_convection_suppression_intervals + long_name = forecast lead times bounding radar derived temperature or convection suppression intervals units = h - dimensions = (5) + dimensions = (maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals_plus_one) type = real kind = kind_phys [ix_dfi_radar] - standard_name = time_indices_in_dfi_radar_tten - long_name = time indices in dfi radar tten + standard_name = indices_with_radar_derived_temperature_or_convection_suppression_data + long_name = indices with radar derived temperature or convection suppression data units = index - dimensions = (4) + dimensions = (maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals) type = integer [shoc_parm(1)] standard_name = pressure_threshold_for_increased_tke_dissipation @@ -4747,8 +4765,8 @@ dimensions = () type = integer [index_of_process_dfi_radar] - standard_name = index_of_radar_mp_temperature_forcing_in_cumulative_change_index - long_name = index of radar mp temperature forcing in second dimension of array cumulative change index + standard_name = index_of_radar_derived_microphysics_temperature_forcing_in_cumulative_change_index + long_name = index of radar-derived microphysics temperature forcing in second dimension of array cumulative change index units = index dimensions = () type = integer @@ -6275,13 +6293,21 @@ kind = kind_phys active = (flag_for_mellor_yamada_janjic_surface_layer_scheme .or. flag_for_mellor_yamada_janjic_pbl_scheme) [dfi_radar_tten] - standard_name = dfi_radar_tten - long_name = prescribed microphysics temperature tendency from radar data - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension,num_dfi_radar) + standard_name = radar_derived_microphysics_temperature_tendency + long_name = radar-derived microphysics temperature tendency + units = unitless + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_radar_derived_temperature_or_convection_suppression_intervals) + type = real + kind = kind_phys + active = (number_of_radar_derived_temperature_or_convection_suppression_intervals>0) +[cap_suppress] + standard_name = radar_derived_convection_suppression + long_name = radar-derived convection suppression + units = unitless + dimensions = (horizontal_loop_extent,number_of_radar_derived_temperature_or_convection_suppression_intervals) type = real kind = kind_phys - active = (num_dfi_radar>0) + active = (number_of_radar_derived_temperature_or_convection_suppression_intervals>0 .and. flag_for_radar_derived_convection_suppression) ######################################################################## [ccpp-table-properties] diff --git a/ccpp/driver/GFS_restart.F90 b/ccpp/driver/GFS_restart.F90 index 9258fbf78..6f05c1b5e 100644 --- a/ccpp/driver/GFS_restart.F90 +++ b/ccpp/driver/GFS_restart.F90 @@ -121,6 +121,9 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & if (Model%imp_physics == Model%imp_physics_thompson .and. Model%ltaerosol) then Restart%num2d = Restart%num2d + 2 endif + if (Model%do_cap_suppress .and. Model%num_dfi_radar>0) then + Restart%num2d = Restart%num2d + Model%num_dfi_radar + endif Restart%num3d = Model%ntot3d if (Model%num_dfi_radar>0) then @@ -323,6 +326,23 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & enddo endif + ! Convection suppression + if (Model%do_cap_suppress .and. Model%num_dfi_radar > 0) then + do itime=1,Model%dfi_radar_max_intervals + if(Model%ix_dfi_radar(itime)>0) then + num = num + 1 + if(itime==1) then + Restart%name2d(num) = 'cap_suppress' + else + write(Restart%name2d(num),'("cap_suppress_",I0)') itime + endif + do nb = 1,nblks + Restart%data(nb,num)%var2p => Tbd(nb)%cap_suppress(:,Model%ix_dfi_radar(itime)) + enddo + endif + enddo + endif + !--- phy_f3d variables do num = 1,Model%ntot3d !--- set the variable name @@ -413,9 +433,9 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, & enddo endif - ! DFI Radar + ! Radar-derived microphysics temperature tendencies if (Model%num_dfi_radar > 0) then - do itime=1,4 + do itime=1,Model%dfi_radar_max_intervals if(Model%ix_dfi_radar(itime)>0) then num = num + 1 if(itime==1) then diff --git a/ccpp/physics b/ccpp/physics index c2130005b..e687c0415 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c2130005b557011deeccbb778eae07092e2f7942 +Subproject commit e687c0415c77363ac9315941580263449ef926bc From 1c2de53cc907c92997b699821afbe0a9358c5169 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 5 Jan 2022 00:29:34 +0000 Subject: [PATCH 16/24] add units to standard_name = radar_derived_microphysics_temperature_tendency variable --- 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 247ccc41f..d91511d42 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -6295,7 +6295,7 @@ [dfi_radar_tten] standard_name = radar_derived_microphysics_temperature_tendency long_name = radar-derived microphysics temperature tendency - units = unitless + units = K s-1 dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_radar_derived_temperature_or_convection_suppression_intervals) type = real kind = kind_phys diff --git a/ccpp/physics b/ccpp/physics index e687c0415..037e5647d 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit e687c0415c77363ac9315941580263449ef926bc +Subproject commit 037e5647de3a4137c1cd7bac3a2e6bafdb1f09d4 From a8b35016db40f27f5ca07111983f79a862bbb126 Mon Sep 17 00:00:00 2001 From: "Shrinivas.Moorthi" Date: Wed, 5 Jan 2022 02:05:54 +0000 Subject: [PATCH 17/24] adding threading to module_block_data.F90 which improves performance --- cpl/module_block_data.F90 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cpl/module_block_data.F90 b/cpl/module_block_data.F90 index 02ef0ebc8..9d2cc9192 100644 --- a/cpl/module_block_data.F90 +++ b/cpl/module_block_data.F90 @@ -71,6 +71,7 @@ subroutine block_copy_1d_i4_to_2d_r8(destin_ptr, source_ptr, block, block_index, if (associated(destin_ptr) .and. associated(source_ptr)) then factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -105,6 +106,7 @@ subroutine block_copy_1d_to_2d_r8(destin_ptr, source_ptr, block, block_index, sc if (associated(destin_ptr) .and. associated(source_ptr)) then factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -144,6 +146,7 @@ subroutine block_copy_1dslice_to_2d_r8(destin_ptr, source_ptr, slice, block, blo if (slice > 0 .and. slice <= size(source_ptr, dim=2)) then factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -182,6 +185,7 @@ subroutine block_copy_2d_to_3d_r8(destin_ptr, source_ptr, block, block_index, sc factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor do k = 1, size(source_ptr, dim=2) +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -219,6 +223,7 @@ subroutine block_copy_2d_to_2d_r8(destin_ptr, source_ptr, block, block_index, sc if (associated(destin_ptr) .and. associated(source_ptr)) then factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -253,6 +258,7 @@ subroutine block_array_copy_2d_to_2d_r8(destin_ptr, source_arr, block, block_ind if (associated(destin_ptr)) then factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -290,6 +296,7 @@ subroutine block_copy_3d_to_3d_r8(destin_ptr, source_ptr, block, block_index, sc factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor do k = 1, size(source_ptr, dim=3) +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -326,6 +333,7 @@ subroutine block_array_copy_3d_to_3d_r8(destin_ptr, source_arr, block, block_ind factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor do k = 1, size(source_arr, dim=3) +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -367,6 +375,7 @@ subroutine block_copy_3dslice_to_3d_r8(destin_ptr, source_ptr, slice, block, blo factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor do k = 1, size(source_ptr, dim=3) +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -407,6 +416,7 @@ subroutine block_array_copy_3dslice_to_3d_r8(destin_ptr, source_arr, slice, bloc factor = 1._kind_phys if (present(scale_factor)) factor = scale_factor do k = 1, size(source_arr, dim=3) +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -441,6 +451,7 @@ subroutine block_fill_2d_r8(destin_ptr, fill_value, block, block_index, rc) ! -- begin localrc = ESMF_RC_PTR_NOTALLOC if (associated(destin_ptr)) then +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -474,6 +485,7 @@ subroutine block_fill_3d_r8(destin_ptr, fill_value, block, block_index, rc) localrc = ESMF_RC_PTR_NOTALLOC if (associated(destin_ptr)) then do k = 1, size(destin_ptr, dim=3) +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) @@ -586,6 +598,7 @@ subroutine block_combine_frac_1d_to_2d_r8(destin_ptr, fract1_ptr, fract2_ptr, bl localrc = ESMF_RC_PTR_NOTALLOC if (associated(destin_ptr) .and. & associated(fract1_ptr) .and. associated(fract2_ptr)) then +!$omp parallel do private(ix,ib,jb,i,j) do ix = 1, block%blksz(block_index) ib = block%index(block_index)%ii(ix) jb = block%index(block_index)%jj(ix) From f292206b961686288796d6c62d7fd503b7a6fd3e Mon Sep 17 00:00:00 2001 From: "Shrinivas.Moorthi" Date: Thu, 6 Jan 2022 14:55:28 +0000 Subject: [PATCH 18/24] after submodule sync --- ccpp/physics | 2 +- io/FV3GFS_io.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ccpp/physics b/ccpp/physics index cc0b5ddd8..88fcf4cbf 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit cc0b5ddd8ff0a18e3a1a95093c76ae045cf7af44 +Subproject commit 88fcf4cbf8b41cfd5424782acf5edf5effc5ae45 diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index b907c698f..b45190f3d 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -1502,7 +1502,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta do nb = 1, Atm_block%nblks do ix = 1, Atm_block%blksz(nb) if (Sfcprop(nb)%landfrac(ix) < one .and. Sfcprop(nb)%fice(ix) < one) then - Sfcprop(nb)%zorlw(ix) = min(Sfcprop(nb)%zorl(ix), 0.317e-2) + Sfcprop(nb)%zorlw(ix) = min(Sfcprop(nb)%zorl(ix), 0.317) endif enddo enddo From 82c0ebaef90873670bf3d599cb9b51271fd0db35 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 6 Jan 2022 08:45:34 -0700 Subject: [PATCH 19/24] Update submodule pointer for ccpp-physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index b7f761285..cd92c4c40 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit b7f761285850db198a8b23d464aa2bd8dc6be215 +Subproject commit cd92c4c40a6dade4a1b5e7db1a307b7916a69ddf From 6332b9778bca47aaa604435080b9ced7831b56f4 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 6 Jan 2022 15:57:03 -0700 Subject: [PATCH 20/24] Revert .gitmodules and update submodule pointer for ccpp-physics --- .gitmodules | 6 ++---- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 89ebfccd9..6bb663df1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,10 +8,8 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - #url = https://github.com/NCAR/ccpp-physics - #branch = main - url = https://github.com/climbfuji/ccpp-physics - branch = mynnsfc_restart + url = https://github.com/NCAR/ccpp-physics + branch = main [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index cd92c4c40..9880f4407 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit cd92c4c40a6dade4a1b5e7db1a307b7916a69ddf +Subproject commit 9880f4407c9132a61dd11741c6a114ae295d8fba From e98274e8c4c58f18a6788fffe1649e040198c950 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 7 Jan 2022 16:55:52 +0000 Subject: [PATCH 21/24] move some code into a subroutine --- ccpp/data/GFS_typedefs.F90 | 115 +++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 50 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 2a0ac0917..db090bd1c 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -50,6 +50,8 @@ module GFS_typedefs integer, parameter :: dfi_radar_max_intervals = 4 !< Number of radar-derived temperature tendency and/or convection suppression intervals. Do not change. + real(kind=kind_phys), parameter :: limit_unspecified = 1e12 !< special constant for "namelist value was not provided" in radar-derived temperature tendency limit range + !> \section arg_table_GFS_typedefs !! \htmlinclude GFS_typedefs.html !! @@ -3560,7 +3562,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & integer, parameter :: max_scav_factors = 25 character(len=40) :: fscav_aero(max_scav_factors) - real(kind=kind_phys), parameter :: limit_unspecified = 1e12 real(kind=kind_phys) :: radar_tten_limits(2) = (/ limit_unspecified, limit_unspecified /) integer :: itime @@ -3767,55 +3768,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%dfi_radar_max_intervals_plus_one = dfi_radar_max_intervals + 1 Model%do_cap_suppress = do_cap_suppress - do i=1,dfi_radar_max_intervals - if(fh_dfi_radar(i)>-1e10 .and. fh_dfi_radar(i+1)>-1e10) then - Model%num_dfi_radar = Model%num_dfi_radar+1 - Model%ix_dfi_radar(i) = Model%num_dfi_radar - else - Model%ix_dfi_radar(i) = -1 - endif - enddo - - if(Model%num_dfi_radar>0) then - if(radar_tten_limits(1)==limit_unspecified) then - if(radar_tten_limits(2)==limit_unspecified) then - radar_tten_limits(1) = -19 - radar_tten_limits(2) = 19 - if(Model%me==Model%master) then - write(0,*) 'Warning: using internal defaults for radar_tten_limits. If the oceans boil, try different values.' - write(0,'(A,F12.4,A)') 'radar_tten_limits(1) = ',radar_tten_limits(1),' <-- lower limit' - write(0,'(A,F12.4,A)') 'radar_tten_limits(2) = ',radar_tten_limits(2),' <-- upper limit' - endif - else - radar_tten_limits(1) = -abs(radar_tten_limits(2)) - radar_tten_limits(2) = abs(radar_tten_limits(2)) - endif - else if(radar_tten_limits(2)==limit_unspecified) then - radar_tten_limits(1) = -abs(radar_tten_limits(1)) - radar_tten_limits(2) = abs(radar_tten_limits(1)) - else if(radar_tten_limits(1)>radar_tten_limits(2)) then - if(Model%me==Model%master) then - write(0,*) 'Error: radar_tten_limits lower limit is higher than upper!' - write(0,'(A,F12.4,A)') 'radar_tten_limits(1) = ',radar_tten_limits(1),' <-- lower limit' - write(0,'(A,F12.4,A)') 'radar_tten_limits(2) = ',radar_tten_limits(2),' <-- upper limit' - write(0,*) "If you do not want me to apply the prescribed tendencies, just say so! Remove fh_dfi_radar from your namelist." - stop - endif - else - !o! Rejoice !o! Radar_tten_limits had lower and upper bounds. - endif - Model%radar_tten_limits = radar_tten_limits - - if(do_cap_suppress) then - if(me==master .and. imfdeepcnv>=0) then - if(imfdeepcnv/=3) then - write(0,*) 'Warning: untested configuration in use! Radar-derived convection suppression is only supported for the GF deep scheme. That feature will be inactive, but microphysics tendencies will still be enabled. This combination is untested. Beware!' - else - write(0,*) 'Warning: experimental configuration in use! Radar-derived convection suppression is experimental (GF deep scheme with fh_dfi_radar).' - endif - endif - endif - endif + call control_initialize_radar_tten(Model, radar_tten_limits) if(gwd_opt==1) then if(me==master) & @@ -5379,6 +5332,68 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & end subroutine control_initialize + subroutine control_initialize_radar_tten(Model, radar_tten_limits) + implicit none + + ! Helper subroutine for initializing variables for radar-derived + ! temperature tendency or convection suppression. + + class(GFS_control_type) :: Model + real(kind_phys) :: radar_tten_limits(2) + integer :: i + + Model%num_dfi_radar = 0 + do i=1,dfi_radar_max_intervals + if(Model%fh_dfi_radar(i)>-1e10 .and. Model%fh_dfi_radar(i+1)>-1e10) then + Model%num_dfi_radar = Model%num_dfi_radar+1 + Model%ix_dfi_radar(i) = Model%num_dfi_radar + else + Model%ix_dfi_radar(i) = -1 + endif + enddo + + if(Model%num_dfi_radar>0) then + if(radar_tten_limits(1)==limit_unspecified) then + if(radar_tten_limits(2)==limit_unspecified) then + radar_tten_limits(1) = -19 + radar_tten_limits(2) = 19 + if(Model%me==Model%master) then + write(0,*) 'Warning: using internal defaults for radar_tten_limits. If the oceans boil, try different values.' + write(0,'(A,F12.4,A)') 'radar_tten_limits(1) = ',radar_tten_limits(1),' <-- lower limit' + write(0,'(A,F12.4,A)') 'radar_tten_limits(2) = ',radar_tten_limits(2),' <-- upper limit' + endif + else + radar_tten_limits(1) = -abs(radar_tten_limits(2)) + radar_tten_limits(2) = abs(radar_tten_limits(2)) + endif + else if(radar_tten_limits(2)==limit_unspecified) then + radar_tten_limits(1) = -abs(radar_tten_limits(1)) + radar_tten_limits(2) = abs(radar_tten_limits(1)) + else if(radar_tten_limits(1)>radar_tten_limits(2)) then + if(Model%me==Model%master) then + write(0,*) 'Error: radar_tten_limits lower limit is higher than upper!' + write(0,'(A,F12.4,A)') 'radar_tten_limits(1) = ',radar_tten_limits(1),' <-- lower limit' + write(0,'(A,F12.4,A)') 'radar_tten_limits(2) = ',radar_tten_limits(2),' <-- upper limit' + write(0,*) "If you do not want me to apply the prescribed tendencies, just say so! Remove fh_dfi_radar from your namelist." + stop + endif + else + !o! Rejoice !o! Radar_tten_limits had lower and upper bounds. + endif + Model%radar_tten_limits = radar_tten_limits + + if(Model%do_cap_suppress) then + if(Model%me==Model%master .and. Model%imfdeepcnv>=0) then + if(Model%imfdeepcnv/=3) then + write(0,*) 'Warning: untested configuration in use! Radar-derived convection suppression is only supported for the GF deep scheme. That feature will be inactive, but microphysics tendencies will still be enabled. This combination is untested. Beware!' + else + write(0,*) 'Warning: experimental configuration in use! Radar-derived convection suppression is experimental (GF deep scheme with fh_dfi_radar).' + endif + endif + endif + endif + + end subroutine control_initialize_radar_tten !--------------------------- ! GFS_control%init_chemistry From 8c0e04f0fb7c7ae8637ef56f56516f5ec8337b1b Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 7 Jan 2022 16:56:03 +0000 Subject: [PATCH 22/24] Switch from specified dimensions to implied shape ( (:,:) instead of (n,m) ) in ccpp/physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index d247e3349..7072fbe9a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d247e3349e7576bd3c1f01bc593c67fc423db81f +Subproject commit 7072fbe9a702dd9637e236868def83c40af4657d From 9c8930bc2cf1e5c96547dcc2deedabfef7828c1e Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 7 Jan 2022 17:55:36 +0000 Subject: [PATCH 23/24] remove a pointer declaration in ccpp/physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 7072fbe9a..64d8f2154 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 7072fbe9a702dd9637e236868def83c40af4657d +Subproject commit 64d8f215453e358ec8749d229fc76934694312bc From bc139a7ab1f41c904139f8a288440dc72e385d60 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Tue, 11 Jan 2022 14:46:47 +0000 Subject: [PATCH 24/24] point to NCAR main ccpp-physics repo --- .gitmodules | 4 ++-- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index fa1f1f2f5..6bb663df1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,8 +8,8 @@ branch = main [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/SamuelTrahanNOAA/ccpp-physics - branch = feature/radar-tten-ufs-community-20211229 + url = https://github.com/NCAR/ccpp-physics + branch = main [submodule "upp"] path = upp url = https://github.com/NOAA-EMC/UPP diff --git a/ccpp/physics b/ccpp/physics index db934c8e0..8500cea5e 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit db934c8e070b2e71465e31a21b20392a69c35f6d +Subproject commit 8500cea5e026dc41b348b98cacf661d4809ab66c