爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 23904|回复: 20

[其他] QUIKSCAT/NCEP数据处理(已解决)

[复制链接]

新浪微博达人勋

发表于 2012-7-6 10:07:15 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本帖最后由 夏天爱裤衩 于 2012-7-6 19:31 编辑

QSCAT/NCEP数据网址: http://rda.ucar.edu/datasets/ds744.4/
同时请教各位,有人处理过这个数据吗,请留言,交流!
后面有fortran和ncl的处理脚本,fortran脚本有一些问题,ncl的可以使用!

密码修改失败请联系微信:mofangbao

新浪微博达人勋

0
早起挑战累计收入
发表于 2012-7-6 11:26:28 | 显示全部楼层
介绍下啥数据啊,楼主是不是处理的时候遇到啥问题了?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 成长值: 0
发表于 2012-7-6 11:31:39 | 显示全部楼层
烦请告知啥数据,啥类型,你想做什么处理?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2012-7-6 12:44:33 | 显示全部楼层
大裤衩,你遇到啥问题了?详细讲撒~
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2012-7-6 14:38:36 | 显示全部楼层
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2012-7-6 14:40:18 | 显示全部楼层
言深深 发表于 2012-7-6 11:31
烦请告知啥数据,啥类型,你想做什么处理?

BLN格式的,就是海洋表面风场数据,但是是QUIKSCAT卫星数据+NCEP补全的数据,不会处理啊
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2012-7-6 14:53:16 | 显示全部楼层
数据按月存放的,一个文件200多M,不能传上来,苦恼啊
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2012-7-6 15:25:45 | 显示全部楼层
  1.       program readqnblendwind

  2. c Fortran program to read binary QSCAT/NCEP blended wind data files.
  3. c This routine can be adapted to read either the zonal and
  4. c meridional wind data ("uv") or the windstress curl data ("curl").
  5. c
  6. c UV or Curl
  7. c
  8. c   Either read two arrays (u and v, in m/s), or one array (curl,
  9. c   in N/m3).  Change record length for open statement, read
  10. c   statements, and call to swap4 subroutine accordingly.
  11. c
  12. c Big-endian vs. little-endian
  13. c
  14. c   The data files were produced on a little-endian machine
  15. c   (a pentium PC).  Subroutine swap4 is required to read these files
  16. c   on big-endian machines (e.g. SGI).  The subroutine does not to be
  17. c   called from little-endian machines.  
  18. c
  19. c Geographic Grid
  20. c
  21. c   The data domain is a 0.5x0.5 degree grid, 720 x 353, starting at
  22. c   (0.5E, 88.0S) and ending at (360.0E, 88.0N).  There are data
  23. c   values at all grid points, including land and ice points.
  24. c   Users who wish to examine ocean points only need to use
  25. c   appropriate land/ice masks.
  26. c
  27. c Time convention
  28. c
  29. c   Time is 6-hourly; the "day" variable is in days of year:
  30. c   e.g. January 1, 6hr = day 0.25. There is no February 29 in leap
  31. c   years.  This data was produced for ocean models, that require
  32. c   a constant number of days per year.  In all years days go from
  33. c   0.25 to 365.00.
  34. c
  35. c Data file types
  36. c
  37. c   bln : QSCAT scatterometer data blended with NCEP analyses.
  38. c         The blended data has realistic highwavenumber variability
  39. c         everywhere and preserves the satellite data where it occurs.
  40. c         For each 6-hourly field, 12 hours of QSCAT satellite swaths
  41. c         are overlayed on the global NCEP analysis map, centered on
  42. c         the analysis time.
  43. c
  44. c   low : NCEP analysis splined to the 0.5x0.5 degree grid.
  45. c
  46. c
  47. c V3.0, June     11, 2002
  48. c V4.0, February 26, 2003: sample output are version 2.0 blended winds
  49. c V5.0, February 22, 2008: sample output are version 5.0 blended winds
  50. c
  51. c-----------------------------------------------------------------------

  52.       parameter
  53.      $( nlon = 720
  54.      $, nlat = 353
  55.      $)

  56.       real
  57.      $  dayin,day
  58.      $, uin(nlon,nlat),u(nlon,nlat)
  59.      $, vin(nlon,nlat),v(nlon,nlat)
  60.      $, cin(nlon,nlat),c(nlon,nlat)

  61.       character dfname*80
  62.       integer idum1,idum2,idum3,idum4,idum5,idum6

  63.       logical readuv     ! to read either uv or curl files
  64. c
  65. c pick datatype
  66. c
  67.       readuv = .true.
  68. c
  69. c open input
  70. c
  71.       if (readuv) then
  72.          lrecl = (2*nlon*nlat + 7)*4
  73.       else
  74.          lrecl = (  nlon*nlat + 5)*4  ! for curl
  75.       endif

  76.       if (readuv) then
  77.          dfname = 'uv.200001.bln'
  78.       else
  79.          dfname = 'curl.200001.bln'
  80.       endif

  81.       write(6,1010) dfname
  82. 1010 format("c input= ",a80)
  83.       open(11,file=dfname,form='unformatted',access='direct',
  84.      $     recl=lrecl)
  85. c
  86. c read data
  87. c
  88.       nread = 0

  89.       irec = 0
  90. 11   irec = irec + 1
  91.       if (readuv) then
  92.          read(11,rec=irec,end=99) idum1,dayin,idum2,
  93.      $                            idum3,uin  ,idum4,
  94.      $                            idum5,vin  ,idum6
  95.       else
  96.          read(11,rec=irec,end=99) idum1,dayin,idum2, ! for curl
  97.      $                            idum3,cin  ,idum4
  98.       endif

  99.       call swap4(dayin,day,4)
  100.       if (readuv) then
  101.          call swap4(uin  ,u  ,4*nlon*nlat)
  102.          call swap4(vin  ,v  ,4*nlon*nlat)
  103.       else
  104.          call swap4(cin  ,c  ,4*nlon*nlat) ! for curl
  105.       endif

  106.       nread = nread + 1

  107.       if (readuv) then ! print some u and v data
  108.          ip1 =  21
  109.          ip2 =  25
  110.          jp  =  20
  111.          write(6,1020) day,ip1,ip2,jp,
  112.      $                 (u(i,jp),i=ip1,ip2),(v(i,jp),i=ip1,ip2)
  113.          jp = 330
  114.          write(6,1020) day,ip1,ip2,jp,
  115.      $                 (u(i,jp),i=ip1,ip2),(v(i,jp),i=ip1,ip2)
  116. 1020    format(/,"c day=",f12.7,
  117.      $          " print data at i=",i4," to",i4,", j=",i4,
  118.      $          /,"c   u=",5e16.7,/,"c   v=",5e16.7)
  119.       endif

  120.       if (.not.readuv) then ! print some curl data
  121.          ip1 =  21
  122.          ip2 =  25
  123.          jp  =  20
  124.          write(6,1030) day,ip1,ip2,jp,(c(i,jp),i=ip1,ip2)
  125.          jp = 330
  126.          write(6,1030) day,ip1,ip2,jp,(c(i,jp),i=ip1,ip2)
  127. 1030    format(/,"c day=",f12.7,
  128.      $          " print data at i=",i4," to",i4,", j=",i4,
  129.      $          /,"c   c=",5e16.7)
  130.       endif

  131.       if (nread.gt.5) goto 99
  132.       goto 11
  133. c
  134. c end of input file
  135. c
  136. 99   close(11)
  137.       write(6,1040) nread
  138. 1040 format(/,"c Nread=",i4)

  139.       stop
  140.       end

  141. c-----------------------------------------------------------------------

  142.       subroutine swap4(in,io,nn)

  143. c     swaps bytes in groups of 4 to compensate for byte swapping within
  144. c     words which occurs on DEC (VAX) and PC machines.
  145. c
  146. c in - input array to be swapped
  147. c io - ouput array with bytes swapped
  148. c nn - number of bytes to be swapped
  149.       logical*1 in(1),io(1),ih
  150. c character*1 in(1),io(1),ih ! Cray CF90 (Version 3.0.1.3)
  151. c Use character*1 instead of logical*1 when compiling on a Cray

  152.         do 10 i=1,nn,4
  153.            ih=in(i)
  154.            io(i)=in(i+3)
  155.            io(i+3)=ih
  156.            ih=in(i+1)
  157.            io(i+1)=in(i+2)
  158.            io(i+2)=ih
  159.    10   continue
  160.         return
  161.         end

  162. c-------------------------------------------------------------------------------------
  163. c sample uv output
  164. c-------------------------------------------------------------------------------------

  165. c input= uv.200012.bln                                                                  

  166. c day= 334.2500000 print data at i=  21 to  25, j=  20
  167. c   u=  -0.7112223E+01  -0.7033203E+01  -0.7011598E+01  -0.7090387E+01  -0.7206115E+01
  168. c   v=  -0.3942553E+01  -0.3962124E+01  -0.3986620E+01  -0.4037624E+01  -0.4137620E+01

  169. c day= 334.2500000 print data at i=  21 to  25, j= 330
  170. c   u=  -0.8854372E+00   0.2394634E+01  -0.6910892E+00   0.1598216E+01   0.9065568E+00
  171. c   v=  -0.2943386E+00   0.2213990E+01   0.1227269E+00   0.1858092E+01   0.5028909E+00

  172. c day= 334.5000000 print data at i=  21 to  25, j=  20
  173. c   u=  -0.2700038E+01  -0.2973726E+01  -0.3258945E+01  -0.3552392E+01  -0.3867300E+01
  174. c   v=  -0.6495625E+01  -0.6497209E+01  -0.6481194E+01  -0.6459236E+01  -0.6407810E+01

  175. c day= 334.5000000 print data at i=  21 to  25, j= 330
  176. c   u=  -0.7971388E+00  -0.1013222E+01  -0.1325200E+01  -0.1679704E+01  -0.2035655E+01
  177. c   v=  -0.1281099E+01  -0.1196701E+01  -0.1229659E+01  -0.1358854E+01  -0.1565742E+01

  178. c day= 334.7500000 print data at i=  21 to  25, j=  20
  179. c   u=  -0.1755905E+01  -0.1725370E+01  -0.1632135E+01  -0.1550382E+01  -0.1490727E+01
  180. c   v=  -0.5887057E+01  -0.5972985E+01  -0.6038925E+01  -0.6098041E+01  -0.6152860E+01

  181. c day= 334.7500000 print data at i=  21 to  25, j= 330
  182. c   u=  -0.4383349E+01  -0.3761794E+01  -0.4659785E+01  -0.4328775E+01  -0.3982705E+01
  183. c   v=  -0.4979240E+00  -0.1160431E+01  -0.1297167E+01  -0.1157849E+01  -0.1222925E+01

  184. c day= 335.0000000 print data at i=  21 to  25, j=  20
  185. c   u=  -0.4119569E+00  -0.6528024E+00  -0.9559648E+00  -0.1262638E+01  -0.1553511E+01
  186. c   v=  -0.4306739E+01  -0.4358467E+01  -0.4473586E+01  -0.4658427E+01  -0.4874317E+01

  187. c day= 335.0000000 print data at i=  21 to  25, j= 330
  188. c   u=  -0.4383684E+01  -0.3762361E+01  -0.4661222E+01  -0.4327851E+01  -0.3985085E+01
  189. c   v=  -0.4991178E+00  -0.1161200E+01  -0.1305194E+01  -0.1169430E+01  -0.1279151E+01

  190. c day= 335.2500000 print data at i=  21 to  25, j=  20
  191. c   u=  -0.4862082E+01  -0.5037855E+01  -0.5188568E+01  -0.5322361E+01  -0.5435145E+01
  192. c   v=  -0.7182055E+01  -0.7120403E+01  -0.7069640E+01  -0.6999370E+01  -0.6883837E+01

  193. c day= 335.2500000 print data at i=  21 to  25, j= 330
  194. c   u=  -0.2559734E+01  -0.2696071E+01  -0.2483752E+01  -0.3011353E+01  -0.2803352E+01
  195. c   v=  -0.1298768E+01  -0.1367403E+01  -0.1607539E+01  -0.1681914E+01  -0.1331954E+01

  196. c day= 335.5000000 print data at i=  21 to  25, j=  20
  197. c   u=  -0.3523773E+01  -0.3660601E+01  -0.3755870E+01  -0.3802105E+01  -0.3791556E+01
  198. c   v=  -0.7283126E+01  -0.7299356E+01  -0.7303202E+01  -0.7252859E+01  -0.7143980E+01

  199. c day= 335.5000000 print data at i=  21 to  25, j= 330
  200. c   u=  -0.7482214E-01  -0.1291005E+01  -0.9619290E+00  -0.1425813E+01  -0.1502040E+01
  201. c   v=  -0.1033460E+01  -0.8185180E+00  -0.1070591E+00  -0.6884152E+00  -0.6684729E+00

  202. c Nread=   6

  203. c-------------------------------------------------------------------------------------
  204. c sample curl output
  205. c-------------------------------------------------------------------------------------

  206. c input= curl.200012.bln                                                                 

  207. c day= 334.2500000 print data at i=  21 to  25, j=  20
  208. c   c=   0.2397559E-06   0.2150966E-06   0.9828683E-07  -0.8977198E-07  -0.2732344E-06

  209. c day= 334.2500000 print data at i=  21 to  25, j= 330
  210. c   c=  -0.2791514E-06  -0.6225630E-06  -0.6434694E-06   0.4090251E-06  -0.2221680E-05

  211. c day= 334.5000000 print data at i=  21 to  25, j=  20
  212. c   c=  -0.2524055E-06  -0.2053237E-06  -0.1808874E-06  -0.1454196E-06  -0.7269648E-07

  213. c day= 334.5000000 print data at i=  21 to  25, j= 330
  214. c   c=  -0.2505921E-08  -0.7731330E-07  -0.1895391E-06  -0.2526803E-06  -0.3188680E-06

  215. c day= 334.7500000 print data at i=  21 to  25, j=  20
  216. c   c=  -0.2273965E-06  -0.1608326E-06  -0.1477028E-06  -0.1304271E-06  -0.1337034E-06

  217. c day= 334.7500000 print data at i=  21 to  25, j= 330
  218. c   c=  -0.5487042E-06  -0.3639760E-06  -0.6742533E-07   0.2923234E-06  -0.4455453E-06

  219. c day= 335.0000000 print data at i=  21 to  25, j=  20
  220. c   c=  -0.1049936E-06  -0.1958875E-06  -0.2931115E-06  -0.3739532E-06  -0.4185766E-06

  221. c day= 335.0000000 print data at i=  21 to  25, j= 330
  222. c   c=  -0.5481131E-06  -0.3678523E-06  -0.6133656E-07   0.2605649E-06  -0.3912448E-06

  223. c day= 335.2500000 print data at i=  21 to  25, j=  20
  224. c   c=  -0.3248148E-06  -0.3325157E-06  -0.3259412E-06  -0.2100612E-06  -0.1497840E-06

  225. c day= 335.2500000 print data at i=  21 to  25, j= 330
  226. c   c=  -0.4591811E-06  -0.1951040E-06  -0.2740069E-06   0.5005482E-07   0.3079399E-06

  227. c day= 335.5000000 print data at i=  21 to  25, j=  20
  228. c   c=  -0.1409196E-06  -0.1356192E-06  -0.3286763E-07   0.1263331E-06   0.2434595E-06

  229. c day= 335.5000000 print data at i=  21 to  25, j= 330
  230. c   c=  -0.2644707E-06  -0.3473503E-08  -0.2066530E-06  -0.4459343E-06  -0.1710275E-06

  231. c Nread=   6
