<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
your xlat and xlon are 2-dimensional. Try<br>
<br>
<font color="#3333ff"><tt>print(sprintf("%8.4f",xlat(:,0)) +" " \</tt><tt><br>
</tt><tt> +sprintf("%8.4f",xlat(0,:)) +" " \</tt></font>
<div><font color="#3333ff"><tt> +sprintf("%8.4f",xlon(:,0)) +"
" \</tt><tt><br>
</tt></font>
<div><font color="#3333ff"><tt> +sprintf("%8.4f",xlon(0,:))
+" " \</tt></font></div>
<font color="#3333ff"><tt> +sprintf("%5.1f",mtmp(0,:,:)) +" "
\</tt></font></div>
<div><font color="#3333ff"><tt> +sprintf("%5.2f",evop(0,:,:)))</tt></font></div>
<br>
-Karin<br>
<br>
<div class="moz-cite-prefix">Am 16.02.18 um 02:52 schrieb jagan
TNAU:<br>
</div>
<blockquote type="cite"
cite="mid:CABpuO0jLSzMaibni9rK-o4Z2t4Dg0Su3nnVF-7pyW0GM8Uw-Wg@mail.gmail.com">
<div dir="ltr">Hello,
<div><br>
</div>
<div>Using the following scripts I want to print latitude and
longitude along with variables. </div>
<div>
<div>;----------------------------------------------------------------------</div>
<div>check.ncl</div>
<div>; Writting ERA netcdf to ASCII </div>
<div>;----------------------------------------------------------------------</div>
<div>; This script uses "sprintf" and extract data from file</div>
<div>;----------------------------------------------------------------------</div>
<div> </div>
<div>load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div>
<div> </div>
<div>begin</div>
<div>;*************************</div>
<div>; read in data</div>
<div>;*************************</div>
<div> </div>
<div> srf = addfile("<a href="http://1980_jan.nc"
moz-do-not-send="true">1980_jan.nc</a>","r")</div>
<div><br>
</div>
<div> prec = srf->tp</div>
<div> sshs = srf->sund</div>
<div> ssrn = srf->ssr</div>
<div> evpn = srf->e</div>
<div> temp = srf->t2m</div>
<div> dwpt = srf->d2m</div>
<div> sst = srf->sst</div>
<div> u10m = srf->u10</div>
<div> time = srf->time</div>
<div> xlat = srf->latitude</div>
<div> xlon = srf->longitude</div>
<div> </div>
<div> mtmp = (((temp*0.000232882282352021) +
(292.749517347921)) - 273.15) ; temp in C</div>
<div> evop = (((evpn*9.12010062706439e-08) +
(0.00290678973604684)) * (1000)) ; evaporation in mm</div>
<div><br>
</div>
<div> print(sprintf("%8.4f",xlat(:,:)) +" " \</div>
<div> +sprintf("%8.4f",xlon(:,:)) +" " \</div>
<div> +sprintf("%5.1f",mtmp(0,:,:)) +" " \</div>
<div> +sprintf("%5.2f",evop(0,:,:)))</div>
<div>end</div>
</div>
<div>;------------------------------------------------------</div>
<div><br>
</div>
<div>The following is the Error </div>
<div>
<p
style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Number
of subscripts do not match number of dimensions of
variable,(2) Subscripts used, (1) Subscripts expected</span></p>
<p
style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p
style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
style="font-variant-ligatures:no-common-ligatures">I used
to print latitude and longitude using different netcdf
file.</span></p>
<p
style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p
style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
style="font-variant-ligatures:no-common-ligatures">The
variable got printed and I am unable to print lat and lon.
The attached netcdf file was used.</span></p>
<p
style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p
style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
style="font-variant-ligatures:no-common-ligatures">Can
someone to help me to solve </span></p>
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>With regards<br>
<br>
Dr.R.Jagannathan <br>
Professor & Former Dean<br>
Tamil Nadu Agricultural University <br>
Coimbatore - 641 003 India <br>
<br>
PHONE: Mob: +91 94438 89891<br>
<br>
DO NOT PRINT THIS E-MAIL UNLESS NECESSARY. THE
ENVIRONMENT CONCERNS US ALL.</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</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>