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

[netCDF #XLB-294114]: error in opening netcdf.mod when compiling f90 file

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [netCDF #XLB-294114]: error in opening netcdf.mod when compiling f90 file
  • Date: Thu, 12 Nov 2009 07:52:45 -0700

> Full Name: Wan Fang
> Email Address: address@hidden
> Organization: Nanyang Technological University
> Package Version:
> Operating System:
> Hardware:
> Description of problem:
> 
> I'm try to compile the example netcdf program file Fortran 90:
> pres_temp_4D_rd.f90 from your website after generated pres_temp_4D.nc.
> 
> fortcom: Error: pres_temp_4D_rd.f90, line 19: Error in opening the compiled 
> module file.  Check INCLUDE paths.   [NETCDF]
> use netcdf
> ------^
> fortcom: Error: pres_temp_4D_rd.f90, line 79: This name does not have a type, 
> and must have an explicit type.   [NF90_OPEN]
> call check( nf90_open(FILE_NAME, nf90_nowrite, ncid) )
> --------------^
> fortcom: Error: pres_temp_4D_rd.f90, line 82: This name does not have a type, 
> and must have an explicit type.   [NF90_INQ_VARID]
> call check( nf90_inq_varid(ncid, LAT_NAME, lat_varid) )
> --------------^
> fortcom: Error: pres_temp_4D_rd.f90, line 86: This name does not have a type, 
> and must have an explicit type.   [NF90_GET_VAR]
> call check( nf90_get_var(ncid, lat_varid, lats) )
> --------------^
> fortcom: Error: pres_temp_4D_rd.f90, line 129: This name does not have a 
> type, and must have an explicit type.   [NF90_CLOSE]
> call check( nf90_close(ncid) )
> --------------^
> fortcom: Error: pres_temp_4D_rd.f90, line 138: This name does not have a 
> type, and must have an explicit type.   [NF90_NOERR]
> if(status /= nf90_noerr) then
> -----------------^
> fortcom: Error: pres_temp_4D_rd.f90, line 139: This name does not have a 
> type, and must have an explicit type.   [NF90_STRERROR]
> print *, trim(nf90_strerror(status))
> --------------------^
> fortcom: Error: pres_temp_4D_rd.f90, line 139: The data types of the 
> argument(s) are invalid.   [TRIM]
> print *, trim(nf90_strerror(status))
> --------------------^
> compilation aborted for pres_temp_4D_rd.f90 (code 1)
> 
> 
> 

Howdy Wan Fang!

Are you still having this problem?

Looks like you need to add a -I option to your fortran build command to tell 
the fortran compiler where to find the netCDF library that you installed.

See your fortran documentation for more information.

Thanks,

Ed

Ticket Details
===================
Ticket ID: XLB-294114
Department: Support netCDF
Priority: Critical
Status: Closed