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

[Resubmit for PR #1881] New option for SLUCM to use global distributed urban aerodynamic parameters #1986

Merged
merged 25 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
45d1380
Merge pull request #1 from wrf-model/develop
cenlinhe Dec 17, 2020
c8d86d3
Merge pull request #2 from wrf-model/develop
cenlinhe Mar 31, 2021
3d62e5e
Merge branch 'wrf-model:develop' into develop
cenlinhe Dec 7, 2021
08e71b9
Merge branch 'wrf-model:develop' into develop
cenlinhe Jan 10, 2022
4bc9b99
Merge branch 'wrf-model:develop' into develop
cenlinhe Jan 20, 2022
26e33d9
Merge branch 'wrf-model:develop' into develop
cenlinhe Mar 17, 2022
63902b4
Merge branch 'wrf-model:develop' into develop
cenlinhe Sep 12, 2022
bcf4941
Merge branch 'wrf-model:develop' into develop
cenlinhe Jan 9, 2023
2ab4941
Merge branch 'wrf-model:develop' into develop
cenlinhe Jan 29, 2023
6cfb6e8
Merge branch 'wrf-model:develop' into develop
cenlinhe May 13, 2023
cfad9e0
Merge branch 'wrf-model:develop' into develop
cenlinhe Aug 8, 2023
4154469
Merge branch 'wrf-model:develop' into develop
cenlinhe Jan 3, 2024
5732c24
Merge branch 'wrf-model:develop' into develop
cenlinhe Jan 5, 2024
6ff203f
Merge branch 'wrf-model:develop' into develop
cenlinhe Jan 16, 2024
7cacbfd
update noahmp submodule for noahmpdrv for urban parameter
cenlinhe Jan 16, 2024
05d23af
Aadd global distributed urban aerodynamics parameter capability
cenlinhe Jan 16, 2024
8541190
bug fix for check_a_mundo
cenlinhe Jan 17, 2024
b2dfab8
update README.namelist
cenlinhe Jan 23, 2024
3c1b440
Merge branch 'wrf-model:develop' into develop
cenlinhe Jan 24, 2024
95c78b4
Merge branch 'wrf-model:develop' into develop
cenlinhe Feb 5, 2024
9141bf5
package variables & rename namelist option
cenlinhe Feb 5, 2024
448067e
Merge branch 'wrf-model:develop' into develop
cenlinhe Feb 6, 2024
c27eece
Resolve merge conflict btw develop and epn09_dist_params_test
cenlinhe Feb 6, 2024
56ca486
Merge branch 'develop' of https://github.com/cenlinhe/WRF into develop
cenlinhe Feb 6, 2024
8aae62b
Merge pull request #5 from cenlinhe/develop
cenlinhe Feb 6, 2024
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
14 changes: 11 additions & 3 deletions Registry/Registry.EM_COMMON
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ state real slope ij misc 1 - rdu "SLOP
state real slp_azi ij misc 1 - rdu "SLP_AZI" "ELEVATION SLOPE AZIMUTH" "rad"
state real shdmax ij misc 1 - i012rhd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "SHDMAX" "ANNUAL MAX VEG FRACTION" ""
state real shdmin ij misc 1 - i012rhd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "SHDMIN" "ANNUAL MIN VEG FRACTION" ""
state real shdavg ij misc 1 - i012rhd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "SHDAVG" "ANNUAL AVG VEG FRACTION" ""
state real snoalb ij misc 1 - i012rhd "SNOALB" "ANNUAL MAX SNOW ALBEDO IN FRACTION" ""
state real toposoil ij misc 1 - i12 "SOILHGT" "ELEVATION OF LSM DATA" "m"
state real landusef iuj misc 1 Z i012rdu "LANDUSEF" "LANDUSE FRACTION BY CATEGORY" ""
Expand Down Expand Up @@ -820,13 +821,18 @@ state real DZR l em - Z r "DZR"
state real DZB l em - Z r "DZB" "THICKNESSES OF WALL LAYERS" "m"
state real DZG l em - Z r "DZG" "THICKNESSES OF ROAD LAYERS" "m"
state real URB_PARAM i{urb}j misc 1 - i1 "URB_PARAM" "NUDAPT_NBSD Urban Parameters" "parameter"
state real LP_URB2D ij misc 1 - ir "BUILD_AREA_FRACTION" "BUILDING PLAN AREA DENSITY" "dimensionless"
state real LP_URB2D ij misc 1 - i01r "BUILD_AREA_FRACTION" "BUILDING PLAN AREA DENSITY" "dimensionless"
state real HI_URB2D i{uhi}j misc 1 Z ir "HEIGHT_HISTOGRAMS" "DISTRIBUTION OF BUILDING HEIGHTS" "dimensionless"
state real LB_URB2D ij misc 1 - ir "BUILD_SURF_RATIO" "BUILDING SURFACE AREA TO PLAN AREA RATIO" "dimensionless"
state real HGT_URB2D ij misc 1 - ir "BUILD_HEIGHT" "AVERAGE BUILDING HEIGHT WEIGHTED BY BUILDING PLAN AREA" "m"
state real MH_URB2D ij misc 1 - ir "MH_URB2D" "Mean Building Height" "m"
state real MH_URB2D ij misc 1 - i01r "MH_URB2D" "Mean Building Height" "m"
state real STDH_URB2D ij misc 1 - ir "STDH_URB2D" "Standard Deviation of Building Height" "m2"
state real LF_URB2D i{udr}j misc 1 Z ir "LF_URB2D" "Frontal Area Index" "dimensionless"
state real ZD_URB2D ij misc 1 - i1 "ZD_URB2D" "Zero-plane Displacement" "m"
state real Z0_URB2D ij misc 1 - i01r "Z0_URB2D" "Roughness length for momentum" "m"
state real LF_URB2D_S ij misc 1 - i01r "LF_URB2D_S" "Frontal area index (no wind directional dependency)" ""
# AHE with month and hour dimension flattened to one dimension, Jan = (0:23), Feb = (24:47)
state real AHE i{m_hr}j misc 1 - i01r "AHE" "Anthropogenic heat emission" "W m-2"
weiwangncar marked this conversation as resolved.
Show resolved Hide resolved

# lsm State Variables

Expand Down Expand Up @@ -2541,6 +2547,8 @@ rconfig integer ishallow namelist,physics 1 0
rconfig real convtrans_avglen_m namelist,physics 1 30 rh "convtrans_avglen_m" "averaging time for convective transport output variables (minutes)" ""
rconfig integer num_land_cat namelist,physics 1 21 - "num_land_cat" "" ""
rconfig integer use_wudapt_lcz namelist,physics 1 0 - "use_wudapt_lcz" "" ""
rconfig logical slucm_distributed_drag namelist,physics 1 .false. rh "slucm_distributed_drag" "" ""
rconfig integer distributed_ahe_opt namelist,physics 1 0 rh "distributed_ahe_opt" "AHE handling: 0= no AHE, 1=add to first level temperature tendency, 2=add to surface sensible heat flux" ""
rconfig integer num_soil_cat namelist,physics 1 16 - "num_soil_cat" "" ""
rconfig integer mp_zero_out namelist,physics 1 0 - "mp_zero_out" "microphysics fields set to zero 0=no action taken, 1=all fields but Qv, 2=all fields including Qv" "flag"
rconfig real mp_zero_out_thresh namelist,physics 1 1.e-8 - "mp_zero_out_thresh" "minimum threshold for non-Qv moist fields, below are set to zero" "kg/kg"
Expand Down Expand Up @@ -3127,7 +3135,7 @@ package temfsfcscheme sf_sfclay_physics==10 - state:wm_
package idealscmsfcscheme sf_sfclay_physics==89 - -
package sfclayscheme sf_sfclay_physics==91 - -

package noahucmscheme sf_urban_physics==1 - state:trb_urb4d,tw1_urb4d,tw2_urb4d,tgb_urb4d,sfw1_urb3d,sfw2_urb3d,sfr_urb3d,sfg_urb3d,a_u_bep,a_v_bep,a_t_bep,a_q_bep,a_e_bep,b_u_bep,b_v_bep,b_t_bep,b_q_bep,b_e_bep,dlg_bep,dl_u_bep,sf_bep,vl_bep,mh_urb2d,stdh_urb2d,lf_urb2d,lp_urb2d,hgt_urb2d,lb_urb2d,tgr_urb2d,cmcr_urb2d,drelr_urb2d,drelb_urb2d,drelg_urb2d,flxhumr_urb2d,flxhumb_urb2d,flxhumg_urb2d,tgrl_urb3d,smr_urb3d,cmgr_sfcdif,chgr_sfcdif,trl_urb3d,tgl_urb3d,tbl_urb3d
package noahucmscheme sf_urban_physics==1 - state:trb_urb4d,tw1_urb4d,tw2_urb4d,tgb_urb4d,sfw1_urb3d,sfw2_urb3d,sfr_urb3d,sfg_urb3d,a_u_bep,a_v_bep,a_t_bep,a_q_bep,a_e_bep,b_u_bep,b_v_bep,b_t_bep,b_q_bep,b_e_bep,dlg_bep,dl_u_bep,sf_bep,vl_bep,mh_urb2d,stdh_urb2d,lf_urb2d,lp_urb2d,hgt_urb2d,lb_urb2d,tgr_urb2d,cmcr_urb2d,drelr_urb2d,drelb_urb2d,drelg_urb2d,flxhumr_urb2d,flxhumb_urb2d,flxhumg_urb2d,tgrl_urb3d,smr_urb3d,cmgr_sfcdif,chgr_sfcdif,trl_urb3d,tgl_urb3d,tbl_urb3d,ahe,lf_urb2d_s,z0_urb2d,zd_urb2d
Copy link
Contributor

@epn09 epn09 Feb 6, 2024

Choose a reason for hiding this comment

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

@cenlinhe I don't understand package in Registry very well but should we add here something like

package ahe_scheme_airtemp distributed_ahe_opt==1 state:ahe
package ahe_scheme_surface distributed_ahe_opt==2 state:ahe

so that those who don't use AH won't need to allocate a big array?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is fine for now to package it to SLUCM scheme. Later, we can create a new package if needed. Currently, there is limited time to finalize the code for the upcoming WRF release, so I do not suggest any major changes unless it is necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cenlinhe Thank you. I understand.

package bepscheme sf_urban_physics==2 - state:a_u_bep,a_v_bep,a_t_bep,a_q_bep,a_e_bep,b_u_bep,b_v_bep,b_t_bep,b_q_bep,b_e_bep,dlg_bep,dl_u_bep,sf_bep,vl_bep,trb_urb4d,tw1_urb4d,tw2_urb4d,tgb_urb4d,sfw1_urb3d,sfw2_urb3d,sfr_urb3d,sfg_urb3d,hi_urb2d,lp_urb2d,hgt_urb2d,lb_urb2d,trl_urb3d,tgl_urb3d,tbl_urb3d,tsk_rural
package bep_bemscheme sf_urban_physics==3 - state:a_u_bep,a_v_bep,a_t_bep,a_q_bep,a_e_bep,b_u_bep,b_v_bep,b_t_bep,b_q_bep,b_e_bep,dlg_bep,dl_u_bep,sf_bep,vl_bep,trb_urb4d,tw1_urb4d,tw2_urb4d,tgb_urb4d,tlev_urb3d,qlev_urb3d,tw1lev_urb3d,tw2lev_urb3d,tglev_urb3d,tflev_urb3d,sf_ac_urb3d,lf_ac_urb3d,cm_ac_urb3d,sfvent_urb3d,lfvent_urb3d,sfwin1_urb3d,sfwin2_urb3d,sfw1_urb3d,sfw2_urb3d,sfr_urb3d,sfg_urb3d,hi_urb2d,lp_urb2d,hgt_urb2d,lb_urb2d,trl_urb3d,tgl_urb3d,tbl_urb3d,tsk_rural,ep_pv_urb3d,t_pv_urb3d,trv_urb4d,qr_urb4d,qgr_urb3d,tgr_urb3d,drain_urb4d,draingr_urb3d,sfrv_urb3d,lfrv_urb3d,dgr_urb3d,dg_urb3d,lfr_urb3d,lfg_urb3d

Expand Down
2 changes: 2 additions & 0 deletions Registry/registry.dimspec
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,5 @@ endif
# Dimensions for PSU-DENG SCP
dimspec nsh 2 constant=100 z nsh

# Dimensions for AHE
dimspec m_hr 2 constant=(0:287) z month_hour
5 changes: 5 additions & 0 deletions dyn_em/module_first_rk_step_part1.F
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& ,BL_PBL_PHYSICS=config_flags%bl_pbl_physics &
& ,SF_SURFACE_PHYSICS=config_flags%sf_surface_physics ,SH2O=grid%sh2o &
& ,SHDMAX=grid%shdmax ,SHDMIN=grid%shdmin ,SMOIS=grid%smois &
& ,SHDAVG=grid%shdavg &
& ,SMSTAV=grid%smstav ,SMSTOT=grid%smstot ,SNOALB=grid%snoalb &
& ,SNOW=grid%snow ,SNOWC=grid%snowc ,SNOWH=grid%snowh &
& ,SMCREL=grid%smcrel &
Expand Down Expand Up @@ -810,6 +811,7 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& ,urban_map_zgrd = config_flags%urban_map_zgrd & !multi-layer urban
& ,NUM_URBAN_HI=config_flags%num_urban_hi & !multi-layer urban
& ,use_wudapt_lcz=config_flags%use_wudapt_lcz & !wudapt
& ,slucm_distributed_drag=config_flags%slucm_distributed_drag & !SLUCM
& ,TSK_RURAL=grid%tsk_rural & !multi-layer urban
& ,TRB_URB4D=grid%trb_urb4d,TW1_URB4D=grid%tw1_urb4d & !multi-layer urban
& ,TW2_URB4D=grid%tw2_urb4d,TGB_URB4D=grid%tgb_urb4d & !multi-layer urban
Expand Down Expand Up @@ -846,6 +848,7 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& ,LB_URB2D=grid%lb_urb2d,HGT_URB2D=grid%hgt_urb2d & !multi-layer urban
& ,MH_URB2D=grid%mh_urb2d,STDH_URB2D=grid%stdh_urb2d & !SLUCM
& ,LF_URB2D=grid%lf_urb2d &
& ,lf_urb2d_s=grid%lf_urb2d_s, z0_urb2d=grid%z0_urb2d &
& ,GMT=grid%gmt,XLAT=grid%xlat,XLONG=grid%xlong,JULDAY=grid%julday &
& ,A_U_BEP=grid%a_u_bep,A_V_BEP=grid%a_v_bep,A_T_BEP=grid%a_t_bep &
& ,A_Q_BEP=grid%a_q_bep &
Expand Down Expand Up @@ -1157,6 +1160,8 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
! Bep changes end
! add tke_pbl, and turbulent fluxes
& ,TKE_PBL=grid%tke_pbl,EL_PBL=grid%el_pbl,WU_TUR=grid%wu_tur &
& , gmt=grid%gmt, xtime=grid%xtime,julday=grid%julday,julyr=grid%julyr &
& , ahe=grid%ahe,distributed_ahe_opt=grid%distributed_ahe_opt &
& ,WV_tur=grid%wv_tur,WT_tur=grid%wt_tur,WQ_tur=grid%wq_tur &
& ,DISS_PBL=grid%diss_pbl,TPE_PBL=grid%tpe_pbl &
& ,TKE_ADV=scalar(ims,kms,jms,P_tke_adv) &
Expand Down
54 changes: 51 additions & 3 deletions dyn_em/module_initialize_real.F
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,15 @@ SUBROUTINE init_domain_rk ( grid &
END IF
END IF

IF (config_flags%slucm_distributed_drag) THEN
CALL wrf_message('Adding zero-plane displacement height to topography')
DO j = jts, MIN(jde - 1, jte)
DO i = its, MIN(ide - 1, ite)
IF (grid%zd_urb2d(i, j) > 0) grid%ht_gc(i, j) = grid%ht_gc(i, j) + grid%zd_urb2d(i, j)
END DO
END DO
END IF

! Is there any vertical interpolation to do? The "old" data comes in on the correct
! vertical locations already.

Expand Down Expand Up @@ -1340,6 +1349,11 @@ SUBROUTINE init_domain_rk ( grid &
ims , ime , jms , jme , kms , kme , &
its , ite , jts , jte , kts , kte )

CALL monthly_avg ( grid%greenfrac , grid%shdavg , &
ids , ide , jds , jde , kds , kde , &
ims , ime , jms , jme , kms , kme , &
its , ite , jts , jte , kts , kte )

! The model expects the green-ness and vegetation fraction values to be in percent, not fraction.

DO j = jts, MIN(jte,jde-1)
Expand All @@ -1348,7 +1362,8 @@ SUBROUTINE init_domain_rk ( grid &
grid%vegfra(i,j) = grid%vegfra(i,j) * 100.
grid%shdmax(i,j) = grid%shdmax(i,j) * 100.
grid%shdmin(i,j) = grid%shdmin(i,j) * 100.
END DO
grid%shdavg(i,j) = grid%shdavg(i,j) * 100.
END DO
END DO

! The model expects the albedo fields as a fraction, not a percent. Set the
Expand Down Expand Up @@ -3119,7 +3134,17 @@ SUBROUTINE init_domain_rk ( grid &

! Split NUDAPT Urban Parameters

IF ( ( config_flags%sf_urban_physics == 1 ) .OR. ( config_flags%sf_urban_physics == 2 ) .OR. ( config_flags%sf_urban_physics == 3 ) ) THEN
distributed_aerodynamics_if: IF (config_flags%sf_urban_physics == 1 .AND. config_flags%slucm_distributed_drag) THEN
DO j = jts , MIN(jde-1,jte)
DO i = its , MIN(ide-1,ite)
IF (grid%ivgtyp(i, j) == model_config_rec%isurban(grid%id)) THEN
grid%frc_urb2d(i, j) = MAX(0.1, MIN(0.9, 1 - grid%shdavg(i, j) / 100.))
END IF
Copy link
Collaborator

Choose a reason for hiding this comment

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

urban fraction set to annual mean vegetation fraction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I asked the same question to the developer and he said this treatment seems most reasonable for their new scheme.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would be concerned about urban areas in dry/desert regions. Why not trust frc_urb2d more?

Copy link
Contributor

@epn09 epn09 Feb 6, 2024

Choose a reason for hiding this comment

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

@dudhia

  • Is FRC_URB2D available globally? I am sorry for my lack of understanding but I've never used that static data before.
  • May be we can add a switch to allow users to pick between our way of estimating FRC_URB2D and the static FRC_URB2D input file.

@cenlinhe If time is limited, can we let it be a TODO for the next minor WRF release?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we can think of it later

END DO
END DO
ELSE

IF ( ( config_flags%sf_urban_physics == 1 ) .OR. ( config_flags%sf_urban_physics == 2 ) .OR. ( config_flags%sf_urban_physics == 3 ) ) THEN
DO j = jts , MIN(jde-1,jte)
DO i = its , MIN(ide-1,ite)
IF ( MMINLU == 'NLCD40' .OR. MMINLU == 'MODIFIED_IGBP_MODIS_NOAH') THEN
Expand All @@ -3141,7 +3166,7 @@ SUBROUTINE init_domain_rk ( grid &
grid%HGT_URB2D(i,j) = grid%URB_PARAM(i,94,j)
END DO
END DO
ENDIF
ENDIF

IF ( ( config_flags%sf_urban_physics == 2 ) .OR. ( config_flags%sf_urban_physics == 3 ) ) THEN
DO j = jts , MIN(jde-1,jte)
Expand Down Expand Up @@ -3175,6 +3200,8 @@ SUBROUTINE init_domain_rk ( grid &
END DO
END DO

END IF distributed_aerodynamics_if

END IF

! Adjustments for the seaice field PRIOR to the grid%tslb computations. This is
Expand Down Expand Up @@ -7954,6 +7981,27 @@ SUBROUTINE monthly_min_max ( field_in , field_min , field_max , &

END SUBROUTINE monthly_min_max

!---------------------------------------------------------------------

SUBROUTINE monthly_avg ( field_in , field_avg , &
ids , ide , jds , jde , kds , kde , &
ims , ime , jms , jme , kms , kme , &
its , ite , jts , jte , kts , kte )
IMPLICIT NONE
INTEGER , INTENT(IN) :: ids , ide , jds , jde , kds , kde , &
ims , ime , jms , jme , kms , kme , &
its , ite , jts , jte , kts , kte
REAL , DIMENSION(ims:ime,12,jms:jme) , INTENT(IN) :: field_in
REAL , DIMENSION(ims:ime, jms:jme) , INTENT(OUT) :: field_avg
! Local vars
INTEGER :: i , j
DO j = jts , MIN(jde-1,jte)
DO i = its , MIN(ide-1,ite)
field_avg(i, j) = SUM(field_in(i, :, j)) / 12
END DO
END DO
END SUBROUTINE monthly_avg

!---------------------------------------------------------------------

SUBROUTINE monthly_interp_to_date ( field_in , date_str , field_out , &
Expand Down
30 changes: 29 additions & 1 deletion phys/module_pbl_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ SUBROUTINE pbl_driver( &
,tke_adv,diss_adv,tpe_adv &
,pr_pbl,el_pbl &
,wu_tur,wv_tur,wt_tur,wq_tur &
! variables added for AHE
, gmt, xtime, julday, julyr, ahe &
, distributed_ahe_opt &
! variables for GBM PBL
,exch_tke, rthraten &
,a_e_bep,b_e_bep,dlg_bep,dl_u_bep &
Expand Down Expand Up @@ -203,6 +206,7 @@ SUBROUTINE pbl_driver( &
USE module_wind_fitch
USE module_wind_mav ! Yulong add for WLM
#endif
use module_ra_gfdleta, only: cal_mon_day

! This driver calls subroutines for the PBL parameterizations.
!
Expand Down Expand Up @@ -617,6 +621,11 @@ SUBROUTINE pbl_driver( &
REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), &
INTENT(OUT) :: EL_PBL

REAL, INTENT(IN) :: gmt, xtime
INTEGER, INTENT(IN) :: julday, julyr
REAL, OPTIONAL, DIMENSION( ims:ime, 0:287, jms:jme ), INTENT(IN) :: ahe
INTEGER, INTENT(IN) :: distributed_ahe_opt

REAL , INTENT(IN ) :: u_frame, &
v_frame
!
Expand Down Expand Up @@ -827,8 +836,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
INTEGER :: ihour, jmonth, jday
!
! FASDAS
!
Expand Down Expand Up @@ -2260,6 +2269,25 @@ SUBROUTINE pbl_driver( &
,ITS=its,ITE=ite,JTS=jts,JTE=jte,KTS=kts,KTE=kte)
ENDIF

IF (distributed_ahe_opt > 0) THEN
call cal_mon_day(julday, julyr, jmonth, jday)
ihour = (jmonth - 1) * 24 + MOD(INT(gmt + xtime / 60.0), 24)
IF (distributed_ahe_opt == 1) THEN
DO j = jts, jte
DO i = its, ite
! Volumetric heat capacity of air = 1200 J/(K m3)
RTHBLTEN(i, 1, j) = RTHBLTEN(i, 1, j) + ahe(i, ihour, j) / 1200 / DZ8W(i, 1, j)
END DO
END DO
ELSE IF (distributed_ahe_opt == 2) THEN
DO j = jts, jte
DO i = its, ite
HFX(i, j) = HFX(i, j) + ahe(i, ihour, j)
END DO
END DO
END IF
END IF

Copy link
Collaborator

Choose a reason for hiding this comment

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

@epn09 @cenlinhe Why is HFX added at the end of PBL driver? What is the added HFX for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is for anthropogenic heat flux (i.e., sensible heat flux) released from surface human activities to the atmosphere.

Copy link
Collaborator

@weiwangncar weiwangncar Feb 6, 2024

Choose a reason for hiding this comment

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

@cenlinhe After the PBL call, how do you expect the flux to be affecting the atmosphere?

Copy link
Contributor Author

@cenlinhe cenlinhe Feb 6, 2024

Choose a reason for hiding this comment

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

I think @epn09 originally wants to let this flux affect atmosphere for the next time step. Another technical consideration is that @epn09 wants to add this flux to the temperature tendency (distributed_ahe_opt=1) which is an output of PBL scheme (if I understand it correctly), so this part needs to be added at the end of PBL call. This is my understanding.

Copy link
Contributor

@epn09 epn09 Feb 6, 2024

Choose a reason for hiding this comment

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

@weiwangncar @cenlinhe

  • I think we added anthropogenic heat (AH) to the end of PBL so that it will not be overwritten by any other scheme.
  • Already discussed before but AH is added in PBL instead of UCM because AH can present in non-urban grids.
  • There are two options for AH:
    1. Add to the temperature tendency at the first layer of the atmosphere
    2. Add directly to the surface sensible heat flux.
  • So far, we found that the first option often produces more natural (?) result but we'd like to expose both options to WRF users.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@epn09 It could explain why your added HFX doesn't have much effect to the model. The flux will be re-computed in the model's next step in the land model, which is called second after the radiation and before PBL.

Copy link
Contributor

Choose a reason for hiding this comment

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

@weiwangncar I see. So where would be the right place to add AH to HFX?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@epn09 Perhaps you could do this in module_pbl_driver.F, but before any PBL physics is called.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Some PBL schemes may set RTHBLTEN to zero before adding to it. It needs to be checked.

ENDDO
!$OMP END PARALLEL DO

Expand Down
7 changes: 4 additions & 3 deletions phys/module_physics_init.F
Original file line number Diff line number Diff line change
Expand Up @@ -3290,8 +3290,8 @@ SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, &

IF ( PRESENT( FRC_URB2D ) .AND. PRESENT( UTYPE_URB2D )) THEN
CALL urban_param_init(DZR,DZB,DZG,num_soil_layers, & !urban
sf_urban_physics,config_flags%use_wudapt_lcz) !urban

sf_urban_physics,config_flags%use_wudapt_lcz, &
config_flags%slucm_distributed_drag)

CALL urban_var_init(ISURBAN,TSK,TSLB,TMN,IVGTYP, & !urban
ims,ime,jms,jme,kms,kme,num_soil_layers, & !urban
Expand Down Expand Up @@ -3433,7 +3433,8 @@ SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, &
IF ((SF_URBAN_PHYSICS.eq.1).OR.(SF_URBAN_PHYSICS.EQ.2).OR.(SF_URBAN_PHYSICS.EQ.3)) THEN
IF ( PRESENT( FRC_URB2D ) .AND. PRESENT( UTYPE_URB2D )) THEN
CALL urban_param_init(DZR,DZB,DZG,num_soil_layers, & !urban
sf_urban_physics,config_flags%use_wudapt_lcz)
sf_urban_physics,config_flags%use_wudapt_lcz, &
config_flags%slucm_distributed_drag)
CALL urban_var_init(ISURBAN,TSK,TSLB,TMN,IVGTYP, & !urban
ims,ime,jms,jme,kms,kme,num_soil_layers, & !urban
LCZ_1_TABLE,LCZ_2_TABLE,LCZ_3_TABLE,LCZ_4_TABLE, & !urban
Expand Down
11 changes: 10 additions & 1 deletion phys/module_sf_clm.F
Original file line number Diff line number Diff line change
Expand Up @@ -59345,6 +59345,10 @@ subroutine clmdrv(zgcmxy ,forc_qxy ,ps ,forc_txy ,tsxy &
character*256 :: msg
real :: mh_urb,stdh_urb,lp_urb,hgt_urb,frc_urb,lb_urb,check
real, dimension(4) :: lf_urb
! Distributed aerodynamics parameters
real :: lf_urb_s
real :: z0_urb
real :: vegfrac

logical, external :: wrf_dm_on_monitor

Expand Down Expand Up @@ -60318,6 +60322,10 @@ subroutine clmdrv(zgcmxy ,forc_qxy ,ps ,forc_txy ,tsxy &
enddo
frc_urb = FRC_URB2D(I,J)
check = 0.
! Distributed aerodynamics
lf_urb_s = 0
z0_urb = 0
vegfrac = 0
!

! Call urban
Expand Down Expand Up @@ -60346,7 +60354,8 @@ subroutine clmdrv(zgcmxy ,forc_qxy ,ps ,forc_txy ,tsxy &
hgt_urb,frc_urb,lb_urb, check,CMCR_URB,TGR_URB, & ! H
TGRL_URB,SMR_URB,CMGR_URB, CHGR_URB, jmonth, & ! H
DRELR_URB,DRELB_URB, & ! H
DRELG_URB,FLXHUMR_URB,FLXHUMB_URB,FLXHUMG_URB)
DRELG_URB,FLXHUMR_URB,FLXHUMB_URB,FLXHUMG_URB, &
lf_urb_s, z0_urb, vegfrac)
!sw--

TS_URB2D(I,J) = TS_URB
Expand Down
Loading