[ncl-talk] Batch process
Arka Banerjee
arka354deb at gmail.com
Mon Dec 18 09:29:37 MST 2017
It was ENDVARS at my first attempt. Second time I change it as a testing
but in both the cases errors are same.
Tell me how to fix that two errors.
Or give a sample one for my code.
Arka
On Dec 18, 2017 9:53 PM, "Karin Meier-Fleischer" <meier-fleischer at dkrz.de>
wrote:
Please, reply to the ncl-talk list!
Are you familiar with the array subscripts? NCL array indices start with
index 0.
The "END VARS" line has to be "ENDVARS"; the index of ctl starts with 0.
Correct Tmin.ncl script:
;Tmin
begin
fn =(/"MINT1971.GRD","MINT1972.GRD"/) ; file paths
ctl=new(8,string)
ctl(*0*)="UNDEF 99.9"
ctl(*1*)="XDEF 35 LINEAR 66.5 1"
ctl(*2*)="YDEF 32 LINEAR 6.5 1"
ctl(*3*)="ZDEF 1 Linear 1 1"
;* CHANGE TDEF TO 366 FOR LEAP YEARS
ctl(*4*)="TDEF 365 LINEAR 1JAN1994 1DY"
ctl(*5*)="VARS 1"
ctl(*6*)="T 0 99 DAILYTEMP"
ctl(*7*)="*ENDVARS*"
do gg = 0,dimsizes(fn)-1
ctl(0) = "DSET "+fn(gg)
asciiwrite("file.ctl",ctl)
system("cdo -f nc import_binary file.ctl "+fn(gg)+".nc")
system("rm file.ctl") ; optional
end do
end
-Karin
Am 18.12.17 um 16:51 schrieb Arka Banerjee:
You told me Adam was right.
I also follow the steps if you have seen my script.
At the end there will be end but script is nt running
On Dec 18, 2017 9:17 PM, "Arka Banerjee" <arka354deb at gmail.com> wrote:
> Seen already.
> But not helpful.
>
> On Dec 18, 2017 9:15 PM, "Karin Meier-Fleischer" <meier-fleischer at dkrz.de>
> wrote:
>
> Have you seen the example https://www.ncl.ucar.edu/Appli
> cations/Scripts/grads_2.ncl
>
> The script reads the same simple GrADS file in * Example 1* but creates a
> netCDF file and plots the data. The creation of netCDF necessitates the
> creation of coordinate variables and other information.
>
> -Karin
>
> Am 18.12.17 um 16:40 schrieb Karin Meier-Fleischer:
>
> Hi Arka,
>
> please, don't send the same question again by changing the subject! And
> always reply to the ncl-talk mailing list.
>
> If you don't have the CDOs available, hopefully you have Ruby installed.
> See
> https://www.ncl.ucar.edu/Applications/grads.shtml#ruby
>
> The hardest way would be to write a program e.g. Fortran to read the GrADS
> binary and write netCDF using the netCDF library.
>
> Maybe you should install CDO, see https://code.mpimet.mpg.de/pro
> jects/cdo/wiki#Installation-and-Supported-Platforms
>
> -Karin
>
> Am 18.12.17 um 07:28 schrieb Arka Banerjee:
>
> Hi,
>
> I’d like to convert data from .grd files to netcdf files using a CTL file.
> If somebody has the solution for it please inform me.
>
>
> Thanks
>
> Arka
>
>
> _______________________________________________
> ncl-talk mailing listncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> _______________________________________________
> ncl-talk mailing listncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171218/c67ad158/attachment.html>
More information about the ncl-talk
mailing list