I have lots of grd (GrADS) file and I want to convert those data into netCDF file using cdo. The operation needs all the corresponding ctl file and I will have to prepare all these. So, my question is there any workaround for this using bash, python or R. Here is an example of ctl file:
*need to change the file name year*_rfp25.grd for each file
DSET /home/amit/climate_data/rf/year1901_rfp25.grd
TITLE Gridded rainfall
UNDEF -999.0
XDEF 135 LINEAR 66.5 0.25
YDEF 129 LINEAR 6.5 0.25
ZDEF 1 linear 1 1
* CHANGE TDEF TO 366 FOR LEAP YEARS
TDEF 365 LINEAR 1jan1901 1DY
VARS 1
rf 0 99 GRIDDED RAINFALL
ENDVARS
.ctl
file? Is there one file per year and the .ctl files differ only in line 2 (filename of grd file) and 9 (start date)? $\endgroup$