<div>I am not exactly sure where to put my input program in. I have a program of global zonal wind data, with dimensions time, latitude, longitude, pressure levels. I was under the impression and this is how I have done programs reading NetCDF in the past, that you use ncopn to open NetCDF files. I have the netcdf.inc file and ngen.h in the current directory where my program is. Here is a copy of the program as it stands right now. Can anyone help me with isolating out the problems with this program because it has been a while since I have used programs of reading and writing NetCDF files and I am a little rusty on it now. </div>
<div> </div><span lang="EN">
<p>c latitude, longitude, time</p>
<p>parameter(nlat=37,nlon=144,nyr=3288)</p>
<p>c number of dimensions</p>
<p>parameter(nvar=10)</p>
<p>parameter(ndims=3)</p>
<p>integer nci(nvar),ncid,iselvar(nvar) </p>
<p>integer input(nvar)</p>
<p>integer i,j,k</p>
<p>include 'netcdf.inc'</p>
<p>c data variables</p>
<p>real data(nlon,nlat), count(nlon,nlat,nyr)</p>
<p>real wnd(nlon,nlat,nyr)</p>
<p>c grads output files</p>
<p>parameter (undef=-9999.)</p>
<p>c open all netcdf files</p>
<p>nci(1)=ncopn('<a href="http://uwnd.2002.nc">uwnd.2002.nc</a>',ncnowrit,rcode)</p>
<p>data start/1,1,1/</p>
<p>count(1)=nlon</p>
<p>count(2)=nlat</p>
<p>count(3)=1</p>
<p>count(3)=nyr</p>
<p>call ncagt(ncid,id,start,count,i2dat,rcode)</p>
<p>call ncvgt(ncid,id,start,count,i2dat,rcode)</p>
<p>stop</p>
<p>end</p>
<div></div></span>Thanks,
<div> </div>
<div>Jason <br><br></div>
<div class="gmail_quote">On Wed, Apr 1, 2009 at 10:34 PM, Chi Mai Nguyen <span dir="ltr"><<a href="mailto:Chi.Nguyen@sci.monash.edu.au">Chi.Nguyen@sci.monash.edu.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Jason,<br><br>I have a small program doing various things, including reading and writing from and to netcdf file. You'll need to check the code inside.<br>
<br>Subroutine getvars => open and get variables from netcdf file<br>subroutine w2Dh => create and output variables to a new netcdif file<br><br>You will need to use netcdf libraries to complile.<br><br>Cheers and good luck!<br>
Mai<br>
<div>
<div></div>
<div class="h5"><br>Jason Snyder <<a href="mailto:jmssnyder@UCDAVIS.EDU">jmssnyder@UCDAVIS.EDU</a>> wrote:<br>> I have a series of netcdf files that I want to filter out data in terms<br>> of<br>> specific Madden Julian Oscillation indices. I am trying to design a<br>
> fortran program to read netcdf so that I could do calculations with the<br>> data and write the results back into a netcdf file. In this I want to<br>> filter out all dates for a specific Madden Julian Oscillation index and<br>
> then average the data to get an average zonal wind profile for that<br>> specific index of MJO and how the winds change on average several days<br>> before that date. I was wondering how to design a fortran program to read<br>
> netcdf files and write netcdf files? Can someone send me an example of<br>> such a program.<br>><br>> Thanks,<br>><br>> jason<br></div></div><font color="#888888">--<br>*********************************<br>
Nguyen Chi Mai<br>School of Mathematical Sciences<br>Rm 225, Bld. 28, Clayton Campus<br>Monash University<br>Work Ph. +61 3 9905 4458<br><a href="http://www.maths.monash.edu.au/~cmnguyen" target="_blank">www.maths.monash.edu.au/~cmnguyen</a><br>
</font></blockquote></div><br>