@@ -165,6 +165,8 @@ subroutine allocate_lsm(config_frac_seaice)
165165 if (.not. allocated(snowc_p) ) allocate(snowc_p(ims:ime,jms:jme) )
166166 if (.not. allocated(snowh_p) ) allocate(snowh_p(ims:ime,jms:jme) )
167167 if (.not. allocated(sr_p) ) allocate(sr_p(ims:ime,jms:jme) )
168+ if (.not. allocated(swddir_p) ) allocate(swddir_p(ims:ime,jms:jme) )
169+ if (.not. allocated(swddif_p) ) allocate(swddif_p(ims:ime,jms:jme) )
168170 if (.not. allocated(swdown_p) ) allocate(swdown_p(ims:ime,jms:jme) )
169171 if (.not. allocated(tmn_p) ) allocate(tmn_p(ims:ime,jms:jme) )
170172 if (.not. allocated(tsk_p) ) allocate(tsk_p(ims:ime,jms:jme) )
@@ -184,9 +186,6 @@ subroutine allocate_lsm(config_frac_seaice)
184186 if (.not. allocated(frc_urb_p) ) allocate(frc_urb_p(ims:ime,jms:jme) )
185187 if (.not. allocated(ust_urb_p) ) allocate(ust_urb_p(ims:ime,jms:jme) )
186188 if (.not. allocated(utype_urb_p) ) allocate(utype_urb_p(ims:ime,jms:jme) )
187- if (.not. allocated(infxsrt_p) ) allocate(infxsrt_p(ims:ime,jms:jme) )
188- if (.not. allocated(sfcheadrt_p) ) allocate(sfcheadrt_p(ims:ime,jms:jme) )
189- if (.not. allocated(soldrain_p) ) allocate(soldrain_p(ims:ime,jms:jme) )
190189
191190 if (config_frac_seaice) then
192191 if (.not. allocated(tsk_sea) ) allocate(tsk_sea(ims:ime,jms:jme) )
@@ -253,6 +252,8 @@ subroutine deallocate_lsm(config_frac_seaice)
253252 if (allocated(snowc_p) ) deallocate(snowc_p )
254253 if (allocated(snowh_p) ) deallocate(snowh_p )
255254 if (allocated(sr_p) ) deallocate(sr_p )
255+ if (allocated(swddir_p) ) deallocate(swddir_p )
256+ if (allocated(swddif_p) ) deallocate(swddif_p )
256257 if (allocated(swdown_p) ) deallocate(swdown_p )
257258 if (allocated(tmn_p) ) deallocate(tmn_p )
258259 if (allocated(tsk_p) ) deallocate(tsk_p )
@@ -272,9 +273,6 @@ subroutine deallocate_lsm(config_frac_seaice)
272273 if (allocated(frc_urb_p) ) deallocate(frc_urb_p )
273274 if (allocated(ust_urb_p) ) deallocate(ust_urb_p )
274275 if (allocated(utype_urb_p) ) deallocate(utype_urb_p )
275- if (allocated(infxsrt_p) ) deallocate(infxsrt_p )
276- if (allocated(sfcheadrt_p) ) deallocate(sfcheadrt_p )
277- if (allocated(soldrain_p) ) deallocate(soldrain_p )
278276
279277 if (config_frac_seaice) then
280278 if (allocated(chs_sea) ) deallocate(chs_sea )
@@ -317,8 +315,8 @@ subroutine lsm_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
317315 real (kind= RKIND),dimension (:),pointer :: acsnom,acsnow,canwat,chs,chs2,chklowq,cpm,cqs2,glw, &
318316 grdflx,gsw,hfx,lai,lh,noahres,potevp,qfx,qgh,qsfc, &
319317 br,sfc_albedo,sfc_albedo_seaice,sfc_emibck,sfc_emiss, &
320- sfcrunoff,smstav,smstot,snotime,snopcx,sr,udrunoff, &
321- z0,znt
318+ sfcrunoff,smstav,smstot,snotime,snopcx,sr,swddif, &
319+ swddir,udrunoff, z0,znt
322320 real (kind= RKIND),dimension (:),pointer :: shdmin,shdmax,snoalb,sfc_albbck,snow,snowc,snowh,tmn, &
323321 skintemp,vegfra,xice,xland
324322 real (kind= RKIND),dimension (:),pointer :: t2m,th2m,q2
@@ -365,6 +363,8 @@ subroutine lsm_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
365363 call mpas_pool_get_array(diag_physics,' smstot' ,smstot )
366364 call mpas_pool_get_array(diag_physics,' snotime' ,snotime )
367365 call mpas_pool_get_array(diag_physics,' snopcx' ,snopcx )
366+ call mpas_pool_get_array(diag_physics,' swddif' ,swddif )
367+ call mpas_pool_get_array(diag_physics,' swddir' ,swddir )
368368 call mpas_pool_get_array(diag_physics,' udrunoff' ,udrunoff )
369369 call mpas_pool_get_array(diag_physics,' z0' ,z0 )
370370 call mpas_pool_get_array(diag_physics,' znt' ,znt )
@@ -439,6 +439,8 @@ subroutine lsm_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
439439 smstot_p(i,j) = smstot(i)
440440 snotime_p(i,j) = snotime(i)
441441 snopcx_p(i,j) = snopcx(i)
442+ swddif_p(i,j) = swddif(i)
443+ swddir_p(i,j) = swddir(i)
442444 udrunoff_p(i,j) = udrunoff(i)
443445 z0_p(i,j) = z0(i)
444446 znt_p(i,j) = znt(i)
@@ -472,13 +474,9 @@ subroutine lsm_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
472474 !initialization of arrays to run the Noah LSM urban parameterization (not currently
473475 frc_urb_p(i,j) = 0._RKIND
474476 ust_urb_p(i,j) = 0._RKIND
475- utype_urb_p(i,j) = low_density_residential
477+ utype_urb_p(i,j) = 0
476478
477- !initialization of arrays to run the Noah LSM hydrological parameterization (not currently
478- !implemented in MPAS):
479- infxsrt_p(i,j) = 0._RKIND
480- sfcheadrt_p(i,j) = 0._RKIND
481- soldrain_p(i,j) = 0._RKIND
479+ if (swddir_p(i,j).gt. 0 .) call mpas_log_write(' --- sw: $i $r $r' ,intArgs= (/ i/ ),realArgs= (/ swddir_p(i,j),swddif_p(i,j)/ ))
482480 enddo
483481 enddo
484482
@@ -838,18 +836,21 @@ subroutine driver_lsm(itimestep,configs,mesh,diag_physics,sfc_input,its,ite)
838836 opt_thcnd = opt_thcnd , ua_phys = ua_phys , flx4_2d = flxsnow_p , &
839837 fvb_2d = fvbsnow_p , fbur_2d = fbursnow_p , fgsn_2d = fgsnsnow_p , &
840838 utype_urb2d = utype_urb_p , frc_urb2d = frc_urb_p , ust_urb2d = ust_urb_p , &
841- infxsrt = infxsrt_p , sfcheadrt = sfcheadrt_p , soldrain = soldrain_p , &
842- fasdas = fasdas , julian = 0 , julyr = 0 , &
839+ swddir = swddir_p , swddif = swddif_p , fasdas = fasdas , &
840+ julian = 0 , julyr = 0 , &
841+ num_soil_layers = num_soils , &
843842 xice_threshold = xice_threshold , &
844843 usemonalb = config_sfc_albedo , &
845- mminlu = mminlu , &
846- num_soil_layers = num_soils , &
847- num_roof_layers = num_soils , &
848- num_wall_layers = num_soils , &
849- num_road_layers = num_soils , &
850- num_urban_layers = num_soils , &
851- num_urban_hi = num_soils , &
852- sf_urban_physics = sf_urban_physics , &
844+ mminlu = mminlu , &
845+ sf_urban_physics = sf_urban_physics , &
846+ num_roof_layers = nurb , num_wall_layers = nurb , &
847+ num_road_layers = nurb , num_urban_hi = nurb , &
848+ num_urban_ndm = nurb , urban_map_zrd = nurb , &
849+ urban_map_zwd = nurb , urban_map_gd = nurb , &
850+ urban_map_zd = nurb , urban_map_zdf = nurb , &
851+ urban_map_bd = nurb , urban_map_wd = nurb , &
852+ urban_map_gbd = nurb , urban_map_fbd = nurb , &
853+ urban_map_zgrd = nurb , &
853854 ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
854855 ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , &
855856 its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte &
0 commit comments