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

971024: translating netCDF data into another format



Perry,
>Date: Thu, 23 Oct 1997 13:18:53 -0400 (EDT)
>From: Perry Shafran <address@hidden>
>Organization: . 
>To: Steve Emmerson <address@hidden>
>Subject: Re: 971022: translating netCDF data into another format 
>Keywords: 199710231718.LAA19840 

In the above message, you wrote:

> I went to the web page <http://www.unidata.ucar.edu/packages/netcdf/docs.html>
> and first I clicked on the link to "online man pages for Fortran 
> interface" near the bottom of the page.  However, I realized that this 
> man page was for netCDF 2, so I clicked the "online man pages for 
> Fortran" under the netCDF 3 reference documentation.  
> 
> Then in the User's Guide for Fortran, I tried to compile and link as 
> suggested in section 4.6, "Compiling and Linking with the NetCDF 
> Library".  Here is the script that I used:
> 
> ---------------------------------------------------------------------------
> mkdir -p /tmp/wd20ps/netcdf
> cd /tmp/wd20ps/netcdf
> 
> cp /emcsrc3/wd20ps/netcdf/netcdf_read.f .
> cp /dm/wd20ps/profilers/prof_azcn5_h.920213.000000.cdf input.nc
> 
> assign -a input.nc  fort.10
> assign -a output.ascii  fort.50
> 
> cf77 -c -I/dmlite3/wd20ps/netcdf-3.3.1/include netcdf_read.f
> cf77 -o netcdf_read.exe netcdf_read.o 
> -l/dmlite3/wd20ps/netcdf-3.3.1/lib/libnetcdf.a
> 
> netcdf_read.exe > netcdf.print
> cp netcdf.print /emcsrc3/wd20ps/netcdf/.
> cp output.ascii /emcsrc3/wd20ps/netcdf/.
> ------------------------------------------------------------------------------
> 
> Then I run this script and get unsatisfied external references.  Am I 
> compiling and linking correctly?  

What are the unresolved external symbols?

> 
> I also notice from the man pages that the subroutines from version 2 are 
> now all functions in version 3.  So I can't simply write CALL NF_OPEN(), 
> for example, in a Fortran program, but I have to write something like 
> iopen=NF_OPEN() or something like that, right?

That is correct if you wish to use the version 3 Fortran routines (which
I recommend).

> I am also assuming that I 
> can't call subroutines such as NCVGT, NCVGTG, NCINQ, and the like, 
> because those are version 2 subroutines, right?  

The version 3 netCDF library should contain both the version 2 and
version 3 Fortran routines.  I recommend using the version 3 ones.

--------
Steve Emmerson   <http://www.unidata.ucar.edu>