1

Currently I am working with cmip6 models monthly precipitation .nc files. I want the dates to start from 1st day of each month. Here is the part of result of cdo sinfo of input file :

1950-01-16 12:00:00 1950-02-15 00:00:00 1950-03-16 12:00:00 1950-04-16 00:00:00

As you can see the date starts from 16 or 15. Even after applying cdo --timestat_date first monmean to my input file, there was no change in dates of my output file. I tried on other models' files too but in vain.

My CDO ver:
CDI library version : 2.0.5
cgribex library version : 2.0.1
ecCodes library version : 2.26.0
NetCDF library version : 4.8.1 of Apr 25 2022 17:43:42 $
hdf5 library version : 1.12.1 threadsafe
exse library version : 1.4.2
FILE library version : 1.9.1

Harith S
  • 47
  • 5
  • 1
    I don't think is any way to answer your second question without further details. You will need to state how you are actually calculating the fluxes. – Robert Wilson Sep 01 '22 at 12:36
  • In general it is best practise in any case to always ask a single question in a post. May I suggest you perhaps delete the second part from here, add the relevant detail @RobertWilson correctly suggests is needed and post a separate question ? – ClimateUnboxed Sep 01 '22 at 13:12
  • Thank you for the help @RobertWilson , Both of the codes you provided are working like magic – Harith S Sep 01 '22 at 15:44
  • and thanks for the explanation @Adrian Tompkins . I have removed the 2nd part of the question and will post it a bit later.. I was gonna extract precipitation data from these CMIP6 GCMs for my station points and compare it against observed data. I have over 35 cmip6 models , gonna evaluate em through statistical indices and find the best performing model for my region of interest. Thats my current goal for now :-: – Harith S Sep 01 '22 at 15:44
  • 1
    @HarithS that can be slightly tricky to do using CDO itself. My python package nctoolkit, which uses CDO, does most of the hard work for you when it comes to matching netcdf and station/point data: https://nctoolkit.readthedocs.io/en/latest/matchpoint.html – Robert Wilson Sep 01 '22 at 16:58

1 Answers1

1

The easiest way to do this in CDO is probably to reset the time axis or set the day. In your case the dataset appears to start on 1st January 1950 and has every month since then. So, one the following ought to work.

cdo settaxis,1950-01-01,12:00:00,1mon infile outfile

cdo setday,1 infile outfile

Note that the command line option you used, --timestat_date first, assigns the first time available within each month to the output file when calculating the monthly mean. Thus it would have worked as desired if you had used daily data as input. However, as your input is already a monthly mean with a single timestep available, it will simply return the time from the original dataset in this case.

cdo --timestat_date first monmean infile outfile
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
Robert Wilson
  • 3,192
  • 11
  • 19