[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #MXO-545754]: read .nc file using the example f90 program



> Dear NetCDF support team,
>
> I have a problem to use the example f90 program,
> simple_xy_rd.f90. It doesn't read in data from
> simple_xy.nc and does not print to screen.
>
> Before I compiled simple_xy_rd.f90, I compiled
> simple_xy_wr.f90 and run the executable to
> generate simple_xy.nc. Using ncdump shows that
> the simple_xy.nc is as following,
>
> bash-3.1$ netcdf/bin/ncdump simple_xy.nc
> netcdf simple_xy {
> dimensions:
> x = 6 ;
> y = 12 ;
> variables:
> int data(x, y) ;
> data:
>
> data =
> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
> 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
> 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
> 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
> 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
> 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
> ;
> }
>
> But when I run the executable of
> simple_xy_rd.f90, it only prints
>
> bash-3.1$ read_goes_test.x
> *** SUCCESS reading example file simple_xy.nc!
>
> Do you know where is the problem? And how can I
> fix it? I downloaded simple_xy_wr.f90 and
> simple_xy_rd.f90 from
> http://www.unidata.ucar.edu/software/netcdf/examples/programs/
>
> Thank you very much,
>
> Julia
>
>

Howdy Julia!

The good news is that there is nothing to fix, apparently. The simple_xy_read
program is reporting that it has successfully read the simple_xy.nc file, and
got expected values. Unless it finds problems, it only prints out the one
line:

*** SUCCESS reading example file simple_xy.nc!

If you take a look at the code, which is also available on-line:
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-tutorial.html#simple_005fxy-in-F90

you will see where you can add your own code to print out the values that are
being read.

Thanks, and keep on netCDFing!

Ed
>
____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>
>


Ticket Details
===================
Ticket ID: MXO-545754
Department: Support netCDF
Priority: Normal
Status: Closed