Skip to content

Commit

Permalink
Adding the WRF-Solar EPS model (wrf-model#1547)
Browse files Browse the repository at this point in the history
TYPE: New feature

KEYWORDS: WRF-Solar, ensemble, stochastic

SOURCE: Pedro A. Jimenez, Ju Hye Kim, Jimy Dudhia (NCAR) and Jaemo Yang (NREL)

DESCRIPTION OF CHANGES:
Problem:
The WRF-Solar model is a deterministic model tailored for solar energy applications. Having a probabilistic component tailored for solar energy application is missing.

Solution:
WRF-Solar Ensemble Prediction System (WRF-Solar EPS, Kim et al. 2021) was designed to provide 
probabilistic forecasts tailored for solar energy applications. We have selected the most relevant 
variables from 6 WRF packages using tangent linear methodologies (Yang et al. 2021). Then we have 
used the available stochastic infrastructure in WRF to perturb these variables at runtine. The scheme 
is activated setting `multi_perturb = 1` in the &stoch block of namelist.input. The characteristics of 
the perturbations are specified in a new file in the run directory called STOCHPERT.TBL. Then the 
perturbations to each module and variable are turned on/off via namelist settings (see run/README.namelist). 
More information can be found in this very preliminar website: 
https://ral.ucar.edu/solutions/products/wrf-solar-eps

Link to Yang et al. 2021 article: https://www-sciencedirect-com.cuucar.idm.oclc.org/science/article/pii/S0038092X21002322?via%3Dihub

Link to Kim et al. 2021 article: https://ieeexplore-ieee-org.cuucar.idm.oclc.org/document/9580552

LIST OF MODIFIED FILES:
M       Registry/Registry.EM_COMMON
M       Registry/registry.dimspec
M       Registry/registry.stoch
M       dyn_em/module_first_rk_step_part1.F
M       dyn_em/module_first_rk_step_part2.F
M       dyn_em/module_stoch.F
M       dyn_em/solve_em.F
M       phys/module_microphysics_driver.F
M       phys/module_pbl_driver.F
M       phys/module_ra_farms.F
M       phys/module_radiation_driver.F
M       phys/module_sf_noahdrv.F
M       phys/module_shallowcu_driver.F
M       phys/module_shcu_deng.F
M       phys/module_surface_driver.F
M       run/README.namelist
A       run/STOCHPERT.TBL
M       share/module_check_a_mundo.F

TESTS CONDUCTED: 
1. We have run multiple years WRF-Solar EPS and analyzed the characteristics of the probabilistic 
forecasts as well as calibrated forecasts. Our analysis do not show any potential problems at this point. 
2. We ran a simulation with 10 ensemble members and calculated the spread of the ensemble (standard 
deviation) as a function of the lead time. The spread (this PR compared to our other tests) is very similar. 
Below is plot with the ensemble spread at given lead time original (left) and current mods (right). The 
area covered is CONUS.

![Screen Shot 2022-01-19 at 5 19 52 PM](https://user-images.githubusercontent.com/14111759/150239976-503980be-fbba-44b6-88f4-f473fcfed198.png)

3. Jenkins testing is all PASS.

RELEASE NOTE: WRF-Solar was expanded to have a stochastic ensemble prediction system (WRF-Solar EPS) tailored for solar energy applications (Yang et al. 2021, Kim et al. 2022). The stochastic perturbations can be introduced into variables of six parameterizations controlling cloud and radiation processes. A more detailed description of the model is provided in the WRF-Solar EPS website:
https://ral.ucar.edu/solutions/products/wrf-solar-eps

Kim, J.-H., P.A. Jimenez, M. Sengupta, J. Yang, J. Dudhia, S. Alessandrini and Y. Xie, 2022: The WRF-Solar Ensemble Prediction System to provide solar irradiance probabilistic forecasts. IEEE J. of Photovoltaics (In press.)

Yang, J., J.-H. Kim, P. A. Jimenez, M. Sengupta, J. Dudhia, Y. Xie, A. Golnas, R. Giering: An Efficient method to identify uncertainties of WRF-Solar variables in forecasting solar irradiance using a tangent linear sensitivity analysis. Solar Energy, 220, 509-522.
  • Loading branch information
pedro-jm authored and vlakshmanan-scala committed Apr 4, 2024
1 parent 8962ee6 commit f260793
Show file tree
Hide file tree
Showing 19 changed files with 1,234 additions and 36 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ em_real : wrf
ln -sf ../../run/ishmael-qi-qc.bin . ; \
ln -sf ../../run/ishmael-qi-qr.bin . ; \
ln -sf ../../run/BROADBAND_CLOUD_GODDARD.bin . ; \
ln -sf ../../run/STOCHPERT.TBL . ; \
if [ $(RWORDSIZE) -eq 8 ] ; then \
ln -sf ../../run/ETAMPNEW_DATA_DBL ETAMPNEW_DATA ; \
ln -sf ../../run/ETAMPNEW_DATA.expanded_rain_DBL ETAMPNEW_DATA.expanded_rain ; \
Expand Down Expand Up @@ -663,6 +664,7 @@ em_real : wrf
ln -sf ../../run/ishmael-qi-qc.bin . ; \
ln -sf ../../run/ishmael-qi-qr.bin . ; \
ln -sf ../../run/BROADBAND_CLOUD_GODDARD.bin . ; \
ln -sf ../../run/STOCHPERT.TBL . ; \
if [ $(RWORDSIZE) -eq 8 ] ; then \
ln -sf ../../run/ETAMPNEW_DATA_DBL ETAMPNEW_DATA ; \
ln -sf ../../run/ETAMPNEW_DATA.expanded_rain_DBL ETAMPNEW_DATA.expanded_rain ; \
Expand Down
1 change: 1 addition & 0 deletions Registry/Registry.EM_COMMON
Original file line number Diff line number Diff line change
Expand Up @@ -2548,6 +2548,7 @@ rconfig integer alevsiz_cu namelist,physics 1 1
rconfig integer aercu_opt namelist,physics 1 0 - "aercu_opt" "aerosol input option for multiscale KF" ""
rconfig real aercu_fct namelist,physics 1 1.0 - "aercu_fct" "aerosol multiplication factor" ""
rconfig integer aercu_used derived 1 0 - "aercu_used" "derived nml for packaging" ""
rconfig logical couple_farms namelist,physics 1 .false. - "couple_farms" "coupling FARMS radiation to land surface model" ""

#BSINGH - added shallowcu_forced_ra, numBins, thBinSize, rBinSize, minDeepFreq, minShallowFreq, shcu_aerosols_opt for CuP scheme

Expand Down
1 change: 1 addition & 0 deletions Registry/registry.dimspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ifdef EM_CORE=1

ifdef DA_CORE=0
dimspec stoclev 2 namelist=num_stoch_levels z num_stoch_levels
dimspec pertn3d 4 namelist=num_pert_3d z num_pert_3d
dimspec j 3 standard_domain y south_north
dimspec k 2 standard_domain z bottom_top
endif
Expand Down
79 changes: 79 additions & 0 deletions Registry/registry.stoch
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,82 @@ state real ALPH_RAND3 - misc 1 - - "A
state real ALPH_RAND4 - misc 1 - - "ALPH_RAND4" "autoregressive coeff. for generic rand. pert." ""
state logical did_stoch - misc 1 - r "DID_STOCH" "Logical to tell us that we already did the initialization for dom 1" ""


# Variables for multi-pert table input
state real gridpt_stddev_mult3d {pertn3d} misc 1 - r "pert3d_std" "gridpoint standard deviation of random perturbations in mult3d" ""
state real stddev_cutoff_mult3d {pertn3d} misc 1 - r "pert3d_cut" "cutoff tails of pdf above this threshold standard deviation" ""
state real lengthscale_mult3d {pertn3d} misc 1 - r "pert3d_len" "Correlation length scale in meters for mult3d" "m"
state real timescale_mult3d {pertn3d} misc 1 - r "pert3d_tim" "Decorrelation time scale in s for mult3d" "s"
state integer mult3d_vertstruc {pertn3d} misc 1 - r "pert3d_ivs" "vertical structure for mult3d: 0=constant, 1=random phase" ""
state integer iseed_mult3d {pertn3d} misc 1 - r "pert3d_isd" "RANDOM SEED FOR mult3d " ""
state integer ISEEDARR_mult3d k{pertn3d} misc 1 - r "ISEEDARR_MULT3D" "Array to hold seed for restart, MULT3D_PERT" "" ""
state integer stepsp - misc 1 - r "stepsp" "Update perturbation every STEPSP time steps"

# Namelist variables for multi-pert option
rconfig integer multi_perturb namelist,stoch max_domains 0 - "stochastic forcing option: 0=none, 1=multi-perturbation option"
rconfig logical pert_farms namelist,stoch max_domains .false. - "adding perturbations to FARMS scheme"
rconfig real pert_farms_albedo namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_farms_aod namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_farms_angexp namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_farms_aerasy namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_farms_qv namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_farms_qc namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_farms_qs namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig logical pert_deng namelist,stoch max_domains .false. - "adding perturbations to Deng scheme"
rconfig real pert_deng_qv namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_deng_qc namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_deng_t namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_deng_w namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig logical pert_mynn namelist,stoch max_domains .false. - "adding perturbations to MYNN scheme"
rconfig real pert_mynn_qv namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_mynn_qc namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_mynn_t namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_mynn_qke namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig logical pert_noah namelist,stoch max_domains .false. - "adding perturbations to Noah scheme"
rconfig real pert_noah_qv namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_noah_t namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_noah_smois namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_noah_tslb namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig logical pert_thom namelist,stoch max_domains .false. - "adding perturbations to Thompson scheme"
rconfig real pert_thom_qv namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_thom_qc namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_thom_qi namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_thom_qs namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_thom_ni namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig logical pert_cld3 namelist,stoch max_domains .false. - "adding perturbations to CLD3 scheme"
rconfig real pert_cld3_qv namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real pert_cld3_t namelist,stoch max_domains 0.0 - "turn on/off the perturbation"
rconfig real spdt namelist,stoch max_domains -1.0 - "Mins to update perts. If spdt<=0 => every time step."

# Perturbation arrays for multi-pert option
state real SPFORCC3d i{pertn3d}j misc 1 XY r "SPFORCC3d" "real spect. coeff. of random perturbation field" "" ""
state real SPFORCS3d i{pertn3d}j misc 1 XY r "SPFORCS3d" "imag. spect. coeff. of random perturbation field" "" ""
state real SP_AMP3d i{pertn3d}j misc 1 - r "SP_AMP3d" "amplitude of random perturbation field" "" ""
state real ALPH_RAND3d {pertn3d} misc 1 - - "ALPH_RAND3d" "autoregressive coeff. for generic rand. pert." ""
state real VERTSTRUCC3d ikj{pertn3d} dyn_em 1 - r "VERTSTRUCC3d" "vertical structure for stoch. pert. forcing " ""
state real VERTSTRUCS3d ikj{pertn3d} dyn_em 1 - r "VERTSTRUCS3d" "vertical structure for stoch. pert. forcing " ""
state real VERTAMPT3d k{pertn3d} misc 1 - r "VERTAMPT3d" "vert. amplitude of stoch. temperature perturb." "" ""

state real - i{stoclev}jf pert3d 1 - -
state real palbedo i{stoclev}jf pert3d 1 - h "PALBEDO" "" ""
state real paod i{stoclev}jf pert3d 1 - h "PAOD" "" ""
state real pangstrom i{stoclev}jf pert3d 1 - h "PANGSTROM" "" ""
state real passymfac i{stoclev}jf pert3d 1 - h "PASSYMFAC" "" ""
state real pqvapor i{stoclev}jf pert3d 1 - h "PQVAPOR" "" ""
state real pqcloud i{stoclev}jf pert3d 1 - h "PQCLOUD" "" ""
state real pqice i{stoclev}jf pert3d 1 - h "PQICE" "" ""
state real pqsnow i{stoclev}jf pert3d 1 - h "PQSNOW" "" ""
state real pni i{stoclev}jf pert3d 1 - h "PNI" "" ""
state real pth i{stoclev}jf pert3d 1 - h "PTH" "" ""
state real ptke i{stoclev}jf pert3d 1 - h "PTKE" "" ""
state real psmois i{stoclev}jf pert3d 1 - h "PSMOIS" "" ""
state real ptsoil i{stoclev}jf pert3d 1 - h "PTSOIL" "" ""
state real pw i{stoclev}jf pert3d 1 - h "PW" "" ""
state real p15 i{stoclev}jf pert3d 1 - h "P15" "" ""

# Namelist parameters for multi-pert option
rconfig integer num_pert_3d namelist,stoch 1 15 - "num_pert_3d" "number of 3d random fields in STOCHPERT.TBL plue one" ""

# Namelist parameters for random number streams
rconfig integer nens namelist,stoch 1 1 - "random number seed for ensemble members " "" ""

Expand Down Expand Up @@ -188,3 +264,6 @@ package skebs_perturb skebs_on==1 - state:ru_tendf_stoch,rv_tendf_
package random_perturb rand_perturb_on==1 - state:rand_pert,SPFORCS,SPFORCC,SP_AMP,VERTSTRUCC,VERTSTRUCS,VERTAMPT,RAND_REAL,RAND_IMAG,RAND_REAL_xxx,RAND_REAL_yyy,RAND_IMAG_xxx,RAND_IMAG_yyy

package stoch_param_perturb spp_on==1 - state:pattern_spp_conv,field_conv,SPFORCS2,SPFORCC2,SP_AMP2,pattern_spp_pbl,field_pbl,SPFORCS3,SPFORCC3,SP_AMP3,pattern_spp_lsm,field_sf,SPFORCS4,SPFORCC4,SP_AMP4,VERTSTRUCC,VERTSTRUCS,VERTAMPT,RAND_REAL,RAND_IMAG,RAND_REAL_xxx,RAND_REAL_yyy,RAND_IMAG_xxx,RAND_IMAG_yyy

package multi_perturb multi_perturb==1 - state:SPFORCS3d,SPFORCC3d,SP_AMP3d,VERTSTRUCC3d,VERTSTRUCS3d,VERTAMPT3d,RAND_REAL,RAND_IMAG,RAND_REAL_xxx,RAND_REAL_yyy,RAND_IMAG_xxx,RAND_IMAG_yyy,stepsp;pert3d:palbedo,paod,pangstrom,passymfac,pqvapor,pqcloud,pqice,pqsnow,pni,pth,ptke,psmois,ptsoil,pw

2 changes: 1 addition & 1 deletion clean
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if ( "$arg" == '-a' || "$arg" == '-aa' ) then
( cd test ; rm -f */*.exe */ETAMPNEW_DATA* */GENPARM.TBL */LANDUSE.TBL */README.namelist */README.physics_files \
*/RRTM_DATA */SOILPARM.TBL */VEGPARM.TBL */MPTABLE.TBL */URBPARM.TBL */URBPARM_LCZ.TBL */grib2map.tbl \
*/CAM_ABS_DATA */CAM_AEROPT_DATA \
*/CCN_ACTIVATE.BIN \
*/CCN_ACTIVATE.BIN */STOCHPERT.TBL \
*/CAMtr_volume_mixing_ratio.RCP4.5 */CAMtr_volume_mixing_ratio.RCP6 */CAMtr_volume_mixing_ratio.RCP8.5 \
*/CAMtr_volume_mixing_ratio.A1B */CAMtr_volume_mixing_ratio.A2 */CAMtr_volume_mixing_ratio \
*/CAMtr_volume_mixing_ratio.SSP119 */CAMtr_volume_mixing_ratio.SSP126 \
Expand Down
56 changes: 56 additions & 0 deletions dyn_em/module_first_rk_step_part1.F
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,30 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& ,swdown2=grid%swdown2, swddni2=grid%swddni2 & ! FARMS coupling
& ,swddif2=grid%swddif2, swddir2=grid%swddir2 & ! FARMS coupling
& ,swdownc2=grid%swdownc2, swddnic2=grid%swddnic2 & ! FARMS coupling
& ,couple_farms=config_flags%couple_farms &
#endif
! WRF-Solar EPS: FARMS
& ,multi_perturb=config_flags% multi_perturb &
& ,pert_farms=config_flags%pert_farms &
& ,perts_albedo=grid%pert3d(:,:,:,P_PALBEDO) &
& ,perts_aod=grid%pert3d(:,:,:,P_PAOD) &
& ,perts_angstrom=grid%pert3d(:,:,:,P_PANGSTROM) &
& ,perts_assymfac=grid%pert3d(:,:,:,P_PASSYMFAC) &
& ,perts_qvapor=grid%pert3d(:,:,:,P_PQVAPOR) &
& ,perts_qcloud=grid%pert3d(:,:,:,P_PQCLOUD) &
& ,perts_qsnow=grid%pert3d(:,:,:,P_PQSNOW) &
& ,pert_farms_albedo=config_flags%pert_farms_albedo &
& ,pert_farms_aod=config_flags%pert_farms_aod &
& ,pert_farms_angexp=config_flags%pert_farms_angexp &
& ,pert_farms_aerasy=config_flags%pert_farms_aerasy &
& ,pert_farms_qv=config_flags%pert_farms_qv &
& ,pert_farms_qc=config_flags%pert_farms_qc &
& ,pert_farms_qs=config_flags%pert_farms_qs &
! WRF-Solar EPS: cld3
& ,pert_cld3=config_flags%pert_cld3 &
& ,perts_th=grid%pert3d(:,:,:,P_PTH) &
& ,pert_cld3_qv=config_flags%pert_cld3_qv &
& ,pert_cld3_t=config_flags%pert_cld3_t &
!BSINGH - For WRFCuP scheme
& ,CU_PHYSICS=config_flags%cu_physics & !CuP, wig 5-Oct-2006
& ,SHALLOWCU_FORCED_RA=config_flags%shallowcu_forced_ra & !CuP, wig
Expand Down Expand Up @@ -996,6 +1019,17 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& ,spp_lsm=config_flags%spp_lsm,pattern_spp_lsm=grid%pattern_spp_lsm & !SPP
& ,field_sf=grid%field_sf & !SPP
& ,spp_pbl=config_flags%spp_pbl,pattern_spp_pbl=grid%pattern_spp_pbl & !SPP
! WRF-Solar EPS: Noah LSM
& ,multi_perturb=config_flags% multi_perturb &
& ,pert_noah=config_flags%pert_noah &
& ,perts_qvapor=grid%pert3d(:,:,:,P_PQVAPOR) &
& ,perts_th=grid%pert3d(:,:,:,P_PTH) &
& ,perts_smois=grid%pert3d(:,:,:,P_PSMOIS) &
& ,perts_tsoil=grid%pert3d(:,:,:,P_PTSOIL) &
& ,pert_noah_qv=config_flags%pert_noah_qv &
& ,pert_noah_t=config_flags%pert_noah_t &
& ,pert_noah_smois=config_flags%pert_noah_smois &
& ,pert_noah_tslb=config_flags%pert_noah_tslb &
& )
#ifdef WRF_HYDRO
Expand Down Expand Up @@ -1175,6 +1209,17 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
! For Wind Turbine Drag Parameterizations
& ,phb=grid%phb &
& ,XLAT_U=grid%xlat_u,XLONG_U=grid%xlong_u &
! WRF-Solar EPS: MYNN
& ,multi_perturb=config_flags%multi_perturb &
& ,pert_mynn=config_flags%pert_mynn &
& ,perts_qvapor=grid%pert3d(:,:,:,P_PQVAPOR) &
& ,perts_qcloud=grid%pert3d(:,:,:,P_PQCLOUD) &
& ,perts_th=grid%pert3d(:,:,:,P_PTH) &
& ,perts_tke=grid%pert3d(:,:,:,P_PTKE) &
& ,pert_mynn_qv=config_flags%pert_mynn_qv &
& ,pert_mynn_qc=config_flags%pert_mynn_qc &
& ,pert_mynn_t=config_flags%pert_mynn_t &
& ,pert_mynn_qke=config_flags%pert_mynn_qke &
!Variables required for camuwpbl scheme
& ,Z_AT_W=grid%z_at_w,CLDFRA_OLD_MP=grid%cldfra_old_mp &
& ,CLDFRA=grid%cldfra &
Expand Down Expand Up @@ -1536,6 +1581,17 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& ,qke=grid%qke &
& ,PBLHAVG=grid%PBLHAVG, TKEAVG=grid%TKEAVG &
& ,BL_PBL_PHYSICS=config_flags%bl_pbl_physics &
! WRF-Solar EPS
& ,multi_perturb=config_flags%multi_perturb &
& ,pert_deng=config_flags%pert_deng &
& ,perts_qvapor=grid%pert3d(:,:,:,P_PQVAPOR) &
& ,perts_qcloud=grid%pert3d(:,:,:,P_PQCLOUD) &
& ,perts_th=grid%pert3d(:,:,:,P_PTH) &
& ,perts_w=grid%pert3d(:,:,:,P_PW) &
& ,pert_deng_qv=config_flags%pert_deng_qv &
& ,pert_deng_qc=config_flags%pert_deng_qc &
& ,pert_deng_t=config_flags%pert_deng_t &
& ,pert_deng_w=config_flags%pert_deng_w &
& )

#if (WRF_CHEM == 1)
Expand Down
Loading

0 comments on commit f260793

Please sign in to comment.