JRA-55 TL319 オリジナル解像度データのダウンロードと解析方法 2015/7/19 筑波大学生命環境系釜江陽一 http://researchmap.jp/mu2g9so07-1772021/#_1772021 0. はじめに 気象庁による長期再解析 JRA-55 のオリジナル解像度データ (TL319) を使用する際のメモです JRA-55 の概要 データ取得方法 マニュアルは下記 JRA-55 ウェブページ上で提供されています JRA-55 のデータを使用する際は Kobayashi et al. (2015) を引用して下さい JRA-55 : 気象庁 55 年長期再解析 http://jra.kishou.go.jp/jra-55/index_ja.html Kobayashi, S., Y. Ota, Y. Harada, A. Ebita, M. Moriya, H. Onoda, K. Onogi, H. Kamahori, C. Kobayashi, H. Endo, K. Miyaoka, and K. Takahashi, 2015: The JRA-55 Reanalysis: General specifications and basic characteristics. J. Meteor. Soc. Japan, 93, 5-48. https://www.jstage.jst.go.jp/article/jmsj/93/1/93_2015-001/_article Ebita, A., S. Kobayashi, Y. Ota, M. Moriya, R. Kumabe, K. Onogi, Y. Harada, S. Yasui, K. Miyaoka, K. Takahashi, H. Kamahori, C. Kobayashi, H. Endo, M. Soma, Y. Oikawa, and T. Ishimizu, 2011: The Japanese 55-year Reanalysis "JRA-55": an interim report. SOLA, 7, 149-152. https://www.jstage.jst.go.jp/article/sola/7/0/7_0_149/_article 1. データの取得 JRA-55 ウェブページの JRA-55 データの利用方法 を参照し データを取得する 1ユーザ登録必要な情報を登録する 2~3 日程度でアカウントが交付される 2 メールで送られてきたユーザ名 初期パスワードをもとに https://ds.data.jma.go.jp/changepasswd/ にログインし パスワードを変更する パスワードの有効期限は 4 ヶ月であるため こまめに変更する 3FTP で気象庁データ提供システム (JDDS) にログインし 対話式でダウンロードする あるいは 以下のようなシェルスクリプトを用いてダウンロードする ダウンロードは 1 日あたり 12 時間を限度に行い 多重接続や長時間接続を控える 1
JRA-55 ではモデル格子データと 1.25 度緯度経度格子データの二種類が配布されている ( マニュアル参照 ) このうちモデル格子データについて解説する サンプルダウンロードスクリプト #!/bin/bash user=jraxxxxx pass=hogehoge option=" N passive ftp x nh cut dir=4" URL=ds.data.jma.go.jp/data20/JRA 55/Hist/Monthly prefix=anl_surf starty=1958 startm=1 endy=1958 endm=12 sleep=60 WGET=/usr/bin/wget ###################################################### # download ###################################################### year=${starty} mo=${startm} if [ ${mo} le 9 ] ;then month="0"${mo} else month=${mo} fi while [ ${year}${month} le ${endy}${endm} ] ;do echo "${WGET} ${option} ftp://${user}:${pass}@${url}/${prefix}/${prefix}.${year}${month}" ${WGET} ${option} ftp://${user}:${pass}@${url}/${prefix}/${prefix}.${year}${month} sleep ${sleep} if [ ${mo} eq 12 ] ;then mo=1 month="01" year=$((year+1)) else mo=$((mo+1)) if [ ${mo} le 9 ] ;then month="0"${mo} else month=${mo} fi fi done ${WGET} ${option} ftp://${user}:${pass}@${url}/${prefix}/${prefix}.monthly.ctl ${WGET} ${option} ftp://${user}:${pass}@${url}/${prefix}/${prefix}.monthly.idx exit 現時点では endm が 1 等の一桁の数値に対応していません 必要に応じて修正して下さい 上記とは別に ftp サーバの JRA-55/Const/ 2
に 以下の TL319 に関する PDEF ファイルがあるので ダウンロードしておく TL319.ctl TL319.grib TL319.idx TL319.pdef TL319_pdef.ctl 2. モデル格子データ モデル格子データマニュアルの表にあるように モデル格子 (TL319) は緯度によって東西の格子数が変化する 下記の図にあるように 南北の緯度 41.3 度より赤道側では 640 点 高緯度ほど格子数が減り 極では 48 点となる モデル格子データに付属されている ctl ファイルは pdef ファイル TL319.pdef を参照するように設定されており ctl ファイルの pdef 文に書かれている pdef ファイルのパスを書き換えるか pdef ファイルを ctl ファイルと同じディレクトリに置くと GrADS で描画することが可能になる 例. anl_surf ディレクトリの中に grib ファイル anl_surf.195801 等と インデックスファイル anl_surf.monthly.idx ctl ファイル anl_surf.monthly.ctl pdef ファイル TL319.pdef がある状態で GrADS で open anl_surf.monthly.ctl d tmp2m と打つと 全ての緯度で東西に 640 の格子が存在する格子系に内挿されたデータが描画される ただし これは中 高緯度では少ない東西格子数から内挿された値であるので 取扱いには注意が必要である どの程度 格子が疎かを確認するため 格子系を作図する 3
jrapdef.sh #!/bin/bash cat>hoge.gs<< 'open TL319_pdef.ctl' 'set x 1' 'set y 1 320' 'a=min(indices,x=1,x=640)' 'b=max(indices,x=1,x=640)' 'set gxout fwrite' 'set fwrite be jrapdef.bin' 'set x 1' 'set y 1' x=1 while(x<=640) 'd const(lev,0)' x=x+1 y=1 while(y<=319) 'set y 'y x=1 while(x<=640) 'set x 'x 'd b(x=1) a(x=1)+1' x=x+1 y=y+1 y=1 while(y<=320) 'set y 'y x=1 while(x<=640) 'set x 'x 'd b(x=1) a(x=1)+1' x=x+1 y=y+1 'disable fwrite' 'quit' grads blc hoge.gs rm f hoge.gs cat>jrapdef.ctl<< DSET ^jrapdef.bin OPTIONS big_endian undef 9.999E+20 title anl_surf * produced by grib2ctl v0.9.12.5p41 xdef 640 linear 0 0.5625 ydef 320 levels 89.570 89.013 88.453 87.892 87.331 86.769 86.208 85.647 85.085 84.523 ( 続く ) 4
( 続き ) 83.962 83.400 82.839 82.277 81.716 81.154 80.592 80.031 79.469 78.908 78.346 77.784 77.223 76.661 76.100 75.538 74.976 74.415 73.853 73.291 72.730 72.168 71.607 71.045 70.483 69.922 69.360 68.799 68.237 67.675 67.114 66.552 65.990 65.429 64.867 64.306 63.744 63.182 62.621 62.059 61.498 60.936 60.374 59.813 59.251 58.689 58.128 57.566 57.005 56.443 55.881 55.320 54.758 54.196 53.635 53.073 52.512 51.950 51.388 50.827 50.265 49.704 49.142 48.580 48.019 47.457 46.895 46.334 45.772 45.211 44.649 44.087 43.526 42.964 42.402 41.841 41.279 40.718 40.156 39.594 39.033 38.471 37.909 37.348 36.786 36.225 35.663 35.101 34.540 33.978 33.416 32.855 32.293 31.732 31.170 30.608 30.047 29.485 28.924 28.362 27.800 27.239 26.677 26.115 25.554 24.992 24.431 23.869 23.307 22.746 22.184 21.622 21.061 20.499 19.938 19.376 18.814 18.253 17.691 17.129 16.568 16.006 15.445 14.883 14.321 13.760 13.198 12.636 12.075 11.513 10.952 10.390 9.828 9.267 8.705 8.144 7.582 7.020 6.459 5.897 5.335 4.774 4.212 3.651 3.089 2.527 1.966 1.404 0.842 0.281 0.281 0.842 1.404 1.966 2.527 3.089 3.651 4.212 4.774 5.335 5.897 6.459 7.020 7.582 8.144 8.705 9.267 9.828 10.390 10.952 11.513 12.075 12.636 13.198 13.760 14.321 14.883 15.445 16.006 16.568 17.129 17.691 18.253 18.814 19.376 19.938 20.499 21.061 21.622 22.184 22.746 23.307 23.869 24.431 24.992 25.554 26.115 26.677 27.239 27.800 28.362 28.924 29.485 30.047 30.608 31.170 31.732 32.293 32.855 33.416 33.978 34.540 35.101 35.663 36.225 36.786 37.348 37.909 38.471 39.033 39.594 40.156 40.718 41.279 41.841 42.402 42.964 43.526 44.087 44.649 45.211 45.772 46.334 46.895 47.457 48.019 48.580 49.142 49.704 50.265 50.827 51.388 51.950 52.512 53.073 53.635 54.196 54.758 55.320 55.881 56.443 57.005 57.566 58.128 58.689 59.251 59.813 60.374 60.936 61.498 62.059 62.621 63.182 63.744 64.306 64.867 65.429 65.990 66.552 67.114 67.675 68.237 68.799 69.360 69.922 70.483 71.045 71.607 72.168 72.730 73.291 73.853 74.415 74.976 75.538 76.100 76.661 77.223 77.784 78.346 78.908 79.469 80.031 80.592 81.154 81.716 82.277 82.839 83.400 83.962 84.523 85.085 85.647 86.208 86.769 87.331 87.892 88.453 89.013 89.570 ZDEF 1 LEVELS 1000.00000 TDEF 1 LINEAR 1JUN1958 1yr vars 2 T2 1 99 Surface Air Temperature at 2m K 1 resol 1 99 Surface Air Temperature at 2m K 1 ENDVARS cat>hoge.gs<< 'open jrapdef.ctl' 'set x 1 640' 'set y 1 320' 'set gxout fwrite' 'set fwrite be jrapdef_total.bin' 'set y 1' 'total=0' y=1 while(y<=320) 'set y 'y 'total=t2(z=1,t=1)+total' 'd total' y=y+1 'disable fwrite' 'quit' grads blc hoge.gs rm f hoge.gs ( 続く ) 5
( 続き ) cat>jrapdef_total.ctl<< DSET ^jrapdef_total.bin OPTIONS big_endian undef 9.999E+20 title anl_surf * produced by grib2ctl v0.9.12.5p41 xdef 640 linear 0 0.5625 ydef 320 levels ( 長いので省略 ) ZDEF 1 LEVELS 1000.00000 TDEF 1 LINEAR 1JUN1958 1yr vars 1 T2 1 99 Surface Air Temperature at 2m K 1 ENDVARS cat>hoge.gs<< 'open jrapdef_total.ctl ' 'open TL319_pdef.ctl ' 'set x 1 640' 'set y 1 320' 'a=indices.2(z=1,t=1) t2' 'set gxout fwrite' 'set fwrite be resol.bin' 'd a' 'disable fwrite' 'quit' grads blc hoge.gs rm f hoge.gs cat>resol.ctl<< DSET ^resol.bin OPTIONS big_endian undef 9.999E+20 title anl_surf * produced by grib2ctl v0.9.12.5p41 xdef 640 linear 0 0.5625 ydef 320 levels ( 長いので省略 ) ZDEF 1 LEVELS 1000.00000 TDEF 1 LINEAR 1JUN1958 1yr vars 1 T2 1 99 Surface Air Temperature at 2m K 1 ENDVARS 6
resol_mod.sh #!/bin/bash cat>hoge.f90<< program main implicit none integer,parameter:: nx=640,ny=320 real:: var(nx,ny),var2(nx,ny) integer:: ix,iy real,parameter:: undef= 9.99e+08 open(10,file='resol.bin', & access='direct',form='unformatted',recl=4*nx*ny) open(20,file='resol_mod.bin', & access='direct',form='unformatted',recl=4*nx*ny) read(10,rec=1) ((var(ix,iy),ix=1,nx),iy=1,ny) do iy=1,ny do ix=1,nx var2(ix,iy)=var(ix,iy) int(var(ix,iy)/2)*2 enddo enddo write(20,rec=1) ((var2(ix,iy),ix=1,nx),iy=1,ny) end ifort assume byterecl convert big_endian hoge.f90./a.out rm f a.out hoge.f90 cat>resol_mod.ctl<< DSET ^resol_mod.bin OPTIONS big_endian undef 9.99e+08 title anl_surf * produced by grib2ctl v0.9.12.5p41 xdef 640 linear 0 0.5625 ydef 320 levels ( 長いので省略 ) ZDEF 1 LEVELS 1000.00000 TDEF 1 LINEAR 1JUN1958 1yr vars 1 t2 1 99 Surface Air Temperature at 2m K 1 ENDVARS 7
TL319_resolution.gs 'open resol_mod.ctl ' 'cc' 'set lon 0 360' 'set lat 90 90' 'set mproj scaled' 'set xlopts 1 4 0.14' 'set ylopts 1 4 0.14' 'set grads off' 'set frame off' 'set grid off' 'set annot 1 4' 'set map 1 1 3' 'set gxout grfill' 'set parea 0.5 6.3 0.5 4' 'set clevs 0.5' 'set ccols 0 15' 'd t2' 'close 1' 'open jrapdef.ctl' 'set x 1' 'set lat 90 90' 'set frame on' 'set parea 7 8.3 0.5 4' 'set xyrev on' 'set cmark 0' 'set ccolor 1' 'set cthick 5' 'set vrange 0 800' 'set xlint 200' 'd resol' pull hoge 'print TL319_resolution.eps' 'quit' TL319_resolution.eps 8
( 解説 ) 特に美しいやり方ではありませんので 参考程度にして下さい TL319_pdef.ctl に含まれている indices は TL319 格子系の (x,y)=(1,1) を 1 (x,y)=(2,1) を 2 とした格子番号を示している ここから一つ南の緯度までの格子数を差し引くと 各緯度での経度方向の格子番号 X のデータを作成することができる jrapdef.sh:indices をもとに 各緯度において その格子は TL319 格子系の ix=x の位置にある ことを示す変数 X のデータを作成する resol_mod.sh:tl319 格子に応じて 0, 1 が並んでいるデータ resol_mod.bin を作成する ( 剰余を求めて偶数 奇数の振り分けをしているだけ ) TL319_resolution.gs:resol_mod.bin から 灰色と白で格子を表す TL319_resolution.eps を作成する なお右側には各緯度の格子数を作図する 参考 JRA-55 info (hysk) http://www.hysk.sakura.ne.jp/data_list/jra55_memo Overview of current atmospheric reanalyses https://reanalyses.org/atmosphere/overview-current-reanalyses 気 象 研 究 ノ ー ト 217 号 気 象 学 に お け る デ ー タ 同 化 http://www.metsoc.jp/tenki/pdf/2008/2008_03_0016.pdf 東北大学大学院理学研究科流体地球物理学講座 GrADS の Tips http://wind.geophys.tohoku.ac.jp/index.php?%b8%f8%b3%ab%be%f0%ca%f3%2f GrADS%2FGrADS%A4%CETips Use PDEF For Displaying Pre-Projected Data With GrADS http://www.iges.org/grads/gadoc/pdef.html 9