Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add three new wind farm parameterizations and their ensembles #1944

Merged
merged 14 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Registry/Registry.EM_COMMON
Original file line number Diff line number Diff line change
Expand Up @@ -3336,6 +3336,8 @@ package wrfhydro wrf_hydro==1 - state:SOLDRAIN
#WRF Windfarm
package no_windfarm windfarm_opt==0 - -
package fitchscheme windfarm_opt==1 - state:power
# Yulong add for WLM
package mavscheme windfarm_opt==2 - state:power

#Ideal Cases
package realcase ideal_case==0 - -
Expand Down Expand Up @@ -3601,3 +3603,10 @@ xpose XPOSE_SPECTRAL_NUDGING dyn_em dif_analysis,dif_xxx,dif_yyy
package no_fft_used fft_used==0 - -
package any_fft_used fft_used==1 - state:t_xxx,u_xxx,ru_xxx,v_xxx,rv_xxx,w_xxx,ww_xxx,ph_xxx,dum_yyy,fourd_xxx

# Yulong add for wind wake models
# 1 = Jensen; 2 = XA; 3 = GM
rconfig integer windfarm_wake_model namelist,physics max_domains 2 rh "windfarm_wake_model" "" ""
#
# wake overlap method, M1, M2, M3, M4 [1, 2, 3, 4]
rconfig integer windfarm_overlap_method namelist,physics max_domains 4 rh "windfarm_overlap_method" "" ""
rconfig real windfarm_deg namelist,physics max_domains 0 - "windfarm_deg" "for windfarm ideal case" "degree"
2 changes: 2 additions & 0 deletions dyn_em/module_first_rk_step_part1.F
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& AKHS=grid%akhs ,AKMS=grid%akms &
& ,BL_PBL_PHYSICS=config_flags%bl_pbl_physics &
& ,WINDFARM_OPT=config_flags%windfarm_opt,power=grid%power &
& ,windfarm_wake_model=config_flags%windfarm_wake_model & ! Yulong add for WLM
& ,windfarm_overlap_method=config_flags%windfarm_overlap_method & ! Yulong add for WLM
& ,BLDT=grid%bldt, CURR_SECS=curr_secs, ADAPT_STEP_FLAG=adapt_step_flag &
& ,BLDTACTTIME=grid%bldtacttime &
& ,BR=grid%br ,CHKLOWQ=chklowq ,CT=grid%ct &
Expand Down
1 change: 1 addition & 0 deletions phys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ MODULES = \
module_fddaobs_rtfdda.o \
module_fddaobs_driver.o \
module_wind_fitch.o \
module_wind_mav.o \
module_sf_lake.o \
module_diagnostics_driver.o \
module_irrigation.o
Expand Down
52 changes: 51 additions & 1 deletion phys/module_pbl_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SUBROUTINE pbl_driver( &
,kpbl,mixht,ct,lh,snow,xice &
,znu, znw, mut, p_top &
,ctopo,ctopo2,windfarm_opt,power &
,windfarm_wake_model, windfarm_overlap_method &
,ysu_topdown_pblmix &
,shinhong_tke_diag &
! OPTIONAL for TEMF scheme
Expand All @@ -39,7 +40,7 @@ SUBROUTINE pbl_driver( &
,flhc,flqc &
! MYNN
,qke,Sh3d,Sm3d &
,qke_adv,bl_mynn_tkeadvect & !ACF for QKE advection
,qke_adv,bl_mynn_tkeadvect &
,tsq,qsq,cov,rmol,ch,qcg,grav_settling &
,dqke,qWT,qSHEAR,qBUOY,qDISS,tke_budget &
,bl_mynn_closure,bl_mynn_cloudpdf &
Expand Down Expand Up @@ -155,6 +156,7 @@ SUBROUTINE pbl_driver( &
CAMUWPBLSCHEME,BEPSCHEME,BEP_BEMSCHEME,MYJSFCSCHEME, &
FITCHSCHEME,SHINHONGSCHEME, &
TEMFPBLSCHEME,GBMPBLSCHEME,EEPSSCHEME,KEPSSCHEME, &
MAVSCHEME, & ! Yulong add for WLM
CAMMGMPSCHEME,p_qi,p_qni,p_qnc,param_first_scalar,& !CAMMGMPSCHEME, p_qni,p_qnc is used for camuwpbl scheme
p_qnwfa,p_qnifa,p_qnbca
#if ( WRFPLUS == 1 )
Expand All @@ -167,6 +169,7 @@ SUBROUTINE pbl_driver( &
, TEMFPBLSCHEME, GFSEDMFSCHEME &
, CAMUWPBLSCHEME &
, FITCHSCHEME, SHINHONGSCHEME &
, MAVSCHEME ! Yulong add for WLM
, GBMPBLSCHEME, MYJSFCSCHEME
#endif

Expand Down Expand Up @@ -198,6 +201,7 @@ SUBROUTINE pbl_driver( &
USE module_bl_keps
USE module_bl_fogdes
USE module_wind_fitch
USE module_wind_mav ! Yulong add for WLM
#endif

! This driver calls subroutines for the PBL parameterizations.
Expand Down Expand Up @@ -434,6 +438,9 @@ SUBROUTINE pbl_driver( &
REAL, DIMENSION( ims:ime, jms:jme ), &
INTENT(IN), OPTIONAL :: xlat_u,xlong_u,xlat_v,xlong_v

! Yulong add for WLM
INTEGER, INTENT(IN ) :: windfarm_wake_model, windfarm_overlap_method

REAL, DIMENSION( ims:ime, kms:kme ,jms:jme ), &
INTENT(IN), OPTIONAL :: w
!
Expand Down Expand Up @@ -820,6 +827,8 @@ SUBROUTINE pbl_driver( &
integer iu_bep,iurb,idiff
real seamask,thsk,zzz,unew,vnew,tnew,qnew,umom,vmom
REAL :: z0,z1,z2,w1,w2

REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) :: TKE_windfarm ! Yulong add for WLM
!
! FASDAS
!
Expand Down Expand Up @@ -2061,6 +2070,47 @@ SUBROUTINE pbl_driver( &
CALL wrf_error_fatal('Lack arguments to call turbine_drag')
ENDIF

! Yulong add new wind farm schemes with wind turbine loss effect
CASE (mavscheme)
IF (PRESENT(id) .AND. &
PRESENT(z_at_w) ) THEN
CALL wrf_debug(100,'in phys/module_wind_mav.F')
CALL dragforce_mav(itimestep &
&,ID=id &
&,Z_AT_W=z_at_w,z_at_m=z,u=u_phy,v=v_phy &
&,DX=dx,DZ=dz8w,DT=dt &
&,TKE=TKE_windfarm &
&,DU=rublten,DV=rvblten &
&,WINDFARM_OPT=windfarm_opt,POWER=power &
&,windfarm_wake_model=windfarm_wake_model &
&,windfarm_overlap_method=windfarm_overlap_method &
&,xland=xland &
&,cosa=cosa,sina=sina &
&,IDS=ids,IDE=ide,JDS=jds,JDE=jde,KDS=kds,KDE=kde &
&,IMS=ims,IME=ime,JMS=jms,JME=jme,KMS=kms,KME=kme &
&,ITS=its,ITE=ite,JTS=jts,JTE=jte,KTS=kts,KTE=kte &
&)

IF (bl_mynn_tkeadvect) THEN
QKE = QKE + 2.*TKE_windfarm
qke_adv=qke
ENDIF

ELSE
WRITE ( message , FMT = '(A,6(L1,1X))' ) &
'present: '// &
'ID, '// &
'z_at_w, '// &
'xlat_u, '// &
'xlong_u, '// &
'xlat_v, '// &
'xlong_v = ' , &
PRESENT( id ) , &
PRESENT( z_at_w )
CALL wrf_debug(0,message)
CALL wrf_error_fatal('Lack arguments to call dragforce_mav')
ENDIF

END SELECT windfarm_select
#endif

Expand Down
5 changes: 5 additions & 0 deletions phys/module_physics_init.F
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ SUBROUTINE phy_init ( id, config_flags, DT, restart, zfull, zhalf, &
USE module_cam_support, ONLY : cam_mam_aerosols
#endif
USE module_wind_fitch
USE module_wind_mav ! Yulong add for WLM
IMPLICIT NONE
!-----------------------------------------------------------------
TYPE (grid_config_rec_type) :: config_flags
Expand Down Expand Up @@ -1412,6 +1413,10 @@ SUBROUTINE phy_init ( id, config_flags, DT, restart, zfull, zhalf, &
!
IF ( config_flags%windfarm_opt .EQ. 1 ) THEN
CALL init_module_wind_fitch(id,config_flags,xlong,xlat,windfarm_initialized,ims,ime,jms,jme,its,ite,jts,jte,ids,ide,jds,jde)
! --- Yulong ---
ELSEIF ( config_flags%windfarm_opt .EQ. 2 ) THEN
CALL init_module_wind_mav(id,config_flags,xlong,xlat,windfarm_initialized, &
dx,ims,ime,jms,jme,its,ite,jts,jte,ids,ide,jds,jde)
ENDIF

CALL wrf_debug ( 200 , 'module_start: phy_init: Before call to ra_init' )
Expand Down
Loading