[ncl-talk] Batch process
Karin Meier-Fleischer
meier-fleischer at dkrz.de
Mon Dec 18 11:36:19 MST 2017
Am 18.12.17 um 19:33 schrieb Karin Meier-Fleischer:
>
> And once again...
>
> PLEASE REPLY TO THE ncl-talk MAILING LIST AND NOT TO SINGLE USER!!!!!
>
> Are you running NCL on Windows? If yes, then you have CYGWIN running
> which is a kind of a Linux system, so it should be possible to install
> CDO (see previous emails).
>
> If you do not have CDO why are you calling it in your NCL script
> Tmin.ncl? It is absolutely clear that Tmin.ncl can not run with this
> cdo system call if not installed.
>
> Use the NCL systemfunc function to retrieve the file names e.g.
> current directory
>
> files = systemfunc("ls *.GRD")
>
> or just use the internet to learn how to write a shell script to run
> through your file names and write the descriptor files.
>
> -Karin
>
> Am 18.12.17 um 17:32 schrieb Arka Banerjee:
>> So now it is fine you are saying?
>> I have not cdo and linux system right now. Tommorow will check it.
>>
>> Overall theme is change the first line of the ctl file that calls the
>> binary files.
>>
>> MATLAB inbuild function doesnot do this thing what CDO is capable of.
>> Thats why I am using this part particularly in NCL.
>>
>> Thank you
>>
>>
>> On Dec 18, 2017 9:57 PM, arka354deb at gmail.com
>> <mailto:arka354deb at gmail.com> wrote:
>>
>> 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 <mailto: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.GR <http://MINT1972.GR>D"/)
>> ; 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 <mailto: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
>>> <mailto:meier-fleischer at dkrz.de>> wrote:
>>>
>>> Have you seen the example
>>> https://www.ncl.ucar.edu/Applications/Scripts/grads_2.ncl
>>> <https://www.ncl.ucar.edu/Applications/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
>>>> <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/projects/cdo/wiki#Installation-and-Supported-Platforms
>>>> <https://code.mpimet.mpg.de/projects/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 list
>>>>> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
>>>>> List instructions, subscriber options, unsubscribe:
>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>>>
>>>
>>
>
--
Dipl. Geophys. Karin Meier-Fleischer
Visualization, NCL, CDO
Application Support
Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany
Phone: +49 (0)40 460094 126
Fax: +49 (0)40 460094 270
E-Mail: meier-fleischer at dkrz.de
URL: www.dkrz.de
Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171218/ec9396ca/attachment.html>
More information about the ncl-talk
mailing list