<div dir="ltr">Thank you all, especially to Andrew as I am very lazy and ncpdq is just right for me ...<div><br></div><div style>Thanks again..</div><div style><br></div><div style>Best wishes,</div><div style><br></div><div style>
Kishore </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 27, 2013 at 1:57 AM, Andrew Friedman <span dir="ltr"><<a href="mailto:andfried@berkeley.edu" target="_blank">andfried@berkeley.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Another option is to use the NCO tool ncpdq:<br>
<a href="http://nco.sourceforge.net/nco.html#ncpdq-netCDF-Permute-Dimensions-Quickly" target="_blank">http://nco.sourceforge.net/nco.html#ncpdq-netCDF-Permute-Dimensions-Quickly</a><br>
<br>
Andrew<br>
<div class="HOEnZb"><div class="h5"><br>
On Mar 26, 2013, at 12:32 PM, Lee Byerle <<a href="mailto:lbyerle@yahoo.com">lbyerle@yahoo.com</a>> wrote:<br>
<br>
> Kishore,<br>
><br>
> Below may also be helpful. It is sample fortran code that can reverse the latitude indices, and writes back to binary (assuming .nc is first dumped to binary):<br>
> .<br>
> .<br>
> .<br>
> irec1=1<br>
> irec2=1<br>
><br>
> do nvar=1,5 !Variables in binary file, with u-wind<br>
> if(nvar.eq.1) then<br>
> do k=1,nk<br>
> read(1,rec=irec1)vgrads !read data in .nc file<br>
> do i=1,ni<br>
> do j=1,nj<br>
> u(i,j,k)=vgrads(i,nj+1-j) !reverse j-index<br>
> enddo<br>
> enddo<br>
> irec1=irec1 + 1<br>
> enddo<br>
><br>
> c now write to file w/latitude (j-index) reversed:<br>
><br>
> do k=1,nk<br>
> do i=1,ni<br>
> do j=1,nj<br>
> var(i,j) = u(i,j,k)<br>
> enddo<br>
> enddo<br>
> write(17,rec=irec2)var<br>
> irec2=irec2 + 1<br>
> enddo<br>
> .<br>
> .<br>
> etc.<br>
><br>
> The new binary output, with latitude starting at +90, can be viewed with a .ctl file using options yrev.<br>
><br>
> Lee<br>
> From: Charles Seman - NOAA Federal <<a href="mailto:charles.seman@noaa.gov">charles.seman@noaa.gov</a>><br>
> To: GrADS Users Forum <<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
> Sent: Tuesday, March 26, 2013 1:09 PM<br>
> Subject: Re: [gradsusr] how to reveres latitudes in nc file<br>
><br>
> Kishore,<br>
><br>
> Have you tried the "yrev" option?<br>
> <a href="http://grads.iges.org/grads/gadoc/descriptorfile.html#OPTIONS" target="_blank">http://grads.iges.org/grads/gadoc/descriptorfile.html#OPTIONS</a><br>
><br>
> You would make a GrADS data descriptor file to open the .nc file, and<br>
> include in the data descriptor file the line:<br>
> options yrev<br>
><br>
> Hope this helps,<br>
> Chuck<br>
><br>
> On 03/26/2013 01:40 AM, Kishore Babu wrote:<br>
> > Dear grads users,<br>
> ><br>
> > My nc file has latitudes as below<br>
> ><br>
> > latitude = -90, -87.5, -85, -82.5, -80, -77.5, -75, -72.5, -70, -67.5, -65,<br>
> > -62.5, -60, -57.5, -55, -52.5, -50, -47.5, -45, -42.5, -40, -37.5,<br>
> > -35,<br>
> > -32.5, -30, -27.5, -25, -22.5, -20, -17.5, -15, -12.5, -10, -7.5, -5,<br>
> > -2.5, 0, 2.5, 5, 7.5, 10, 12.5, 15, 17.5, 20, 22.5, 25, 27.5, 30,<br>
> > 32.5,<br>
> > 35, 37.5, 40, 42.5, 45, 47.5, 50, 52.5, 55, 57.5, 60, 62.5, 65,<br>
> > 67.5, 70,<br>
> > 72.5, 75, 77.5, 80, 82.5, 85, 87.5, 90 ;<br>
> ><br>
> > But, I need to have latitudes in reveres such as below...<br>
> ><br>
> > latitude = 90, 87.5, 85, 82.5, 80, 77.5, 75, 72.5, 70, 67.5, 65, 62.5, 60,<br>
> > 57.5, 55, 52.5, 50, 47.5, 45, 42.5, 40, 37.5, 35, 32.5, 30, 27.5, 25,<br>
> > 22.5, 20, 17.5, 15, 12.5, 10, 7.5, 5, 2.5, 0, -2.5, -5, -7.5, -10,<br>
> > -12.5,<br>
> > -15, -17.5, -20, -22.5, -25, -27.5, -30, -32.5, -35, -37.5, -40,<br>
> > -42.5,<br>
> > -45, -47.5, -50, -52.5, -55, -57.5, -60, -62.5, -65, -67.5, -70,<br>
> > -72.5,<br>
> > -75, -77.5, -80, -82.5, -85, -87.5, -90 ;<br>
> ><br>
> > Could you please anybody let me know how it is changed?<br>
> ><br>
> > Thank you in advance..<br>
> ><br>
> > Regards,<br>
> ><br>
> > Kishore<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > gradsusr mailing list<br>
> > <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
> > <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
> ><br>
><br>
> --<br>
><br>
> Please note that <a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a> should be considered my NOAA<br>
> email address, not <a href="mailto:cjs@gfdl.noaa.gov">cjs@gfdl.noaa.gov</a>.<br>
><br>
> ********************************************************************<br>
> Charles Seman <a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a><br>
> U.S. Department of Commerce / NOAA / OAR<br>
> Geophysical Fluid Dynamics Laboratory voice: <a href="tel:%28609%29%20452-6547" value="+16094526547">(609) 452-6547</a><br>
> 201 Forrestal Road fax: <a href="tel:%28609%29%20987-5063" value="+16099875063">(609) 987-5063</a><br>
> Princeton, NJ 08540-6649 <a href="http://www.gfdl.noaa.gov/~cjs/" target="_blank">http://www.gfdl.noaa.gov/~cjs/</a><br>
> ********************************************************************<br>
><br>
> "The contents of this message are mine personally and do not reflect any<br>
> official or unofficial position of the United States Federal Government,<br>
> the United States Department of Commerce, or NOAA."<br>
> _______________________________________________<br>
> gradsusr mailing list<br>
> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
><br>
><br>
> _______________________________________________<br>
> gradsusr mailing list<br>
> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">Andrew Friedman<br>
Graduate Student, UC Berkeley Geography<br>
<a href="mailto:andfried@berkeley.edu">andfried@berkeley.edu</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</div></div></blockquote></div><br></div>