复制代码
我的代码,提示E:\QuikSCAT_NCEP_process_code\readqnblendwind.f(100) : Error: An END= specifier is not valid in a direct access READ statement.
         read(11,rec=irec,end=99) idum1,dayin,idum2,
^
E:\QuikSCAT_NCEP_process_code\readqnblendwind.f(104) : Error: An END= specifier is not valid in a direct access READ statement.
         read(11,rec=irec,end=99) idum1,dayin,idum2, ! for curl,高手给看看呀
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 成长值: 0
发表于 2012-7-6 15:50:20 | 显示全部楼层
夏天爱裤衩 发表于 2012-7-6 15:25
我的代码,提示E:\QuikSCAT_NCEP_process_code\readqnblendwind.f(100) : Error: An END= specifier is not ...

你好,刚刚看了你的程序,也进行了编译,但是出现如你所说的错误。
由于不知道你程序的目的何在(程序实在比较长,还存在较多的冗余代码),因此不便做改到。

【建议】自己重新敲代码,按自己的需求写,这个代码应该是年代比较久远了,可读性不是很高,改起来也不是很方便。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2012-7-6 16:04:56 | 显示全部楼层
言深深 发表于 2012-7-6 15:50
你好,刚刚看了你的程序,也进行了编译,但是出现如你所说的错误。
由于不知道你程序的目的何在(程序实 ...

着实不会写程序啊,只是想把数据中任意经纬度范围、时间范围的数据读出来就可以,刚刚把end=99删掉,编译勉强通过,却发现改动时间范围,出现的结果都一样,汗死
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表