undef("wind_log_extrap") function wind_log_extrap(zref:numeric, vref:numeric, rlen:numeric, zext:numeric, opt[1]:logical ) ; ; Extrapolate the wind speed at a certain height by using the log law. ; Appropriate for the change of wind speed with height in the lowest 100m. ; ; Reference: https://websites.pmc.ucsc.edu/~jnoble/wind/extrap/ ; ; INPUT: ; zref - height where vref is known ; vref - velocity at height zref ; rlen - roughness length in the current wind direction (rlen>0) ; same units as zref ; zext - height of extrapolated wind ; opt - currently not used ; ; OUTPUT: ; vext - log extrapolated wind at height 'zext' ; begin if (any(rlen.le.0)) then print("wind_log_extrap: rlen has inappropriate values") exit end if vext = vref*(log(zext/rlen)/log(zref/rlen)) ; meta data if (isatt(vref,"long_name")) then vext@long_name = "wind_log_extrap: "+vref@long_name else vext@long_name = "wind_log_extrap wind value" end if if (isatt(vref,"units")) then vext@units = vref@units end if return(xext) end