Skip to content

Instantly share code, notes, and snippets.

@mehori
Created October 17, 2023 02:43
Show Gist options
  • Save mehori/c82139ba3d2ba07429dec6b0f105b086 to your computer and use it in GitHub Desktop.
Save mehori/c82139ba3d2ba07429dec6b0f105b086 to your computer and use it in GitHub Desktop.
時間軸がsnapshotになっているNetCDFファイルを、GrADSで読み込めるようにする
#!/bin/bash
ifile=composite_z500.nc
ofile=out.nc
ncks -O --mk_rec_dmn snapshot $ifile tmp.nc # snapshotをunlimited 次元にしてる
ncrename -O -d snapshot,time tmp.nc # snapshot を time に
cdo settaxis,1981-01-01,00:00:00,1day tmp.nc tmp2.nc # time のカレンダー変更
cdo chname,snap_var129,b tmp2.nc $ofile # snap_var129 を b に
rm -f tmp.nc tmp2.nc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment