@/Net/Movies0/bourassa/data/SWS2/read_SWS2.pro @/usr/people/bourassa/BVW/test/ht_adj03x2.pro @/usr/people/bourassa/idl_lib/color_table.pro COMMON colors ctabps1, c ; set color table ; Reads data from the SWS-2 experiment, stored in the file nomad_stress.txt. ; File nomad.stress.txt is tab delimited with one header line. ; The variables are: ; jday Day of year (gmt) Jan 1st = 1 ; section 10 sections of 1024 samples at 20Hz sampling were collected ; each hour - only those with maximum data quality flag have ; been retained, this is the sequential section number ; (1 to 10) ; SndVel sound speed (m/s) from sonic (can be used as a QC guide) ; Hdg buoy heading (magnetic) ; s_d_Hdg standard deviation of heading (QC guide) ; rdirEN relative wind direction of horizontal wind (180 = bow pointed ; into wind) ; spdENV vector averaged 3 component wind speed (m/s) ; tilt tilt of flow (90 = horizontal) ; RH (90%) RH was not measured on buoy, 90% was mean value from ; ship (really!) ; TairAx air temp (C) ; pres1ax air pressure (mb) ; sstAx SST (C) ; TpWavAx peak wave period (sea + swell) ; HsWavAx significant wave height (sea + swell) ; LatAx latitude (north) ; LongAx longitude (west) ; U10BF3 U10n (m/s) ; USTBF3 friction velocity (m/s) ; SENBF3 sensible heat flux (W/m2) ; LATBF3 latent heat flux (W/m2) ; TOLBF3 stability (10/L where L = MO length) miss = -9999 ; read the quality controlled SWS-2 data n_data = read_SWS2( wind_spd, rel_hum, Tair, T_sst, pressure, period_peak, $ Hsig, ustar, shf_SWS2, lhf_SWS2 ) U_orb = !DTOR * 180.0 * Hsig / period_peak ustar_SWS2 = ustar CD_BVW = FLTARR( n_data ) ustar_BVW = FLTARR( n_data ) z0_BVW = FLTARR( n_data ) u10 = FLTARR( n_data ) Tp_BVW = FLTARR( n_data ) lhf_BVW = FLTARR( n_data ) shf_BVW = FLTARR( n_data ) CD_BVWa = FLTARR( n_data ) ustar_BVWa = FLTARR( n_data ) z0_BVWa = FLTARR( n_data ) u10a = FLTARR( n_data ) Tp_BVWa = FLTARR( n_data ) lhf_BVWa = FLTARR( n_data ) shf_BVWa = FLTARR( n_data ) CD_BVWb = FLTARR( n_data ) ustar_BVWb = FLTARR( n_data ) z0_BVWb = FLTARR( n_data ) u10b = FLTARR( n_data ) Tp_BVWb = FLTARR( n_data ) lhf_BVWb = FLTARR( n_data ) shf_BVWb = FLTARR( n_data ) CD_BVWc = FLTARR( n_data ) ustar_BVWc = FLTARR( n_data ) z0_BVWc = FLTARR( n_data ) u10c = FLTARR( n_data ) Tp_BVWc = FLTARR( n_data ) lhf_BVWc = FLTARR( n_data ) shf_BVWc = FLTARR( n_data ) ; Compare obsersed stresses to those estimated with Large and Pond's CD ; Calculate Large and Pond values of stress cd_LP = ( 0.49 + 0.065 * wind_spd ) * 1.0e-03 i_LP = where( wind_spd LT 11.0 ) cd_LP(i_LP)= 0.0012 stress_LP = cd_LP * 1.2 * wind_spd^2 stress = 1.2 * ustar^2 ; Plot the drag coefficients as a function of ustar i_good = where( wind_spd NE miss AND stress LT 0.8 AND stress_LP LT 0.8, n_good_tau ) x = stress_LP( i_good ) y = 1.2 * ustar * ustar yt = 'SWS2 Observed Stress (N/m^2)' xt = 'Large and Pond Stress (N/m^2)' xmax_lim = 0.75 ymax_lim = 0.75 xmin_lim = 0.0 ymin_lim = 0.0 xtckv = 0.15*[0, 1.0, 2.0, 3.0, 4.0, 5,0 ] ytckv = xtckv xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 xmin = MAX( [ MIN( [ min( xtckv), min( x ) ] ), xmin_lim ] ) ymin = MAX( [ MIN( [ min( ytckv), min( y ) ] ), ymin_lim ] ) xmax = MAX( [ max( xtckv), MIN( [ max( x ), xmax_lim ] ) ] ) ymax = MAX( [ max( ytckv), MIN( [ max( y ), ymax_lim ] ) ] ) SET_PLOT, 'PS' psfile = 'compare_stress.ps' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 5.0 DEVICE, /COLOR, FILE = psfile, $ XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv OPlot, x, y, Min = -300, symsize = 0.1, $ thick = thck, PSYM=1, color=black ; overplot mean values bin_size = 0.01 n_bins = (ymax - ymin) / bin_size mean_stress = FLTARR( n_bins ) mean_stress_LP = FLTARR( n_bins ) bin_CD = FLTARR( n_bins ) For i_bin = 0, n_bins - 1 do begin i_good = where( stress_LP GE i_bin * bin_size AND $ stress_LP LT ( i_bin + 1 ) * bin_size, n_stress ) if ( n_stress GT 9 ) THEN BEGIN mean_stress(i_bin) = mean( stress( i_good ) ) mean_stress_LP(i_bin) = mean( stress_LP( i_good ) ) ENDIF ELSE BEGIN mean_stress(i_bin) = miss mean_stress_LP(i_bin) = miss ENDELSE ENDFOR OPlot, mean_stress_LP, mean_stress, Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=red DEVICE, /CLOSE ; define the input arrays lhf = 0.0 shf = 0.0 tau = FLTARR(2) tau = [0.0, 0.0] u_star = FLTARR(2) u_star = [0.0, 0.0] t_star = 0.0 q_star = 0.0 z_over_L = 0.0 wave_age = 0.0 dom_phs_spd = 0.0 h_sig = 0.0 ww_stab = 0.0 zo_m = [0.0, 0.0] u_at_z = 0.0 t_at_z = 0.0 q_at_z = 0.0 Qnet = 10.0 CONV_CRIT = 0.00005 ; convergence critereon (fractional change) [] */ CONVECT = 1.25 ; convective parameter */ warn = 0L ; warning are given */ eqv_neut = 0L ; output winds are winds rather than equivalent neutral winds */ z_wanted = 10.0 ; height to which winds, potential temp, air_moist_prm = 1L sfc_moist_prm = 1L ; RH sfc_moist_val = 0.980 sst_prm = 0L ; Skin (0) or Bulk (1) to be converted to skin astab = 1L ; stability is considered (1) dyn_in_prm = 0L ; Wind speed ref_ht_wind = 10.0 ; anemometer's reference height ref_ht_tq = 10.0 ; thermometer's reference height salinity = 0.0349 ; Oceanic average salinity (34.9 ppt) QNET = 25.0 ; fudge FOR i = 0, n_data - 1 DO BEGIN flux_model = 0L ; 0L = BVW model dyn_in_val = wind_spd(i) press_sfc = pressure(i) air_moist_val = rel_hum(i) ss_val = Hsig(i) ; ss_val = period_peak(i) Charnocks_prm = 0.016 ss_val = 0.48 / Charnocks_prm ; 07.0 ss_prm = 2L ; 2 for wave age, 3 for HSIG, 5 for period t_air = Tair(i) t_skin = T_sst(i) wind_ang = 0.0 ; ss_val = U_orb(i) ss_prm = 3L ref_ht_wind = 10.0 ; anemometer's reference height ref_ht_tq = 10.0 ; thermometer's reference height ; dyn_in_prm = 1L ; run the height adjustment code result = ht_adj03x2( dyn_in_prm, dyn_in_val, wind_ang, CONVECT, conv_crit,$ press_sfc, air_moist_prm, air_moist_val, sfc_moist_prm, sfc_moist_val, $ salinity, ss_prm, ss_val, t_air, sst_prm, t_skin, ref_ht_wind, ref_ht_tq, $ astab, Qnet, warn, shf, lhf, tau, u_star, t_star, q_star, z_over_L, $ wave_age, dom_phs_spd, h_sig, ww_stab, zo_m, eqv_neut, z_wanted, u_at_z, $ t_at_z, q_at_z, flux_model ) flux_model = 0L ; 9L = BVW03 model (BVW/CFC Hybrid) u10( i ) = u_at_z ustar_BVW( i ) = u_star( 0 ) z0_BVW( i ) = zo_m( 0 ) Charnocks_prm = 0.034 ss_val = 0.48 / Charnocks_prm ; 07.0 ss_prm = 2L ; 2 for wave age, 3 for HSIG, 5 for period lhf_BVW( i ) = lhf shf_BVW( i ) = shf U_orb_scale = 0.80 dh_u_orb = U_orb_scale ref_ht_wind = 10.0 - 0.0 * dh_u_orb * Hsig(i) ; anemometer's reference height ref_ht_tq = 10.0 - 0.0 * dh_u_orb * Hsig(i) ; thermometer's reference height ref_ht_wind = 10.0 dyn_in_val = wind_spd(i) - U_orb_scale * U_orb(i) ; dyn_in_val = ustar(i) ; dyn_in_prm = 1L result = ht_adj03x2( dyn_in_prm, dyn_in_val, wind_ang, CONVECT, conv_crit,$ press_sfc, air_moist_prm, air_moist_val, sfc_moist_prm, sfc_moist_val, $ salinity, ss_prm, ss_val, t_air, sst_prm, t_skin, ref_ht_wind, ref_ht_tq, $ astab, Qnet, warn, shf, lhf, tau, u_star, t_star, q_star, z_over_L, $ wave_age, dom_phs_spd, h_sig, ww_stab, zo_m, eqv_neut, z_wanted, u_at_z, $ t_at_z, q_at_z, flux_model ) u10a( i ) = u_at_z ustar_BVWa( i ) = u_star( 0 ) z0_BVWa( i ) = zo_m( 0 ) Tp_BVWa(i) = dom_phs_spd lhf_BVWa( i ) = lhf shf_BVWa( i ) = shf flux_model = 9L ; 9L = BVW03 model (BVW/CFC Hybrid) u10( i ) = u_at_z ustar_BVW( i ) = u_star( 0 ) z0_BVW( i ) = zo_m( 0 ) Charnocks_prm = 0.030 ss_val = 0.48 / Charnocks_prm ; 07.0 ss_prm = 2L ; 2 for wave age, 3 for HSIG, 5 for period lhf_BVW( i ) = lhf shf_BVW( i ) = shf U_orb_scale = 0.80 dh_u_orb = U_orb_scale ref_ht_wind = 10.0 - dh_u_orb * Hsig(i) ; anemometer's reference height ref_ht_tq = 10.0 -0.0 * Hsig(i) ; thermometer's reference height dyn_in_val = wind_spd(i) - U_orb_scale * U_orb(i) ; dyn_in_val = ustar(i) ; dyn_in_prm = 1L result = ht_adj03x2( dyn_in_prm, dyn_in_val, wind_ang, CONVECT, conv_crit,$ press_sfc, air_moist_prm, air_moist_val, sfc_moist_prm, sfc_moist_val, $ salinity, ss_prm, ss_val, t_air, sst_prm, t_skin, ref_ht_wind, ref_ht_tq, $ astab, Qnet, warn, shf, lhf, tau, u_star, t_star, q_star, z_over_L, $ wave_age, dom_phs_spd, h_sig, ww_stab, zo_m, eqv_neut, z_wanted, u_at_z, $ t_at_z, q_at_z, flux_model ) u10b( i ) = u_at_z ustar_BVWb( i ) = u_star( 0 ) z0_BVWb( i ) = zo_m( 0 ) Tp_BVWb(i) = dom_phs_spd lhf_BVWb( i ) = lhf shf_BVWb( i ) = shf flux_model = 9L ; 9L = BVW03 model (BVW/CFC Hybrid) u10( i ) = u_at_z ustar_BVW( i ) = u_star( 0 ) z0_BVW( i ) = zo_m( 0 ) Charnocks_prm = 0.038 ss_val = 0.48 / Charnocks_prm ; 07.0 ss_prm = 2L ; 2 for wave age, 3 for HSIG, 5 for period lhf_BVW( i ) = lhf shf_BVW( i ) = shf U_orb_scale = 0.80 dh_u_orb = U_orb_scale ref_ht_wind = 10.0 - dh_u_orb * Hsig(i) ; anemometer's reference height ref_ht_tq = 10.0 -0.0 * Hsig(i) ; thermometer's reference height dyn_in_val = wind_spd(i) - 0.0* U_orb_scale * U_orb(i) ; dyn_in_val = ustar(i) ; dyn_in_prm = 1L result = ht_adj03x2( dyn_in_prm, dyn_in_val, wind_ang, CONVECT, conv_crit,$ press_sfc, air_moist_prm, air_moist_val, sfc_moist_prm, sfc_moist_val, $ salinity, ss_prm, ss_val, t_air, sst_prm, t_skin, ref_ht_wind, ref_ht_tq, $ astab, Qnet, warn, shf, lhf, tau, u_star, t_star, q_star, z_over_L, $ wave_age, dom_phs_spd, h_sig, ww_stab, zo_m, eqv_neut, z_wanted, u_at_z, $ t_at_z, q_at_z, flux_model ) u10c( i ) = u_at_z ustar_BVWc( i ) = u_star( 0 ) z0_BVWc( i ) = zo_m( 0 ) Tp_BVWc(i) = dom_phs_spd lhf_BVWc( i ) = lhf shf_BVWc( i ) = shf ; if i EQ 2 then stop ENDFOR CD_SWS2 = 1000.0 * ustar^2 / u10^2 CD_BVW = 1000.0 * ustar_BVW^2 / u10^2 CD_SWS2_mod = 1000.0 * ustar^2 / (u10 - U_orb)^2 ; Plot the drag coefficients as a function of wind speed yt = '10^3 * SWS-2 Drag Coefficient ' xt = 'Wind speed, U10 (m/s)' xmax = 35.0 ymax = 5.0 xmin = 0.0 ymin = 0.0 xtckv = [0, 5, 10, 15, 20, 25] ytckv = [0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 xmin = MIN( [ min( xtckv), min( u10 ) ] ) ymin = MIN( [ min( ytckv), min( CD_SWS2 ) ] ) xmax = MAX( [ max( xtckv), max( u10 ) ] ) ymax = MAX( [ max( ytckv), MIN( [ max( CD_SWS2 ), 4.0 ] ) ] ) !P.BACKGROUND = white SET_PLOT, 'Z' dcolor = !D.N_COLORS DEVICE, SET_RESOLUTION = [800, 600], SET_COLORS = dcolor ERASE plotfile = 'SWS2_cd_u10.gif' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 1.0 ; DEVICE, FILE = psfile, $ ; XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 2.0, charsize = 1.0, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv OPlot, u10, CD_SWS2, Min = -300, symsize = 1.0, $ thick = thck, PSYM=2, color=black ; OPlot, u10 - U_orb, CD_SWS2_mod, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=black image = TVRD() TVLCT, /GET, r, g, b ibackground = WHERE(image EQ 0) IF ibackground(0) GE 0 THEN image(ibackground) = white WRITE_GIF, plotfile, image, r, g, b DEVICE, /CLOSE ; Plot the drag coefficients as a function of ustar yt = '10^3 * SWS-2 Drag Coefficients ' xt = 'Friction Velocity, u* (m/s)' xmax = 35.0 ymax = 5.0 xmin = 0.0 ymin = 0.0 xtckv = [ -2, -1, 0, 1 ] ytckv = [0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5,0 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 xmin = MIN( [ min( xtckv), min( alog10(ustar) ) ] ) ymin = MIN( [ min( ytckv), min( CD_SWS2 ) ] ) xmax = MAX( [ max( xtckv), max( alog10(ustar) ) ] ) ymax = MAX( [ max( ytckv), MIN( [ max( CD_SWS2 ), 5.0 ] ) ] ) SET_PLOT, 'PS' psfile = 'SWS2_cd_ustar.ps' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 5.0 DEVICE, /COLOR, FILE = psfile, $ XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv OPlot, alog10(ustar), CD_SWS2, Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=black OPlot, alog10(ustar), CD_SWS2_mod, Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=red OPlot, alog10(ustar), CD_SWS2, Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=black DEVICE, /CLOSE ; Plot CD_SWS2 vs. CD BVW yt = '10^3 * BVW03 Drag Coefficient ' xt = '10^3 * SWS-2 Drag Coefficient ' xmax = 5.0 ymax = 5.0 xmin = 0.0 ymin = 0.0 xtckv = [0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0 ] ytckv = [0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 xmin = MIN( [ min( xtckv), min( u10 ) ] ) ymin = MIN( [ min( ytckv), MIN( CD_SWS2 ) ] ) xmax = MAX( [ max( xtckv), MIN( [ max( CD_SWS2 ), 5.0 ] ) ] ) ymax = MAX( [ max( ytckv), MIN( [ max( CD_BVW ), 5.0 ] ) ] ) SET_PLOT, 'PS' psfile = 'SWS2_cd_BVW_cd.ps' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 5.0 DEVICE, /COLOR, FILE = psfile, $ XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv OPlot, CD_SWS2, CD_BVW, Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=black ; overplot mean values bin_size = 0.25 n_bins = (ymax - ymin) / bin_size mean_CD_SWS2 = FLTARR( n_bins ) mean_CD_BVW03 = FLTARR( n_bins ) bin_CD = FLTARR( n_bins ) For i_bin = 0, n_bins - 1 do begin i_good = where( CD_SWS2 GE i_bin * bin_size AND $ CD_SWS2 LT ( i_bin + 1 ) * bin_size, n_CD ) if ( n_CD GT 9 ) THEN BEGIN mean_CD_SWS2(i_bin) = mean( CD_SWS2( i_good ) ) mean_CD_BVW03(i_bin) = mean( CD_BVW( i_good ) ) ENDIF ELSE BEGIN mean_CD_SWS2(i_bin) = miss mean_CD_BVW03(i_bin) = miss ENDELSE bin_CD(i_bin) = FLOAT( i_bin + 0.5 ) * bin_size ENDFOR OPlot, mean_CD_SWS2, mean_CD_BVW03, Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=red DEVICE, /CLOSE ; Plot ustar (obs) vs. z0 (BVW03 & SWS2) yt = 'Roughness Length (m)' xt = 'SWS-2 Friction Velocity (m/s)' xmax = 5.0 ymax = 5.0 xmin = 0.0 ymin = 0.0 ; xtckv = [ -2, -1, 0, 1 ] xtckv = 10.0^[ -1, -0.75, -0.5, -0.25, 0, 0.25 ] ; ytckv = [ -7, -6, -5, -4, -3, -2 ] ytckv = 10.0^[ -6, -5, -4, -3, -2 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 xmin = MIN( [ min( xtckv), min( ( ustar ) ) ] ) ymin = MIN( [ min( ytckv), MIN( (z0_BVW) ) ] ) xmax = MAX( [ max( xtckv), MIN( [ max( (ustar) ), 5.0 ] ) ] ) ymax = MAX( [ max( ytckv), MIN( [ max( (z0_BVW) ), 5.0 ] ) ] ) !P.BACKGROUND = white SET_PLOT, 'Z' dcolor = !D.N_COLORS DEVICE, SET_RESOLUTION = [800, 600], SET_COLORS = dcolor ERASE plotfile = 'SWS2_ustar_BVW_z0.gif' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 2.0 ; DEVICE, /COLOR, FILE = plotfile, $ ; XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], /XLOG, /YLOG, Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv ; OPlot, alog10(ustar), alog10(z0_BVW), Min = -300, symsize = 2.0, $ ; thick = thck, PSYM=1, color=black z0_SWS2 = z_wanted / exp( 0.4 * u10 / ustar ) ; OPlot, alog10(ustar), alog10(z0_SWS2), Min = -300, symsize = 2.0, $ ; thick = thck, PSYM=1, color=red rms_diff = SQRT( TOTAL( ( z0_SWS2 - z0_BVW )^2 / n_data ) ) print, 'RMS z0 difference (without orb)= ', rms_diff z0_SWS2_mod = z0_SWS2 / exp( -0.4 * U_orb / ustar ) ; OPlot, alog10(ustar), alog10(z0_SWS2_mod), Min = -300, symsize = 2.0, $ ; thick = thck, PSYM=1, color=black z0_BVW03_mod = z0_BVW / exp( 0.4 * U_orb / ustar ) z0_BVW03_mod = z0_BVWa wave_length = 1.5 * period_peak^2 z0_TY_mod = 1200.0 /3.97 * Hsig * ( ( Hsig / Wave_length )^4.5 ) * exp( 0.4 * U_orb / ustar ) ; OPlot, alog10(ustar), alog10(z0_TY_mod), Min = -300, symsize = 2.0, $ ; thick = thck, PSYM=1, color=blue z0_TY = 1200.0 * Hsig * ( ( Hsig / Wave_length )^4.5 ) ; OPlot, alog10(ustar), alog10(z0_TY), Min = -300, symsize = 2.0, $ ; thick = thck, PSYM=1, color=purple rms_diff = SQRT( TOTAL( ( z0_SWS2 - z0_BVWa )^2 / n_data ) ) print, 'RMS z0 difference (with orb)= ', rms_diff rms_diff = SQRT( TOTAL( ( z0_SWS2 - z0_TY )^2 / n_data ) ) print, 'RMS z0 difference (T&Y99) = ', rms_diff ; overplot mean values bin_size = 0.05 n_bins = (xmax - xmin) / bin_size mean_z0_SWS2 = FLTARR( n_bins ) mean_z0_SWS2_mod = FLTARR( n_bins ) mean_z0_BVW03 = FLTARR( n_bins ) mean_z0_BVW03_mod = FLTARR( n_bins ) mean_z0_TY = FLTARR( n_bins ) mean_z0_TY_mod = FLTARR( n_bins ) st_dev_z0_SWS2 = FLTARR( n_bins ) st_dev_z0_SWS2_mod = FLTARR( n_bins ) mean_ustar = FLTARR( n_bins ) bin_CD = FLTARR( n_bins ) For i_bin = 0, n_bins - 1 do begin i_good = where( alog10( ustar ) GE alog10(xmin) + i_bin * bin_size AND $ alog10( ustar ) LT alog10(xmin) + ( i_bin + 1 ) * bin_size, n_z0 ) if ( n_z0 GT 8 ) THEN BEGIN mean_z0_SWS2(i_bin) = 10^( mean( alog10( z0_SWS2( i_good ) ) ) ) mean_z0_SWS2_mod(i_bin) = 10^( mean( alog10( z0_SWS2_mod( i_good ) ) ) ) mean_z0_TY(i_bin) = 10^( mean( alog10( z0_TY( i_good ) ) ) ) mean_z0_TY_mod(i_bin) = alog10( mean( z0_TY_mod( i_good ) ) ) mean_z0_BVW03(i_bin) = 10^( mean( alog10( z0_BVWa( i_good ) ) ) ) mean_z0_BVW03_mod(i_bin) = 10^( mean( alog10( z0_BVW03_mod( i_good )) ) ) st_dev_z0_SWS2(i_bin) = stddev( alog10( z0_SWS2( i_good ) ) ) st_dev_z0_SWS2_mod(i_bin) = stddev( alog10( z0_SWS2_mod( i_good ) ) ) mean_ustar(i_bin) = ( mean( ustar( i_good ) ) ) ENDIF ELSE BEGIN mean_z0_SWS2(i_bin) = miss mean_z0_BVW03(i_bin) = miss mean_z0_BVW03_mod(i_bin) = miss mean_z0_TY(i_bin) = miss mean_z0_TY_mod(i_bin) = miss st_dev_z0_SWS2(i_bin) = miss st_dev_z0_SWS2_mod(i_bin) = miss mean_ustar(i_bin) = miss ENDELSE ENDFOR print, 'plotting mean z0 vs. mean ustar' OPlot, mean_ustar, mean_z0_BVW03, Min = -300, $ symsize = 1.0, thick = thck*1, PSYM=1, color=orange OPlot, mean_ustar, mean_z0_BVW03_mod, Min = -300, $ symsize = 1.0, thick = thck*1, PSYM=1, color=red OPlot, mean_ustar, mean_z0_SWS2, Min = -300, $ symsize = 1.0, thick = thck*1, PSYM=2, color=black OPlot, mean_ustar, mean_z0_SWS2_mod, Min = -300, $ symsize = 1.0, thick = thck*1, PSYM=2, color=green ; OPlot, mean_ustar, mean_z0_TY_mod, Min = -300, $ ; symsize = 1.0, thick = thck*1, PSYM=1, color=blue OPlot, mean_ustar, mean_z0_TY, Min = -300, $ symsize = 1.0, thick = thck*1, PSYM=4, color=purple i_bin = where( mean_ustar NE miss, n_bin ) For i = 0, n_bin-1 do begin x_vals = [ 1,1 ] * alog10( mean_ustar( i_bin(i) ) ) y_vals1 = [ alog10( mean_z0_SWS2(i_bin(i)) ) + st_dev_z0_SWS2(i_bin(i)), $ alog10( mean_z0_SWS2(i_bin(i)) ) - st_dev_z0_SWS2(i_bin(i)) ] y_vals2 = [ alog10( mean_z0_SWS2_mod(i_bin(i)) + st_dev_z0_SWS2_mod(i_bin(i)) ), $ alog10( mean_z0_SWS2_mod(i_bin(i)) - st_dev_z0_SWS2_mod(i_bin(i)) ) ] Oplot, x_vals, y_vals2, thick = thck*1, linestyle=0, color=orange print, x_vals(0), y_vals1 ENDFOR image = TVRD() TVLCT, /GET, r, g, b ibackground = WHERE(image EQ 0) IF ibackground(0) GE 0 THEN image(ibackground) = white WRITE_GIF, plotfile, image, r, g, b DEVICE, /CLOSE ; Plot ustar (obs) vs. z0 (BVW03 & SWS2) yt = 'Modeled Friction Velocity (m/s)' xt = 'SWS-2 Friction Velocity (m/s)' xmax = 5.0 ymax = 5.0 xmin = 0.0 ymin = 0.0 xtckv = [ 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2 ] ytckv = [ 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 xmin = MAX( [ MIN( [ min( xtckv), min( ustar_SWS2 ) ] ), 0 ] ) ymin = MAX( [ MIN( [ min( ytckv), MIN( ustar_BVW ) ] ), 0 ] ) xmax = MAX( [ max( xtckv), MIN( [ max( ustar_SWS2 ), 5.0 ] ) ] ) ymax = MAX( [ max( ytckv), MIN( [ max( ustar_BVW ), 5.0 ] ) ] ) ymin = 0 xmin = 0 !P.BACKGROUND = white SET_PLOT, 'Z' dcolor = !D.N_COLORS DEVICE, SET_RESOLUTION = [800, 600], SET_COLORS = dcolor ERASE ; Plot ustar (obs) vs. ustar (BVW03) yt = 'BVW03 Friction Velocity based on U - 0.5 * Uorb (m/s)' xt = 'SWS-2 Friction Velocity (m/s)' x = ustar y = ustar_BVW scale = 0.30 xmax = scale * 5.0 ymax = scale * 5.0 xmin = 0.0 ymin = 0.0 xtckv = scale * [0, 1.0, 2.0, 3.0, 4.0, 5,0 ] ytckv = xtckv xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 xmin = MAX( [ MIN( [ min( xtckv), min( x ) ] ), xmin_lim ] ) ymin = MAX( [ MIN( [ min( ytckv), min( y ) ] ), ymin_lim ] ) xmax = MAX( [ max( xtckv), MIN( [ max( x ), xmax_lim ] ) ] ) ymax = MAX( [ max( ytckv), MIN( [ max( y ), ymax_lim ] ) ] ) SET_PLOT, 'PS' psfile = 'SWS2_ustar_ustar.ps' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 5.0 DEVICE, /COLOR, FILE = psfile, $ XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv OPLOT, [0,1.5],[0,1.5], color=yellow cd_LP = ( 0.49 + 0.065 * wind_spd ) * 1.0e-03 i_LP = where( wind_spd LT 11.0 ) cd_LP(i_LP)= 0.0012 ustar_LP = SQRT( cd_LP) * wind_spd OPlot, (ustar), (ustar_LP), Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=red ustar_TY = 0.4 * wind_spd / alog( 10.0 / z0_TY ) OPlot, (ustar), (ustar_TY), Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=blue OPlot, (ustar), (ustar_BVW), Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=black ; overplot mean values bin_size = 0.05 n_bins = (xmax - xmin) / bin_size mean_ustar_SWS2 = FLTARR( n_bins ) mean_ustar_BVW03 = FLTARR( n_bins ) bin_CD = FLTARR( n_bins ) For i_bin = 0, n_bins - 1 do begin i_good = where( ustar GE xmin + i_bin * bin_size AND $ ustar LT xmin + ( i_bin + 1 ) * bin_size, n_ustar ) if ( n_ustar GT 9 ) THEN BEGIN mean_ustar_SWS2(i_bin) = mean( ( ustar( i_good ) ) ) mean_ustar_BVW03(i_bin) = mean( ( ustar_BVW( i_good ) ) ) ENDIF ELSE BEGIN mean_ustar_SWS2(i_bin) = miss mean_ustar_BVW03(i_bin) = miss ENDELSE print, n_ustar ENDFOR print, 'plotting mean ustar (model) vs. mean ustar (obs)' OPlot, mean_ustar_SWS2, mean_ustar_BVW03, Min = -300, $ symsize = 2.0, thick = thck*3, PSYM=1, color=green ; Plot z0_SWS2 / z0_BVW vs. various things yt = 'Roughness Length Ratio, based on U - Uorb (m)' xt = 'SWS-2 Friction Velocity (m/s)' xmax = 5.0 ymax = 5.0 xmin = 0.0 ymin = 0.0 xtckv = [ -2, -1, 0, 1, 2, 3 ] ytckv = [ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 xmin = MIN( [ min( xtckv), min( alog10( ustar ) ) ] ) ymin = MIN( [ min( ytckv), MIN( alog10(z0_BVW) ) ] ) xmax = MAX( [ max( xtckv), MIN( [ max( alog10(ustar) ), 5.0 ] ) ] ) ymax = MAX( [ max( ytckv), MIN( [ max( alog10(z0_BVW) ), 5.0 ] ) ] ) SET_PLOT, 'PS' psfile = 'SWS2_ustar_z0_ratio.ps' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 5.0 DEVICE, /COLOR, FILE = psfile, $ XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv z0_BVW = z0_BVW * exp( 0.4 * 0.5 * (U_orb) / ustar ) z0_SWS2 = ref_ht_wind / exp( 0.4 * (u10-U_orb) / ustar ) ratio = z0_SWS2 / z0_BVW OPlot, (U_orb), alog10(ratio), Min = -300, symsize = 2.0, $ thick = thck, PSYM=1, color=black ; Plot CD( U10 - Uorb, Hsig ) & departures from theory ; Plot lhf (obs) vs. lhf (BVW03 & SWS2) yt = 'Modeled Latent Heat Flux (W/m^2)' xt = 'SWS-2 Latent Heat Flux (W/m^2)' !P.BACKGROUND = white SET_PLOT, 'Z' dcolor = !D.N_COLORS DEVICE, SET_RESOLUTION = [800, 600], SET_COLORS = dcolor ERASE xmax = 120.0 ymax = 120.0 xmin = -40.0 ymin = -40.0 xtckv = 20.0 * [ -2, -1, 0, 1, 2, 3, 4, 5, 6 ] ytckv = 20.0 * [ -2, -1, 0, 1, 2, 3, 4, 5, 6 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 plotfile = 'SWS2_LHF_BVW_LHF.gif' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 1.0 ; DEVICE, /COLOR, FILE = plotfile, $ ; XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv Oplot, xtckv, ytckv, thick = thck*0.25, linestyle=0, color=black ; OPlot, lhf_SWS2, lhf_BVW, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=black rms_diff = SQRT( TOTAL( ( lhf_SWS2 - lhf_BVW )^2 / n_data ) ) ; print, 'RMS LHF difference (without) = ', rms_diff OPlot, lhf_SWS2, lhf_BVWa, Min = -300, symsize = 1.0, $ thick = thck, PSYM=1, color=dkblue rms_diff = SQRT( TOTAL( ( lhf_SWS2 - lhf_BVWa )^2 / n_data ) ) ; print, 'RMS LHF difference (with orb)= ', rms_diff ; overplot mean values bin_size = 5.0 n_bins = (xmax - xmin) / bin_size mean_lhf_SWS2 = FLTARR( n_bins ) mean_lhf_BVW03 = FLTARR( n_bins ) mean_lhf = FLTARR( n_bins ) std_lhf_SWS2 = FLTARR( n_bins ) std_lhf_BVW03 = FLTARR( n_bins ) bin_CD = FLTARR( n_bins ) For i_bin = 0, n_bins - 1 do begin i_good = where( lhf_SWS2 GE xmin + i_bin * bin_size AND $ lhf_SWS2 LT xmin + ( i_bin + 1 ) * bin_size, n_lhf ) ; print, n_lhf, xmin + i_bin * bin_size, xmin + (i_bin+1) * bin_size if ( n_lhf GT 8 ) THEN BEGIN mean_lhf_SWS2(i_bin) = mean( lhf_SWS2( i_good ) ) mean_lhf_BVW03(i_bin) = mean( lhf_BVWa( i_good ) ) mean_lhf(i_bin) = mean( lhf( i_good ) ) std_lhf_SWS2(i_bin) = SQRT( mean( ( lhf_SWS2( i_good ) - mean_lhf_SWS2( i_bin ) )^2 ) ) / SQRT( n_lhf -2 ) std_lhf_BVW03(i_bin) = SQRT( mean( ( lhf_BVWa( i_good ) - mean_lhf_BVW03( i_bin ) )^2 ) ) / SQRT( n_lhf - 2 ) ; print, mean_lhf_SWS2(i_bin), n_lhf, std_lhf_BVW03(i_bin), std_lhf_SWS2(i_bin) ENDIF ELSE BEGIN mean_lhf_SWS2(i_bin) = miss mean_lhf_BVW03(i_bin) = miss mean_lhf(i_bin) = miss std_lhf_SWS2(i_bin) = miss std_lhf_BVW03(i_bin) = miss ENDELSE ENDFOR ; print, 'plotting mean lhf (model) vs. mean lhf (obs)' igood = where( mean_lhf_SWS2 GE -200.0 ) OPlot, mean_lhf_SWS2(igood), mean_lhf_BVW03(igood), Min = -300, $ symsize = 0.5, thick = thck*1, PSYM=1, color=red ; OPlot, mean_lhf, mean_lhf_SWS2, Min = -300, $ ; symsize = 2.0, thick = thck*1, PSYM=1, color=orange ; plot error bars FOR i_pts = 0, N_ELEMENTS( igood ) - 1 DO BEGIN error_bars_vert_lines_y = mean_lhf_BVW03( igood( i_pts ) ) + $ 3.0 * std_lhf_BVW03( igood( i_pts ) ) * [ -1, 1 ] error_bars_vert_lines_x = mean_lhf_SWS2( igood( i_pts ) ) * [1,1] OPlot, error_bars_vert_lines_x, error_bars_vert_lines_y, Min = -300, $ thick = thck*2, linestyle=0, color=red ; print, error_bars_vert_lines_x, error_bars_vert_lines_y ENDFOR image = TVRD() TVLCT, /GET, r, g, b ibackground = WHERE(image EQ 0) IF ibackground(0) GE 0 THEN image(ibackground) = white WRITE_GIF, plotfile, image, r, g, b DEVICE, /CLOSE ; Plot shf (obs) vs. shf (BVW03 & SWS2) yt = 'Modeled Sensible Heat Flux (W/m^2)' xt = 'SWS-2 Sensible Heat Flux (W/m^2)' !P.BACKGROUND = white SET_PLOT, 'Z' dcolor = !D.N_COLORS DEVICE, SET_RESOLUTION = [800, 600], SET_COLORS = dcolor ERASE xmax = 80.0 ymax = 80.0 xmin = -50.0 ymin = -50.0 xtckv = 10.0 * [ -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8 ] ytckv = xtckv xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 plotfile = 'SWS2_SHF_BVW_SHF.gif' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 1.0 ; DEVICE, /COLOR, FILE = plotfile, $ ; XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv Oplot, xtckv, ytckv, thick = thck*0.25, linestyle=0, color=black ; OPlot, shf_SWS2, shf_BVW, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=black rms_diff = SQRT( TOTAL( ( shf_SWS2 - shf_BVW )^2 / n_data ) ) ; print, 'RMS SHF difference (without) = ', rms_diff OPlot, shf_SWS2, shf_BVWa, Min = -300, symsize = 1.0, $ thick = thck, PSYM=1, color=dkblue rms_diff = SQRT( TOTAL( ( shf_SWS2 - shf_BVWa )^2 / n_data ) ) ; print, 'RMS SHF difference (with orb)= ', rms_diff ; overplot mean values bin_size = 5.0 n_bins = (xmax - xmin) / bin_size mean_shf_SWS2 = FLTARR( n_bins ) mean_shf_BVW03 = FLTARR( n_bins ) mean_shf = FLTARR( n_bins ) std_shf_SWS2 = FLTARR( n_bins ) std_shf_BVW03 = FLTARR( n_bins ) bin_CD = FLTARR( n_bins ) For i_bin = 0, n_bins - 1 do begin i_good = where( shf_SWS2 GE xmin + i_bin * bin_size AND $ shf_SWS2 LT xmin + ( i_bin + 1 ) * bin_size, n_shf ) ; print, n_shf, xmin + i_bin * bin_size, xmin + (i_bin+1) * bin_size if ( n_shf GT 8 ) THEN BEGIN mean_shf_SWS2(i_bin) = mean( shf_SWS2( i_good ) ) mean_shf_BVW03(i_bin) = mean( shf_BVWa( i_good ) ) mean_shf(i_bin) = mean( shf( i_good ) ) std_shf_SWS2(i_bin) = SQRT( mean( ( shf_SWS2( i_good ) - mean_shf_SWS2( i_bin ) )^2 ) ) / SQRT( n_shf -2 ) std_shf_BVW03(i_bin) = SQRT( mean( ( shf_BVWa( i_good ) - mean_shf_BVW03( i_bin ) )^2 ) ) / SQRT( n_shf - 2 ) ; print, mean_shf_SWS2(i_bin), n_shf, std_shf_BVW03(i_bin), std_shf_SWS2(i_bin) ENDIF ELSE BEGIN mean_shf_SWS2(i_bin) = miss mean_shf_BVW03(i_bin) = miss mean_shf(i_bin) = miss std_shf_SWS2(i_bin) = miss std_shf_BVW03(i_bin) = miss ENDELSE ENDFOR ; print, 'plotting mean shf (model) vs. mean shf (obs)' igood = where( mean_shf_SWS2 GE -200.0 ) OPlot, mean_shf_SWS2(igood), mean_shf_BVW03(igood), Min = -300, $ symsize = 0.5, thick = thck*1, PSYM=1, color=red ; OPlot, mean_shf, mean_shf_SWS2, Min = -300, $ ; symsize = 2.0, thick = thck*1, PSYM=1, color=orange ; plot error bars FOR i_pts = 0, N_ELEMENTS( igood ) - 1 DO BEGIN error_bars_vert_lines_y = mean_shf_BVW03( igood( i_pts ) ) + $ 3.0 * std_shf_BVW03( igood( i_pts ) ) * [ -1, 1 ] error_bars_vert_lines_x = mean_shf_SWS2( igood( i_pts ) ) * [1,1] OPlot, error_bars_vert_lines_x, error_bars_vert_lines_y, Min = -300, $ thick = thck*2, linestyle=0, color=red ; print, error_bars_vert_lines_x, error_bars_vert_lines_y ENDFOR image = TVRD() TVLCT, /GET, r, g, b ibackground = WHERE(image EQ 0) IF ibackground(0) GE 0 THEN image(ibackground) = white WRITE_GIF, plotfile, image, r, g, b DEVICE, /CLOSE ; Plot ustar obs) vs. ustar (BVW03 & SWS2) yt = 'Modeled Friction Velocity (m/s)' xt = 'SWS-2 Friction Velocity (m/s)' !P.BACKGROUND = white SET_PLOT, 'Z' dcolor = !D.N_COLORS DEVICE, SET_RESOLUTION = [800, 600], SET_COLORS = dcolor ERASE xmax = 1.20 ymax = 1.20 xmin = 0.0 ymin = 0.0 xtckv = 0.20 * [ 0, 1, 2, 3, 4, 5, 6 ] ytckv = 0.20 * [ 0, 1, 2, 3, 4, 5, 6 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 plotfile = 'SWS2_ustar_BVW_ustar.gif' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 1.0 ; DEVICE, /COLOR, FILE = plotfile, $ ; XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv ; Oplot, xtckv, ytckv, thick = thck*0.25, linestyle=0, color=black ; OPlot, ustar_SWS2, ustar_BVW, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=black rms_diff = SQRT( TOTAL( ( ustar_SWS2 - ustar_BVW )^2 / n_data ) ) i_test = where( ustar_SWS2 LT 0.7, n_data2 ) rms_diff2 = SQRT( TOTAL( ( ustar_SWS2(i_test) - ustar_BVW(i_test ) )^2 / n_data2 ) ) i_test2 = where( ustar_SWS2 LT 0.7 AND abs( ustar_BVW - ustar_SWS2 ) LT 0.15, n_data2 ) rms_diff3 = SQRT( TOTAL( ( ustar_SWS2(i_test2) - ustar_BVW(i_test2) )^2 / n_data2 ) ) print, 'RMS ustar difference (without) = ', rms_diff, ', ', rms_diff2, ', ', rms_diff3 ; OPlot, ustar_SWS2, ustar_BVWa, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=dkblue ; OPlot, ustar_SWS2, ustar_BVWa, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=black rms_diff = SQRT( TOTAL( ( ustar_SWS2 - ustar_BVWa )^2 / n_data ) ) rms_diff2 = SQRT( TOTAL( ( ustar_SWS2(i_test) - ustar_BVWa(i_test ) )^2 / n_data2 ) ) rms_diff3 = SQRT( TOTAL( ( ustar_SWS2(i_test2) - ustar_BVWa(i_test2) )^2 / n_data2 ) ) print, 'RMS ustar difference (with orb)= ', rms_diff, ', ', rms_diff2, ', ', rms_diff3 ; overplot the ideal line Oplot, xtckv, ytckv, thick = thck*0.25, linestyle=0, color=black ; overplot mean values bin_size = 0.05 n_bins = (xmax - xmin) / bin_size mean_ustar_SWS2 = FLTARR( n_bins ) mean_ustar_BVW03 = FLTARR( n_bins ) mean_ustar_BVW03b = FLTARR( n_bins ) mean_ustar_BVW03c = FLTARR( n_bins ) mean_ustar = FLTARR( n_bins ) std_ustar_SWS2 = FLTARR( n_bins ) std_ustar_BVW03 = FLTARR( n_bins ) bin_CD = FLTARR( n_bins ) For i_bin = 0, n_bins - 1 do begin i_good = where( ustar_SWS2 GE xmin + i_bin * bin_size AND $ ustar_SWS2 LT xmin + ( i_bin + 1 ) * bin_size, n_ustar ) ; print, n_ustar, xmin + i_bin * bin_size, xmin + (i_bin+1) * bin_size if ( n_ustar GT 8 ) THEN BEGIN mean_ustar_SWS2(i_bin) = mean( ustar_SWS2( i_good ) ) mean_ustar_BVW03(i_bin) = mean( ustar_BVWa( i_good ) ) mean_ustar_BVW03b(i_bin) = mean( ustar_BVWb( i_good ) ) mean_ustar_BVW03c(i_bin) = mean( ustar_BVWc( i_good ) ) mean_ustar(i_bin) = mean( ustar( i_good ) ) std_ustar_SWS2(i_bin) = SQRT( mean( ( ustar_SWS2( i_good ) - mean_ustar_SWS2( i_bin ) )^2 ) ) / SQRT( n_ustar -2 ) std_ustar_BVW03(i_bin) = SQRT( mean( ( ustar_BVWa( i_good ) - mean_ustar_BVW03( i_bin ) )^2 ) ) / SQRT( n_ustar - 2 ) print, mean_ustar_SWS2(i_bin), mean_ustar_BVW03(i_bin), n_ustar, std_ustar_BVW03(i_bin), std_ustar_SWS2(i_bin) ENDIF ELSE BEGIN mean_ustar_SWS2(i_bin) = miss mean_ustar_BVW03(i_bin) = miss mean_ustar(i_bin) = miss std_ustar_SWS2(i_bin) = miss std_ustar_BVW03(i_bin) = miss ENDELSE ENDFOR print, 'plotting mean ustar (model) vs. mean ustar (obs)' igood = where( mean_ustar_SWS2 GE -200.0 ) OPlot, mean_ustar_SWS2(igood), mean_ustar_BVW03(igood), Min = -300, $ symsize = 1.0, thick = thck*1, PSYM=1, color=black OPlot, mean_ustar_SWS2(igood), mean_ustar_BVW03b(igood), Min = -300, $ symsize = 1.0, thick = thck*1, PSYM=4, color=black OPlot, mean_ustar_SWS2(igood), mean_ustar_BVW03c(igood), Min = -300, $ symsize = 1.0, thick = thck*1, PSYM=5, color=black ; OPlot, mean_ustar, mean_ustar_SWS2, Min = -300, $ ; symsize = 2.0, thick = thck*1, PSYM=1, color=orange ; plot error bars FOR i_pts = 0, N_ELEMENTS( igood ) - 1 DO BEGIN error_bars_vert_lines_y = mean_ustar_BVW03( igood( i_pts ) ) + $ 3.0 * std_ustar_BVW03( igood( i_pts ) ) * [ -1, 1 ] error_bars_vert_lines_x = mean_ustar_SWS2( igood( i_pts ) ) * [1,1] ; OPlot, error_bars_vert_lines_x, error_bars_vert_lines_y, Min = -300, $ ; thick = thck*2, linestyle=0, color=black ; print, error_bars_vert_lines_x, error_bars_vert_lines_y ENDFOR image = TVRD() TVLCT, /GET, r, g, b ibackground = WHERE(image EQ 0) IF ibackground(0) GE 0 THEN image(ibackground) = white WRITE_GIF, plotfile, image, r, g, b DEVICE, /CLOSE ; Plot ustar obs) vs. U10EN (BVW03 & SWS2) yt = 'Observed Friction Velocity (m/s)' xt = 'Equivalent Neutral Wind Speed (m/s)' !P.BACKGROUND = white SET_PLOT, 'Z' dcolor = !D.N_COLORS DEVICE, SET_RESOLUTION = [800, 600], SET_COLORS = dcolor ERASE cblast_ustar = [0.783, 0.814, 1.3216, 2.2998, 1.82423 ] cblast_U10EN1 = [32.0855, 46.8656, 52.073, 51.8389, 61.1473] cblast_U10EN2 = [ 16.5, 16.99, 24.3859, 36.0658, 30.7204] cblast_U_sfc = [ 24.0, 36.0, 44.0, 51.0, 58.0 ] cblast_z0 = [ 7.66699e-07, 9.99917e-10, 1.42928e-06, 0.00121449, 1.50335e-05 ] cblast_z0_mod = cblast_z0 / exp( -0.4*cblast_U_sfc / cblast_ustar ) cblast_u10EN3 = 0.25 * cblast_ustar * alog( 10.0 / cblast_z0_mod ) xmax = 1.20 ymax = 1.20 xmin = 0.0 ymin = 0.0 xtckv = 5.00 * [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ] ytckv = 0.20 * [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 plotfile = 'SWS2_ustar_BVW_U10EN2.gif' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 1.0 ; DEVICE, /COLOR, FILE = plotfile, $ ; XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv ; Oplot, xtckv, ytckv, thick = thck*0.25, linestyle=0, color=black ; OPlot, 2.5 * ustar_BVWa * alog( 10.0 / z0_BVWa ), ustar_SWS2, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=black OPlot, 2.5 * ustar_BVWb * alog( ( 10.0 - 0.8 * U_orb) / z0_BVWb ), ustar_SWS2, Min = -300, symsize = 1.0, $ thick = thck, PSYM=1, color=black OPlot, CBLAST_U10EN3, CBLAST_ustar, Min = -300, symsize = 1.0, $ thick = 2*thck, PSYM=1, color=red rms_diff = SQRT( TOTAL( ( ustar_SWS2 - ustar_BVW )^2 / n_data ) ) i_test = where( ustar_SWS2 LT 0.7, n_data2 ) rms_diff2 = SQRT( TOTAL( ( ustar_SWS2(i_test) - ustar_BVW(i_test ) )^2 / n_data2 ) ) i_test2 = where( ustar_SWS2 LT 0.7 AND abs( ustar_BVW - ustar_SWS2 ) LT 0.15, n_data2 ) rms_diff3 = SQRT( TOTAL( ( ustar_SWS2(i_test2) - ustar_BVW(i_test2) )^2 / n_data2 ) ) print, 'RMS ustar difference (without) = ', rms_diff, ', ', rms_diff2, ', ', rms_diff3 ; OPlot, ustar_SWS2, ustar_BVWa, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=dkblue ; OPlot, ustar_SWS2, ustar_BVWa, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=black rms_diff = SQRT( TOTAL( ( ustar_SWS2 - ustar_BVWa )^2 / n_data ) ) rms_diff2 = SQRT( TOTAL( ( ustar_SWS2(i_test) - ustar_BVWa(i_test ) )^2 / n_data2 ) ) rms_diff3 = SQRT( TOTAL( ( ustar_SWS2(i_test2) - ustar_BVWa(i_test2) )^2 / n_data2 ) ) print, 'RMS ustar difference (with orb)= ', rms_diff, ', ', rms_diff2, ', ', rms_diff3 ; overplot the ideal line ; Oplot, xtckv, ytckv, thick = thck*0.25, linestyle=0, color=black ; overplot mean values bin_size = 0.05 n_bins = (xmax - xmin) / bin_size mean_ustar_SWS2 = FLTARR( n_bins ) mean_ustar_BVW03 = FLTARR( n_bins ) mean_ustar_BVW03b = FLTARR( n_bins ) mean_ustar_BVW03c = FLTARR( n_bins ) mean_ustar = FLTARR( n_bins ) std_ustar_SWS2 = FLTARR( n_bins ) std_ustar_BVW03 = FLTARR( n_bins ) bin_CD = FLTARR( n_bins ) For i_bin = 0, n_bins - 1 do begin i_good = where( ustar_SWS2 GE xmin + i_bin * bin_size AND $ ustar_SWS2 LT xmin + ( i_bin + 1 ) * bin_size, n_ustar ) ; print, n_ustar, xmin + i_bin * bin_size, xmin + (i_bin+1) * bin_size if ( n_ustar GT 8 ) THEN BEGIN mean_ustar_SWS2(i_bin) = mean( ustar_SWS2( i_good ) ) mean_ustar_BVW03(i_bin) = mean( ustar_BVWa( i_good ) ) mean_ustar_BVW03b(i_bin) = mean( ustar_BVWb( i_good ) ) mean_ustar_BVW03c(i_bin) = mean( ustar_BVWc( i_good ) ) mean_ustar(i_bin) = mean( ustar( i_good ) ) std_ustar_SWS2(i_bin) = SQRT( mean( ( ustar_SWS2( i_good ) - mean_ustar_SWS2( i_bin ) )^2 ) ) / SQRT( n_ustar -2 ) std_ustar_BVW03(i_bin) = SQRT( mean( ( ustar_BVWa( i_good ) - mean_ustar_BVW03( i_bin ) )^2 ) ) / SQRT( n_ustar - 2 ) print, mean_ustar_SWS2(i_bin), mean_ustar_BVW03(i_bin), n_ustar, std_ustar_BVW03(i_bin), std_ustar_SWS2(i_bin) ENDIF ELSE BEGIN mean_ustar_SWS2(i_bin) = miss mean_ustar_BVW03(i_bin) = miss mean_ustar(i_bin) = miss std_ustar_SWS2(i_bin) = miss std_ustar_BVW03(i_bin) = miss ENDELSE ENDFOR print, 'plotting mean ustar (model) vs. mean ustar (obs)' igood = where( mean_ustar_SWS2 GE -200.0 ) ; OPlot, mean_ustar_SWS2(igood), mean_ustar_BVW03(igood), Min = -300, $ ; symsize = 1.0, thick = thck*1, PSYM=1, color=black ; OPlot, mean_ustar_SWS2(igood), mean_ustar_BVW03b(igood), Min = -300, $ ; symsize = 1.0, thick = thck*1, PSYM=4, color=black ; OPlot, mean_ustar_SWS2(igood), mean_ustar_BVW03c(igood), Min = -300, $ ; symsize = 1.0, thick = thck*1, PSYM=5, color=black ; OPlot, mean_ustar, mean_ustar_SWS2, Min = -300, $ ; symsize = 2.0, thick = thck*1, PSYM=1, color=orange ; plot error bars FOR i_pts = 0, N_ELEMENTS( igood ) - 1 DO BEGIN error_bars_vert_lines_y = mean_ustar_BVW03( igood( i_pts ) ) + $ 3.0 * std_ustar_BVW03( igood( i_pts ) ) * [ -1, 1 ] error_bars_vert_lines_x = mean_ustar_SWS2( igood( i_pts ) ) * [1,1] ; OPlot, error_bars_vert_lines_x, error_bars_vert_lines_y, Min = -300, $ ; thick = thck*2, linestyle=0, color=black ; print, error_bars_vert_lines_x, error_bars_vert_lines_y ENDFOR image = TVRD() TVLCT, /GET, r, g, b ibackground = WHERE(image EQ 0) IF ibackground(0) GE 0 THEN image(ibackground) = white WRITE_GIF, plotfile, image, r, g, b DEVICE, /CLOSE ; Plot U10EN1 vs. U10EN2 (BVW03 & SWS2) yt = 'Change in Equivalent Neutral Wind Speed (m/s)' xt = 'Equivalent Neutral Wind Speed (m/s)' !P.BACKGROUND = white SET_PLOT, 'Z' dcolor = !D.N_COLORS DEVICE, SET_RESOLUTION = [800, 600], SET_COLORS = dcolor ERASE cblast_ustar = [0.783, 0.814, 1.3216, 2.2998, 1.82423 ] cblast_U10EN1 = [32.0855, 46.8656, 52.073, 51.8389, 61.1473] cblast_U10EN2 = [ 16.5, 16.99, 24.3859, 36.0658, 30.7204] cblast_U_sfc = [ 24.0, 36.0, 44.0, 51.0, 58.0 ] cblast_z0 = [ 7.66699e-07, 9.99917e-10, 1.42928e-06, 0.00121449, 1.50335e-05 ] cblast_z0_mod = cblast_z0 / exp( -0.4*cblast_U_sfc / cblast_ustar ) cblast_u10EN3 = 0.25 * cblast_ustar * alog( 10.0 / cblast_z0_mod ) xmax = 1.20 ymax = 1.20 xmin = 0.0 ymin = 0.0 xtckv = 5.00 * [ 0, 1, 2, 3, 4, 5] ytckv = 0.30 * [ 0, 1, 2, 3, 4, 5, 6 ] xtcks = N_ELEMENTS( xtckv ) - 1 ytcks = N_ELEMENTS( ytckv ) - 1 plotfile = 'U10EN.gif' ; thickness of lines in plots thk = 4.0 ; thickness for plot symbols thck = 1.0 ; DEVICE, /COLOR, FILE = plotfile, $ ; XSIZE = 17.6, YSIZE = 17.6, XOFFSET = 1.25, YOFFSET = 5.0 Plot, [-999], [-999], Min = -300, symsize = 2.0, thick = 2.0, $ Charthick = 1.5, charsize = 1.5, xtitle=xt, ytitle=yt, TITLE=tt, $ PSYM=1, color=1, Xrange=[xmin,xmax], Yrange=[ymin,ymax], $ Xstyle=1, Ystyle=1, Xticks=xtcks, Xtickv=xtckv, Yticks=ytcks, $ Ytickv=ytckv ; Oplot, xtckv, ytckv, thick = thck*0.25, linestyle=0, color=black diff = 2.5 * ustar_BVWb * alog( ( 10.0 - 0.8 * U_orb) / z0_BVWb ) - 2.5 * ustar_BVWa * alog( 10.0 / z0_BVWa ) OPlot, 2.5 * ustar_BVWa * alog( 10.0 / z0_BVWa ), diff, Min = -300, symsize = 1.0, $ thick = thck, PSYM=1, color=black ; OPlot, 2.5 * ustar_BVWb * alog( ( 10.0 - 0.8 * U_orb) / z0_BVWb ), ustar_SWS2, Min = -300, symsize = 1.0, $ ; thick = thck, PSYM=1, color=black ; OPlot, CBLAST_U10EN3, CBLAST_ustar, Min = -300, symsize = 1.0, $ ; thick = 2*thck, PSYM=1, color=red rms_diff = SQRT( TOTAL( ( ustar_SWS2 - ustar_BVW )^2 / n_data ) ) i_test = where( ustar_SWS2 LT 0.7, n_data2 ) rms_diff2 = SQRT( TOTAL( ( ustar_SWS2(i_test) - ustar_BVW(i_test ) )^2 / n_data2 ) ) i_test2 = where( ustar_SWS2 LT 0.7 AND abs( ustar_BVW - ustar_SWS2 ) LT 0.15, n_data2 ) rms_diff3 = SQRT( TOTAL( ( ustar_SWS2(i_test2) - ustar_BVW(i_test2) )^2 / n_data2 ) ) print, 'RMS ustar difference (without) = ', rms_diff, ', ', rms_diff2, ', ', rms_diff3 image = TVRD() TVLCT, /GET, r, g, b ibackground = WHERE(image EQ 0) IF ibackground(0) GE 0 THEN image(ibackground) = white WRITE_GIF, plotfile, image, r, g, b DEVICE, /CLOSE END