Skip to content

Conversation

@BarryHLynn
Copy link

To add the Dynamic Lightning Scheme to the public version of WRF

New Feature

Lightning-Forecast Lightning Dynamic Lightning Scheme Cloud-to-ground-Lightning, Intracloud Lightning. (LPI code also updated to calculate 3d and 2d LPI)

Barry.H.Lynn@gmail.com; Barry.Lynn@Weather-It-Is.com (Weather It Is, LTD and Hebrew University of Jerusalem)

DESCRIPTION OF CHANGES:

Registry/registry.dyn_light

dyn_em/solve_em.F

phys/Makefile

phys/module_calc_lpi_new.F

phys/module_ltng_pe.F

phys/module_ltng_strokes.F

phys/module_microphysics_driver.F

Just added/modified these routines (based on already published work going back to 2010).

ISSUE: For use when this PR closes an issue.
Fixes #123

RELEASE NOTE: Include a stand-alone message suitable for the inclusion in the minor and annual releases. A publication citation is appropriate. This is the Dynamic Lightning Scheme based originally on this paper.

Lynn, B. H., 2017: The Usefulness and Economic Value of Total Lightning Forecasts Made with a Dynamic Lightning Scheme Coupled with Lightning Data Assimilation. Wea. Forecasting, 32, 645–663, https://doi.org/10.1175/WAF-D-16-0031.1.

@BarryHLynn BarryHLynn requested review from a team as code owners November 2, 2025 18:46
@BarryHLynn
Copy link
Author

I accidentally uploaded an abbreviated version of registry.sbm_light. I have uploaded the complete file and all should be well.

@dudhia
Copy link
Collaborator

dudhia commented Nov 3, 2025

OK. We had some automatic checks that failed and will let you know what they are later. This could be special compilation options for example.

@BarryHLynn
Copy link
Author

BarryHLynn commented Nov 3, 2025 via email

LOGICAL :: f_flux ! flag for computing averaged fluxes in cu_gd
REAL :: curr_secs, curr_secs2, curr_mins2
REAL(8) :: curr_secs_r8, curr_secs2_r8
REAL :: curr_secs, curr_secs2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should be making this change. The two lines in the code should be retained.


TYPE(WRFU_TimeInterval) :: tmpTimeInterval, tmpTimeInterval2
REAL :: real_time
REAL(8) :: real_time_r8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same for this line, which should not be removed.

curr_secs2 = real_time(tmpTimeInterval2)
curr_secs_r8 = real_time_r8(tmpTimeInterval)
curr_secs2_r8 = real_time_r8(tmpTimeInterval2)
curr_mins2 = REAL( curr_secs2_r8 / 60.0d0 )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies here.

, config_flags%use_adaptive_time_step &
, curr_secs, curr_mins2 &
, curr_secs &
, psim , psih , gz1oz0 &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies here.

& ,P8W=p8w ,P=p_phy ,PI_PHY=pi_phy &
& ,RHO=grid%rho ,SPEC_ZONE=grid%spec_zone &
& ,SR=grid%sr ,TH=th_phy &
& ,ssat=grid%ssat, ssati=grid%ssati &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

!======================
#endif
& ,XLAND=grid%xland,SNOWH=grid%SNOW,XICE=grid%XICE &
& ,XLAND=grid%xland,SNOWH=grid%SNOW & !PMA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same here.

module_bl_mynnedmf_driver.o \
module_bl_mynn_common.o \
module_bl_mynn.o \
module_bl_mynn_wrapper.o \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be changed in your PR.

module_mp_etanew.o \
module_mp_fer_hires.o \
module_mp_thompson.o \
module_mp_rcon.o \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be removed.

module_mp_wdm5.o \
module_mp_wdm6.o \
module_mp_wdm7.o \
module_mp_udm.o \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one too, should not be removed.

TARGETDIR = ./

$(LIBTARGET) :
(cd .. && ./tools/manage_externals/checkout_externals --externals ./arch/Externals.cfg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You definitely should not remove this line.

else \
echo No action required for MYNN-EDMF submodule ; \
fi

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not remove these lines either.

,cldfra, cldfra_old, exch_h, nsource &
,qlsink, precr, preci, precs, precg &
,xland,snowh,xice,itimestep &
,xland,snowh,itimestep &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not change it here.

#endif
,qnwfa2d, qnifa2d, qnbca2d & ! for water/ice-friendly/black carbon aerosols
,qnocbb2d, qnbcbb2d & ! for biomass burning aerosols
,ssat,ssati &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not remove this line.

USE module_state_description, ONLY : &
KESSLERSCHEME, LINSCHEME, SBU_YLINSCHEME, WSM3SCHEME, WSM5SCHEME &
,WSM6SCHEME, ETAMPNEW, FER_MP_HIRES, THOMPSON, THOMPSONAERO, RCON_MP_SCHEME, THOMPSONGH, FAST_KHAIN_LYNN_SHPUND, MORR_TWO_MOMENT &
,WSM6SCHEME, ETAMPNEW, FER_MP_HIRES, THOMPSON, THOMPSONAERO, THOMPSONGH, FAST_KHAIN_LYNN_SHPUND, MORR_TWO_MOMENT &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not change this line.

,GSFCGCESCHEME, WDM5SCHEME, WDM6SCHEME, NSSL_2MOM, MADWRF_MP &
,FER_MP_HIRES_ADVECT &
,WSM7SCHEME, WDM7SCHEME, UDMSCHEME &
,WSM7SCHEME, WDM7SCHEME &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not change this line.

USE module_mp_wsm7
USE module_mp_etanew
USE module_mp_fer_hires
USE module_mp_rcon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not remove this line.

USE module_mp_wdm5
USE module_mp_wdm6
USE module_mp_wdm7
USE module_mp_udm
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not remove this line.

! Optional
!
REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme, jms:jme ) , INTENT(OUT) :: refl_10cm,ssat,ssati
REAL, OPTIONAL, DIMENSION( ims:ime , kms:kme, jms:jme ) , INTENT(OUT) :: refl_10cm
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not change this line.

dbz = refl_10cm, &
ssat3d = ssat, &
ssati = ssati, &
nssl_ssat_output = config_flags%nssl_ssat_output, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not remove these lines.

ENDIF
ELSE
CALL wrf_error_fatal ( 'arguments not present for calling rcon' )
ENDIF
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not remove these lines.

ELSE
CALL wrf_error_fatal ( 'arguments not present for calling udm')
ENDIF
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not remove these lines.

@weiwangncar
Copy link
Collaborator

@BarryHLynn The general errors you made is to overwrite the current version of the code with the version you worked on. Doing so, you removed many new updates we made in the model (which I pointed out). Those changes are not part of the modification you intend to make, and should be removed / corrected for this PR.

@BarryHLynn
Copy link
Author

BarryHLynn commented Nov 20, 2025 via email

@dudhia
Copy link
Collaborator

dudhia commented Nov 20, 2025

In github one thing not to do is copy modules from another directory into the one you downloaded. You should only clone an existing recent release version and edit that directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants