PRO readqnblendwind ; IDL program to read binary blended wind data files. ; This routine can be adapted to read either the zonal and ; meridional wind data ("uv") or the windstress curl data ("curl"). ; ; UV or Curl ; ; Either read two arrays (u and v, in m/s), or one array (curl, ; in N/m3). ; ; Big-endian vs. little-endian ; ; The data files were produced on a little-endian machine (pentium PC). ; If reading from a big-endian machine, use the IDL keyword ; "SWAP_IF_BIG_ENDIAN" in open statement. ; ; Geographic Grid ; The data domain is a 0.5x0.5 degree grid, 720 x 353, starting at ; (0.5E, 88.0S) and ending at (360.0E, 88.0N). There are data ; values at all grid points, including land and ice points. ; Users who wish to examine ocean points only need to use ; appropriate land/ice masks. ; ; Time convention ; ; Time is 6-hourly; the "day" variable is in days of year: ; e.g. January 1, 6hr = day 0.25. There is no February 29 in leap ; years. This data was produced for ocean models that require ; a constant number of days per year. In all years days go from ; 0.25 to 365.00. ; ; Data file types ; ; bln : QSCAT scatterometer data blended with NCEP analyses. ; The blended data has realistic highwavenumber variability ; everywhere and preserves the satellite data where it occurs. ; For each 6-hourly field, 12 hours of QSCAT satellite swaths ; are overlayed on the global NCEP analysis map, centered on the ; analysis time. ; ; low : NCEP analysis splined to the 0.5x0.5 degree grid. ; ; ; Version 2.0, June 11, 2002 ; Version 3.0, February 26, 2003: the sample output is from version 2.0 ; blended winds ; Version 3.1, May 1 , 2003: for blended winds version 3.0, ; the sample output is now in separate ; file ; ;----------------------------------------------------------------------- ; data type readuv = 0 ; if readuv=1, read uv data, else read curl data ; parameters nlon = 720 nlat = 353 u = fltarr(nlon,nlat) v = fltarr(nlon,nlat) c = fltarr(nlon,nlat) ; for curl ; open input file if (readuv eq 1) then begin dfname = 'uv.200012.bln' dfname = '/data/ocean04/data1/WINDqscat-1.v03/uv.200012.bln' endif else begin dfname = 'curl.200012.bln' dfname = '/data/ocean04/data1/WINDqscat-1.v03/curl.200012.bln' endelse print,'input= ',dfname get_lun,iunit openr,iunit,dfname,/F77_UNFORMATTED,/SWAP_IF_BIG_ENDIAN ; read data nread = long(0) g11: if(eof(iunit)) then goto, g99 readu,iunit,day if (readuv eq 1) then begin readu,iunit,u readu,iunit,v endif else begin readu,iunit,c endelse nread = nread + 1 if (readuv eq 1) then begin ; print some u and v data uvformat='(/,"day=",f9.4," print data at i=",i4," to",i4,", j=",i4,/," u=",5e16.7,/," v=",5e16.7)' ip1 = 20 ip2 = 24 jp = 19 print,day,ip1+1,ip2+1,jp+1,u(ip1:ip2,jp),v(ip1:ip2,jp),format=uvformat jp = 329 print,day,ip1+1,ip2+1,jp+1,u(ip1:ip2,jp),v(ip1:ip2,jp),format=uvformat endif if (readuv ne 1) then begin ; print some curl data cformat='(/,"day=",f9.4," print data at i=",i4," to",i4,", j=",i4,/," c=",5e16.7)' ip1 = 20 ip2 = 24 jp = 19 print,day,ip1+1,ip2+1,jp+1,c(ip1:ip2,jp),format=cformat jp = 329 print,day,ip1+1,ip2+1,jp+1,c(ip1:ip2,jp),format=cformat endif if (nread gt 5) then goto, g99 goto, g11 ; end of input file g99: free_lun,iunit print,nread,format='(/,"Nread=",i4)' end