From 10b1b0cb88b17d172669b039a6fcb0e489fa97b4 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Thu, 8 May 2025 19:44:28 +0200 Subject: [PATCH 01/23] Modifications by A. Martilli to output new urban variables for the FPS-URB-RCC and changes in the dimensionality of the arrays to use less memory (changes in nbui_max, etc). These changes are paired with changes in noahmp commit: https://github.com/CORDEX-WRF-community/noahmp/commit/12018117 --- Registry/Registry.EM_COMMON | 16 +- dyn_em/module_first_rk_step_part1.F | 9 ++ dyn_em/module_initialize_real.F | 15 +- phys/module_sf_bep_bem.F | 219 ++++++++++++++++++++++------ phys/module_sf_noahdrv.F | 36 +++++ phys/module_surface_driver.F | 109 +++++++++++--- phys/noahmp | 2 +- 7 files changed, 334 insertions(+), 72 deletions(-) diff --git a/Registry/Registry.EM_COMMON b/Registry/Registry.EM_COMMON index 889a92854b..8ff2204ac7 100644 --- a/Registry/Registry.EM_COMMON +++ b/Registry/Registry.EM_COMMON @@ -895,13 +895,23 @@ state real dfi_SMFR3D ilj misc 1 Z r "SMFR3D_df state real dfi_KEEPFR3DFLAG ilj misc 1 Z r "KEEPFR3DFLAG_dfi" "FLAG - 1. FROZEN SOIL YES, 0 - NO" "" # urban state variables -state real TSK_RURAL ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "TSK_RURAL" "TSK for rural fraction" "K" state real TR_URB2D ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "TR_URB" "URBAN ROOF SKIN TEMPERATURE" "K" state real TGR_URB2D ij misc 1 - rd=(interp_mask_land_field:lu_index)u=(copy_fcnm) "TGR_URB" "URBAN GREEN ROOF SKIN TEMPERATURE" "K" state real TB_URB2D ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "TB_URB" "URBAN WALL SKIN TEMPERATURE" "K" state real TG_URB2D ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "TG_URB" "URBAN ROAD SKIN TEMPERATURE" "K" state real TC_URB2D ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "TC_URB" "URBAN CANOPY TEMPERATURE" "K" state real QC_URB2D ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "QC_URB" "URBAN CANOPY HUMIDITY" "kg kg{-1}" +#CORDEX +state real TSK_RURAL ij misc 1 - rh "TSK_RURAL" "TSK for rural fraction" "K" +state real T2R_URB2D ij misc 1 - rh "T2R_URB2D" "2M ROOF TEMPERATURE" "K" +state real T2G_URB2D ij misc 1 - rh "T2G_URB2D" "2M ROAD TEMPERATURE" "K" +state real TGROUND_URB2D ij misc 1 - rh "TGROUND_URB2D" "ROAD SURFACE TEMPERATURE" "K" +state real TROOF_URB2D ij misc 1 - rh "TROOF_URB2D" "ROOF SURFACE TEMPERATURE" "K" +state real T2VEG_URB2D ij misc 1 - rh "T2VEG_URB2D" "2M VEG TEMPERATURE" "K" +state real TCAN_URB2D ij misc 1 - rh "TCAN_URB2D" "URBAN CANOPY TEMP" "K" +state real UCAN_URB2D ij misc 1 - rh "UCAN_URB2D" "URBAN CANOPY WIND" "M/S" +state real QCAN_URB2D ij misc 1 - rh "QCAN_URB2D" "URBAN CANOPY HUMIDITY" "Kg kg{-1}" +#CORDEX state real UC_URB2D ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "UC_URB" "URBAN CANOPY WIND" "m s{-1}" state real XXXR_URB2D ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "XXXR_URB" "M-O LENGTH ABOVE URBAN ROOF" "dimensionless" state real XXXB_URB2D ij misc 1 - rd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "XXXB_URB" "M-O LENGTH ABOVE URBAN WALL" "dimensionless" @@ -3094,7 +3104,9 @@ 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 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 +#CORDEX +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,t2r_urb2d,t2g_urb2d,t2veg_urb2d,tcan_urb2d,ucan_urb2d,qcan_urb2d,troof_urb2d,tground_urb2d +#CORDEX package nolsmscheme sf_surface_physics==0 - - diff --git a/dyn_em/module_first_rk_step_part1.F b/dyn_em/module_first_rk_step_part1.F index f5eb26734d..d3db03ab50 100644 --- a/dyn_em/module_first_rk_step_part1.F +++ b/dyn_em/module_first_rk_step_part1.F @@ -775,6 +775,15 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags & & ,TG_URB2D=grid%tg_urb2d & !H urban & ,TC_URB2D=grid%tc_urb2d ,QC_URB2D=grid%qc_urb2d & !H urban & ,UC_URB2D=grid%uc_urb2d & !H urban +!CORDEX + & ,T2G_URB2D=grid%t2g_urb2d,T2R_URB2D=grid%t2r_urb2d & + & ,T2VEG_URB2D=grid%t2veg_urb2d & + & ,TCAN_URB2D=grid%tcan_urb2d & + & ,UCAN_URB2D=grid%ucan_urb2d & + & ,QCAN_URB2D=grid%qcan_urb2d & + & ,TGROUND_URB2D=grid%tground_urb2d & + & ,TROOF_URB2D=grid%troof_urb2d & +!CORDEX & ,XXXR_URB2D=grid%xxxr_urb2d & & ,XXXB_URB2D=grid%xxxb_urb2d & !H urban & ,XXXG_URB2D=grid%xxxg_urb2d & diff --git a/dyn_em/module_initialize_real.F b/dyn_em/module_initialize_real.F index 96629232bf..3c7a8d557b 100644 --- a/dyn_em/module_initialize_real.F +++ b/dyn_em/module_initialize_real.F @@ -3117,9 +3117,20 @@ SUBROUTINE init_domain_rk ( grid & DO j = jts , MIN(jde-1,jte) DO i = its , MIN(ide-1,ite) IF ( skip_middle_points_t ( ids , ide , jds , jde , i , j , em_width , hold_ups ) ) CYCLE - DO k = 1, 15 - grid%HI_URB2D(i,k,j) = grid%URB_PARAM(i,k+117,j) +!CORDEX +! DO k = 1, 15 +! grid%HI_URB2D(i,k,j) = grid%URB_PARAM(i,k+117,j) +! END DO +! force to one level + DO k = 1, 6!15 + grid%HI_URB2D(i,k,j) =0.! grid%URB_PARAM(i,k+117,j) END DO + k=int(grid%HGT_URB2D(i,j)/10.)+1 + if(k.lt.1)k=1 + if(k.gt.4)k=4 + grid%HI_URB2D(i,k,j) =1. +! force to one level + END DO END DO ENDIF diff --git a/phys/module_sf_bep_bem.F b/phys/module_sf_bep_bem.F index f249700a08..55835b2da7 100644 --- a/phys/module_sf_bep_bem.F +++ b/phys/module_sf_bep_bem.F @@ -42,12 +42,12 @@ MODULE module_sf_bep_bem integer ngb_u !Number of grid levels in the ground below building (BEM) parameter (ngb_u=10) - +! real dz_u ! Urban grid resolution - parameter (dz_u=5.) + parameter (dz_u=10.) !CORDEX integer nbui_max !maximum number of types of buildings in an urban class - parameter (nbui_max=15) !must be less or equal than nz_um + parameter (nbui_max=1) !CORDEX!must be less or equal than nz_um real h_water @@ -117,6 +117,10 @@ subroutine BEP_BEM(FRC_URB2D,UTYPE_URB2D,itimestep,dz8w,dt,u_phy,v_phy, & a_u,a_v,a_t,a_e,b_u,b_v, & b_t,b_e,b_q,dlg,dl_u,sf,vl, & rl_up,rs_abs,emiss,grdflx_urb,qv_phy, & +!CORDEX + tground_urb2d,troof_urb2d,tcan_urb2d, & + t2g_urb2d,t2r_urb2d,ucan_urb2d,qcan_urb2d, & +!CORDEX ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte) @@ -178,6 +182,15 @@ subroutine BEP_BEM(FRC_URB2D,UTYPE_URB2D,itimestep,dz8w,dt,u_phy,v_phy, & REAL, DIMENSION( ims:ime, 1:urban_map_zdf, jms:jme ), INTENT(INOUT) :: drain_urb4d REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: rainbl REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: draingr_urb3d +!CORDEX + REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: troof_urb2d + REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: tground_urb2d + REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: tcan_urb2d + REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: t2g_urb2d + REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: t2r_urb2d + REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: ucan_urb2d + REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: qcan_urb2d +!CORDEX !New variables used for BEM REAL, DIMENSION( ims:ime, kms:kme, jms:jme ):: qv_phy REAL, DIMENSION( ims:ime, 1:urban_map_bd, jms:jme ), INTENT(INOUT) :: tlev_urb3d @@ -945,7 +958,10 @@ subroutine BEP_BEM(FRC_URB2D,UTYPE_URB2D,itimestep,dz8w,dt,u_phy,v_phy, & dlg1D,dl_u1D,sf1D,vl1D,rl_up(ix,iy), & rs_abs(ix,iy),emiss(ix,iy),grdflx_urb(ix,iy), & qv1D,tlev1D,qlev1D,sflev1D,lflev1D,consumlev1D, & - eppvlev1D,tpvlev1D,sfvlev1D,lfvlev1D,twlev1D,tglev1D,tflev1D,sfwin1D,tair1D,sfr_indoor1D,sfrpv1D,gfr1D) + eppvlev1D,tpvlev1D,sfvlev1D,lfvlev1D,twlev1D,tglev1D,tflev1D,sfwin1D,tair1D,sfr_indoor1D,sfrpv1D,gfr1D, & +!CORDEX + t2g_urb2d(ix,iy),t2r_urb2d(ix,iy),tcan_urb2d(ix,iy),ucan_urb2d(ix,iy),qcan_urb2d(ix,iy)) +!CORDEX do ibui=1,nbui_max !type of building do iz=1,nz_um !vertical levels @@ -987,22 +1003,31 @@ subroutine BEP_BEM(FRC_URB2D,UTYPE_URB2D,itimestep,dz8w,dt,u_phy,v_phy, & enddo enddo - +!CORDEX - initalize to zero the ground and roof average surface temperature + tground_urb2d(ix,iy)=0. + troof_urb2d(ix,iy)=0. +!CORDEX -end do id=1,ndm do ig=1,ng_u - tgb_urb4d(ix,ind_gd(ig,id),iy)=tg1D(id,ig) enddo +!CORDEX - averaging it over the different street directions + tground_urb2d(ix,iy)=tground_urb2d(ix,iy)+tg1D(id,ng_u)/ndm +!CORDEX -end do iz_u=1,nz_um do ir=1,nwr_u trb_urb4d(ix,ind_zrd(iz_u,ir,id),iy)=tr1D(id,iz_u,ir) enddo - if(gr_flag_u.eq.1)then +!CORDEX - averaging it over the different street directions, and different heights + troof_urb2d(ix,iy)=troof_urb2d(ix,iy)+ss(iz_u)*tr1D(id,iz_u,nwr_u)/ndm + +!CORDEX -end + if(gr_flag_u.eq.1)then do ir=1,ngr_u trv_urb4d(ix,ind_grd(iz_u,ir,id),iy)=trv1D(id,iz_u,ir) qr_urb4d(ix,ind_grd(iz_u,ir,id),iy)=qr1D(id,iz_u,ir) enddo - endif + endif enddo enddo ! @@ -1182,7 +1207,10 @@ subroutine BEP1D(itimestep,ix,iy,iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, b_u,b_v,b_t,b_ac,b_e,b_q, & dlg,dl_u,sf,vl,rl_up,rs_abs,emiss,grdflx_urb, & qv,tlev,qlev,sflev,lflev,consumlev, & - eppvlev,tpvlev,sfvlev,lfvlev,twlev,tglev,tflev,sfwin,tmp_u,sfr_indoor,sfrpv,gfr) + eppvlev,tpvlev,sfvlev,lfvlev,twlev,tglev,tflev,sfwin,tmp_u,sfr_indoor,sfrpv,gfr, & +!CORDEX + t2g_urb2d,t2r_urb2d,tcan_urb2d,ucan_urb2d,qcan_urb2d) +!CORDEX ! print*,'SFR_AFT',sfr(id,iz) @@ -1228,7 +1256,9 @@ subroutine BEP1D(itimestep,ix,iy,iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, real emg ! Emissivity of ground real emw ! Emissivity of wall real emr ! Emissivity of roof - +!CORDEX + real tcan_urb2d,t2g_urb2d,t2r_urb2d,ucan_urb2d,qcan_urb2d +!CORDEX ! fww,fwg,fgw,fsw,fsg are the view factors used to compute the long and ! short wave radation. @@ -1479,6 +1509,9 @@ subroutine BEP1D(itimestep,ix,iy,iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, real tr_av(ndm,nz_um) real tr_avb(ndm,nbui_max) real sfr_avb(ndm,nbui_max) +!CORDEX + real zcenter, zcenter0,tc0,tc1,uc0,uc1,qc0,qc1 +!CORDEX ! ---------------------------------------------------------------------- ! END VARIABLES DEFINITIONS ! ---------------------------------------------------------------------- @@ -1515,6 +1548,38 @@ subroutine BEP1D(itimestep,ix,iy,iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, call interpol(kms,kme,kts,kte,nzu,z,z_u,pr,pr_u) call interpol(kms,kme,kts,kte,nzu,z,z_u,da,da_u) call interpol(kms,kme,kts,kte,nzu,z,z_u,qv,qv_u) +!CORDEX - here I am computing the value of temperature at 2m and wind speed at 10m + tcan_urb2d=0. + ucan_urb2d=0. + qcan_urb2d=0. + do iz=1,nz_um-1 + if(z_u(iz).le.2.and.z_u(iz+1).gt.2)then + if(iz.eq.1)then + tcan_urb2d=pt_u(1)*(pr_u(1)/1.e5)**rcp_u + qcan_urb2d=qv_u(1) + else + zcenter0=(z_u(iz-1)+z_u(iz))/2. + tc0=pt_u(iz-1)*(pr_u(iz-1)/1.e5)**rcp_u + tc1=pt_u(iz)*(pr_u(iz)/1.e5)**rcp_u + qc0=qv_u(iz-1) + qc1=qv_u(iz) + tcan_urb2d=((zcenter-2.)*tc0+(2.-zcenter0)*tc1)/(zcenter-zcenter0) + qcan_urb2d=((zcenter-2.)*qc0+(2.-zcenter0)*qc1)/(zcenter-zcenter0) + endif + endif + if(z_u(iz).le.10.and.z_u(iz+1).gt.10)then + if(iz.eq.1)then + ucan_urb2d=sqrt(ua_u(iz)**2.+va_u(iz)**2.) + else + zcenter0=(z_u(iz-1)+z_u(iz))/2. + uc0=sqrt(ua_u(iz-1)**2.+va_u(iz-1)**2.) + uc1=sqrt(ua_u(iz)**2.+va_u(iz)**2.) + ucan_urb2d=((zcenter-10.)*uc0+(10.-zcenter0)*uc1)/(zcenter-zcenter0) + endif + endif + enddo +!CORDEX + ! Compute the modification of the radiation due to the buildings @@ -1585,6 +1650,8 @@ subroutine BEP1D(itimestep,ix,iy,iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, call surf_temp(ndu,pr_u,dt, & rld,rsg,rlg, & tg,alag,csg,emg,albg,ptg,sfg,lfg,gfg) + if(ix.eq.50.and.iy.eq.42)write(98,'(10(2x,f15.8))')sfg(1),gfg(1),rsg(1),rlg(1),ptg(1) + if(ix.eq.50.and.iy.eq.42)write(99,'(10(2x,f15.8))')sfg(2),gfg(2),rsg(2),rlg(2),ptg(2) if(gr_flag.eq.1)then if(gr_frac_roof.gt.0.)then hfgr=0. @@ -1729,6 +1796,7 @@ subroutine BEP1D(itimestep,ix,iy,iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, sfvlev1D,lfvlev1D,hfgrb(1,ibui),tr_avb(1,ibui), & tpv(ibui),sfpv(ibui),sfr_indoor(ibui)) + if(ix.eq.50.and.iy.eq.42)write(88,'(10(2x,f15.8))')sfr_avb(1,1),gfrb(1,1),rs,rld,ptr(1,1) ! !Temporal modifications @@ -1845,7 +1913,10 @@ subroutine BEP1D(itimestep,ix,iy,iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, uhb_u,vhb_u,thb_u,ehb_u,ss,dt,sfw,sfg,sfr,sfrpv,sfrv,lfrv, & dgr,dg,lfr,lfg, & sfwin,pb,bs_u,dz_u,sflev,lflev,sfvlev,lfvlev,tvb_ac,ix,iy,rsg,rs,qr,gr_frac_roof, & - pv_frac_roof,gr_flag,gr_type) + pv_frac_roof,gr_flag,gr_type, & +!CORDEX + t2g_urb2d,t2r_urb2d) +!CORDEX @@ -1955,6 +2026,7 @@ subroutine param(iurb,nzu,nzurb,nzurban,ndu, & ! LOCAL: ! ---------------------------------------------------------------------- integer id,ig,ir,iw,iz,iflo,ihu + real sstot ! ---------------------------------------------------------------------- ! END VARIABLES DEFINITIONS ! ---------------------------------------------------------------------- @@ -2601,7 +2673,10 @@ subroutine buildings(iurb,nd,nz,z0,cdrag,ua_u,va_u,pt_u,pt0_u, & uhb_u,vhb_u,thb_u,ehb_u,ss,dt,sfw,sfg,sfr,sfrpv,sfrv,lfrv, & dgr,dg,lfr,lfg, & sfwin,pb,bs_u,dz_u,sflev,lflev,sfvlev,lfvlev,tvb_ac,ix,iy,rsg,rs,qr,gr_frac_roof, & - pv_frac_roof,gr_flag,gr_type) + pv_frac_roof,gr_flag,gr_type, & +!CORDEX + t2g_urb2d,t2r_urb2d) +!CORDEX ! ---------------------------------------------------------------------- ! This routine computes the sources or sinks of the different quantities @@ -2644,7 +2719,10 @@ subroutine buildings(iurb,nd,nz,z0,cdrag,ua_u,va_u,pt_u,pt0_u, & real trv(ndm,nz_um,ngr_u) ! Ground Soil Moisture real roof_frac real road_frac -! +!CORDEX + real t2g_urb2d,t2r_urb2d + real t2m +!CORDEX !New variables (BEM) ! real bs_u(ndm,nurbm) ! Building width [m] @@ -2722,6 +2800,8 @@ subroutine buildings(iurb,nd,nz,z0,cdrag,ua_u,va_u,pt_u,pt0_u, & real qr_tmp(ngr_u) data rsv /0,1/ real fh,ric,utot + !local + real sstot !------------------------------------------------------------------ ! END VARIABLES DEFINITIONS ! ---------------------------------------------------------------------- @@ -2763,11 +2843,19 @@ subroutine buildings(iurb,nd,nz,z0,cdrag,ua_u,va_u,pt_u,pt0_u, & enddo ! Calculation at the ground surfaces +!CORDEX + t2g_urb2d=0. + t2r_urb2d=0. +!CORDEX do id=1,nd call flux_flat(dz,z0(id,1),ua_u(1),va_u(1),pt_u(1),pt0_u(1), & ptg(id),qv_u(1),uhb(id,1), & - vhb(id,1),sfg(id),lfg(id),ehb(id,1),da_u(1),pr_u(1)) + vhb(id,1),sfg(id),lfg(id),ehb(id,1),da_u(1),pr_u(1), & +!CORDEX + t2m) + t2g_urb2d=t2g_urb2d+t2m/ndm +!CORDEX if(dg(id).gt.0)then wfg=dg(id)/dgmax lfg(id)=-da_u(1)*latent*(-(wfg*lfg(id))/(da_u(1)*latent)) @@ -2780,49 +2868,53 @@ subroutine buildings(iurb,nd,nz,z0,cdrag,ua_u,va_u,pt_u,pt0_u, & uhb_u(id,1)=uhb(id,1) ehb_u(id,1)=ehb(id,1) qhb_u(id,1)=-lfg(id)/(da_u(1)*latent) + do iz=2,nz - if(ss(iz).gt.0)then - + if(ss(iz).gt.0)then call flux_flat(dz,z0(id,iz),ua_u(iz),& va_u(iz),pt_u(iz),pt0_u(iz), & ptr(id,iz),qv_u(iz),uhb(id,iz), & - vhb(id,iz),sfr(id,iz),lfr(id,iz),ehb(id,iz),da_u(iz),pr_u(iz)) - if(dgr(id,iz).gt.0)then - wfr=dgr(id,iz)/drmax - lfr(id,iz)=-da_u(iz)*latent*(-(wfr*lfr(id,iz))/(da_u(iz)*latent)) - else - lfr(id,iz)=0. - endif - if(gr_flag.eq.1.and.gr_frac_roof.gt.0.)then - do il=1,ngr_u - qr_tmp(il)=qr(id,iz,il) - enddo + vhb(id,iz),sfr(id,iz),lfr(id,iz),ehb(id,iz),da_u(iz),pr_u(iz), & +!CORDEX + t2m) + t2r_urb2d=t2r_urb2d+t2m/ndm*ss(iz) +!CORDEX + if(dgr(id,iz).gt.0)then + wfr=dgr(id,iz)/drmax + lfr(id,iz)=-da_u(iz)*latent*(-(wfr*lfr(id,iz))/(da_u(iz)*latent)) + else + lfr(id,iz)=0. + endif + if(gr_flag.eq.1.and.gr_frac_roof.gt.0.)then + do il=1,ngr_u + qr_tmp(il)=qr(id,iz,il) + enddo call flux_flat_roof(dz,z0v,ua_u(iz),va_u(iz),pt_u(iz),pt0_u(iz), & ptrv(id,iz),uhbv(id,iz), & vhbv(id,iz),sfrv(id,iz),lfrv(id,iz),ehbv(id,iz),da_u(iz),qv_u(iz),pr_u(iz),rs,qr_tmp,resg,rsveg,f1,f2,f3,f4,gr_type,pv_frac_roof) - sfr(id,iz)=sfr(id,iz)+pv_frac_roof*sfrpv(id,iz) - thb_u(id,iz)=-((1.-gr_frac_roof)*sfr(id,iz)+gr_frac_roof*sfrv(id,iz))/(da_u(iz)*cp_u) - vhb_u(id,iz)=(1.-gr_frac_roof)*vhb(id,iz)+gr_frac_roof*vhbv(id,iz) - uhb_u(id,iz)=(1.-gr_frac_roof)*uhb(id,iz)+gr_frac_roof*uhbv(id,iz) - ehb_u(id,iz)=(1.-gr_frac_roof)*ehb(id,iz)+gr_frac_roof*ehbv(id,iz) - qhb_u(id,iz)=-(gr_frac_roof*lfrv(id,iz)+(1.-gr_frac_roof)*lfr(id,iz))/(da_u(iz)*latent) - sfr(id,iz)=sfr(id,iz)-pv_frac_roof*sfrpv(id,iz) - else - sfr(id,iz)=sfr(id,iz)+pv_frac_roof*sfrpv(id,iz) - thb_u(id,iz)=-sfr(id,iz)/(da_u(iz)*cp_u) - vhb_u(id,iz)=vhb(id,iz) - uhb_u(id,iz)=uhb(id,iz) - ehb_u(id,iz)=ehb(id,iz) - qhb_u(id,iz)=-lfr(id,iz)/(da_u(iz)*latent) - sfr(id,iz)=sfr(id,iz)-pv_frac_roof*sfrpv(id,iz) - endif - else + sfr(id,iz)=sfr(id,iz)+pv_frac_roof*sfrpv(id,iz) + thb_u(id,iz)=-((1.-gr_frac_roof)*sfr(id,iz)+gr_frac_roof*sfrv(id,iz))/(da_u(iz)*cp_u) + vhb_u(id,iz)=(1.-gr_frac_roof)*vhb(id,iz)+gr_frac_roof*vhbv(id,iz) + uhb_u(id,iz)=(1.-gr_frac_roof)*uhb(id,iz)+gr_frac_roof*uhbv(id,iz) + ehb_u(id,iz)=(1.-gr_frac_roof)*ehb(id,iz)+gr_frac_roof*ehbv(id,iz) + qhb_u(id,iz)=-(gr_frac_roof*lfrv(id,iz)+(1.-gr_frac_roof)*lfr(id,iz))/(da_u(iz)*latent) + sfr(id,iz)=sfr(id,iz)-pv_frac_roof*sfrpv(id,iz) + else + sfr(id,iz)=sfr(id,iz)+pv_frac_roof*sfrpv(id,iz) + thb_u(id,iz)=-sfr(id,iz)/(da_u(iz)*cp_u) + vhb_u(id,iz)=vhb(id,iz) + uhb_u(id,iz)=uhb(id,iz) + ehb_u(id,iz)=ehb(id,iz) + qhb_u(id,iz)=-lfr(id,iz)/(da_u(iz)*latent) + sfr(id,iz)=sfr(id,iz)-pv_frac_roof*sfrpv(id,iz) + endif + else uhb_u(id,iz) = 0.0 vhb_u(id,iz) = 0.0 thb_u(id,iz) = 0.0 ehb_u(id,iz) = 0.0 qhb_u(id,iz) = 0.0 - endif + endif enddo @@ -4594,7 +4686,10 @@ end subroutine flux_flat_roof ! ===6=8===============================================================72 subroutine flux_flat(dz,z0,ua,va,pt,pt0,ptg,qv, & - uhb,vhb,sf,lf,ehb,da,pr) + uhb,vhb,sf,lf,ehb,da,pr, & +!CORDEX + t2m) +!CORDEX ! ---------------------------------------------------------------------- ! Calculation of the flux at the ground @@ -4610,8 +4705,13 @@ subroutine flux_flat(dz,z0,ua,va,pt,pt0,ptg,qv, & real ua ! wind speed real va ! wind speed real z0 ! Roughness length + real z0t ! Roughness length for heat real da ! air density real qv +!CORDEX + real t2m + real a2 +!CORDEX ! ---------------------------------------------------------------------- ! OUTPUT: ! ---------------------------------------------------------------------- @@ -4632,6 +4732,7 @@ subroutine flux_flat(dz,z0,ua,va,pt,pt0,ptg,qv, & ! LOCAL: ! ---------------------------------------------------------------------- real aa + real ah real al real buu real c @@ -4648,11 +4749,18 @@ subroutine flux_flat(dz,z0,ua,va,pt,pt0,ptg,qv, & real zz real qvsg,qvs,es,esa,fbqq,tmp,resg real b,cm,ch,rr,tol + real akanda,sqvisc,ust_g + integer ikanda parameter(b=9.4,cm=7.4,ch=5.3,rr=0.74,tol=.001) ! ---------------------------------------------------------------------- ! END VARIABLES DEFINITIONS ! ---------------------------------------------------------------------- + akanda=1.29 + sqvisc = 258.2 + + ! ikanda=0 !ikanda=0 => same roughness length for momentum and heat - original BEP-BEM formulation + ikanda=1 !ikanda=1 => Kanda et al. (2007) fromula to estimate roughness length for heat - same as for SLUCM ! computation of the ground temperature @@ -4673,6 +4781,14 @@ subroutine flux_flat(dz,z0,ua,va,pt,pt0,ptg,qv, & aa=vk/log(zz/z0) + if(ikanda.eq.0)then + z0t=z0 + elseif(ikanda.eq.1)then + ust_g=utot*vk/alog(zz/z0) + z0t = exp (2.0-akanda*(sqvisc**2 * ust_g * z0)**0.25)* z0 + endif + + ah=vk/log(zz/z0t) tmp=ptg*(pr/(1.e+5))**(rcp_u)-273.15 @@ -4689,13 +4805,14 @@ subroutine flux_flat(dz,z0,ua,va,pt,pt0,ptg,qv, & else c=b*cm*aa*aa*(zz/z0)**.5 fm=1.-b*ric/(1.+c*(-ric)**.5) + c=b*cm*aa*ah*(zz/z0t)**.5 c=c*ch/cm - fh=1.-b*ric/(1.+c*(-ric)**.5) + fh=1-b*ric/(1+c*(-ric)**.5) endif resg= rr/(aa*aa*utot*fh) fbuw=-aa*aa*utot*utot*fm - fbpt=-aa*aa*utot*(pt-ptg)*fh/rr + fbpt=-aa*ah*utot*(pt-ptg)*fh/rr fbqq=-(qv-qvsg)/(resg) ustar=(-fbuw)**.5 @@ -4711,6 +4828,12 @@ subroutine flux_flat(dz,z0,ua,va,pt,pt0,ptg,qv, & lf= ustar*qstar*da*latent ehb=buu !!!!!!!!!!!!!!! +!CORDEX + a2=vk/log(2./z0t) + t2m=ah/a2*pt+(1.-ah/a2)*ptg + t2m=t2m*(pr/1.e5)**rcp_u +!CORDEX + return end subroutine flux_flat diff --git a/phys/module_sf_noahdrv.F b/phys/module_sf_noahdrv.F index 5c7df673a2..632305f0c2 100644 --- a/phys/module_sf_noahdrv.F +++ b/phys/module_sf_noahdrv.F @@ -68,6 +68,11 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & !Optional Urban TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !H urban UC_URB2D, & !H urban +!CORDEX + T2G_URB2D,T2R_URB2D,T2VEG_URB2D, & + TCAN_URB2D,UCAN_URB2D,QCAN_URB2D, & + TGROUND_URB2D,TROOF_URB2D, & +!CORDEX XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !H urban TRL_URB3D,TBL_URB3D,TGL_URB3D, & !H urban SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D,TS_URB2D, & !H urban @@ -535,6 +540,16 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TB_URB2D REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TG_URB2D REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TC_URB2D +!CORDEX + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: T2G_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: T2R_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: T2VEG_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TCAN_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UCAN_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QCAN_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TGROUND_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TROOF_URB2D +!CORDEX REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QC_URB2D REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UC_URB2D REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXR_URB2D @@ -686,6 +701,9 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & REAL :: CMR_URB, CHR_URB, CMC_URB, CHC_URB, CMGR_URB, CHGR_URB REAL :: frc_urb,lb_urb REAL :: check +!CORDEX + real aa_veg,a2_veg +!CORDEX ! ---------------------------------------------------------------------- ! DECLARATIONS END - urban ! ---------------------------------------------------------------------- @@ -1658,6 +1676,10 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & b_t_bep,b_e_bep,b_q_bep,dlg_bep, & dl_u_bep,sf_bep,vl_bep, & rl_up_urb,rs_abs_urb,emiss_urb,grdflx_urb,qv3d, & +!CORDEX + tground_urb2d,troof_urb2d,tcan_urb2d, & + t2g_urb2d,t2r_urb2d,ucan_urb2d,qcan_urb2d, & +!CORDEX ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) @@ -1752,6 +1774,20 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & ! print*,'ust',ust(i,j) ! print*,'swdown,glw',swdown(i,j),glw(i,j) ! endif +!CORDEX here I do a simple log interpolation between the surface temperature of the vegetated frction, tsk_rural, and the lowest +!model level value of temperature + aa_veg=alog(dz8w(i,1,j)/2./znt(i,j)) + a2_veg=alog(2/znt(i,j)) + t2veg_urb2d(i,j)=(1.-aa_veg/a2_veg)*tsk_rural(i,j)+aa_veg/a2_veg*th_phy(i,1,j) +! write(*,*)'znt=',znt(i,j) +! write(*,*)'aa_veg=',aa_veg +! write(*,*)'a2_veg=',a2_veg +! write(*,*)'tsk_rural=',tsk_rural(i,j) +! write(*,*)'th_phy=',th_phy(i,1,j) +! write(*,*)'p_phy=',p_phy(i,1,j) + + t2veg_urb2d(i,j)=t2veg_urb2d(i,j)*(p_phy(i,1,j)/1.e5)**0.286 +!CORDEX else SH_URB2D(I,J) = 0. LH_URB2D(I,J) = 0. diff --git a/phys/module_surface_driver.F b/phys/module_surface_driver.F index f1592a1f00..899acc8b6b 100644 --- a/phys/module_surface_driver.F +++ b/phys/module_surface_driver.F @@ -187,6 +187,11 @@ SUBROUTINE surface_driver( & & ,num_road_layers, dzr, dzb, dzg & !I urban & ,tr_urb2d,tb_urb2d,tg_urb2d,tc_urb2d,qc_urb2d & !H urban & ,uc_urb2d & !H urban +!CORDEX + & ,t2g_urb2d,t2r_urb2d,t2veg_urb2d & + & ,tcan_urb2d,ucan_urb2d,qcan_urb2d & + & ,tground_urb2d,troof_urb2d & +!CORDEX & ,xxxr_urb2d,xxxb_urb2d,xxxg_urb2d,xxxc_urb2d & !H urban & ,cmcr_urb2d,tgr_urb2d,tgrl_urb3d,smr_urb3d & !H urban & ,julian,julyr,drelr_urb2d,drelb_urb2d,drelg_urb2d & !H urban @@ -360,7 +365,12 @@ SUBROUTINE surface_driver( & USE module_sf_gfs USE module_sf_noahdrv ! danli mosaic, the " ,only : lsm " needs to be deleted USE module_sf_noahlsm, only : LCZ_1,LCZ_2,LCZ_3,LCZ_4,LCZ_5,LCZ_6,LCZ_7,LCZ_8,LCZ_9,LCZ_10,LCZ_11 - USE module_sf_noahmpdrv, only : noahmplsm, noahmp_urban + USE module_sf_noahmpdrv, only : noahmplsm,noahmp_urban +!CORDEX- BUG + USE NOAHMP_TABLES, ONLY: ISURBAN_TABLE,LCZ_1_TABLE,LCZ_2_TABLE,LCZ_3_TABLE,LCZ_4_TABLE, & + LCZ_5_TABLE,LCZ_6_TABLE,LCZ_7_TABLE,LCZ_8_TABLE, & + LCZ_9_TABLE,LCZ_10_TABLE,LCZ_11_TABLE +!CORDEX- BUG USE module_sf_noahmp_groundwater USE module_sf_noah_seaice_drv #ifdef WRF_USE_CLM @@ -1273,6 +1283,16 @@ SUBROUTINE surface_driver( & REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: TC_URB2D !urban REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: QC_URB2D !urban REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: UC_URB2D !urban +!CORDEX + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: T2G_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: T2R_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: T2VEG_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: TCAN_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: UCAN_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: QCAN_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: TGROUND_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: TROOF_URB2D !urban +!CORDEX REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: XXXR_URB2D !urban REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: XXXB_URB2D !urban REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: XXXG_URB2D !urban @@ -2838,6 +2858,11 @@ SUBROUTINE surface_driver( & ,cmgr_sfcdif,chgr_sfcdif & ,tr_urb2d,tb_urb2d,tg_urb2d,tc_urb2d,qc_urb2d, & !H urban uc_urb2d, & !H urban +!CORDEX + t2g_urb2d,t2r_urb2d,t2veg_urb2d, & + tcan_urb2d,ucan_urb2d,qcan_urb2d, & + tground_urb2d,troof_urb2d, & +!CORDEX xxxr_urb2d,xxxb_urb2d,xxxg_urb2d,xxxc_urb2d, & !H urban trl_urb3d,tbl_urb3d,tgl_urb3d, & !H urban sh_urb2d,lh_urb2d,g_urb2d,rn_urb2d,ts_urb2d, & !H urban @@ -3008,15 +3033,28 @@ SUBROUTINE surface_driver( & IF((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.eq.3)) THEN DO j=j_start(ij),j_end(ij) !urban DO i=i_start(ij),i_end(ij) !urban +! write(*,*)'ivgtyp',IVGTYP(I,J),LCZ_2,LCZ_6,LCZ_8 IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1 .or. IVGTYP(I,J) == LCZ_2 .or. & IVGTYP(I,J) == LCZ_3 .or. IVGTYP(I,J) == LCZ_4 .or. IVGTYP(I,J) == LCZ_5 .or. & IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. & IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 )THEN - T2(I,J) = TH_PHY(i,1,j)/((1.E5/PSFC(I,J))**RCP) !urban - TH2(I,J) = TH_PHY(i,1,j) !urban - Q2(I,J) = qv_curr(i,1,j) !urban - U10(I,J) = U_phy(I,1,J) !urban - V10(I,J) = V_phy(I,1,J) !urban + T2(I,J) = TH_PHY(i,1,j)/((1.E5/PSFC(I,J))**RCP) !urban + TH2(I,J) = TH_PHY(i,1,j) !urban + Q2(I,J) = qv_curr(i,1,j) !urban + U10(I,J) = U_phy(I,1,J) !urban + V10(I,J) = V_phy(I,1,J) !urban +!CORDEX ! for non urban points put 1.e20 for urban diagnostic variables + else + tsk_rural(i,j)=1.e20 + tcan_urb2d(i,j)=1.e20 + ucan_urb2d(i,j)=1.e20 + qcan_urb2d(i,j)=1.e20 + t2g_urb2d(i,j)=1.e20 + t2r_urb2d(i,j)=1.e20 + t2veg_urb2d(i,j)=1.e20 + troof_urb2d(i,j)=1.e20 + tground_urb2d(i,j)=1.e20 +!CORDEX END IF !urban ENDDO !urban ENDDO !urban @@ -3170,6 +3208,16 @@ SUBROUTINE surface_driver( & IF(SF_URBAN_PHYSICS > 0 ) THEN !urban + DO j=j_start(ij),j_end(ij) + DO i=i_start(ij),i_end(ij) + IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1_TABLE .or. IVGTYP(I,J) == LCZ_2_TABLE .or. & + IVGTYP(I,J) == LCZ_3_TABLE .or. IVGTYP(I,J) == LCZ_4_TABLE .or. IVGTYP(I,J) == LCZ_5_TABLE .or. & + IVGTYP(I,J) == LCZ_6_TABLE .or. IVGTYP(I,J) == LCZ_7_TABLE .or. IVGTYP(I,J) == LCZ_8_TABLE .or. & + IVGTYP(I,J) == LCZ_9_TABLE .or. IVGTYP(I,J) == LCZ_10_TABLE .or. IVGTYP(I,J) == LCZ_11_TABLE )THEN + tsk_rural(i,j)=tsk(i,j) + ENDIF + ENDDO + ENDDO call noahmp_urban (sf_urban_physics, NUM_SOIL_LAYERS, IVGTYP,ITIMESTEP, & ! IN : Model configuration DTBL, COSZEN, XLAT_URB2D, & ! IN : Time/Space-related T_PHY, QV_CURR, U_PHY, V_PHY, SWDOWN, & ! IN : Forcing @@ -3184,6 +3232,12 @@ SUBROUTINE surface_driver( & chc_sfcdif, cmgr_sfcdif, chgr_sfcdif, & tr_urb2d, tb_urb2d, tg_urb2d, & !H urban tc_urb2d, qc_urb2d, uc_urb2d, & !H urban + tsk_rural, & +!CORDEX + t2g_urb2d, t2r_urb2d, & + tcan_urb2d, ucan_urb2d, qcan_urb2d, & + tground_urb2d, troof_urb2d, & +!CORDEX xxxr_urb2d, xxxb_urb2d, xxxg_urb2d, xxxc_urb2d, & !H urban trl_urb3d, tbl_urb3d, tgl_urb3d, & !H urban sh_urb2d, lh_urb2d, g_urb2d, rn_urb2d, ts_urb2d, & !H urban @@ -3223,7 +3277,6 @@ SUBROUTINE surface_driver( & a_e_bep, b_u_bep, b_v_bep, & !O multi-layer urban b_t_bep, b_q_bep, b_e_bep, dlg_bep, & !O multi-layer urban dl_u_bep, sf_bep, vl_bep) !O multi-layer urban - ENDIF IF ( iopt_run .EQ. 5 ) THEN @@ -3341,10 +3394,10 @@ SUBROUTINE surface_driver( & ENDIF TH2(I,J) = T2(I,J)*(1.E5/PSFC(I,J))**RCP ! ELSEIF (IVGTYP(I,J) == ISURBAN .OR. IVGTYP(I,J) == ISICE .OR. FVEGXY(I,J) == 0.0 ) THEN - ELSEIF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1 .or. IVGTYP(I,J) == LCZ_2 .or. & - IVGTYP(I,J) == LCZ_3 .or. IVGTYP(I,J) == LCZ_4 .or. IVGTYP(I,J) == LCZ_5 .or. & - IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. & - IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 .or. & + ELSEIF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1_TABLE .or. IVGTYP(I,J) == LCZ_2_TABLE .or. & + IVGTYP(I,J) == LCZ_3_TABLE .or. IVGTYP(I,J) == LCZ_4_TABLE .or. IVGTYP(I,J) == LCZ_5_TABLE .or. & + IVGTYP(I,J) == LCZ_6_TABLE .or. IVGTYP(I,J) == LCZ_7_TABLE .or. IVGTYP(I,J) == LCZ_8_TABLE .or. & + IVGTYP(I,J) == LCZ_9_TABLE .or. IVGTYP(I,J) == LCZ_10_TABLE .or. IVGTYP(I,J) == LCZ_11_TABLE .or. & (IVGTYP(I,J) == ISICE .AND. XICE(I,J) .LT. XICE_THRESHOLD)) THEN Q2(I,J) = Q2MBXY(I,J) @@ -3369,10 +3422,10 @@ SUBROUTINE surface_driver( & IF(SF_URBAN_PHYSICS.eq.1) THEN DO j=j_start(ij),j_end(ij) !urban DO i=i_start(ij),i_end(ij) !urban - IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1 .or. IVGTYP(I,J) == LCZ_2 .or. & - IVGTYP(I,J) == LCZ_3 .or. IVGTYP(I,J) == LCZ_4 .or. IVGTYP(I,J) == LCZ_5 .or. & - IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. & - IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 )THEN + IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1_TABLE .or. IVGTYP(I,J) == LCZ_2_TABLE .or. & + IVGTYP(I,J) == LCZ_3_TABLE .or. IVGTYP(I,J) == LCZ_4_TABLE .or. IVGTYP(I,J) == LCZ_5_TABLE .or. & + IVGTYP(I,J) == LCZ_6_TABLE .or. IVGTYP(I,J) == LCZ_7_TABLE .or. IVGTYP(I,J) == LCZ_8_TABLE .or. & + IVGTYP(I,J) == LCZ_9_TABLE .or. IVGTYP(I,J) == LCZ_10_TABLE .or. IVGTYP(I,J) == LCZ_11_TABLE )THEN Q2(I,J) = (FVEGXY(I,J)*Q2MVXY(I,J) + (1.-FVEGXY(I,J))*Q2MBXY(I,J))*(1.-FRC_URB2D(I,J)) + & Q2_URB2D(I,J)*FRC_URB2D(I,J) T2(I,J) = (FVEGXY(I,J)*T2MVXY(I,J) + (1.-FVEGXY(I,J))*T2MBXY(I,J))*(1.-FRC_URB2D(I,J)) + & @@ -3391,17 +3444,35 @@ SUBROUTINE surface_driver( & ENDIF IF((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.eq.3)) THEN + ! write(*,*)'entering section',j_start(ij),j_end(ij),i_start(ij),i_end(ij) DO j=j_start(ij),j_end(ij) !urban DO i=i_start(ij),i_end(ij) !urban - IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1 .or. IVGTYP(I,J) == LCZ_2 .or. & - IVGTYP(I,J) == LCZ_3 .or. IVGTYP(I,J) == LCZ_4 .or. IVGTYP(I,J) == LCZ_5 .or. & - IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. & - IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 )THEN +!CORDEX - BUG + IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1_TABLE .or. IVGTYP(I,J) == LCZ_2_TABLE .or. & + IVGTYP(I,J) == LCZ_3_TABLE .or. IVGTYP(I,J) == LCZ_4_TABLE .or. IVGTYP(I,J) == LCZ_5_TABLE .or. & + IVGTYP(I,J) == LCZ_6_TABLE .or. IVGTYP(I,J) == LCZ_7_TABLE .or. IVGTYP(I,J) == LCZ_8_TABLE .or. & + IVGTYP(I,J) == LCZ_9_TABLE .or. IVGTYP(I,J) == LCZ_10_TABLE .or. IVGTYP(I,J) == LCZ_11_TABLE )THEN +!CORDEX - BUG T2(I,J) = TH_PHY(i,1,j)/((1.E5/PSFC(I,J))**RCP) !urban TH2(I,J) = TH_PHY(i,1,j) !urban Q2(I,J) = qv_curr(i,1,j) !urban U10(I,J) = U_phy(I,1,J) !urban V10(I,J) = V_phy(I,1,J) !urban +!CORDEX + T2VEG_URB2D(I,J) = FVEGXY(I,J)*T2MVXY(I,J) + (1.-FVEGXY(I,J))*T2MBXY(I,J) +!CORDEX +!CORDEX ! for non urban points put 1.e20 for urban diagnostic variables + else + tsk_rural(i,j)=1.e20 + tcan_urb2d(i,j)=1.e20 + ucan_urb2d(i,j)=1.e20 + qcan_urb2d(i,j)=1.e20 + t2g_urb2d(i,j)=1.e20 + t2r_urb2d(i,j)=1.e20 + t2veg_urb2d(i,j)=1.e20 + troof_urb2d(i,j)=1.e20 + tground_urb2d(i,j)=1.e20 +!CORDEX END IF !urban ENDDO !urban ENDDO !urban diff --git a/phys/noahmp b/phys/noahmp index e348cac8f1..12018117ab 160000 --- a/phys/noahmp +++ b/phys/noahmp @@ -1 +1 @@ -Subproject commit e348cac8f1949f88cd122dcf9c3a84bd3f3b0451 +Subproject commit 12018117ab9ec9075508a3238fc3def8a35e7606 From da3eb1132eb49f5ce6a9165fa5284b7edba0239d Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Thu, 8 May 2025 19:54:47 +0200 Subject: [PATCH 02/23] Update version to 4.5.1.7rc to start development --- inc/version_decl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/version_decl b/inc/version_decl index dd466ae75e..644b3bf565 100644 --- a/inc/version_decl +++ b/inc/version_decl @@ -1 +1 @@ - CHARACTER (LEN=*), PARAMETER :: release_version = 'V4.5.1.6 (CWC)' + CHARACTER (LEN=*), PARAMETER :: release_version = 'V4.5.1.7rc (CWC)' From 94ad1e48d82b0c240b1c3a7289165ea86c5ac47a Mon Sep 17 00:00:00 2001 From: joshi994 <160153650+joshi994@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:54:11 -0400 Subject: [PATCH 03/23] The net longwave flux absorbed by the building wall, RB2, in module_sf_urban.F is underestimating the value by a factor of emissivty of the wall, EPSG, as it is multiplied twice. I corrected the equation in the aforementioned module. (#2016) TYPE: Bug fix KEYWORDS: Longwave flux, radiation/energy balance, Surface temperature, Urban climate, SLUCM SOURCE: Parag Joshi (Brookhaven National Lab), Katia Lamer (Brookhaven National Lab) DESCRIPTION OF CHANGES: Problem: The net long wave fluxes absorbed by the building walls is being underestimated due to multiplication of the emissivity twice in the equation. The command/lines that evaluate RB2 in the module_sf_urban.F (Lines 1300 and 1419 of WRF version-4.5.2) reflect the net long wave fluxes absorbed by building walls. Solution: The code has been corrected by referring to the equation A9 of in the article, Kusaka & Kimora 2004, Journal of Applied Meteorology. ISSUE: For use when this PR closes an issue. Fixes #2011 LIST OF MODIFIED FILES: M module_sf_urban.F TESTS CONDUCTED: 1. Tests were conducted by the LSM group at NCAR/RAL. 2. It passed Jenkins tests. RELEASE NOTE: Correcting the net long wave fluxes for application in modeling urban climate using Single Layer Urban Canopy Model (SLUCM). It slightly improved 2-m temperature in urban area. --- phys/module_sf_urban.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phys/module_sf_urban.F b/phys/module_sf_urban.F index a4b78c5c86..f42a5bb805 100644 --- a/phys/module_sf_urban.F +++ b/phys/module_sf_urban.F @@ -1297,7 +1297,7 @@ SUBROUTINE urban(LSOLAR, & ! L RB2=EPSB*( (1.-EPSG)*VFWG*VFGS*RX & +(1.-EPSG)*EPSB*VFGW*VFWG*SIG*(TBP**4.)/60. & +(1.-EPSB)*VFWS*(1.-2.*VFWS)*RX & - +(1.-EPSB)*VFWG*(1.-2.*VFWS)*EPSG*SIG*EPSG*TGP**4./60. & + +(1.-EPSB)*VFWG*(1.-2.*VFWS)*SIG*EPSG*TGP**4./60. & +EPSB*(1.-EPSB)*(1.-2.*VFWS)*(1.-2.*VFWS)*SIG*TBP**4./60. ) RG=RG1+RG2 @@ -1416,7 +1416,7 @@ SUBROUTINE urban(LSOLAR, & ! L RB2=EPSB*( (1.-EPSG)*VFWG*VFGS*RX & +(1.-EPSG)*EPSB*VFGW*VFWG*SIG*(TBP**4.)/60. & +(1.-EPSB)*VFWS*(1.-2.*VFWS)*RX & - +(1.-EPSB)*VFWG*(1.-2.*VFWS)*EPSG*SIG*EPSG*TGP**4./60. & + +(1.-EPSB)*VFWG*(1.-2.*VFWS)*SIG*EPSG*TGP**4./60. & +EPSB*(1.-EPSB)*(1.-2.*VFWS)*(1.-2.*VFWS)*SIG*TBP**4./60. ) RG=RG1+RG2 From 7c5f7c7d87720449d5a0611ba0431e18fe0e93c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Fita?= <96058724+LluisFB@users.noreply.github.com> Date: Thu, 10 Apr 2025 19:25:26 -0300 Subject: [PATCH 04/23] Fix for a do loop index in bep_bem urban code (#2196) TYPE: bug fix KEYWORDS: module_sf_bep_bem.F, loop index, debugging-crash SOURCE: L. Fita (UBA/CIMA/IFAECI) DESCRIPTION OF CHANGES: Problem: The loop index in line 1600 of subroutine module_sf_bep_bem.F should be up to `nzu`, instead of `nz_um`. Solution: This PR fixes the index. ISSUE: For use when this PR closes an issue. Fixes #2194 LIST OF MODIFIED FILES: M phys/module_sf_bep_bem.F TESTS CONDUCTED: 1. Code was modified and recompiled in serial debug mode and it did not crashed 2. The Jenkins tests are all passing. RELEASE NOTE: This PR fixed a loop index error in bep_bem urban code. --- phys/module_sf_bep_bem.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phys/module_sf_bep_bem.F b/phys/module_sf_bep_bem.F index f249700a08..656fa1bc90 100644 --- a/phys/module_sf_bep_bem.F +++ b/phys/module_sf_bep_bem.F @@ -1597,7 +1597,7 @@ subroutine BEP1D(itimestep,ix,iy,iurb,kms,kme,kts,kte,z,dt,ua,va,pt,da,pr,pt0, - do iz=1,nz_um !Compute the outdoor temperature + do iz=1,nzu !Compute the outdoor temperature tmp_u(iz)=pt_u(iz)*(pr_u(iz)/p0)**(rcp_u) end do From 39ea5f01b9705a3ee1fdd98a5b2a3c65117f4853 Mon Sep 17 00:00:00 2001 From: Cenlin_He Date: Tue, 23 Jan 2024 11:32:59 -0700 Subject: [PATCH 05/23] Update urban LCZ parameter table with more reasonable values (#1969) TYPE: enhancement KEYWORDS: urban, parameter SOURCE: Reported by Benjamin Fersch (Karlsruhe Institute of Technology, Germany), fixed by Alberto Martilli (CIEMAT, Spain) DESCRIPTION OF CHANGES: Problem: Current urban LCZ parameter table includes some unreasonable values for urban morphology (e.g., too large road width) and thermal properties (e.g., CAPR, CAPB, CAPG, AKSR, AKPB, AKPG). The LCZ classification is mainly a classification based on morphology, rather than thermal properties, so it should use the same thermal properties for different LCZs unless users have specific information from other local data sources. Solution: Use morphological parameters correspond to mid-range values of Stewart and Oke 2012, and all the LCZ classes have the same thermal properties. ISSUE: [For use when this PR closes an issue.](https://github.com/wrf-model/WRF/issues/1954) LIST OF MODIFIED FILES: URBPARM_LCZ.TBL TESTS CONDUCTED: 1. The mods fix the problem. 2. It passed regression tests. RELEASE NOTE: Update urban LCZ parameter table (URBPARM_LCZ.TBL) with more reasonable values. --- run/URBPARM_LCZ.TBL | 96 +++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/run/URBPARM_LCZ.TBL b/run/URBPARM_LCZ.TBL index 80e6809c17..450d765f9d 100644 --- a/run/URBPARM_LCZ.TBL +++ b/run/URBPARM_LCZ.TBL @@ -32,21 +32,21 @@ SIGMA_ZED: 4.0, 3.0, 1.0, 1., 1., 1., 1., 1., 1., 1., 1. # ROOF_WIDTH: Roof (i.e., building) width [ m ] # (sf_urban_physics=1) -ROOF_WIDTH: 31.7, 25.7, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 10. +ROOF_WIDTH: 22.2, 22., 9.6, 42.86, 26.25, 13., 25., 28.9, 43.33, 23.8, 5. # # ROAD_WIDTH: road width [ m ] # (sf_urban_physics=1) # -ROAD_WIDTH: 98.9, 39.2, 108.0, 108.0, 108.0, 108.0, 108.0, 108.0, 108.0, 108.0, 108.0 +ROAD_WIDTH: 20., 14., 5.2, 50.0, 35.0, 13.0, 3.33, 32.5, 43.3, 28.6, 100.0 # # AH: Anthropogenic heat [ W m{-2} ] # (sf_urban_physics=1) # -AH: 100.0, 35.0, 30.0, 30.0, 15.0, 10.0, 30.0, 40.0, 5.0, 300.0, 0 +AH: 175.0, 37.5, 37.5, 25.0, 12.5, 12.5, 17.5, 25.0, 5.0, 350.0, 350.0 # @@ -54,7 +54,7 @@ AH: 100.0, 35.0, 30.0, 30.0, 15.0, 10.0, 30.0, 40.0, 5.0, 300.0, 0 # (sf_urban_physics=1) # -ALH: 20.0, 25.0, 40.0, 20.0, 25.0, 40.0, 20.0, 25.0, 40.0, 20.0, 0 +ALH: 20.0, 25.0, 40.0,20.0, 25.0, 40.0,20.0, 25.0, 40.0,20.0, 25.0 # # AKANDA_URBAN: Coefficient modifying the Kanda approach to computing @@ -232,90 +232,92 @@ DZGR: 0.05 0.10 0.15 0.20 # (sf_urban_physics=1,2,3) # -FRC_URB: 1.00, 0.99, 1.00, 0.65, 0.7, 0.65, 0.3, 0.85, 0.3, 0.55, 1.00 +FRC_URB: 0.95, 0.9,0.85, 0.65, 0.7, 0.6, 0.85, 0.85, 0.3, 0.55, 1.00 + # # CAPR: Heat capacity of roof [ J m{-3} K{-1} ] # (sf_urban_physics=1,2,3) # -CAPR: 1.8E6, 1.8E6, 1.44E6, 1.8E6, 1.8E6, 1.44E6, 2.0E6, 1.8E6, 1.44E6, 2.0E6, 1.8E6 +CAPR: 1.32E6,1.32E6,1.32E6, 1.32E6, 1.32E6, 1.32E6, 1.32E6, 1.32E6, 1.32E6, 1.32E6, 1.32E6 # # CAPB: Heat capacity of building wall [ J m{-3} K{-1} ] # (sf_urban_physics=1,2,3) # -CAPB: 1.8E6, 2.67E6, 2.05E6, 2.0E6, 2.0E6, 2.05E6, 0.72E6, 1.8E6, 2.56E6, 1.69E6, 1.8E6 +CAPB: 1.54E6,1.54E6,1.54E6, 1.54E6, 1.54E6, 1.54E6, 1.54E6, 1.54E6, 1.54E6, 1.54E6, 1.54E6 # # CAPG: Heat capacity of ground (road) [ J m{-3} K{-1} ] # (sf_urban_physics=1,2,3) # -CAPG: 1.75E6, 1.68E6, 1.63E6, 1.54E6, 1.50E6, 1.47E6, 1.67E6, 1.38E6, 1.37E6, 1.49E6, 1.38E6 +CAPG: 1.74E6,1.74E6,1.74E6, 1.74E6, 1.74E6, 1.74E6, 1.74E6, 1.74E6, 1.74E6, 1.74E6, 1.74E6 # # AKSR: Thermal conductivity of roof [ J m{-1} s{-1} K{-1} ] # (sf_urban_physics=1,2,3) # -AKSR: 1.25, 1.25, 1.00, 1.25, 1.25, 1.00, 2.0, 1.25, 1.00, 2.00, 1.25 +AKSR: 1.54,1.54,1.54, 1.54, 1.54, 1.54, 1.54, 1.54, 1.54, 1.54, 1.54 # # AKSB: Thermal conductivity of building wall [ J m{-1} s{-1} K{-1} ] # (sf_urban_physics=1,2,3) # -AKSB: 1.09, 1.5, 1.25, 1.45, 1.45, 1.25, 0.5, 1.25, 1.00, 1.33, 1.25 +AKSB: 1.51,1.51,1.51, 1.51, 1.51, 1.51,1.51,1.51,1.51, 1.51, 1.51 # # AKSG: Thermal conductivity of ground (road) [ J m{-1} s{-1} K{-1} ] # (sf_urban_physics=1,2,3) # -AKSG: 0.77, 0.73, 0.69, 0.64, 0.62, 0.60, 0.72, 0.51, 0.55, 0.61, 0.51 +AKSG: 0.82, 0.82, 0.82, 0.82, 0.82, 0.82, 0.82, 0.82, 0.82, 0.82, 0.82 # # ALBR: Surface albedo of roof [ fraction ] # (sf_urban_physics=1,2,3) # -ALBR: 0.13, 0.18, 0.15, 0.13, 0.13, 0.13, 0.15, 0.18, 0.13, 0.10, 0.13 +ALBR: 0.30, 0.30 0.30, 0.30, 0.30, 0.30, 0.30, 0.30, 0.30, 0.30, 0.30 + # # ALBB: Surface albedo of building wall [ fraction ] # (sf_urban_physics=1,2,3) # -ALBB: 0.25, 0.20, 0.20, 0.25, 0.25, 0.25, 0.20, 0.25, 0.25, 0.20, 0.20 +ALBB: 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3 # # ALBG: Surface albedo of ground (road) [ fraction ] # (sf_urban_physics=1,2,3) # -ALBG: 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.18, 0.14, 0.14, 0.14, 0.14 +ALBG: 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08, 0.08 # # EPSR: Surface emissivity of roof [ - ] # (sf_urban_physics=1,2,3) # -EPSR: 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.28, 0.91, 0.91, 0.91, 0.95 +EPSR: 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90 # # EPSB: Surface emissivity of building wall [-] # (sf_urban_physics=1,2,3) # -EPSB: 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.95 +EPSB: 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90, 0.90 # # EPSG: Surface emissivity of ground (road) [ - ] # (sf_urban_physics=1,2,3) # -EPSG: 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.92, 0.95, 0.95, 0.95, 0.95 +EPSG: 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95 # # Z0B: Roughness length for momentum, over building wall [ m ] @@ -348,14 +350,14 @@ Z0R: 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 # (sf_urban_physics=1,2,3) # -TRLEND: 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00 +TRLEND: 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00 # # TBLEND: Lower boundary temperature for building wall temperature [ K ] # (sf_urban_physics=1,2,3) # -TBLEND: 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00, 299.00 +TBLEND: 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00 # # TGLEND: Lower boundary temperature for ground (road) temperature [ K ] @@ -368,7 +370,7 @@ TGLEND: 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, 293.00, # (sf_urban_physics=3) # -COP: 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5 +COP: 4., 4., 4., 4., 4., 4., 4., 4., 4., 4., 4. # # BLDAC_FRC: fraction of buildings installed with A/C systems [ - ] # (sf_urban_physics=3) @@ -388,7 +390,7 @@ COOLED_FRC: 1.0, 1.0, 1.0,1.0, 1.0, 1.0,1.0, 1.0, 1.0,1.0, 1.0 # (sf_urban_physics=3) # -PWIN: 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.9, 0.2, 0.2, 0.2, 0.0 +PWIN: 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.0 # # BETA: Thermal efficiency of heat exchanger @@ -450,7 +452,7 @@ GAPHUM: 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0. # (sf_urban_physics=3) # -PERFLO: 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.00 +PERFLO: 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.00 # @@ -465,7 +467,7 @@ HSEQUIP: 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.5 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 # (sf_urban_physics=3) # -HSEQUIP_SCALE_FACTOR: 36.00, 20.00, 20.00, 36.00, 20.00, 20.00, 20.00, 36.00, 20.00, 20.00, 20.00 +HSEQUIP_SCALE_FACTOR: 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00 # @@ -480,7 +482,7 @@ GR_FLAG:0 # (sf_urban_physics=3) # -GR_TYPE: 2 +GR_TYPE: 1 # # GR_FRAC_ROOF: fraction of green roof over the roof (0:1) @@ -502,8 +504,9 @@ IRHO:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1 # (sf_urban_physics=3) # -PV_FRAC_ROOF: 0,0,0,0,0,0,0,0,0,0,0 +PV_FRAC_ROOF: 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0. +# STREET PARAMETERS: @@ -513,26 +516,26 @@ STREET PARAMETERS: # category direction width width # [index] [deg from N] [m] [m] - 1 0.0 15. 12. - 1 90.0 15. 12. - 2 0.0 10. 20. - 2 90.0 10. 20. - 3 0.0 5.7 9. - 3 90.0 5.7 9. - 4 0.0 30.0 20. - 4 90.0 30.0 20. - 5 0.0 20.0 20. - 5 90.0 20.0 20. - 6 0.0 12.4 10.5 - 6 90.0 12.4 10.5 - 7 0.0 10. 20. - 7 90.0 10. 20. - 8 0.0 32.5 28.8 - 8 90.0 32.5 28.8 - 9 0.0 10. 10. - 9 90.0 10. 10. - 10 0.0 28.5 23.8 - 10 90.0 28.5 23.8 + 1 0.0 20. 22.22 + 1 90.0 20. 22.22 + 2 0.0 14. 22. + 2 90.0 14. 22. + 3 0.0 5.2 9.6 + 3 90.0 5.2 9.6 + 4 0.0 50.0 42.86 + 4 90.0 50.0 42.86 + 5 0.0 35.0 26.25 + 5 90.0 35.0 26.25 + 6 0.0 13.0 13. + 6 90.0 13.0 13. + 7 0.0 3.33 25. + 7 90.0 3.33 25. + 8 0.0 32.5 28.9 + 8 90.0 32.5 28.9 + 9 0.0 43.3 43.33 + 9 90.0 43.3 43.33 + 10 0.0 28.6 23.8 + 10 90.0 28.6 23.8 11 0.0 100. 5. 11 90.0 100. 5. @@ -639,7 +642,6 @@ BUILDING HEIGHTS: 11 # height Percentage # [m] [%] - 5.0 100.0 + 5.0 100.0 END BUILDING HEIGHTS - From 68267944e39b484a8f215e2a20ce98abb16db545 Mon Sep 17 00:00:00 2001 From: Cenlin_He Date: Wed, 24 Jan 2024 11:14:12 -0700 Subject: [PATCH 06/23] Update WRF develop with bug fix for LAI initialization for urban pxiel in Noah-MP (#1990) TYPE: bug fix KEYWORDS: LAI, urban, Noah-MP SOURCE: Cenlin He (NCAR/RAL) DESCRIPTION OF CHANGES: Problem: Before bug fix, Noah-MP (v4.5 and earlier versions) initializes leaf mass from the table parameter based on land type. However, this causes model crash if the LCZ capability is activated for urban pixel, because the LCZ land type index (51-61) is out of the MODIS or USGS land type number. This code is in module_sf_noahmpdrv.F file. Solution: Add an if-statement to assign default natural vegetation type for urban pixels with large land type index to represent rural portion of the urban pixel. This is related to a reported Noah-MP issue (NCAR/noahmp#104). LIST OF MODIFIED FILES: phys/noahmp/drivers/wrf/module_sf_noahmpdrv.F TESTS CONDUCTED: - The mods fix the problem - It passed the regression tests. RELEASE NOTE: This PR fixed a bug in Noah-MP for uninitialized leaf area index when LCZ is used. --- phys/noahmp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phys/noahmp b/phys/noahmp index e348cac8f1..4c5576356e 160000 --- a/phys/noahmp +++ b/phys/noahmp @@ -1 +1 @@ -Subproject commit e348cac8f1949f88cd122dcf9c3a84bd3f3b0451 +Subproject commit 4c5576356ebe4946a66b4ef7f93ab1b635547366 From 9e8acb16a91fa711c8a35652c3cba4d44cb4f060 Mon Sep 17 00:00:00 2001 From: Cenlin_He Date: Fri, 12 Jan 2024 18:21:49 -0700 Subject: [PATCH 07/23] Bug fix for Noah-MP vegetation and urban (NCAR/noahmp#91, NCAR/noahmp#92) TYPE: bug fix KEYWORDS: Noah-MP, vegetation fraction scaling SOURCE: Cenlin He (NCAR/RAL) DESCRIPTION OF CHANGES: A bug fix for Noah-MP related processes: There is a bug in vegetation fraction (FVEG) scaling for stomata resistance calculation (https://github.com/NCAR/noahmp/issues/92) and canopy interception calculation (https://github.com/NCAR/noahmp/issues/91). LIST OF MODIFIED FILES: list of changed files (use `git diff --name-status master` to get formatted list): phys/noahmp/src/module_sf_noahmplsm.F TESTS CONDUCTED: 1. Tested successfully in NCAR Cheyenne HPC for 13-km run over the entire CONUS region 2. The Jenkins tests are all passing. RELEASE NOTE: Noah-MP bug fix for vegetation fraction scaling. --- phys/noahmp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phys/noahmp b/phys/noahmp index 4c5576356e..d26d2b7434 160000 --- a/phys/noahmp +++ b/phys/noahmp @@ -1 +1 @@ -Subproject commit 4c5576356ebe4946a66b4ef7f93ab1b635547366 +Subproject commit d26d2b74341f85537ed76b96adb930950b5dcc65 From 565c18606d7f8026d17b14c87b9656e38bfc43cb Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 12 Jan 2024 21:53:21 -0500 Subject: [PATCH 08/23] Remove arbitrary limiting of heat fluxes (#1924) TYPE: bug fix KEYWORDS: surface layer, latent heat flux limit SOURCE: David Robertson, Rutgers University DESCRIPTION OF CHANGES: Problem: Arbitrary limitation in the computation of QFX and HFX in modules module_sf_sfclay.F and module_sf_sfclayrev.F that affects the computation latent heat fluxes and sensible heat flux in coastal areas that limit fog layers. Solution: The zero downward latent heat flux limit is removed. LIST OF MODIFIED FILES: M phys/module_sf_sfclay.F M phys/module_sf_sfclayrev.F TESTS CONDUCTED: - Ran the coupled WRF-ROMS standard test case for Hurricane Irene. - It passed regression tests. RELEASE NOTE: This PR removed zero negative latent heat flux limit (atmosphere to water) in the revised MM5 and original MM5 surface layer schemes. --- phys/module_sf_sfclay.F | 4 ++-- phys/module_sf_sfclayrev.F | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phys/module_sf_sfclay.F b/phys/module_sf_sfclay.F index 2b3ba578f0..8cdaaa158c 100644 --- a/phys/module_sf_sfclay.F +++ b/phys/module_sf_sfclay.F @@ -892,7 +892,7 @@ SUBROUTINE SFCLAY1D(J,UX,VX,T1D,QV1D,P1D,dz8w1d, & ! DO 370 I=its,ite QFX(I)=FLQC(I)*(QSFC(I)-QX(I)) - QFX(I)=AMAX1(QFX(I),0.) +! QFX(I)=AMAX1(QFX(I),0.) LH(I)=XLV*QFX(I) 370 CONTINUE @@ -910,7 +910,7 @@ SUBROUTINE SFCLAY1D(J,UX,VX,T1D,QV1D,P1D,dz8w1d, & ! ENDIF ELSEIF(XLAND(I)-1.5.LT.0.)THEN HFX(I)=FLHC(I)*(THGB(I)-THX(I)) - HFX(I)=AMAX1(HFX(I),-250.) +! HFX(I)=AMAX1(HFX(I),-250.) ENDIF 400 CONTINUE diff --git a/phys/module_sf_sfclayrev.F b/phys/module_sf_sfclayrev.F index 9f65730122..2a3ca5a01d 100644 --- a/phys/module_sf_sfclayrev.F +++ b/phys/module_sf_sfclayrev.F @@ -1041,7 +1041,7 @@ SUBROUTINE SFCLAYREV1D(J,UX,VX,T1D,QV1D,P1D,dz8w1d, & DO 370 I=its,ite QFX(I)=FLQC(I)*(QSFC(I)-QX(I)) - QFX(I)=AMAX1(QFX(I),0.) +! QFX(I)=AMAX1(QFX(I),0.) LH(I)=XLV*QFX(I) 370 CONTINUE @@ -1059,7 +1059,7 @@ SUBROUTINE SFCLAYREV1D(J,UX,VX,T1D,QV1D,P1D,dz8w1d, & ! ENDIF ELSEIF(XLAND(I)-1.5.LT.0.)THEN HFX(I)=FLHC(I)*(THGB(I)-THX(I)) - HFX(I)=AMAX1(HFX(I),-250.) +! HFX(I)=AMAX1(HFX(I),-250.) ENDIF 400 CONTINUE From fc22ac2a7ee5daf1dcf4c650288925c16fa5c8b6 Mon Sep 17 00:00:00 2001 From: Lluis Fita Borrell Date: Mon, 24 Feb 2025 14:16:46 -0300 Subject: [PATCH 09/23] Fixing issue #2039 focing the reading of urbfrac from 'URBPARM_LCZ.TBL' --- dyn_em/module_initialize_real.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dyn_em/module_initialize_real.F b/dyn_em/module_initialize_real.F index 96629232bf..e8d5c8ea19 100644 --- a/dyn_em/module_initialize_real.F +++ b/dyn_em/module_initialize_real.F @@ -3101,7 +3101,7 @@ SUBROUTINE init_domain_rk ( grid & ENDIF IF ( grid%FRC_URB2D(i,j) == 0. ) THEN - IF ( (MMINLU == 'NLCD40' .OR. MMINLU == 'MODIFIED_IGBP_MODIS_NOAH') .AND. & + IF ( (MMINLU == 'NLCD40') .AND. & (grid%ivgtyp(i,j)==24 .OR. grid%ivgtyp(i,j)==25 .OR. grid%ivgtyp(i,j)==26 .OR. grid%ivgtyp(i,j)==13) ) grid%FRC_URB2D(i,j) = 0.9 IF ( MMINLU == 'USGS' .AND. grid%ivgtyp(i,j)==1 ) grid%FRC_URB2D(i,j) = 0.9 ENDIF From d826f5010c7f5b1bda894d04856389ac855c70aa Mon Sep 17 00:00:00 2001 From: Lukas Pilz Date: Fri, 17 Jan 2025 02:05:13 +0100 Subject: [PATCH 10/23] Bug fix for overwriting of LCZ urban cells in LU_INDEX with default USGS urban category. (#2153) TYPE: bug fix KEYWORDS: LCZ, USGS SOURCE: Lukas Pilz (Heidelberg University) DESCRIPTION OF CHANGES: Problem: As shown in #2152, for USGS data the wrfinput LU_INDEX field has major differences to the met_em LU_INDEX field. Cells in LU_INDEX which have LCZ categories (>30) were overwritten with the default USGS urban category (1) where FRC_URB2D > 0.5. Solution: Add a check similar to the MODIS case above. ISSUE: Fixes #2152 LIST OF MODIFIED FILES: M dyn_em/module_initialize_real.F TESTS CONDUCTED: 1. Did local tests, the only differences between wrfinput and met_em which remain are changing LU_INDEX 28 to 16, which is a water body redesignation as to my knowledge. 2. Jenkins tests have passed. RELEASE NOTE: Bug fix for wrfinput where LCZ urban cells in LU_INDEX were overwritten with default USGS urban category. --- dyn_em/module_initialize_real.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dyn_em/module_initialize_real.F b/dyn_em/module_initialize_real.F index e8d5c8ea19..bb23fbaca0 100644 --- a/dyn_em/module_initialize_real.F +++ b/dyn_em/module_initialize_real.F @@ -3097,7 +3097,7 @@ SUBROUTINE init_domain_rk ( grid & (grid%ivgtyp(i,j).NE.13 .AND. grid%ivgtyp(i,j).NE.24 .AND. grid%ivgtyp(i,j).NE.25 .AND. grid%ivgtyp(i,j).NE.26 .AND. grid%ivgtyp(i,j).LT.30)) grid%ivgtyp(i,j)=13 ELSE IF ( MMINLU == "USGS" ) THEN IF ( grid%FRC_URB2D(i,j) .GE. 0.5 .AND. & - grid%ivgtyp(i,j).NE.1 ) grid%ivgtyp(i,j)=1 + grid%ivgtyp(i,j).NE.1 .AND. grid%ivgtyp(i,j).LT.30) grid%ivgtyp(i,j)=1 ENDIF IF ( grid%FRC_URB2D(i,j) == 0. ) THEN From 199804495c2c862428345fd4d74133bc86f4ba6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Fita?= <96058724+LluisFB@users.noreply.github.com> Date: Thu, 10 Apr 2025 19:25:26 -0300 Subject: [PATCH 11/23] Fix for a do loop index in bep_bem urban code (#2196) TYPE: bug fix KEYWORDS: module_sf_bep_bem.F, loop index, debugging-crash SOURCE: L. Fita (UBA/CIMA/IFAECI) DESCRIPTION OF CHANGES: Problem: The loop index in line 1600 of subroutine module_sf_bep_bem.F should be up to `nzu`, instead of `nz_um`. Solution: This PR fixes the index. ISSUE: For use when this PR closes an issue. Fixes #2194 LIST OF MODIFIED FILES: M phys/module_sf_bep_bem.F TESTS CONDUCTED: 1. Code was modified and recompiled in serial debug mode and it did not crashed 2. The Jenkins tests are all passing. RELEASE NOTE: This PR fixed a loop index error in bep_bem urban code. --- phys/noahmp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phys/noahmp b/phys/noahmp index d26d2b7434..88f40a53bd 160000 --- a/phys/noahmp +++ b/phys/noahmp @@ -1 +1 @@ -Subproject commit d26d2b74341f85537ed76b96adb930950b5dcc65 +Subproject commit 88f40a53bda028afe37e61eca1d2620de1a3a7dd From a03eaf8839bed9c835aa02a2f0a514f075246343 Mon Sep 17 00:00:00 2001 From: Josipa Milovac Date: Mon, 12 May 2025 16:55:54 +0200 Subject: [PATCH 12/23] Bug fix in module_sf_noahdrv.F (A.Martilli) Bug affecting calculation of t2veg_urb2d in module_sf_noahdrv.F is fixed. --- phys/module_sf_noahdrv.F | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/phys/module_sf_noahdrv.F b/phys/module_sf_noahdrv.F index 5c7df673a2..760826560f 100644 --- a/phys/module_sf_noahdrv.F +++ b/phys/module_sf_noahdrv.F @@ -68,6 +68,11 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & !Optional Urban TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !H urban UC_URB2D, & !H urban +!CORDEX + T2G_URB2D,T2R_URB2D,T2VEG_URB2D, & + TCAN_URB2D,UCAN_URB2D,QCAN_URB2D, & + TGROUND_URB2D,TROOF_URB2D, & +!CORDEX XXXR_URB2D,XXXB_URB2D,XXXG_URB2D,XXXC_URB2D, & !H urban TRL_URB3D,TBL_URB3D,TGL_URB3D, & !H urban SH_URB2D,LH_URB2D,G_URB2D,RN_URB2D,TS_URB2D, & !H urban @@ -535,6 +540,16 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TB_URB2D REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TG_URB2D REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TC_URB2D +!CORDEX + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: T2G_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: T2R_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: T2VEG_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TCAN_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UCAN_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QCAN_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TGROUND_URB2D + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: TROOF_URB2D +!CORDEX REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: QC_URB2D REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: UC_URB2D REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: XXXR_URB2D @@ -686,6 +701,9 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & REAL :: CMR_URB, CHR_URB, CMC_URB, CHC_URB, CMGR_URB, CHGR_URB REAL :: frc_urb,lb_urb REAL :: check +!CORDEX + real aa_veg,a2_veg,ptg_rur,zhalf +!CORDEX ! ---------------------------------------------------------------------- ! DECLARATIONS END - urban ! ---------------------------------------------------------------------- @@ -1658,6 +1676,10 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & b_t_bep,b_e_bep,b_q_bep,dlg_bep, & dl_u_bep,sf_bep,vl_bep, & rl_up_urb,rs_abs_urb,emiss_urb,grdflx_urb,qv3d, & +!CORDEX + tground_urb2d,troof_urb2d,tcan_urb2d, & + t2g_urb2d,t2r_urb2d,ucan_urb2d,qcan_urb2d, & +!CORDEX ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) @@ -1752,6 +1774,17 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & ! print*,'ust',ust(i,j) ! print*,'swdown,glw',swdown(i,j),glw(i,j) ! endif +!CORDEX here I do a simple log interpolation between the surface temperature of the vegetated frction, tsk_rural, and the lowest +!model level value of temperature + zhalf=dz8w(i,1,j)/2. + aa_veg=0.4/alog(zhalf/znt(i,j)) + a2_veg=0.4/alog(2./znt(i,j)) + ptg_rur=tsk_rural(i,j)*(1.e5/p_phy(i,1,j))**0.286 + t2veg_urb2d(i,j)=(1.-aa_veg/a2_veg)*ptg_rur+aa_veg/a2_veg*th_phy(i,1,j) + t2veg_urb2d(i,j)=t2veg_urb2d(i,j)*(p_phy(i,1,j)/1.e5)**0.286 + + +!CORDEX else SH_URB2D(I,J) = 0. LH_URB2D(I,J) = 0. From 3d3c97358026599fc4e8efa0ae5cc6d1babc6704 Mon Sep 17 00:00:00 2001 From: Josipa Milovac Date: Mon, 12 May 2025 17:00:57 +0200 Subject: [PATCH 13/23] Near-surface diagnostics in BEP+BEM redefined (A.Martilli) In module_surface_driver.F near-surface diagnostics (e.g.T2) set to be equal to the weighted average of the vaules over the urban fraction (e.g. T2G_URB2D) and vegetation fraction (e.g. T2VEG_URB2D). NOTE: TCAN_URB2D as it is now is basically the temperature of the lowest model level - not the temperature of the urban canyon. Defintion of this TCAN_URB2D is opened to be redefined in the future if needed. SLUCM is having a different approct to defind this temperature. --- phys/module_surface_driver.F | 113 ++++++++++++++++++++++++++++------- 1 file changed, 93 insertions(+), 20 deletions(-) diff --git a/phys/module_surface_driver.F b/phys/module_surface_driver.F index f1592a1f00..f4fdfcac1c 100644 --- a/phys/module_surface_driver.F +++ b/phys/module_surface_driver.F @@ -187,6 +187,11 @@ SUBROUTINE surface_driver( & & ,num_road_layers, dzr, dzb, dzg & !I urban & ,tr_urb2d,tb_urb2d,tg_urb2d,tc_urb2d,qc_urb2d & !H urban & ,uc_urb2d & !H urban +!CORDEX + & ,t2g_urb2d,t2r_urb2d,t2veg_urb2d & + & ,tcan_urb2d,ucan_urb2d,qcan_urb2d & + & ,tground_urb2d,troof_urb2d & +!CORDEX & ,xxxr_urb2d,xxxb_urb2d,xxxg_urb2d,xxxc_urb2d & !H urban & ,cmcr_urb2d,tgr_urb2d,tgrl_urb3d,smr_urb3d & !H urban & ,julian,julyr,drelr_urb2d,drelb_urb2d,drelg_urb2d & !H urban @@ -360,7 +365,12 @@ SUBROUTINE surface_driver( & USE module_sf_gfs USE module_sf_noahdrv ! danli mosaic, the " ,only : lsm " needs to be deleted USE module_sf_noahlsm, only : LCZ_1,LCZ_2,LCZ_3,LCZ_4,LCZ_5,LCZ_6,LCZ_7,LCZ_8,LCZ_9,LCZ_10,LCZ_11 - USE module_sf_noahmpdrv, only : noahmplsm, noahmp_urban + USE module_sf_noahmpdrv, only : noahmplsm,noahmp_urban +!CORDEX- BUG + USE NOAHMP_TABLES, ONLY: ISURBAN_TABLE,LCZ_1_TABLE,LCZ_2_TABLE,LCZ_3_TABLE,LCZ_4_TABLE, & + LCZ_5_TABLE,LCZ_6_TABLE,LCZ_7_TABLE,LCZ_8_TABLE, & + LCZ_9_TABLE,LCZ_10_TABLE,LCZ_11_TABLE +!CORDEX- BUG USE module_sf_noahmp_groundwater USE module_sf_noah_seaice_drv #ifdef WRF_USE_CLM @@ -1273,6 +1283,16 @@ SUBROUTINE surface_driver( & REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: TC_URB2D !urban REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: QC_URB2D !urban REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: UC_URB2D !urban +!CORDEX + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: T2G_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: T2R_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: T2VEG_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: TCAN_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: UCAN_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: QCAN_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: TGROUND_URB2D !urban + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: TROOF_URB2D !urban +!CORDEX REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: XXXR_URB2D !urban REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: XXXB_URB2D !urban REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT):: XXXG_URB2D !urban @@ -2838,6 +2858,11 @@ SUBROUTINE surface_driver( & ,cmgr_sfcdif,chgr_sfcdif & ,tr_urb2d,tb_urb2d,tg_urb2d,tc_urb2d,qc_urb2d, & !H urban uc_urb2d, & !H urban +!CORDEX + t2g_urb2d,t2r_urb2d,t2veg_urb2d, & + tcan_urb2d,ucan_urb2d,qcan_urb2d, & + tground_urb2d,troof_urb2d, & +!CORDEX xxxr_urb2d,xxxb_urb2d,xxxg_urb2d,xxxc_urb2d, & !H urban trl_urb3d,tbl_urb3d,tgl_urb3d, & !H urban sh_urb2d,lh_urb2d,g_urb2d,rn_urb2d,ts_urb2d, & !H urban @@ -3008,15 +3033,29 @@ SUBROUTINE surface_driver( & IF((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.eq.3)) THEN DO j=j_start(ij),j_end(ij) !urban DO i=i_start(ij),i_end(ij) !urban +! write(*,*)'ivgtyp',IVGTYP(I,J),LCZ_2,LCZ_6,LCZ_8 IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1 .or. IVGTYP(I,J) == LCZ_2 .or. & IVGTYP(I,J) == LCZ_3 .or. IVGTYP(I,J) == LCZ_4 .or. IVGTYP(I,J) == LCZ_5 .or. & IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. & IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 )THEN - T2(I,J) = TH_PHY(i,1,j)/((1.E5/PSFC(I,J))**RCP) !urban - TH2(I,J) = TH_PHY(i,1,j) !urban - Q2(I,J) = qv_curr(i,1,j) !urban - U10(I,J) = U_phy(I,1,J) !urban - V10(I,J) = V_phy(I,1,J) !urban + ! T2(I,J) = TH_PHY(i,1,j)/((1.E5/PSFC(I,J))**RCP) !urban + T2(I,J)=FRC_URB2D(I,J)*T2G_URB2D(I,J)+(1.-FRC_URB2D(I,J))*T2VEG_URB2D(I,J) + TH2(I,J) = TH_PHY(i,1,j) !urban + Q2(I,J) = qv_curr(i,1,j) !urban + U10(I,J) = U_phy(I,1,J) !urban + V10(I,J) = V_phy(I,1,J) !urban +!CORDEX ! for non urban points put 1.e20 for urban diagnostic variables + else + tsk_rural(i,j)=1.e20 + tcan_urb2d(i,j)=1.e20 + ucan_urb2d(i,j)=1.e20 + qcan_urb2d(i,j)=1.e20 + t2g_urb2d(i,j)=1.e20 + t2r_urb2d(i,j)=1.e20 + t2veg_urb2d(i,j)=1.e20 + troof_urb2d(i,j)=1.e20 + tground_urb2d(i,j)=1.e20 +!CORDEX END IF !urban ENDDO !urban ENDDO !urban @@ -3170,6 +3209,16 @@ SUBROUTINE surface_driver( & IF(SF_URBAN_PHYSICS > 0 ) THEN !urban + DO j=j_start(ij),j_end(ij) + DO i=i_start(ij),i_end(ij) + IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1_TABLE .or. IVGTYP(I,J) == LCZ_2_TABLE .or. & + IVGTYP(I,J) == LCZ_3_TABLE .or. IVGTYP(I,J) == LCZ_4_TABLE .or. IVGTYP(I,J) == LCZ_5_TABLE .or. & + IVGTYP(I,J) == LCZ_6_TABLE .or. IVGTYP(I,J) == LCZ_7_TABLE .or. IVGTYP(I,J) == LCZ_8_TABLE .or. & + IVGTYP(I,J) == LCZ_9_TABLE .or. IVGTYP(I,J) == LCZ_10_TABLE .or. IVGTYP(I,J) == LCZ_11_TABLE )THEN + tsk_rural(i,j)=tsk(i,j) + ENDIF + ENDDO + ENDDO call noahmp_urban (sf_urban_physics, NUM_SOIL_LAYERS, IVGTYP,ITIMESTEP, & ! IN : Model configuration DTBL, COSZEN, XLAT_URB2D, & ! IN : Time/Space-related T_PHY, QV_CURR, U_PHY, V_PHY, SWDOWN, & ! IN : Forcing @@ -3184,6 +3233,12 @@ SUBROUTINE surface_driver( & chc_sfcdif, cmgr_sfcdif, chgr_sfcdif, & tr_urb2d, tb_urb2d, tg_urb2d, & !H urban tc_urb2d, qc_urb2d, uc_urb2d, & !H urban + tsk_rural, & +!CORDEX + t2g_urb2d, t2r_urb2d, & + tcan_urb2d, ucan_urb2d, qcan_urb2d, & + tground_urb2d, troof_urb2d, & +!CORDEX xxxr_urb2d, xxxb_urb2d, xxxg_urb2d, xxxc_urb2d, & !H urban trl_urb3d, tbl_urb3d, tgl_urb3d, & !H urban sh_urb2d, lh_urb2d, g_urb2d, rn_urb2d, ts_urb2d, & !H urban @@ -3223,7 +3278,6 @@ SUBROUTINE surface_driver( & a_e_bep, b_u_bep, b_v_bep, & !O multi-layer urban b_t_bep, b_q_bep, b_e_bep, dlg_bep, & !O multi-layer urban dl_u_bep, sf_bep, vl_bep) !O multi-layer urban - ENDIF IF ( iopt_run .EQ. 5 ) THEN @@ -3341,10 +3395,10 @@ SUBROUTINE surface_driver( & ENDIF TH2(I,J) = T2(I,J)*(1.E5/PSFC(I,J))**RCP ! ELSEIF (IVGTYP(I,J) == ISURBAN .OR. IVGTYP(I,J) == ISICE .OR. FVEGXY(I,J) == 0.0 ) THEN - ELSEIF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1 .or. IVGTYP(I,J) == LCZ_2 .or. & - IVGTYP(I,J) == LCZ_3 .or. IVGTYP(I,J) == LCZ_4 .or. IVGTYP(I,J) == LCZ_5 .or. & - IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. & - IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 .or. & + ELSEIF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1_TABLE .or. IVGTYP(I,J) == LCZ_2_TABLE .or. & + IVGTYP(I,J) == LCZ_3_TABLE .or. IVGTYP(I,J) == LCZ_4_TABLE .or. IVGTYP(I,J) == LCZ_5_TABLE .or. & + IVGTYP(I,J) == LCZ_6_TABLE .or. IVGTYP(I,J) == LCZ_7_TABLE .or. IVGTYP(I,J) == LCZ_8_TABLE .or. & + IVGTYP(I,J) == LCZ_9_TABLE .or. IVGTYP(I,J) == LCZ_10_TABLE .or. IVGTYP(I,J) == LCZ_11_TABLE .or. & (IVGTYP(I,J) == ISICE .AND. XICE(I,J) .LT. XICE_THRESHOLD)) THEN Q2(I,J) = Q2MBXY(I,J) @@ -3369,10 +3423,10 @@ SUBROUTINE surface_driver( & IF(SF_URBAN_PHYSICS.eq.1) THEN DO j=j_start(ij),j_end(ij) !urban DO i=i_start(ij),i_end(ij) !urban - IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1 .or. IVGTYP(I,J) == LCZ_2 .or. & - IVGTYP(I,J) == LCZ_3 .or. IVGTYP(I,J) == LCZ_4 .or. IVGTYP(I,J) == LCZ_5 .or. & - IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. & - IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 )THEN + IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1_TABLE .or. IVGTYP(I,J) == LCZ_2_TABLE .or. & + IVGTYP(I,J) == LCZ_3_TABLE .or. IVGTYP(I,J) == LCZ_4_TABLE .or. IVGTYP(I,J) == LCZ_5_TABLE .or. & + IVGTYP(I,J) == LCZ_6_TABLE .or. IVGTYP(I,J) == LCZ_7_TABLE .or. IVGTYP(I,J) == LCZ_8_TABLE .or. & + IVGTYP(I,J) == LCZ_9_TABLE .or. IVGTYP(I,J) == LCZ_10_TABLE .or. IVGTYP(I,J) == LCZ_11_TABLE )THEN Q2(I,J) = (FVEGXY(I,J)*Q2MVXY(I,J) + (1.-FVEGXY(I,J))*Q2MBXY(I,J))*(1.-FRC_URB2D(I,J)) + & Q2_URB2D(I,J)*FRC_URB2D(I,J) T2(I,J) = (FVEGXY(I,J)*T2MVXY(I,J) + (1.-FVEGXY(I,J))*T2MBXY(I,J))*(1.-FRC_URB2D(I,J)) + & @@ -3391,17 +3445,36 @@ SUBROUTINE surface_driver( & ENDIF IF((SF_URBAN_PHYSICS.eq.2).OR.(SF_URBAN_PHYSICS.eq.3)) THEN + ! write(*,*)'entering section',j_start(ij),j_end(ij),i_start(ij),i_end(ij) DO j=j_start(ij),j_end(ij) !urban DO i=i_start(ij),i_end(ij) !urban - IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1 .or. IVGTYP(I,J) == LCZ_2 .or. & - IVGTYP(I,J) == LCZ_3 .or. IVGTYP(I,J) == LCZ_4 .or. IVGTYP(I,J) == LCZ_5 .or. & - IVGTYP(I,J) == LCZ_6 .or. IVGTYP(I,J) == LCZ_7 .or. IVGTYP(I,J) == LCZ_8 .or. & - IVGTYP(I,J) == LCZ_9 .or. IVGTYP(I,J) == LCZ_10 .or. IVGTYP(I,J) == LCZ_11 )THEN - T2(I,J) = TH_PHY(i,1,j)/((1.E5/PSFC(I,J))**RCP) !urban +!CORDEX - BUG + IF( IVGTYP(I,J) == ISURBAN .or. IVGTYP(I,J) == LCZ_1_TABLE .or. IVGTYP(I,J) == LCZ_2_TABLE .or. & + IVGTYP(I,J) == LCZ_3_TABLE .or. IVGTYP(I,J) == LCZ_4_TABLE .or. IVGTYP(I,J) == LCZ_5_TABLE .or. & + IVGTYP(I,J) == LCZ_6_TABLE .or. IVGTYP(I,J) == LCZ_7_TABLE .or. IVGTYP(I,J) == LCZ_8_TABLE .or. & + IVGTYP(I,J) == LCZ_9_TABLE .or. IVGTYP(I,J) == LCZ_10_TABLE .or. IVGTYP(I,J) == LCZ_11_TABLE )THEN +!CORDEX - BUG + T2VEG_URB2D(I,J) = FVEGXY(I,J)*T2MVXY(I,J) + (1.-FVEGXY(I,J))*T2MBXY(I,J) + ! T2(I,J) = TH_PHY(i,1,j)/((1.E5/PSFC(I,J))**RCP) !urban + T2(I,J)=FRC_URB2D(I,J)*T2G_URB2D(I,J)+(1.-FRC_URB2D(I,J))*T2VEG_URB2D(I,J) TH2(I,J) = TH_PHY(i,1,j) !urban Q2(I,J) = qv_curr(i,1,j) !urban U10(I,J) = U_phy(I,1,J) !urban V10(I,J) = V_phy(I,1,J) !urban +!CORDEX +!CORDEX +!CORDEX ! for non urban points put 1.e20 for urban diagnostic variables + else + tsk_rural(i,j)=1.e20 + tcan_urb2d(i,j)=1.e20 + ucan_urb2d(i,j)=1.e20 + qcan_urb2d(i,j)=1.e20 + t2g_urb2d(i,j)=1.e20 + t2r_urb2d(i,j)=1.e20 + t2veg_urb2d(i,j)=1.e20 + troof_urb2d(i,j)=1.e20 + tground_urb2d(i,j)=1.e20 +!CORDEX END IF !urban ENDDO !urban ENDDO !urban From 26a45b20d9da6068d7abb975c50d33b1d5f77426 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Tue, 13 May 2025 11:24:07 +0200 Subject: [PATCH 14/23] Update README to include CWC WRF development --- CWC-WRF-development.svg | 401 ++++++++++++++++++++++++++++++++++++++++ README.md | 14 ++ 2 files changed, 415 insertions(+) create mode 100644 CWC-WRF-development.svg diff --git a/CWC-WRF-development.svg b/CWC-WRF-development.svg new file mode 100644 index 0000000000..aa0f234921 --- /dev/null +++ b/CWC-WRF-development.svg @@ -0,0 +1,401 @@ + + + + + + + + + + master + + + + v4.5.2 + v4.5.1 + release-v4.5.2 + + + + bugfix-x + + + + + + + v4.5.1-cwc + v4.5.1.7-devel + bugfix-x + + + + + + v4.5.1.7 + v4.5.1.6 + newfeature-y + + + + wrf-model/WRF + CORDEX-WRF-Community/WRF + + + + + + + diff --git a/README.md b/README.md index b5e292d3fc..46f9128c8c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ +# CORDEX WRF Community (CWC) WRF code # + +This is a fork of the official code repository for the [Weather Research & Forecasting (WRF)](https://github.com/wrf-model/WRF) modelling system. +CORDEX-WRF-Community (CWC) WRF versions are tagged with an additional number (e.g. [v4.5.1.6](https://github.com/CORDEX-WRF-community/WRF/releases/tag/v4.5.1.6)), indicating our modifications with respect to an official release (e.g. v4.5.1), which might include bugfixes not yet included in the official release or new features used by some CORDEX initiatives. +Discussion occurs as issues in the specific repositories for the different initiatives. +WRF development is done via pull requests to the next CWC WRF development branch (currently **v4.5.1.7-devel**). +The latest CWC WRF release (currently **v4.5.1.6**) is always found in branch **v4.5.1-cwc**, or the corresponding base version. +Releases are issued for specific purposes; e.g. when a new experiment is started for a given CORDEX initiative. +Check out the repository of the corresponding initiative to find out which model version to use for each experiment and the specific configuration files (namelists, TBL files, etc). + +![CWC WRF development](./CWC-WRF-development.svg) + +## Original WRF README.md ## + ### WRF-ARW Modeling System ### We request that all new users of WRF please register. This allows us to better determine how to support and develop the model. Please register using this form:[https://www2.mmm.ucar.edu/wrf/users/download/wrf-regist.php](https://www2.mmm.ucar.edu/wrf/users/download/wrf-regist.php). From e87989fa84887e05ecdd856af7e092ba1e35d49f Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Wed, 14 May 2025 19:26:07 +0200 Subject: [PATCH 15/23] Add must-have PR for all branches and explain why CWC WRF is needed --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 46f9128c8c..d014b93135 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,21 @@ # CORDEX WRF Community (CWC) WRF code # This is a fork of the official code repository for the [Weather Research & Forecasting (WRF)](https://github.com/wrf-model/WRF) modelling system. -CORDEX-WRF-Community (CWC) WRF versions are tagged with an additional number (e.g. [v4.5.1.6](https://github.com/CORDEX-WRF-community/WRF/releases/tag/v4.5.1.6)), indicating our modifications with respect to an official release (e.g. v4.5.1), which might include bugfixes not yet included in the official release or new features used by some CORDEX initiatives. +The CORDEX-WRF-Community (CWC) uses the WRF model for long-term regional climate simulations. +In the period since a given set of climate simulations are designed, model configurations are tested, and the final configuration is selected, several official WRF versions are usually released. +These typically come with new features and associated bugs, but also with bug fixes that might affect our selected code. +Thus, we freeze the (official) code version, but still apply selected important bug fixes or new features relevant for the community. +CWC WRF versions are tagged with an additional number (e.g. [v4.5.1.6](https://github.com/CORDEX-WRF-community/WRF/releases/tag/v4.5.1.6)), indicating our modifications with respect to an official release (e.g. v4.5.1), which might include bugfixes not yet included in the official release or new features used by some CORDEX initiatives. Discussion occurs as issues in the specific repositories for the different initiatives. -WRF development is done via pull requests to the next CWC WRF development branch (currently **v4.5.1.7-devel**). -The latest CWC WRF release (currently **v4.5.1.6**) is always found in branch **v4.5.1-cwc**, or the corresponding base version. -Releases are issued for specific purposes; e.g. when a new experiment is started for a given CORDEX initiative. +WRF development is done via pull requests to the next CWC WRF development branch (e.g. **v4.5.1.7-devel**). +The latest CWC WRF release (e.g. **v4.5.1.6**) is always found in branch **v4.5.1-cwc**, or the corresponding base version. +CWC WRF releases are issued for specific purposes; e.g. when a new experiment is started for a given CORDEX initiative. Check out the repository of the corresponding initiative to find out which model version to use for each experiment and the specific configuration files (namelists, TBL files, etc). ![CWC WRF development](./CWC-WRF-development.svg) +[All branches](https://github.com/CORDEX-WRF-community/WRF/branches/all) in the https://github.com/CORDEX-WRF-community/WRF repository must have an associated Pull Request detailing their purpose. + ## Original WRF README.md ## ### WRF-ARW Modeling System ### From 3342c831cedd8efcdb906efd71cb4644493251fa Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Fri, 23 May 2025 19:35:59 +0200 Subject: [PATCH 16/23] Point noahmp to prepare for merge --- phys/noahmp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phys/noahmp b/phys/noahmp index 12018117ab..2e328ee6a1 160000 --- a/phys/noahmp +++ b/phys/noahmp @@ -1 +1 @@ -Subproject commit 12018117ab9ec9075508a3238fc3def8a35e7606 +Subproject commit 2e328ee6a1ed8a6c1fda8acba92553a8c2deddd8 From 00cf7ff311427c8ca8bd908d4e9fbddef1a8e6d9 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Wed, 28 May 2025 13:56:36 +0200 Subject: [PATCH 17/23] Point phys/noahmp to the latest version before merging --- phys/noahmp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phys/noahmp b/phys/noahmp index 88f40a53bd..ba0ce72e88 160000 --- a/phys/noahmp +++ b/phys/noahmp @@ -1 +1 @@ -Subproject commit 88f40a53bda028afe37e61eca1d2620de1a3a7dd +Subproject commit ba0ce72e882e0b28e25174b27a227bbfb0afc34f From b61e07154525968fdd360f7bc63956d27ad233df Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Wed, 11 Jun 2025 17:01:30 +0200 Subject: [PATCH 18/23] Fix remnants of conflict resolution see https://github.com/CORDEX-WRF-community/WRF/pull/4 --- phys/module_sf_noahdrv.F | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/phys/module_sf_noahdrv.F b/phys/module_sf_noahdrv.F index 6afae66b82..f62b2b6117 100644 --- a/phys/module_sf_noahdrv.F +++ b/phys/module_sf_noahdrv.F @@ -702,11 +702,7 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & REAL :: frc_urb,lb_urb REAL :: check !CORDEX -<<<<<<< HEAD real aa_veg,a2_veg,ptg_rur,zhalf -======= - real aa_veg,a2_veg ->>>>>>> v4.5.1.7-devel !CORDEX ! ---------------------------------------------------------------------- ! DECLARATIONS END - urban @@ -1780,28 +1776,12 @@ SUBROUTINE lsm(DZ8W,QV3D,P8W3D,T3D,TSK, & ! endif !CORDEX here I do a simple log interpolation between the surface temperature of the vegetated frction, tsk_rural, and the lowest !model level value of temperature -<<<<<<< HEAD zhalf=dz8w(i,1,j)/2. aa_veg=0.4/alog(zhalf/znt(i,j)) a2_veg=0.4/alog(2./znt(i,j)) ptg_rur=tsk_rural(i,j)*(1.e5/p_phy(i,1,j))**0.286 t2veg_urb2d(i,j)=(1.-aa_veg/a2_veg)*ptg_rur+aa_veg/a2_veg*th_phy(i,1,j) t2veg_urb2d(i,j)=t2veg_urb2d(i,j)*(p_phy(i,1,j)/1.e5)**0.286 - - -======= - aa_veg=alog(dz8w(i,1,j)/2./znt(i,j)) - a2_veg=alog(2/znt(i,j)) - t2veg_urb2d(i,j)=(1.-aa_veg/a2_veg)*tsk_rural(i,j)+aa_veg/a2_veg*th_phy(i,1,j) -! write(*,*)'znt=',znt(i,j) -! write(*,*)'aa_veg=',aa_veg -! write(*,*)'a2_veg=',a2_veg -! write(*,*)'tsk_rural=',tsk_rural(i,j) -! write(*,*)'th_phy=',th_phy(i,1,j) -! write(*,*)'p_phy=',p_phy(i,1,j) - - t2veg_urb2d(i,j)=t2veg_urb2d(i,j)*(p_phy(i,1,j)/1.e5)**0.286 ->>>>>>> v4.5.1.7-devel !CORDEX else SH_URB2D(I,J) = 0. From 7246d572499ab84c1430cb34af9e9a4f0f3adb2e Mon Sep 17 00:00:00 2001 From: Yoselita Date: Tue, 24 Jun 2025 11:30:37 +0200 Subject: [PATCH 19/23] Update nbui_max and dz_u in module_sf_bep_bem.F Change hardcoded parameters nbui_max and dz_u in order to better represent the morphological characteristics per LCZ. --- phys/module_sf_bep_bem.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phys/module_sf_bep_bem.F b/phys/module_sf_bep_bem.F index b077d89011..6adc64cce9 100644 --- a/phys/module_sf_bep_bem.F +++ b/phys/module_sf_bep_bem.F @@ -44,10 +44,10 @@ MODULE module_sf_bep_bem parameter (ngb_u=10) ! real dz_u ! Urban grid resolution - parameter (dz_u=10.) !CORDEX + parameter (dz_u=5.) !CORDEX integer nbui_max !maximum number of types of buildings in an urban class - parameter (nbui_max=1) !CORDEX!must be less or equal than nz_um + parameter (nbui_max=3) !CORDEX!must be less or equal than nz_um real h_water From 88a4831eced3dc79d4c026bf97792c06d68b4b5e Mon Sep 17 00:00:00 2001 From: Yoselita Date: Tue, 24 Jun 2025 15:01:15 +0200 Subject: [PATCH 20/23] Update URBPARM_LCZ.TBL for nbui_max=3 Adapt URBPARM_LCZ.TBL for hardcoded nbui_max=3 for BEP+BEM urabn parametrization scheme. --- run/URBPARM_LCZ.TBL | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/run/URBPARM_LCZ.TBL b/run/URBPARM_LCZ.TBL index 450d765f9d..cfb304e4cc 100644 --- a/run/URBPARM_LCZ.TBL +++ b/run/URBPARM_LCZ.TBL @@ -546,11 +546,9 @@ BUILDING HEIGHTS: 1 # height Percentage # [m] [%] - 40.0 17. - 45.0 21. - 50.0 24. - 55.0 21. - 60.0 17. + 45.0 32. + 50.0 36. + 55.0 32. END BUILDING HEIGHTS BUILDING HEIGHTS: 2 @@ -576,11 +574,9 @@ BUILDING HEIGHTS: 4 # height Percentage # [m] [%] - 40.0 17. - 45.0 21. - 50.0 24. - 55.0 21. - 60.0 17. + 45.0 32. + 50.0 36. + 55.0 32. END BUILDING HEIGHTS BUILDING HEIGHTS: 5 From dc06c9510d06a2d30029ad3cc7a294b73c307f15 Mon Sep 17 00:00:00 2001 From: Yoselita Date: Wed, 25 Jun 2025 13:51:51 +0200 Subject: [PATCH 21/23] Update initialzation of nbui_max and dz_u Remove forcing of the number of nbui_max to 1 and dz_u to 10m when 2D morphological data used. --- dyn_em/module_initialize_real.F | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/dyn_em/module_initialize_real.F b/dyn_em/module_initialize_real.F index 7d96c98d4f..bb23fbaca0 100644 --- a/dyn_em/module_initialize_real.F +++ b/dyn_em/module_initialize_real.F @@ -3117,20 +3117,9 @@ SUBROUTINE init_domain_rk ( grid & DO j = jts , MIN(jde-1,jte) DO i = its , MIN(ide-1,ite) IF ( skip_middle_points_t ( ids , ide , jds , jde , i , j , em_width , hold_ups ) ) CYCLE -!CORDEX -! DO k = 1, 15 -! grid%HI_URB2D(i,k,j) = grid%URB_PARAM(i,k+117,j) -! END DO -! force to one level - DO k = 1, 6!15 - grid%HI_URB2D(i,k,j) =0.! grid%URB_PARAM(i,k+117,j) + DO k = 1, 15 + grid%HI_URB2D(i,k,j) = grid%URB_PARAM(i,k+117,j) END DO - k=int(grid%HGT_URB2D(i,j)/10.)+1 - if(k.lt.1)k=1 - if(k.gt.4)k=4 - grid%HI_URB2D(i,k,j) =1. -! force to one level - END DO END DO ENDIF From 70a9d088ef53bf8b8cd0c7efc23271f7d0cbd8ad Mon Sep 17 00:00:00 2001 From: Josipa Milovac <54983612+yoselita@users.noreply.github.com> Date: Tue, 1 Jul 2025 19:08:40 +0200 Subject: [PATCH 22/23] Update URBPARM_LCZ.TBL Truncate the tails and assigning the values to the border categories for LCZ1 and LCZ4. --- run/URBPARM_LCZ.TBL | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/run/URBPARM_LCZ.TBL b/run/URBPARM_LCZ.TBL index cfb304e4cc..381dc1e1b8 100644 --- a/run/URBPARM_LCZ.TBL +++ b/run/URBPARM_LCZ.TBL @@ -546,9 +546,9 @@ BUILDING HEIGHTS: 1 # height Percentage # [m] [%] - 45.0 32. - 50.0 36. - 55.0 32. + 45.0 38. + 50.0 24. + 55.0 38. END BUILDING HEIGHTS BUILDING HEIGHTS: 2 @@ -574,9 +574,9 @@ BUILDING HEIGHTS: 4 # height Percentage # [m] [%] - 45.0 32. - 50.0 36. - 55.0 32. + 45.0 38. + 50.0 24. + 55.0 38. END BUILDING HEIGHTS BUILDING HEIGHTS: 5 From 795676dd59c201e09aa4a428464bfa29baa969e6 Mon Sep 17 00:00:00 2001 From: Yoselita Date: Thu, 24 Jul 2025 17:03:56 +0200 Subject: [PATCH 23/23] Update module_initialize_real.F module_initialize_real.F update to work with nbui_max different from default nbui_max=15. This modification creates forcng files with real.exe to be readable in wrf for different nbui_max (in this vesion nbui_max=3). --- dyn_em/module_initialize_real.F | 40 ++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/dyn_em/module_initialize_real.F b/dyn_em/module_initialize_real.F index bb23fbaca0..ad5e92092d 100644 --- a/dyn_em/module_initialize_real.F +++ b/dyn_em/module_initialize_real.F @@ -30,7 +30,11 @@ MODULE module_initialize_real ,HALO_EM_INIT_6_sub & ,HALO_EM_VINTERP_UV_1_sub #endif - +!CORDEX + use module_sf_bep_bem, ONLY : nbui_max + integer ikmin,kk + real hmin,htot +!CORDEX REAL , SAVE :: p_top_save INTEGER :: internal_time_loop @@ -3097,11 +3101,11 @@ SUBROUTINE init_domain_rk ( grid & (grid%ivgtyp(i,j).NE.13 .AND. grid%ivgtyp(i,j).NE.24 .AND. grid%ivgtyp(i,j).NE.25 .AND. grid%ivgtyp(i,j).NE.26 .AND. grid%ivgtyp(i,j).LT.30)) grid%ivgtyp(i,j)=13 ELSE IF ( MMINLU == "USGS" ) THEN IF ( grid%FRC_URB2D(i,j) .GE. 0.5 .AND. & - grid%ivgtyp(i,j).NE.1 .AND. grid%ivgtyp(i,j).LT.30) grid%ivgtyp(i,j)=1 + grid%ivgtyp(i,j).NE.1 ) grid%ivgtyp(i,j)=1 ENDIF IF ( grid%FRC_URB2D(i,j) == 0. ) THEN - IF ( (MMINLU == 'NLCD40') .AND. & + IF ( (MMINLU == 'NLCD40' .OR. MMINLU == 'MODIFIED_IGBP_MODIS_NOAH') .AND. & (grid%ivgtyp(i,j)==24 .OR. grid%ivgtyp(i,j)==25 .OR. grid%ivgtyp(i,j)==26 .OR. grid%ivgtyp(i,j)==13) ) grid%FRC_URB2D(i,j) = 0.9 IF ( MMINLU == 'USGS' .AND. grid%ivgtyp(i,j)==1 ) grid%FRC_URB2D(i,j) = 0.9 ENDIF @@ -3117,9 +3121,39 @@ SUBROUTINE init_domain_rk ( grid & DO j = jts , MIN(jde-1,jte) DO i = its , MIN(ide-1,ite) IF ( skip_middle_points_t ( ids , ide , jds , jde , i , j , em_width , hold_ups ) ) CYCLE +!CORDEX + icount=0 DO k = 1, 15 grid%HI_URB2D(i,k,j) = grid%URB_PARAM(i,k+117,j) + if(grid%HI_URB2D(i,k,j).gt.0)icount=icount+1 END DO + write(*,*)'NBUI_MAX=',nbui_max + if(icount.gt.nbui_max)then +! do kk=1,icount-nbui_max +333 continue + ikmin=0 + hmin=10000. + do k=1,15 + if(grid%HI_URB2D(i,k,j).lt.hmin.and.grid%HI_URB2D(i,k,j).gt.0)then + hmin=grid%HI_URB2D(i,k,j) + ikmin=k + endif + enddo + grid%HI_URB2D(i,ikmin,j)=0 +! enddo + htot=0 + do k=1,15 + htot=htot+grid%HI_URB2D(i,k,j) + enddo + grid%HI_URB2D(i,:,j)=grid%HI_URB2D(i,:,j)/htot*100 + icount=0 + DO k = 1, 15 + if(grid%HI_URB2D(i,k,j).gt.0)icount=icount+1 + END DO + if(icount.gt.nbui_max)go to 333 + endif +!CORDEX + END DO END DO ENDIF