Deaccumulation of a variable - converting an accumulated variable to timestep values
Added by Marco Alves over 4 years ago
Added by Marco Alves 1 minute ago
Hi,
I have several datsets from ERA5-Land reanalysis on a grid with one variable only, which is accumulated from the beginning of the forecast time to the end of the forecast step. How can I extract the single values associated to each timestep?
I am currently trying the following sequence as a test:
#!/bin/bash
for m in `seq 1 4`
do
file=evaporation_from_the_top_of_canopy_198${m}.nc
nstep=`cdo ntime $file`
cdo sub -seltimestep,2/$nstep $file -seltimestep,1/`expr $nstep - 1` $file diff_198${m}.nc
cdo mergetime -seltimestep,1 $file diff_198${m}.nc evatc_198${m}.nc
done
However, the output files I am getting have only values from 1 Jan to 17 May. Does anyone knows a better way of extracting this values?
I really appreciate the help!
Cheers,
Marco
Reply
Replies (2)
RE: Deaccumulation of a variable - converting an accumulated variable to timestep values - Added by Ralf Mueller over 4 years ago
hi Marco!
you seem to want to get the difference between two timesteps. For this you can use the 'deltat' operator.
hth
ralf
RE: Deaccumulation of a variable - converting an accumulated variable to timestep values - Added by Marco Alves over 4 years ago
Thank you Ralf, it worked !!!