<div dir="ltr"><div class="gmail_default" style="font-size:small">I think you are close. The lat/lon array is actually 410 x 720, and not 720 x 410, so you want something like this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">nlon = getfilevardimsizes (fin,"xaxis_1")</font></div><div class="gmail_default"><font face="monospace, monospace">nlat = getfilevardimsizes (fin,"yaxis_1")</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">; "Conform" the<span class="Apple-tab-span" style="white-space:pre">        </span>1D lat/lon arrays to be<span class="Apple-tab-span" style="white-space:pre">        </span>2D arrays of nlat x nlon in size</font></div><div class="gmail_default"><font face="monospace, monospace">lat2d = conform_dims((/nlat,nlon/),fin->yaxis_1,0)</font></div><div class="gmail_default"><font face="monospace, monospace">lon2d = conform_dims((/nlat,nlon/),fin->xaxis_1,1)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">gen_res = True</font></div><div class="gmail_default"><font face="monospace, monospace">gen_res@sfXArray = lon2d</font></div><div class="gmail_default"><font face="monospace, monospace">gen_res@sfYArray = lat2d</font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 8:18 AM, Vimal Koul <span dir="ltr"><<a href="mailto:koulvimal18@gmail.com" target="_blank">koulvimal18@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Nicolas,<br><br></div><div>Thanks for your help.<br><br></div><div>But now, the following error messages are seen:<br><br>warning:ScalarFieldSetValues: 2d coordinate array sfXArray has an incorrect dimension size: defaulting sfXArray<br>warning:ScalarFieldSetValues: 2d coordinate array sfYArray has an incorrect dimension size: defaulting sfYArray<br>warning:ContourPlotDraw: out of range coordinates encountered; standard AreaFill rendering method may be unreliable;<br> consider setting the resource trGridType to "TriangularMesh" if coordinates contain missing values<br>fatal:ContourPlotDraw: Workspace reallocation would exceed maximum size 100000000<br>fatal:ContourPlotDraw: draw error<br>fatal:ContourPlotDraw: draw error<br>fatal:PlotManagerDraw: error in plot draw<br>fatal:_NhlPlotManagerDraw: Draw error<br><br></div><div>Please note that I don't have the grid resolution information except nlat, nlon and depth levels.</div><div><br>Modified script is attached.<br></div><div><br></div><div><br></div><div>Regards,<br>Vimal<br><br></div></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font size="2">Sincerely<br></font></div><font size="2">Vimal Koul<br><br></font></div><div><font size="2">Graduate Student<br></font></div><div><font size="2">Department of Atmospheric and Space Science<br></font></div><div><font size="2">Savitribai Phule Pune University<br></font></div><div><font size="2">India</font><br></div><div dir="ltr"><br><br></div></div></div></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On 4 August 2015 at 16:41, Nicolas GASNIER <span dir="ltr"><<a href="mailto:ngprod41@gmail.com" target="_blank">ngprod41@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
With the xaxis_1 and yaxis_1 variables you should try to build a lat and<br>
lon 2d arrays matching your data grid dimensions. Then use these 2d<br>
arrays as sfXArray and sfYArray plotting ressource.<br>
<br>
Something like this (untested) :<br>
<br>
xaxis_1 = fin->xaxis_1<br>
yaxis_1 = fin->yaxis_1<br>
<br>
lon2d = new((/720, 410/), float)<br>
do i=0,719<br>
lon2d(i, :) = xaxis_1<br>
end do<br>
<br>
lat2d = new((/720, 410/), float)<br>
do i=0,409<br>
lat2d(:, i) = yaxis_1<br>
end do<br>
<br>
<br>
gen_res = True<br>
gen_res@sfXArray = lon2d<br>
gen_res@sfYArray = lat2d<br>
<br>
Then pass that ressource to your plotting function.<br>
<br>
Hope that helps.<br>
<br>
Nicolas Gasnier<br>
<br>
<br>
Le 04/08/2015 08:23, <a href="mailto:ncl-talk-request@ucar.edu" target="_blank">ncl-talk-request@ucar.edu</a> a écrit :<br>
> Date: Tue, 4 Aug 2015 11:53:07 +0530<br>
> From: Vimal Koul<<a href="mailto:koulvimal18@gmail.com" target="_blank">koulvimal18@gmail.com</a>><br>
> Subject: [ncl-talk] Problem with CFS initial condition data plot in<br>
> NCL<br>
> <a href="mailto:To%3Ancl-talk@ucar.edu" target="_blank">To:ncl-talk@ucar.edu</a><br>
> Message-ID:<br>
> <<a href="mailto:CAJVe0MCbueZr-1EZHk6eOD1VULML0XEOMaGchvsM5rczLjjFSQ@mail.gmail.com" target="_blank">CAJVe0MCbueZr-1EZHk6eOD1VULML0XEOMaGchvsM5rczLjjFSQ@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> Dear Users,<br>
><br>
> I am trying to plot an ocean data file which is a part of CFS High<br>
> Resolution Initial Conditions (<a href="http://nomads.ncdc.noaa.gov/data.php" rel="noreferrer" target="_blank">http://nomads.ncdc.noaa.gov/data.php</a>).<br>
><br>
> File: <a href="http://ocnanl.gdas.1985050100.ocean_temp_salt.res.nc" rel="noreferrer" target="_blank">ocnanl.gdas.1985050100.ocean_temp_salt.res.nc</a> (uploaded to ncl ftp<br>
> link) or download from:<a href="https://copy.com/7bVgOvDfQKDjcg07" rel="noreferrer" target="_blank">https://copy.com/7bVgOvDfQKDjcg07</a><br>
><br>
> Unfortunately, printVarSummary shows that the variable "temp" I'm trying to<br>
> plot does not have coordinate information, however, nlat, nlon are<br>
> provided. So I used fspan (and tried other functions also) to attach<br>
> coordinates, but the resulting plot is messed up. The plot and ncl script<br>
> are attached.<br>
><br>
> Can you please help me in defining the lat long coordinate information for<br>
> this type of data?<br>
><br>
> I am completely new to NCL, infact just started last week.<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>