[gradsusr] Help Regarding additon of extra t dimension ina grd file

Andrew Friedman andfried at gmail.com
Fri Dec 6 04:46:09 EST 2019


Hi Sumant,

Here’s an example of how I use the NCO utility NCAP2 to change seconds to minutes so that I can read a file in GrADS:

ncap2 -O -s "time=time/(60)" -s "time at units=\"minutes since 1979-01-01 00:00:00\"" $infile $infile # change time units

The online reference is here: http://nco.sourceforge.net/nco.html#ncap2-netCDF-Arithmetic-Processor

-Andrew

> On Dec 5, 2019, at 7:10 PM, Dr. Suman Maity <suman.buie at gmail.com> wrote:
> 
> Thank you Kishore. You are correct. The year of the file first12 should be changed using cdo settime and settaxis. After that only mergetime will work.
> 
> Best 
> Suman
> 
> On Fri 6 Dec, 2019, 12:33 AM Kishore Ragi, <kishoreragi at gmail.com> wrote:
> I don't think Suman's CDO solution may not work.
> cdo mergetime file120.nc first12.nc file132.nc
> 
> first12.nc's timesteps are the part of file120.nc, so in the cdo mergetime output may not write the same timesteps twice. Therefore, the file132.nc may have only 120 timesteps; however, I may be wrong as well.
> 
> Regards,
> Kishore
> Department of Chemistry,
> National Institute of Technology, Rourkela,
> India- 769008
> Phone: +91-8908671881
> 
> http://www.researchgate.net/profile/Kishore_Ragi
> 
> https://in.linkedin.com/in/kishoreragi
> 
> 
> 
> On Fri, Dec 6, 2019 at 12:06 AM Dr. Suman Maity <suman.buie at gmail.com> wrote:
> Dear Tammy
> Is it possible for you to share your netcdf file? If the sige is big then cut it to a smaller domain by cdo sellonlatbox.
> I will check it and reply accordingly. 
> 
> Best
> Suman
> 
> On Thu 5 Dec, 2019, 5:34 PM Tanmay Sarkar, <tanmays at barc.gov.in> wrote:
> Dear Sir,
> Thank you so much for your reply. I have used this option. It is creating merged *.nc file. But that merged file is not opening using GrADS. It is giving some error saying "time unit has too small and increment".
> Don’t know why I am not able to visualize. That why I am confused.
> 
> -- 
> Thanks and Regards
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> Tanmay Sarkar
> Scientific Officer D
> Safety Studies Section
> Health Physics Division
> Bhabha Atomic Research Centre
> Trombay, Mumbai -⁠ 400 085
> &
> PhD Student
> Homi Bhabha National Institute
> =========================
> Contacts:
> +91-22-25592359 (O)
> +91-9920134749 (M)
> =========================
> 
> 
> 
> -----Original Message-----
> From: gradsusr [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Dr. Suman Maity
> Sent: 05 December 2019 17:19
> To: GrADS Users Forum
> Subject: Re: [gradsusr] Help Regarding additon of extra t dimension ina grd file
> 
> Dear Tanmoy
> I don't think it's easier in grads and consequently it is problematic to write multi-timestep netcdf file in grads. However, it's very easy to implement using cdo (as you told you have corresponding netcdf file). The procedure will be the following:
> Lets suppose you first file name (that having 12 timestep) is file120.nc. Then cdo seltimestep,1/12 file120.nc first12.nc cdo mergetime file120.nc first12.nc file132.nc
> 
> Now, file132.nc will contain 132 timesteps where first 120 timesteps will be from file120.nc (original) and rest 12 timestep will be from first12.nc (first 12 timestep of file120.nc).
> 
> I hope it will solve your problem.
> 
> Cheers!!!!!!
> 
> Best
> Suman
> __________________________________________________________________
> On 12/5/19, Tanmay Sarkar <tanmays at barc.gov.in> wrote:
> > Dear GrADS users,
> >
> > I have a file grd file (also having netcdf file) of t dimension 
> > varying from
> > 1 to 120.
> >
> > Now I want to make a file of t dimension of  1 to (120+12= )132.
> >
> > The first 12 data which I am going to add is just the repetition of  
> > second
> > 12 data in new file. (or saying in another way, I want to repeat the 
> > first
> > 12 data of old file in t dimension to make new file with total 
> > 120+12=132 t
> > dimension)
> >
> >
> >
> > Any idea regarding this using GrADS will be appreciable.
> >
> > Thank you in advance of reading my problem.
> >
> >
> >
> > --
> >
> > Thanks and Regards
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Tanmay Sarkar
> >
> > Scientific Officer D
> >
> > Safety Studies Section
> >
> > Health Physics Division
> >
> > Bhabha Atomic Research Centre
> >
> > Trombay, Mumbai -⁠ 400 085
> >
> > &
> >
> > PhD Student
> >
> > Homi Bhabha National Institute
> >
> > =========================
> >
> > Contacts:
> >
> > +91-22-25592359 (O)
> >
> > +91-9920134749 (M)
> >
> > =========================
> >
> >
> >
> >
> 
> 
> -- 
> ++++++++++++++++++++++++++++++++++++
> Dr. Suman Maity
> Research Scientist
> Interdisciplinary Program in Climate Studies Indian Institute of Technology Bombay Powai, Mumbai-400076, Maharashtra India.
> ++++++++++++++++++++++++++++++++++++
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr




More information about the gradsusr mailing list