<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">Am 18.12.17 um 19:33 schrieb Karin
Meier-Fleischer:<br>
</div>
<blockquote type="cite"
cite="mid:8899b8fa-bfe0-8ace-cf79-bf91b72178d8@dkrz.de">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<br>
And once again...<br>
<br>
<font color="#ff0000"> PLEASE REPLY TO THE ncl-talk MAILING
LIST AND NOT TO SINGLE USER!!!!!</font><br>
<br>
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).<br>
<br>
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.<br>
<br>
Use the NCL systemfunc function to retrieve the file names e.g.
current directory<br>
<br>
files = systemfunc("ls *.GRD")<br>
<br>
or just use the internet to learn how to write a shell script to
run through your file names and write the descriptor files.<br>
<br>
-Karin<br>
<br>
<div class="moz-cite-prefix">Am 18.12.17 um 17:32 schrieb Arka
Banerjee:<br>
</div>
<blockquote type="cite"
cite="mid:CAO_6oLjGkWrMX8Mau1vEm6b5pn00G+QXGmA985wvz=+ntFDkFA@mail.gmail.com">
<div dir="auto">So now it is fine you are saying?
<div dir="auto">I have not cdo and linux system right now.
Tommorow will check it.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Overall theme is change the first line of the
ctl file that calls the binary files.</div>
<div dir="auto"><br>
</div>
<div dir="auto">MATLAB inbuild function doesnot do this thing
what CDO is capable of. Thats why I am using this part
particularly in NCL.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Thank you</div>
<div dir="auto"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Dec 18, 2017 9:57 PM, <a
href="mailto:arka354deb@gmail.com" moz-do-not-send="true">arka354deb@gmail.com</a>
wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto">It was ENDVARS at my first attempt. Second
time I change it as a testing but in both the cases
errors are same.
<div dir="auto"><br>
</div>
<div dir="auto">Tell me how to fix that two errors.</div>
<div dir="auto">Or give a sample one for my code.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Arka</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Dec 18, 2017 9:53 PM, "Karin
Meier-Fleischer" <<a
href="mailto:meier-fleischer@dkrz.de"
target="_blank" moz-do-not-send="true">meier-fleischer@dkrz.de</a>>
wrote:<br type="attribution">
<blockquote class="m_-5465591516351667103quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Please, reply
to the ncl-talk list!<br>
<br>
Are you familiar with the array subscripts? NCL
array indices start with index 0. <br>
<br>
The "END VARS" line has to be "ENDVARS"; the index
of ctl starts with 0.<br>
<br>
Correct Tmin.ncl script:<br>
<br>
<font color="#3333ff"><tt>;Tmin</tt><tt><br>
</tt><tt>begin</tt><tt><br>
</tt><tt> fn =(/"MINT1971.GRD","<a
href="http://MINT1972.GR"
moz-do-not-send="true">MINT1972.GR</a><wbr>D"/)
; file paths</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> ctl=new(8,string)</tt><tt><br>
</tt><tt><br>
</tt><tt> ctl(<b>0</b>)="UNDEF 99.9"</tt><tt><br>
</tt><tt> ctl(<b>1</b>)="XDEF 35 LINEAR 66.5
1"</tt><tt><br>
</tt><tt> ctl(<b>2</b>)="YDEF 32 LINEAR 6.5
1" </tt><tt><br>
</tt><tt> ctl(<b>3</b>)="ZDEF 1 Linear 1 1"</tt><tt><br>
</tt><tt>;* CHANGE TDEF TO 366 FOR LEAP YEARS </tt><tt><br>
</tt><tt> ctl(<b>4</b>)="TDEF 365 LINEAR
1JAN1994 1DY"</tt><tt><br>
</tt><tt> ctl(<b>5</b>)="VARS 1"</tt><tt><br>
</tt><tt> ctl(<b>6</b>)="T 0 99 DAILYTEMP"</tt><tt><br>
</tt><tt> ctl(<b>7</b>)="<b>ENDVARS</b>"</tt><tt><br>
</tt><tt><br>
</tt><tt> do gg = 0,dimsizes(fn)-1 </tt><tt><br>
</tt><tt> ctl(0) = "DSET "+fn(gg)</tt><tt><br>
</tt><tt> asciiwrite("file.ctl",ctl)</tt><tt><br>
</tt><tt> system("cdo -f nc import_binary
file.ctl "+fn(gg)+".nc")</tt><tt><br>
</tt><tt> system("rm file.ctl") ;
optional</tt><tt><br>
</tt><tt> end do</tt><tt><br>
</tt><tt><br>
</tt><tt>end</tt></font><br>
<br>
-Karin<br>
<br>
<br>
<div
class="m_-5465591516351667103m_6516687254760282339moz-cite-prefix">Am
18.12.17 um 16:51 schrieb Arka Banerjee:<br>
</div>
<div class="m_-5465591516351667103elided-text">
<blockquote type="cite">
<div dir="auto">You told me Adam was right.
<div dir="auto">I also follow the steps if
you have seen my script.</div>
<div dir="auto">At the end there will be end
but script is nt running</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Dec 18, 2017
9:17 PM, "Arka Banerjee" <<a
href="mailto:arka354deb@gmail.com"
target="_blank" moz-do-not-send="true">arka354deb@gmail.com</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">
<div dir="auto">Seen already.
<div dir="auto">But not helpful.</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Dec 18,
2017 9:15 PM, "Karin
Meier-Fleischer" <<a
href="mailto:meier-fleischer@dkrz.de"
target="_blank"
moz-do-not-send="true">meier-fleischer@dkrz.de</a>>
wrote:<br type="attribution">
<blockquote
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371quote"
style="margin:0 0 0
.8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000"
bgcolor="#FFFFFF"> Have you seen
the example <a
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-txt-link-freetext"
href="https://www.ncl.ucar.edu/Applications/Scripts/grads_2.ncl"
target="_blank"
moz-do-not-send="true">https://www.ncl.ucar.edu/Appli<wbr>cations/Scripts/grads_2.ncl</a><br>
<br>
The script reads the same simple
GrADS file in <b> Example 1</b>
but creates a netCDF file and
plots the data. The creation of
netCDF necessitates the creation
of coordinate variables and
other information.<br>
<br>
-Karin<br>
<br>
<div
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-cite-prefix">Am
18.12.17 um 16:40 schrieb
Karin Meier-Fleischer:<br>
</div>
<div
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371elided-text">
<blockquote type="cite"> Hi
Arka, <br>
<br>
please, don't send the same
question again by changing
the subject! And always
reply to the ncl-talk
mailing list.<br>
<br>
If you don't have the CDOs
available, hopefully you
have Ruby installed. See<br>
<a
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-txt-link-freetext"
href="https://www.ncl.ucar.edu/Applications/grads.shtml#ruby"
target="_blank"
moz-do-not-send="true">https://www.ncl.ucar.edu/Appli<wbr>cations/grads.shtml#ruby</a><br>
<br>
The hardest way would be to
write a program e.g. Fortran
to read the GrADS binary and
write netCDF using the
netCDF library.<br>
<br>
Maybe you should install
CDO, see <a
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-txt-link-freetext"
href="https://code.mpimet.mpg.de/projects/cdo/wiki#Installation-and-Supported-Platforms"
target="_blank"
moz-do-not-send="true">https://code.mpimet.mpg.de/pro<wbr>jects/cdo/wiki#Installation-an<wbr>d-Supported-Platforms</a><br>
<br>
-Karin<br>
<br>
<div
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-cite-prefix">Am
18.12.17 um 07:28 schrieb
Arka Banerjee:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi,
<div><br>
</div>
<div><span
style="font-size:12.8px">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.</span><br>
</div>
<div><span
style="font-size:12.8px"><br>
</span></div>
<div><span
style="font-size:12.8px"><br>
</span></div>
<div><span
style="font-size:12.8px">Thanks</span></div>
<div><span
style="font-size:12.8px"><br>
</span></div>
<div><span
style="font-size:12.8px">Arka</span></div>
</div>
<br>
<fieldset
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854mimeAttachmentHeader"></fieldset>
<br>
<pre>______________________________<wbr>_________________
ncl-talk mailing list
<a class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank" moz-do-not-send="true">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" moz-do-not-send="true">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
<br>
<fieldset
class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854mimeAttachmentHeader"></fieldset>
<br>
<pre>______________________________<wbr>_________________
ncl-talk mailing list
<a class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank" moz-do-not-send="true">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="m_-5465591516351667103m_6516687254760282339m_3269425221698160371m_506550997051548854moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank" moz-do-not-send="true">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu"
target="_blank"
moz-do-not-send="true">ncl-talk@ucar.edu</a><br>
List instructions, subscriber
options, unsubscribe:<br>
<a
href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
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: <a class="moz-txt-link-abbreviated" href="mailto:meier-fleischer@dkrz.de">meier-fleischer@dkrz.de</a>
URL: <a class="moz-txt-link-abbreviated" href="http://www.dkrz.de">www.dkrz.de</a>
Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
</pre>
</body>
</html>