Mohamed,
Thanks for the Netcdf version information. We may also need to know
what kind of computer you are using. Please send the output from
"uname -a".
Now it has become clear that you are using precompiled binaries and
a third party distribution from http://dag.wieers.com/apt/ . Also
it seems to me that this distribution contains only dynamic
libraries, not the static ones with which I am more familiar.
This is probably all okay except that you need to debug your
installation, and I can't be of much more help personally. However:
1. The message "is not a valid module information file" on
netcdf.mod continues to be an important clue. (Thanks again Tom
Green.) If you are using a different Fortran 90 compiler than the
one that built this Netcdf distribution, then this is one of the
likely error messages that you would get, because of
non-standardized .mod file formats. Do you have other Fortran
compilers that you can try with your programs?
2. Much of Unidata's *install* documentation may be inaccurate for
a third party distribution. This explains why you had trouble
understanding the Unidata documentation that you mentioned below.
It probably has numerous references to things that you don't have.
The Unidata *usage* instructions will be just fine though!
Start with Dag Wieers install documentation if you can find it,
rather than Unidata's. In particular, from your file list below
(but these might just be copied from Unidata):
/usr/share/doc/netcdf-3.6.3/INSTALL
/usr/share/doc/netcdf-3.6.3/README
/usr/share/info/netcdf-f90.info.gz
/usr/share/info/netcdf-install.info.gz
/usr/share/info/netcdf-tutorial.info.gz
/usr/share/info/netcdf.info.gz
Also search the Dag Wieers website for this information. I see that
they have some user support lists of their own; you might give them
a try.
3. You had the link for Unidata's install documentation for Netcdf
4.0. But you have Netcdf version 3.6.3, which is the current
non-HDF release. The correct link for 3.6.3 install documents is as
follows; this is simpler and will better match your installation:
http://www.unidata.ucar.edu/software/netcdf/old_docs/docs_3_6_3/netcdf-install/
4. It will probably be better to get the third party distribution
working, because it is already tailored to your Linux. But if that
doesn't work out, you also have the option of installing Netcdf
straight from Unidata. You would have the further choice of
precompiled binary or source code. The source distribution would
allow you to build Netcdf with your own Fortran compiler, but the
build procedure is more complicated. Start here and then move on to
install information in (3):
http://www.unidata.ucar.edu/software/netcdf/binaries.html
5. The test programs mentioned by Ed Hartnett are included in the
Unidata source distributions, and they would be valuable to try. I
do not see them in the third party file list that you gave. But
just get this very simple Fortran 90 program working first:
program netcdf_version
use netcdf
print *, trim(nf90_inq_libvers())
end
I feel like I am just piling on information without getting at your
actual problem. Perhaps others with Linux distribution experience
can give you better advice. Good luck.
--Dave
Mohamed Mohamed wrote:
Dave,
The available information as bellow:
My operating system is Linux
The netcdf package and files are:
Name : netcdf Relocations: (not
relocatable)
Version : 3.6.3 Vendor: Dag Apt
Repository, http://dag.wieers.com/apt/
Release : 1.el5.rf Build Date: Mon 30 Jun 2008
08:54:52 PM BST
Install Date: Wed 03 Sep 2008 11:10:52 AM BST Build Host:
lisse.leuven.wieers.com
Group : Development/Libraries Source RPM:
netcdf-3.6.3-1.el5.rf.src.rpm
Size : 3248222 License: BSD like
Signature : DSA/SHA1, Mon 30 Jun 2008 09:03:15 PM BST, Key ID
a20e52146b8d79e6
Packager : Dries Verachtert <dries@xxxxxxxxxxx>
URL : http://www.unidata.ucar.edu/software/netcdf/
Summary : Libraries for the Unidata network Common Data Form
(NetCDF)
Description :
The Unidata network Common Data Form (netCDF) is an interface for
scientific data access and a freely-distributed software library that
provides an implementation of the interface. The netCDF library also
defines a machine-independent format for representing scientific data.
Together, the interface, library, and format support the creation,
access, and sharing of scientific data.
/usr/bin/ncdump
/usr/bin/ncgen
/usr/lib64/libnetcdf.so.4
/usr/lib64/libnetcdf.so.4.0.0
/usr/lib64/libnetcdf_c++.so.4
/usr/lib64/libnetcdf_c++.so.4.0.0
/usr/lib64/libnetcdff.so.4
/usr/lib64/libnetcdff.so.4.0.0
/usr/share/doc/netcdf-3.6.3
/usr/share/doc/netcdf-3.6.3/INSTALL
/usr/share/doc/netcdf-3.6.3/README
/usr/share/info/netcdf-c.info.gz
/usr/share/info/netcdf-cxx.info.gz
/usr/share/info/netcdf-f77.info.gz
/usr/share/info/netcdf-f90.info.gz
/usr/share/info/netcdf-install.info.gz
/usr/share/info/netcdf-tutorial.info.gz
/usr/share/info/netcdf.info.gz
/usr/share/man/man1/ncdump.1.gz
/usr/share/man/man1/ncgen.1.gz
/usr/share/man/man3/netcdf.3.gz
/usr/share/man/man3/netcdf_f77.3.gz
/usr/share/man/man3/netcdf_f90.3.gz
Also The nedded HDF5 files are installd in the same directories. I will
send you the compuler version once I recived information .
I guess part of the solution in the following link however I did not
understand it. Can u help in that?
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install/Using.ht
ml#Using
thanks
Mohamed Ali
malibec2005@xxxxxxxxx
Mob 00447912033240
SChEME Department
Faculty of Engineering
University of Nottingham
Nottingham (NG7 2RD) UK
Fax: 0044(0)115 951 4115
-----Original Message-----
From: netcdfgroup-bounces@xxxxxxxxxxxxxxxx
[mailto:netcdfgroup-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Dave Allured
Sent: Wednesday, November 12, 2008 11:31 PM
To: netcdfgroup@xxxxxxxxxxxxxxxx
Subject: Re: [netcdfgroup] netcdf
Mohamed,
Yes I made two mistakes there. That is pretty funny, "movie clip".
That is just your OS (Windows?) misinterpreting the .mod extension I
think. Please disregard that, the compiler knows what to do with a .mod
file.
You are right about the name libnetcdf.so.4. That is the dynamic
library. libnetcdf.a would be the static version, but it is not
currently part of your installation. You can link with either one,
provided that a few other libraries are installed correctly.
The linker should be smart enough to find either one with the same two
command options "-L/usr/lib64 -lnetcdf". You might need to sym link
libnetcdf.so.4 to the name libnetcdf.so; I am not knowledgeable on the
details of library naming rules. Anyone?
More seriously, as Tom Green mentioned earlier, the format of .mod files
is not standardized and compiler dependent. Now I am thinking that the
message "is not a valid module information file" is the symptom of using
a different compiler than what was used to build your netcdf library.
Please show us identification and version information about your
compiler and netcdf version and computer platform. Also, did you
download precompiled Netcdf binaries from Unidata, or build them
yourself from the source distribution? If the latter, which compiler
was used?
--Dave
Mohamed Mohamed wrote:
Dave
I found the netcdf.mod file in the same location
("/usr/include/netcdf.mod ).
I noticed that its type is movie clip.
Is it correct type?.
Also I noticed. I do not have any netcdf files with the .a extension .
For example I found the libnetcdf file with .so.4 extension in the
(usr/lib64/ libnetcdf.so.4) not the libnetcdf.a as you mention in
your massage.
thanks
Mohamed Ali
-----Original Message-----
[mailto:netcdfgroup-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Dave
Allured
Sent: Tuesday, November 11, 2008 5:55 PM
Mohamed,
Regarding the error "/usr/include/netcdf.mod is not a valid module
information file", this is an important file for the Fortran 90
interface. You need to debug this. Please find the correct location
of netcdf.mod on your system, and change the path in the -I command
argument to match.
This file might be in the same directory as the library file
libnetcdf.a, or a different directory. The standard install location
for this file is, I think, in a separate "include"
directory. Good luck.
--Dave
Mohamed Mohamed wrote:
Dave
Thanks for your help. I made simple Fortran programs and it is going
well.
I made you simple test program but I had this statement "Fatal Error:
netcdftest.f90, line 2: /usr/include/netcdf.mod is not a valid module
information file
detected at NETCDF@<end-of-statement>"
Thanks
Mohamed Ali
-----Original Message-----
[mailto:netcdfgroup-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Dave
Allured
Sent: Monday, November 10, 2008 8:52 PM
Mohamed,
The statement "use netcdf" goes into your fortran 90 program below
the
program or subroutine or function statement, and above "implicit
none".
You should study and understand Fortran 90 modules before working on
this program.
See if you can get this simple test program to compile and run:
program netcdf_version
use netcdf
print *, trim(nf90_inq_libvers()) end
The compile command should look something like this:
f90 netcdf_version.f90 -I/usr/include -L/usr/lib64 -lnetcdf
where the include directory contains the file netcdf.mod.
Is there any chance that you have old Fortran 77 code that somehow
got renamed to ".f90" without complete conversion to Fortran 90?
--Dave
Mohamed Mohamed wrote:
Dave,
Thanks, I think it is may be the solution. However I am still a
beginner in the Linux. So please could you tell me what to do.
You said " I suspect that you need to add this to the top of each
program unit that has Netcdf calls:
use netcdf " My question is how ?
Find below a long part of the error. Please have a look.
f_ts.o vdif_uv.o vertvl_edge.o water_depth.o wreal.o ghostuv.o
dens3.o init_sed.o advave_edge_gcy.o advection_edge_gcy.o
adv_uv_edge_gcy.o bcond_gcy.o shape_coef_gcy.o depth_check.o
vdif_ts_gom.o adjust_ts.o shutdown_check.o extelpf_edge.o fct_q2.o
fct_q2l.o viscofh.o
print_vals.o rho_mean.o viz.o -L/usr/lib64 -lnetcdf
mod_ncdio.o: In function `__mod_ncdio__handle_ncerr':
mod_ncdio.f90:(.text+0x125): undefined reference to
`__netcdf__nf90_strerror'
mod_ncdio.o: In function `__mod_ncdio__putvar':
mod_ncdio.f90:(.text+0x11e4): undefined reference to
`__netcdf__nf90_put_var_2d_fourbytereal'
<snip many error messages>
Thanks
Mohamed Ali
-----Original Message-----
[mailto:netcdfgroup-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Dave
Allured
Sent: Thursday, November 06, 2008 5:50 PM
Mohamed,
These are missing library symbol errors. I suspect that you need to
add this to the top of each program unit that has Netcdf calls:
use netcdf
This is because the Netcdf Fortran 90 interface uses modules. You
can't properly link to the Netcdf F90 library without this
declaration.
For diagnosis, your program is trying to link to this:
__netcdf__nf90_open
But with a correct "use" statement it should be seeking a symbol
named something like this (the name change may vary by compiler and
platform):
___netcdf_MOD_nf90_open
I might be wrong about all of this if you are on a platform or
compiler that uses Fortran 90 linking conventions much different
than
what I am familiar with. If "use" doesn't fix it, then please
provide identification and version info for your platform, compiler,
and netcdf version.
Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
http://cires.colorado.edu/science/centers/cdc/
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
http://www.cdc.noaa.gov/
Mohamed Mohamed wrote:
I worked with FVCOM software. When I started to get netcdf output
type I received the following error:
mod_lag.f90:(.text+0x89f6): undefined reference to
`__netcdf__nf90_put_att_text'
mod_lag.f90:(.text+0x8a1e): undefined reference to
`__netcdf__nf90_put_att_text'
<snip many error messages>
_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/