program readqnblendwind c Fortran program to read binary QSCAT/NCEP blended wind data files. c This routine can be adapted to read either the zonal and c meridional wind data ("uv") or the windstress curl data ("curl"). c c UV or Curl c c Either read two arrays (u and v, in m/s), or one array (curl, c in N/m3). Change record length for open statement, read c statements, and call to swap4 subroutine accordingly. c c Big-endian vs. little-endian c c The data files were produced on a little-endian machine c (a pentium PC). Subroutine swap4 is required to read these files c on big-endian machines (e.g. SGI). The subroutine does not to be c called from little-endian machines. c c Geographic Grid c c The data domain is a 0.5x0.5 degree grid, 720 x 353, starting at c (0.5E, 88.0S) and ending at (360.0E, 88.0N). There are data c values at all grid points, including land and ice points. c Users who wish to examine ocean points only need to use c appropriate land/ice masks. c c Time convention c c Time is 6-hourly; the "day" variable is in days of year: c e.g. January 1, 6hr = day 0.25. There is no February 29 in leap c years. This data was produced for ocean models, that require c a constant number of days per year. In all years days go from c 0.25 to 365.00. c c Data file types c c bln : QSCAT scatterometer data blended with NCEP analyses. c The blended data has realistic highwavenumber variability c everywhere and preserves the satellite data where it occurs. c For each 6-hourly field, 12 hours of QSCAT satellite swaths c are overlayed on the global NCEP analysis map, centered on c the analysis time. c c low : NCEP analysis splined to the 0.5x0.5 degree grid. c c c V3.0, June 11, 2002 c V4.0, February 26, 2003: sample output are version 2.0 blended winds c V5.0, February 22, 2008: sample output are version 5.0 blended winds c c----------------------------------------------------------------------- parameter $( nlon = 720 $, nlat = 353 $) real $ dayin,day $, uin(nlon,nlat),u(nlon,nlat) $, vin(nlon,nlat),v(nlon,nlat) $, cin(nlon,nlat),c(nlon,nlat) character dfname*80 integer idum1,idum2,idum3,idum4,idum5,idum6 logical readuv ! to read either uv or curl files c c pick datatype c readuv = .true. c c open input c if (readuv) then lrecl = (2*nlon*nlat + 7)*4 else lrecl = ( nlon*nlat + 5)*4 ! for curl endif if (readuv) then dfname = 'uv.200012.bln' else dfname = 'curl.200012.bln' endif write(6,1010) dfname 1010 format("c input= ",a80) open(11,file=dfname,form='unformatted',access='direct', $ recl=lrecl) c c read data c nread = 0 irec = 0 11 irec = irec + 1 if (readuv) then read(11,rec=irec,end=99) idum1,dayin,idum2, $ idum3,uin ,idum4, $ idum5,vin ,idum6 else read(11,rec=irec,end=99) idum1,dayin,idum2, ! for curl $ idum3,cin ,idum4 endif call swap4(dayin,day,4) if (readuv) then call swap4(uin ,u ,4*nlon*nlat) call swap4(vin ,v ,4*nlon*nlat) else call swap4(cin ,c ,4*nlon*nlat) ! for curl endif nread = nread + 1 if (readuv) then ! print some u and v data ip1 = 21 ip2 = 25 jp = 20 write(6,1020) day,ip1,ip2,jp, $ (u(i,jp),i=ip1,ip2),(v(i,jp),i=ip1,ip2) jp = 330 write(6,1020) day,ip1,ip2,jp, $ (u(i,jp),i=ip1,ip2),(v(i,jp),i=ip1,ip2) 1020 format(/,"c day=",f12.7, $ " print data at i=",i4," to",i4,", j=",i4, $ /,"c u=",5e16.7,/,"c v=",5e16.7) endif if (.not.readuv) then ! print some curl data ip1 = 21 ip2 = 25 jp = 20 write(6,1030) day,ip1,ip2,jp,(c(i,jp),i=ip1,ip2) jp = 330 write(6,1030) day,ip1,ip2,jp,(c(i,jp),i=ip1,ip2) 1030 format(/,"c day=",f12.7, $ " print data at i=",i4," to",i4,", j=",i4, $ /,"c c=",5e16.7) endif if (nread.gt.5) goto 99 goto 11 c c end of input file c 99 close(11) write(6,1040) nread 1040 format(/,"c Nread=",i4) stop end c----------------------------------------------------------------------- subroutine swap4(in,io,nn) c swaps bytes in groups of 4 to compensate for byte swapping within c words which occurs on DEC (VAX) and PC machines. c c in - input array to be swapped c io - ouput array with bytes swapped c nn - number of bytes to be swapped logical*1 in(1),io(1),ih c character*1 in(1),io(1),ih ! Cray CF90 (Version 3.0.1.3) c Use character*1 instead of logical*1 when compiling on a Cray do 10 i=1,nn,4 ih=in(i) io(i)=in(i+3) io(i+3)=ih ih=in(i+1) io(i+1)=in(i+2) io(i+2)=ih 10 continue return end c------------------------------------------------------------------------------------- c sample uv output c------------------------------------------------------------------------------------- c input= uv.200012.bln c day= 334.2500000 print data at i= 21 to 25, j= 20 c u= -0.7112223E+01 -0.7033203E+01 -0.7011598E+01 -0.7090387E+01 -0.7206115E+01 c v= -0.3942553E+01 -0.3962124E+01 -0.3986620E+01 -0.4037624E+01 -0.4137620E+01 c day= 334.2500000 print data at i= 21 to 25, j= 330 c u= -0.8854372E+00 0.2394634E+01 -0.6910892E+00 0.1598216E+01 0.9065568E+00 c v= -0.2943386E+00 0.2213990E+01 0.1227269E+00 0.1858092E+01 0.5028909E+00 c day= 334.5000000 print data at i= 21 to 25, j= 20 c u= -0.2700038E+01 -0.2973726E+01 -0.3258945E+01 -0.3552392E+01 -0.3867300E+01 c v= -0.6495625E+01 -0.6497209E+01 -0.6481194E+01 -0.6459236E+01 -0.6407810E+01 c day= 334.5000000 print data at i= 21 to 25, j= 330 c u= -0.7971388E+00 -0.1013222E+01 -0.1325200E+01 -0.1679704E+01 -0.2035655E+01 c v= -0.1281099E+01 -0.1196701E+01 -0.1229659E+01 -0.1358854E+01 -0.1565742E+01 c day= 334.7500000 print data at i= 21 to 25, j= 20 c u= -0.1755905E+01 -0.1725370E+01 -0.1632135E+01 -0.1550382E+01 -0.1490727E+01 c v= -0.5887057E+01 -0.5972985E+01 -0.6038925E+01 -0.6098041E+01 -0.6152860E+01 c day= 334.7500000 print data at i= 21 to 25, j= 330 c u= -0.4383349E+01 -0.3761794E+01 -0.4659785E+01 -0.4328775E+01 -0.3982705E+01 c v= -0.4979240E+00 -0.1160431E+01 -0.1297167E+01 -0.1157849E+01 -0.1222925E+01 c day= 335.0000000 print data at i= 21 to 25, j= 20 c u= -0.4119569E+00 -0.6528024E+00 -0.9559648E+00 -0.1262638E+01 -0.1553511E+01 c v= -0.4306739E+01 -0.4358467E+01 -0.4473586E+01 -0.4658427E+01 -0.4874317E+01 c day= 335.0000000 print data at i= 21 to 25, j= 330 c u= -0.4383684E+01 -0.3762361E+01 -0.4661222E+01 -0.4327851E+01 -0.3985085E+01 c v= -0.4991178E+00 -0.1161200E+01 -0.1305194E+01 -0.1169430E+01 -0.1279151E+01 c day= 335.2500000 print data at i= 21 to 25, j= 20 c u= -0.4862082E+01 -0.5037855E+01 -0.5188568E+01 -0.5322361E+01 -0.5435145E+01 c v= -0.7182055E+01 -0.7120403E+01 -0.7069640E+01 -0.6999370E+01 -0.6883837E+01 c day= 335.2500000 print data at i= 21 to 25, j= 330 c u= -0.2559734E+01 -0.2696071E+01 -0.2483752E+01 -0.3011353E+01 -0.2803352E+01 c v= -0.1298768E+01 -0.1367403E+01 -0.1607539E+01 -0.1681914E+01 -0.1331954E+01 c day= 335.5000000 print data at i= 21 to 25, j= 20 c u= -0.3523773E+01 -0.3660601E+01 -0.3755870E+01 -0.3802105E+01 -0.3791556E+01 c v= -0.7283126E+01 -0.7299356E+01 -0.7303202E+01 -0.7252859E+01 -0.7143980E+01 c day= 335.5000000 print data at i= 21 to 25, j= 330 c u= -0.7482214E-01 -0.1291005E+01 -0.9619290E+00 -0.1425813E+01 -0.1502040E+01 c v= -0.1033460E+01 -0.8185180E+00 -0.1070591E+00 -0.6884152E+00 -0.6684729E+00 c Nread= 6 c------------------------------------------------------------------------------------- c sample curl output c------------------------------------------------------------------------------------- c input= curl.200012.bln c day= 334.2500000 print data at i= 21 to 25, j= 20 c c= 0.2397559E-06 0.2150966E-06 0.9828683E-07 -0.8977198E-07 -0.2732344E-06 c day= 334.2500000 print data at i= 21 to 25, j= 330 c c= -0.2791514E-06 -0.6225630E-06 -0.6434694E-06 0.4090251E-06 -0.2221680E-05 c day= 334.5000000 print data at i= 21 to 25, j= 20 c c= -0.2524055E-06 -0.2053237E-06 -0.1808874E-06 -0.1454196E-06 -0.7269648E-07 c day= 334.5000000 print data at i= 21 to 25, j= 330 c c= -0.2505921E-08 -0.7731330E-07 -0.1895391E-06 -0.2526803E-06 -0.3188680E-06 c day= 334.7500000 print data at i= 21 to 25, j= 20 c c= -0.2273965E-06 -0.1608326E-06 -0.1477028E-06 -0.1304271E-06 -0.1337034E-06 c day= 334.7500000 print data at i= 21 to 25, j= 330 c c= -0.5487042E-06 -0.3639760E-06 -0.6742533E-07 0.2923234E-06 -0.4455453E-06 c day= 335.0000000 print data at i= 21 to 25, j= 20 c c= -0.1049936E-06 -0.1958875E-06 -0.2931115E-06 -0.3739532E-06 -0.4185766E-06 c day= 335.0000000 print data at i= 21 to 25, j= 330 c c= -0.5481131E-06 -0.3678523E-06 -0.6133656E-07 0.2605649E-06 -0.3912448E-06 c day= 335.2500000 print data at i= 21 to 25, j= 20 c c= -0.3248148E-06 -0.3325157E-06 -0.3259412E-06 -0.2100612E-06 -0.1497840E-06 c day= 335.2500000 print data at i= 21 to 25, j= 330 c c= -0.4591811E-06 -0.1951040E-06 -0.2740069E-06 0.5005482E-07 0.3079399E-06 c day= 335.5000000 print data at i= 21 to 25, j= 20 c c= -0.1409196E-06 -0.1356192E-06 -0.3286763E-07 0.1263331E-06 0.2434595E-06 c day= 335.5000000 print data at i= 21 to 25, j= 330 c c= -0.2644707E-06 -0.3473503E-08 -0.2066530E-06 -0.4459343E-06 -0.1710275E-06 c Nread= 6