diff --git a/ccpp/physics b/ccpp/physics index 1003d151d..ce0a2cf7d 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 1003d151dcaf33698c6cbf5bad7e6d8ac4d9566a +Subproject commit ce0a2cf7d6adf97653badf9098171ce8e3379b37 diff --git a/scm/src/GFS_typedefs.F90 b/scm/src/GFS_typedefs.F90 index ff3eb3f49..ac9e277e7 100644 --- a/scm/src/GFS_typedefs.F90 +++ b/scm/src/GFS_typedefs.F90 @@ -152,6 +152,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: pgr (:) => null() !< surface pressure (Pa) real real (kind=kind_phys), pointer :: ugrs (:,:) => null() !< u component of layer wind real (kind=kind_phys), pointer :: vgrs (:,:) => null() !< v component of layer wind + real (kind=kind_phys), pointer :: wgrs (:,:) => null() !< w component of layer wind real (kind=kind_phys), pointer :: vvl (:,:) => null() !< layer mean vertical velocity in pa/sec real (kind=kind_phys), pointer :: tgrs (:,:) => null() !< model layer mean temperature in k real (kind=kind_phys), pointer :: qgrs (:,:,:) => null() !< layer mean tracer concentration @@ -1452,6 +1453,9 @@ module GFS_typedefs real(kind=kind_phys) :: rhcmax ! maximum critical relative humidity, replaces rhc_max in physcons.F90 real(kind=kind_phys) :: huge !< huge fill value +!--- lightning threat and diagsnostics + logical :: lightning_threat !< report lightning threat indices + contains procedure :: init => control_initialize procedure :: init_chemistry => control_chemistry_initialize @@ -1972,6 +1976,11 @@ module GFS_typedefs real (kind=kind_phys), pointer :: aux2d(:,:) => null() !< auxiliary 2d arrays in output (for debugging) real (kind=kind_phys), pointer :: aux3d(:,:,:)=> null() !< auxiliary 2d arrays in output (for debugging) + !--- Lightning threat indices + real (kind=kind_phys), pointer :: ltg1_max(:) => null() ! + real (kind=kind_phys), pointer :: ltg2_max(:) => null() ! + real (kind=kind_phys), pointer :: ltg3_max(:) => null() ! + contains procedure :: create => diag_create procedure :: rad_zero => diag_rad_zero @@ -2031,6 +2040,9 @@ subroutine statein_create (Statein, IM, Model) allocate (Statein%pgr (IM)) allocate (Statein%ugrs (IM,Model%levs)) allocate (Statein%vgrs (IM,Model%levs)) + if(Model%lightning_threat) then + allocate (Statein%wgrs (IM,Model%levs)) + endif allocate (Statein%qgrs (IM,Model%levs,Model%ntrac)) Statein%qgrs = clear_val @@ -2038,6 +2050,10 @@ subroutine statein_create (Statein, IM, Model) Statein%ugrs = clear_val Statein%vgrs = clear_val + if(Model%lightning_threat) then + Statein%wgrs = clear_val + endif + !--- soil state variables - for soil SPPT - sfc-perts, mgehne allocate (Statein%smc (IM,Model%lsoil)) allocate (Statein%stc (IM,Model%lsoil)) @@ -3514,6 +3530,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & logical :: mix_chem = .false. ! tracer mixing option by MYNN PBL logical :: fire_turb = .false. ! enh vertmix option by MYNN PBL +!-- Lightning threat index + logical :: lightning_threat = .false. + !--- aerosol scavenging factors integer, parameter :: max_scav_factors = 183 character(len=40) :: fscav_aero(max_scav_factors) @@ -3658,7 +3677,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & addsmoke_flag, fire_turb, mix_chem, & !--- (DFI) time ranges with radar-prescribed microphysics tendencies ! and (maybe) convection suppression - fh_dfi_radar, radar_tten_limits, do_cap_suppress + fh_dfi_radar, radar_tten_limits, do_cap_suppress, & + !--- GSL lightning threat indices + lightning_threat !--- other parameters integer :: nctp = 0 !< number of cloud types in CS scheme @@ -3732,6 +3753,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%flag_for_scnv_generic_tend = .true. Model%flag_for_dcnv_generic_tend = .true. + Model%lightning_threat = lightning_threat + 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 @@ -5081,6 +5104,13 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%restart = restart Model%lsm_cold_start = .not. restart Model%hydrostatic = hydrostatic + + if(Model%hydrostatic .and. Model%lightning_threat) then + write(0,*) 'Turning off lightning threat index for hydrostatic run.' + Model%lightning_threat = .false. + lightning_threat = .false. + endif + Model%jdat(1:8) = jdat(1:8) allocate(Model%si(Model%levs+1)) !--- Define sigma level for radiation initialization @@ -5853,6 +5883,7 @@ subroutine control_print(Model) print *, ' thermodyn_id : ', Model%thermodyn_id print *, ' sfcpress_id : ', Model%sfcpress_id print *, ' gen_coord_hybrid : ', Model%gen_coord_hybrid + print *, ' hydrostatic : ', Model%hydrostatic print *, ' ' print *, 'grid extent parameters' print *, ' isc : ', Model%isc @@ -6359,7 +6390,9 @@ subroutine control_print(Model) print *, ' first_time_step : ', Model%first_time_step print *, ' restart : ', Model%restart print *, ' lsm_cold_start : ', Model%lsm_cold_start - print *, ' hydrostatic : ', Model%hydrostatic + print *, ' ' + print *, 'lightning threat indexes' + print *, ' lightning_threat : ', Model%lightning_threat endif end subroutine control_print @@ -6952,6 +6985,15 @@ subroutine diag_create (Diag, IM, Model) Diag%old_pgr = clear_val endif + if(Model%lightning_threat) then + allocate (Diag%ltg1_max(IM)) + allocate (Diag%ltg2_max(IM)) + allocate (Diag%ltg3_max(IM)) + Diag%ltg1_max = zero + Diag%ltg2_max = zero + Diag%ltg3_max = zero + endif + !--- Radiation allocate (Diag%fluxr (IM,Model%nfxr)) allocate (Diag%topfsw (IM)) @@ -7516,6 +7558,13 @@ subroutine diag_phys_zero (Diag, Model, linit, iauwindow_center) Diag%tsnowp = zero endif +! GSL lightning threat indexes + if(Model%lightning_threat) then + Diag%ltg1_max = zero + Diag%ltg2_max = zero + Diag%ltg3_max = zero + endif + end subroutine diag_phys_zero end module GFS_typedefs diff --git a/scm/src/GFS_typedefs.meta b/scm/src/GFS_typedefs.meta index ad1c9625c..4a9b60bea 100644 --- a/scm/src/GFS_typedefs.meta +++ b/scm/src/GFS_typedefs.meta @@ -111,6 +111,14 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys +[wgrs] + standard_name = unsmoothed_nonhydrostatic_upward_air_velocity + long_name = unsmoothed non-hydrostatic upward air velocity + units = m s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + active = (do_lightning_threat_index_calculations) [vvl] standard_name = lagrangian_tendency_of_air_pressure long_name = layer mean vertical velocity @@ -6097,6 +6105,12 @@ units = flag dimensions = () type = logical +[lightning_threat] + standard_name = do_lightning_threat_index_calculations + long_name = enables the lightning threat index calculations + units = flag + dimensions = () + type = logical [ipt] standard_name = index_of_horizontal_gridpoint_for_debug_output long_name = horizontal index for point used for diagnostic printout @@ -8891,6 +8905,33 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys +[ltg1_max] + standard_name = lightning_threat_index_1 + long_name = lightning threat index 1 + units = flashes 5 min-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + active = (do_lightning_threat_index_calculations) +[ltg2_max] + standard_name = lightning_threat_index_2 + long_name = lightning threat index 2 + units = flashes 5 min-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + active = (do_lightning_threat_index_calculations) +[ltg3_max] + standard_name = lightning_threat_index_3 + long_name = lightning threat index 3 + units = flashes 5 min-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + active = (do_lightning_threat_index_calculations) ######################################################################## [ccpp-table-properties]