このwiki内では、グリッドファイル(GrADS 4byteバイナリ、特に断らなければdirect書き込み)を〜.bin、コントロールファイルを〜.ctl、変数名をvarと表記します。
・データ配信元でctlファイルが配布されていないか調べる(tools、programsなど) ・データの情報を調べる(undef値、格子情報、変数の数) ・一行あたり数百文字までしか読み込んでくれないため、x, y, zなどを levelsで設定するときなどは、適度なところで改行すること。
1. 元の.ncファイルをGrADSでsdfopenする 2. q ctlinfo で表示された内容をコピー、ペーストする。 3. dset文をbinaryを読むように書き換える 4. 末尾にendvars文を書く 5. その他、書式の間違いを書き直す(undef値、格子情報、変数の数と名前、他)
var197101.bin var197102.bin ・・・ var200012.bin
dset ^var%y4%m2.bin ・・・ options template ・・・ tdef 360 linear 16jan1971 1mo ・・・
var1971-1980.bin var1981-1990.bin var1991-2000.bin
dset ^var%ch.bin ・・・ options template chsub 1 120 1971-1980 chsub 121 240 1981-1990 chsub 241 360 1991-2000 ・・・ tdef 360 linear 16jan1971 1mo ・・・
DSET /cmip5/MIROC5/piControl/mo/tas_Amon_MIROC5_piControl_r1i1p1_%ch.nc DTYPE netcdf TITLE XXX UNDEF 9.96921e+36 OPTIONS 365_day_calendar template chsub 1 120 200001-209912 chsub 121 240 210001-219912 chsub 241 360 220001-229912 chsub 361 480 230001-239912 chsub 481 600 240001-249912 chsub 601 720 250001-259912 chsub 721 840 260001-269912 xdef 256 linear 0 1.40625 ydef 128 levels -88.9277 -87.5387 -86.1415 -84.7424 -83.3426 -81.9425 -80.5421 -79.1417 -77.7412 -76.3406 -74.94 -73.5394 -72.1387 -70.7381 -69.3374 -67.9367 -66.536 -65.1353 -63.7345 -62.3338 -60.9331 -59.5323 -58.1316 -56.7309 -55.3301 -53.9294 -52.5286 -51.1279 -49.7271 -48.3264 -46.9256 -45.5248 -44.1241 -42.7233 -41.3226 -39.9218 -38.5211 -37.1203 -35.7195 -34.3188 -32.918 -31.5172 -30.1165 -28.7157 -27.315 -25.9142 -24.5134 -23.1127 -21.7119 -20.3111 -18.9104 -17.5096 -16.1088 -14.7081 -13.3073 -11.9065 -10.5058 -9.10499 -7.70422 -6.30345 -4.90269 -3.50192 -2.10115 -0.700384 0.700384 2.10115 3.50192 4.90269 6.30345 7.70422 9.10499 10.5058 11.9065 13.3073 14.7081 16.1088 17.5096 18.9104 20.3111 21.7119 23.1127 24.5134 25.9142 27.315 28.7157 30.1165 31.5172 32.918 34.3188 35.7195 37.1203 38.5211 39.9218 41.3226 42.7233 44.1241 45.5248 46.9256 48.3264 49.7271 51.1279 52.5286 53.9294 55.3301 56.7309 58.1316 59.5323 60.9331 62.3338 63.7345 65.1353 66.536 67.9367 69.3374 70.7381 72.1387 73.5394 74.94 76.3406 77.7412 79.1417 80.5421 81.9425 83.3426 84.7424 86.1415 87.5387 88.9277 zdef 1 levels 0 tdef 840 linear 12Z16JAN2100 1mo VARS 1 tas=>tas 1 t,y,x Surface Air Temperature [K] ENDVARS
vars 1 u(変数名) 23(層数), 99(ユニット指定) zonal wind velocity [m/s](変数の説明) endvars
-1,40,1 1バイト符号なし整数 -1,40,2 2バイト符号なし整数 -1,40,-2 2バイト符号有り整数 -1,40,4 4バイト整数
dset ^t.bin title NCDC GHCN t options big_endian undef -999.0 xdef 72 linear 0.0 5.0 ydef 36 linear -87.5 5.0 zdef 1 levels 1000 tdef 1600 linear jan1880 1mo vars 1 var 1 0 x,y t endvars
DSET ^gpcp_v2.1_psg.%y4 options yrev big_endian template UNDEF -99999.0 FILEHEADER 576 TITLE GPCP Version 2.1 Monthly Precipitation XDEF 144 LINEAR 1.25 2.5 YDEF 72 LINEAR -88.75 2.5 ZDEF 1 LEVELS 1 TDEF 372 LINEAR 01Jan1979 1mo VARS 1 precip 0 99 GPCP V2.1 Monthly Precipitation (mm/day) ENDVARS
dset ^hus1901-2000.bin title mri-cgcm2.3.2a 20c3m options 365_day_calendar big_endian undef 1e+20 xdef 128 linear 0.0 2.8125 ydef 64 levels -87.8638 -85.0965 -82.3129 -79.5256 -76.7369 -73.9475 -71.1578 -68.3678 -65.5776 -62.7874 -59.997 -57.2066 -54.4162 -51.6257 -48.8352 -46.0447 -43.2542 -40.4636 -37.6731 -34.8825 -32.0919 -29.3014 -26.5108 -23.7202 -20.9296 -18.139 -15.3484 -12.5578 -9.76715 -6.97653 -4.18592 -1.39531 1.39531 4.18592 6.97653 9.76715 12.5578 15.3484 18.139 20.9296 23.7202 26.5108 29.3014 32.0919 34.8825 37.6731 40.4636 43.2542 46.0447 48.8352 51.6257 54.4162 57.2066 59.997 62.7874 65.5776 68.3678 71.1578 73.9475 76.7369 79.5256 82.3129 85.0965 87.8638 zdef 17 levels 100000 92500 85000 70000 60000 50000 40000 30000 25000 20000 15000 10000 7000 5000 3000 2000 1000 tdef 1200 linear jun1901 1mo vars 1 hus 17 x,y Specific Humidity endvars
DSET ^air.mon.mean.nc DTYPE netcdf TITLE XXX UNDEF -9.96921e+36 UNPACK scale_factor add_offset OPTIONS yrev XDEF 144 linear 0 2.5 YDEF 73 linear -90 2.5 ZDEF 17 levels 1000 925 850 700 600 500 400 300 250 200 150 100 70 50 30 20 10 TDEF 360 linear 00Z01JAN1979 1mo VARS 1 air=>q 17 t,z,y,x Temperature ENDVARS
UNPACK scale_factor add_offset
DSET ^BAS_P3_biome_veg_v1.0.nc DTYPE netcdf TITLE XXX UNDEF -999 OPTIONS yrev XDEF 180 linear -179.0 2.0 YDEF 90 linear -89.0 2.0 ZDEF 1 levels 0.0 TDEF 1 linear 01JAN0001 1mo VARS 1 biome_vegetation=>q 0 y,x hoge ENDVARS
DSET ^nocs_v2_0_shf_1973.nc DTYPE netcdf TITLE NOCS Surface Flux Dataset v2.0 (NOCS v2.0) UNDEF -9999. OPTIONS XDEF 360 linear -179.5 1.0 YDEF 180 linear -89.5 1.0 ZDEF 1 levels 0 TDEF 12 linear 00Z01JAN1973 1mo VARS 6 shf=>shf 1 t,y,x Sensible Heat Flux [watt/m2] shf_err_rand=>shfer 1 t,y,x Sensible Heat Flux Random Uncertainty Estimate [watt/m2] shf_err_bias=>shfeb 1 t,y,x Sensible Heat Flux Bias Uncertainty Estimate [watt/m2] shf_err_total=>shfet 1 t,y,x Sensible Heat Flux Total Uncertainty Estimate [watt/m2] shf_sdv=>shfs 1 t,y,x Sensible Heat Flux Intra-monthly Standard Deviation [watt/m2] shf_qflag=>shfq 1 t,y,x Sensible Heat Flux Quality Indicator Flag [flag] ENDVARS
DSET ^wrfout_d01_2008-07-27_00%3A00%3A00 DTYPE netcdf TITLE wrf output atmosphere & surface UNPACK scale_factor add_offset UNDEF -999 PDEF 119 119 LCC 35.698349 139.0202 60 60 30 60 139.0202 4100 4100 XDEF 150 linear 136 0.04 YDEF 115 linear 33.4 0.04 ZDEF 30 linear 0.0 1 TDEF 8 linear 00:00Z27jul2008 3hr VARS 6 #一部の変数だけ U=>u 30 t,z,y,x x-wind component [m s-1] V=>v 30 t,z,y,x y-wind component [m s-1] W=>w 30 t,z,y,x z-wind component [m s-1] T=>t 30 t,z,y,x perturbation potential temperature (theta-t0) [K] T2=>t2 0 t,y,x TEMP at 2 M [K] HGT=>hgt 0 t,y,x Terrain Height [m] ENDVARS
DSET AMSR_E_L3_RainGrid_B05_200707.hdf TITLE AE_RnGd OPTIONS YREV XDEF XDim:MonthlyRainTotal_GeoGrid 72 LINEAR 2.55 YDEF YDim:MonthlyRainTotal_GeoGrid 28 LINEAR -67.55 VARS 1 RrLandRain=>RrLandRain Rain rate derived monthly rain total over land. ENDVARS
xdfopen hoge.xdf
DSET AMSR_E_L3_SeaIce12km_B02_20020619.hdf DTYP Ehdfsds UNDEF 0_FillValue PDEF 608 896 BILIN STREAM BINARY bilin_file XDEF 360 linear -179.5 1 YDEF 180 linear -89.5 1 ZDEF 1 levels 0 TDEF 1 linear 00Z19jun2002 1mo VARS 1 SI_12km_NH_SNOWDEPTH_5DAY=>snow 0 y,x SI_12 Snow Depth ENDVARS
open hoge.xdf