Splitting into timesteps
Added by Vassa Pupkunder almost 7 years ago
Hello!
Now we must use
"cdo -splitsel,1 my.nc split_"
"cdo showtimesteps my.nc > list.txt"
and then to rename split_* files according to timesteps from the "list.txt".
Is there any smart way to split .nc file into timesteps using timesteps names for resulting filenames?
Replies (1)
RE: Splitting into timesteps - Added by Karin Meier-Fleischer almost 7 years ago
Hi Vassa,
a short shell script will do it for you, e.g.
#!/bin/ksh cdo showtimestamp my.nc > list.txt cdo -splitsel,1 my.nc split_ times=($(cat list.txt)) x=0; for f in $(ls split_*.nc); do mv $f tas_${times[$x]}.nc; let x=$x+1; done exit
-Karin