After installation of NetCDF3

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

After installation of NetCDF3

#1 Unread post by justina0622 »

Hi everyone,

I installed NetCDF3 finally. However, there are still may errors: :(

Can anyone tell me what is the problem? Is it possible because of the version of my compiler? Should I update the compiler?

Thank you very much!

The errors are in the following:
cd Build; /opt/intel/fc/9.1.043/bin/ifort -c -heap-arrays -fp-model precise -ip -O3 -xW -free strings.f90
cd Build; /opt/intel/fc/9.1.043/bin/ifort -c -heap-arrays -fp-model precise -ip -O3 -xW -free mod_netcdf.f90
fortcom: Error: mod_netcdf.f90, line 19: This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read. [NETCDF]
USE netcdf
----------^
fortcom: Error: mod_netcdf.f90, line 105: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_REAL]
integer, parameter :: NF_FOUT = nf90_real
--------------------------------------^
fortcom: Error: mod_netcdf.f90, line 106: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_DOUBLE]
integer, parameter :: NF_FRST = nf90_double
--------------------------------------^
fortcom: Error: mod_netcdf.f90, line 107: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_DOUBLE]
integer, parameter :: NF_TYPE = nf90_double
--------------------------------------^
fortcom: Error: mod_netcdf.f90, line 111: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_CLOBBER]
integer :: CMODE = nf90_clobber ! NetCDF classic format file
-------------------------^
fortcom: Error: mod_netcdf.f90, line 111: This is not a valid initialization expression. [NF90_CLOBBER]
integer :: CMODE = nf90_clobber ! NetCDF classic format file
-------------------------^
fortcom: Error: mod_netcdf.f90, line 105: This name does not have a type, and must have an explicit type. [NF90_REAL]
integer, parameter :: NF_FOUT = nf90_real
--------------------------------------^
fortcom: Error: mod_netcdf.f90, line 106: This name does not have a type, and must have an explicit type. [NF90_DOUBLE]
integer, parameter :: NF_FRST = nf90_double
--------------------------------------^
fortcom: Error: mod_netcdf.f90, line 111: This name does not have a type, and must have an explicit type. [NF90_CLOBBER]
integer :: CMODE = nf90_clobber ! NetCDF classic format file
-------------------------^
fortcom: Error: mod_netcdf.f90, line 218: This name does not have a type, and must have an explicit type. [NF90_INQUIRE]
status=nf90_inquire(ncid, n_dim, n_var, n_gatt, rec_id)
---------------^
fortcom: Error: mod_netcdf.f90, line 220: This name does not have a type, and must have an explicit type. [NF90_NOERR]
IF ((status.eq.nf90_noerr).and.(n_dim.le.Mdims)) THEN
-----------------------^
fortcom: Error: mod_netcdf.f90, line 227: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_DIMENSION]
status=nf90_inquire_dimension(ncid, dim_id(i), &
-------------------^
fortcom: Error: mod_netcdf.f90, line 712: This name does not have a type, and must have an explicit type. [NF90_INQUIRE]
status=nf90_inquire(my_ncid, n_dim, n_var, n_gatt, rec_id)
---------------^
fortcom: Error: mod_netcdf.f90, line 721: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_VARIABLE]
status=nf90_inquire_variable(my_ncid, var_id(i), &
-------------------^
fortcom: Error: mod_netcdf.f90, line 727: This name does not have a type, and must have an explicit type. [NF90_INQ_ATTNAME]
status=nf90_inq_attname(my_ncid, var_id(i), j, &
-----------------------^
fortcom: Error: mod_netcdf.f90, line 815: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_DIMENSION]
status=nf90_inquire_dimension(my_ncid, var_Dids(i), &
---------------------^
fortcom: Error: mod_netcdf.f90, line 831: Keyword arguments are invalid without an explicit interface. [XTYPE]
& xtype = my_Atype, &
------------------------------------------------^
fortcom: Error: mod_netcdf.f90, line 832: Keyword arguments are invalid without an explicit interface. [LEN]
& len = my_Alen)
------------------------------------------------^
fortcom: Error: mod_netcdf.f90, line 829: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_ATTRIBUTE]
status=nf90_inquire_attribute(my_ncid, my_id, &
-------------------------^
fortcom: Error: mod_netcdf.f90, line 834: This name does not have a type, and must have an explicit type. [NF90_INT]
IF (my_Atype.eq.NF90_INT) THEN
------------------------------------^
fortcom: Error: mod_netcdf.f90, line 835: This name does not have a type, and must have an explicit type. [NF90_GET_ATT]
status=nf90_get_att(my_ncid, my_id, &
-----------------------------^
fortcom: Error: mod_netcdf.f90, line 848: This name does not have a type, and must have an explicit type. [NF90_FLOAT]
ELSE IF ((my_Atype.eq.NF90_FLOAT ).or. &
------------------------------------------^
fortcom: Error: mod_netcdf.f90, line 863: This name does not have a type, and must have an explicit type. [NF90_CHAR]
ELSE IF (my_Atype.eq.NF90_CHAR) THEN
-----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 986: This name does not have a type, and must have an explicit type. [NF90_INQ_VARID]
status=nf90_inq_varid(ncid, TRIM(myVarName), VarID)
---------------^
fortcom: Error: mod_netcdf.f90, line 1070: Keyword arguments are invalid without an explicit interface. [NAME]
& name = my_Vname, &
-------------------------------------^
fortcom: Error: mod_netcdf.f90, line 1071: Keyword arguments are invalid without an explicit interface. [NATTS]
& nAtts = my_natts)
-------------------------------------^
fortcom: Error: mod_netcdf.f90, line 1069: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_VARIABLE]
status=nf90_inquire_variable(my_ncid, varid, &
---------------^
fortcom: Severe: Too many errors, exiting
compilation aborted for mod_netcdf.f90 (code 1)
make: *** [Build/mod_netcdf.o] Error 1


Best,
Q
Qianqian@URI

linzhenhua
Posts: 64
Joined: Mon Oct 17, 2005 2:02 am
Location: Institute of Oceanology,Chinese Academy of Sciences

Re: After installation of NetCDF3

#2 Unread post by linzhenhua »

I do not know whether you just install a binary version of netcdf or not.

If this is the case, please compile netcdf from source using the same compiler.

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: After installation of NetCDF3

#3 Unread post by justina0622 »

linzhenhua wrote:I do not know whether you just install a binary version of netcdf or not.

If this is the case, please compile netcdf from source using the same compiler.
Thanks for your reply!
I did compile netcdf from source using the same compiler. So, the problem is really weird. I use a simple model to test NetCDF. It does work.

I remember our ifort is a version of 2007. Could it be the problem?

Thank you.

Best,
Q
Qianqian@URI

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: After installation of NetCDF3

#4 Unread post by kate »

Are you sure it's picking up the right netcdf.mod file? Early, early in the build phase it copies netcdf.mod from somewhere.

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: After installation of NetCDF3

#5 Unread post by justina0622 »

kate wrote:Are you sure it's picking up the right netcdf.mod file? Early, early in the build phase it copies netcdf.mod from somewhere.
Thank you, Kate.


Sorry, I don't get your meaning by 'Early, early in the build phase it copies netcdf.mod from somewhere'. Is there problem in installing netcdf, or, you mean, in the process of running the test? Because of the problems of the cluster, I asked a professional person to install NetCDF. I think maybe it is OK.

And I changed the path in the Linux-ifort.mk in the following way. I think it is what I should change in the test running except for 'FORT ?=ifort', right?

else
NETCDF_INCDIR ?= /usr/local/include
NETCDF_LIBDIR ?= /usr/local/lib
endif

Thank you, :)!

Best,
Q
Qianqian@URI

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: After installation of NetCDF3

#6 Unread post by kate »

It told you the problem:
fortcom: Error: mod_netcdf.f90, line 19: This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read. [NETCDF]
USE netcdf
----------^
You said you had compiled it yourself with the same compiler, but now you say someone else installed it into /usr/local. The compiler is telling you that the /usr/local/include/netcdf.mod that gets copied into your build directory will not work. It might even work for the regular fortran interface and only fail on the f90 interface.

If you compile it you can make sure all the tests run, including the f90 tests.

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: After installation of NetCDF3

#7 Unread post by justina0622 »

kate wrote:It told you the problem:
fortcom: Error: mod_netcdf.f90, line 19: This module file was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read. [NETCDF]
USE netcdf
----------^
You said you had compiled it yourself with the same compiler, but now you say someone else installed it into /usr/local. The compiler is telling you that the /usr/local/include/netcdf.mod that gets copied into your build directory will not work. It might even work for the regular fortran interface and only fail on the f90 interface.

If you compile it you can make sure all the tests run, including the f90 tests.
Sorry, my English is not good enough to make myself clear, I mean the netcdf has been installed(I did not mean by myself, very sorry for the misleading) and I have told him what kind of compiler I will use and he compiled it from the source. So, I can not get what the problem is.

Thank you!

Best,
Q
Qianqian@URI

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: After installation of NetCDF3

#8 Unread post by kate »

I'm saying he didn't use exactly the same compiler. He might have downloaded binaries from the net. It might even be binaries for ifort, but not the same version. You asked if you need to update your ifort. That might solve the problem - or might not, I don't know.

Compiling netcdf yourself with the compiler on hand (updated or not) will solve the problem.

linzhenhua
Posts: 64
Joined: Mon Oct 17, 2005 2:02 am
Location: Institute of Oceanology,Chinese Academy of Sciences

Re: After installation of NetCDF3

#9 Unread post by linzhenhua »

I think the time you spend on compiling netcdf yourself is less than that you need to negotiate with system admin to do it for you. It's really fast and do not require system privilege.

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: After installation of NetCDF3

#10 Unread post by justina0622 »

linzhenhua wrote:I think the time you spend on compiling netcdf yourself is less than that you need to negotiate with system admin to do it for you. It's really fast and do not require system privilege.
I did have spent quite a lot of time in installing netcdf by myself. I know it should be really easy referring to the manual for NetCDF, however, it is really not in our cluster. I asked a lot of persons, even who had a lot of experience in NetCDF and asked help from unidata, still failed. Finally, I turned to professional person. I know it is ridiculous to spend so much time on this.

Thanks all the same. :)

Best,
Q
Qianqian@URI

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: After installation of NetCDF3

#11 Unread post by justina0622 »

kate wrote:Compiling netcdf yourself with the compiler on hand (updated or not) will solve the problem.

I will try. Thanks a lot. :)
Qianqian@URI

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: After installation of NetCDF3

#12 Unread post by justina0622 »

Thanks for all the replies. Problem has been solved.


In the .bashrc file, /opt/intel/fc/9.1.043 should be /opt/intel/fce/9.1.043.

Sorry, it is really a very very silly mistake. Oops.

Best,
Q
Qianqian@URI

wzhu
Posts: 39
Joined: Sun Oct 28, 2012 6:56 pm
Location: Horn Point Laboratory UMCES

Re: After installation of NetCDF3

#13 Unread post by wzhu »

Hi justina0622,
I am now having the same problem, where is the .bashrc file, I only have a .bash file and I can not find the directory in the file.

Wenwu

tony1230
Posts: 87
Joined: Wed Mar 31, 2010 3:29 pm
Location: SKLEC,ECNU,Shanghai,China

Re: After installation of NetCDF3

#14 Unread post by tony1230 »

You can open at any (sub)directory with command vi/emacs ~/.bashrc

Post Reply