; 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) function read_SWS2, wind_spd, rel_hum, T_air, T_sst, pressure, period_peak, $ Hsig, ustar, shf, lhf, atmos_stab ; open data file OPENR, SWS2_data, "/Net/Movies0/bourassa/data/SWS2/nomad_stress2.txt", /GET_LUN ; skip first line (with headers) junk = ' ' READF, SWS2_data, junk ; define output arrays n_data = 1710L wind_spd = FLTARR( n_data ) rel_hum = wind_spd T_air = wind_spd T_sst = wind_spd pressure = wind_spd period_peak = wind_spd Hsig = wind_spd ustar = wind_spd shf = wind_spd lhf = wind_spd sound_spd = wind_spd stnd_dev_Hdg = wind_spd z_over_L = wind_spd ; read in all data (1710 lines) For i = 1L, n_data do begin READF, SWS2_data, jday, section, SndVel, Hdg, s_d_Hdg, rdirEN, spdENV, $ tilt, RH, TairAx, pres1ax, sstAx, TpWavAx, HsWavAx, LatAx, LongAx, $ U10BF3, USTBF3, SENBF3, LATBF3, TOLBF3 wind_spd(i-1) = spdENV sound_spd(i-1) = SndVel rel_hum(i-1) = 0.01 * RH T_air(i-1) = TairAx T_sst(i-1) = sstAx pressure(i-1) = 100.0 * pres1ax period_peak(i-1) = TpWavAx Hsig(i-1) = HsWavAx ustar(i-1) = USTBF3 shf(i-1) = SENBF3 lhf(i-1) = LATBF3 stnd_dev_Hdg(i-1) = s_d_Hdg z_over_L(i-1) = TOLBF3 ENDFOR ; Apply quality control U_orb = !DTOR * 180.0 * Hsig / period_peak ; Find the points where QC conditions are met i_good = where( sound_spd GT 332.0 AND sound_spd LE 338 AND $ stnd_dev_Hdg LT 14 AND U_orb LT 2.5 AND ABS( z_over_L ) LT 0.18 ) ; i_good = where( sound_spd GT 332.0 AND sound_spd LE 338 AND $ ; stnd_dev_Hdg LT 14 ) ; Save only the data that meet the QC conditions wind_spd = wind_spd(i_good) rel_hum = rel_hum(i_good) T_air = T_air( i_good ) T_sst = T_sst( i_good ) pressure = pressure( i_good ) period_peak = period_peak( i_good ) Hsig = Hsig( i_good ) ustar = ustar( i_good ) shf = shf( i_good ) lhf = lhf( i_good ) atmos_stab = z_over_L( i_good ) ; stop return, N_elements( lhf ) END