[gradsusr] convert multiple grib files to netcdf files
Natansh Naidu
natanshnaidu at yahoo.in
Sun Jan 3 01:47:55 EST 2016
The reason I am trying to write the .nc file name via a variable, while converting from .grd to .nc, is because I intend to create a loop in which variable n = n+1 can be applied so that n=20110111 will change to n=20110112 and so on, so that I can use this in while loop while n<32 to convert all the files for January from .grd into netcdf all at once. Dear GrADS users, is this possible ???
Regards,Natansh Naidu
Sent from Yahoo Mail on Android
On Sun, 3 Jan, 2016 at 11:07, Krishnakumar AP<krishnaap7 at gmail.com> wrote: so put it like this
' set sdfwrite -dbl ' 20110111 '.nc '
By
Krishnakumar.AP
On Sun, Jan 3, 2016 at 12:54 AM, Natansh Naidu <natanshnaidu at yahoo.in> wrote:
Hello everyone,
I am Natansh Naidu from India and am very new to GrADS. I am having one month's daily average data in .grd files. I have written a script file for converting a single .grd file to netcdf classic, which is as follows:
' open 4.ctl '' set lat 4 26 '' set lon 60 100 '' set t 1 1 '' define Dst = sst '' define n = 20110111 '' set sdfwrite -dbl ' n '.nc '' sdfwrite Dst '' clear sdfwrite '
I want my output file to be named as 20110111.nc but instead of that it is generating n.nc. I know I can directly define it as 20110111.nc but is there any way of defining the filename via variable? Also please guide me how can I automatically change the DSET of my ctl file since I have 30 .grd files labelled similar to 20110111.grd and I dont want to create a seperate ctl file for every .grd file.
Thanks in advance for your help.Regards,Natansh Naidu
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160103/69764546/attachment.html
More information about the gradsusr
mailing list