subroutine stats_allocate_tavg_pedestrian_wind implicit none integer :: h if (nreceptor_heights > 0) then allocate(wind_heights(nreceptor_heights)) wind_heights = receptor_heights(1:nreceptor_heights) else allocate(wind_heights(1)) wind_heights(1) = receptor_height end if allocate(ws_localt(ib:ie,jb:je,1:size(wind_heights))); ws_localt = 0. allocate(ws_10t (ib:ie,jb:je)); ws_10t = 0. allocate(ws_now (ib:ie,jb:je)); ws_now = 0. allocate(ws_local_valid(ib:ie,jb:je,1:size(wind_heights))); ws_local_valid = .false. allocate(ws_local_klo(size(wind_heights)), ws_local_khi(size(wind_heights))) allocate(ws_local_weight(size(wind_heights)), ws_local_available(size(wind_heights))) allocate(ws_10_valid (ib:ie,jb:je)); ws_10_valid = .false. do h = 1, size(wind_heights) call stats_find_vertical_bracket(wind_heights(h), ws_local_klo(h), ws_local_khi(h), & ws_local_weight(h), ws_local_available(h)) if (ws_local_available(h)) then if (ws_local_klo(h) == ws_local_khi(h)) then ws_local_valid(:,:,h) = IIc(ib:ie,jb:je,ws_local_klo(h)) == 1 else ws_local_valid(:,:,h) = (IIc(ib:ie,jb:je,ws_local_klo(h)) == 1) .and. & (IIc(ib:ie,jb:je,ws_local_khi(h)) == 1) end if else if (myid == 0) then write(0,'(a,f10.3,a)') 'WARNING: ws_local cannot be sampled at ', & wind_heights(h), ' m: outside the scalar-level range.' end if end do call stats_find_vertical_bracket(utci_wind_height, ws_10_klo, ws_10_khi, & ws_10_weight, ws_10_available) if (ws_10_available) then if (ws_10_klo == ws_10_khi) then ws_10_valid = IIc(ib:ie,jb:je,ws_10_klo) == 1 else ws_10_valid = (IIc(ib:ie,jb:je,ws_10_klo) == 1) .and. & (IIc(ib:ie,jb:je,ws_10_khi) == 1) end if else if (myid == 0) then write(0,*) 'WARNING: ws_10 cannot be sampled because z=10 m is outside the scalar-level range.' end if call ncinfo(pedestrianWindVars(1,:), 'ws_local', & 'Time-mean horizontal wind speed at configured height above model ground', 'm/s', 'tt0t') call ncinfo(pedestrianWindVars(2,:), 'ws_10', & 'Time-mean horizontal wind speed at z=10 m above model ground', 'm/s', 'tt0t') end subroutine stats_allocate_tavg_pedestrian_wind