Re: [netcdfgroup] problems installing NetCDF on Ubuntu Linux 10.10

Hello
could it be that you are nevertheless be just missing an include in the compile:

f95 -O $F90FLAGS -B$NETCDF_ROOT dataread_batch.f95 -L /usr/local/lib -l netcdf  
-I/usr/local/include $LINK_F90

NB this is meant to be a capital -I not a lower case -l:   -I/usr/local/include
this is where your netcdf.mod should live.

Cheers,
Joerg

--
Jörg Kaduk
Lecturer
Department of Geography         J.Kaduk@xxxxxxxxxxxxxxx
University of Leicester         joerg@xxxxxxxxxxxxxxxxxxx
UK - Leicester LE1 7RH          Tel: + 44 (0)116 2523848
http://www.le.ac.uk/geography/staff/academic_kaduk.html

From: netcdfgroup-bounces@xxxxxxxxxxxxxxxx 
[mailto:netcdfgroup-bounces@xxxxxxxxxxxxxxxx] On Behalf Of David La Puma
Sent: 05 May 2011 16:42
To: Subject: [netcdfgroup] problems installing NetCDF on Ubuntu Linux 10.10

First of all, I apologize in advance for the abundance of code I'm pasting 
here. i'm new to Fortran.

I'm running into some issues with a custom piece of software that has to access 
the NetCDF module. The program was originally built on a Sun Unix server using 
the Solstudio C Compiler (cc) and Fortran 95 compiler (f95). I have tried to 
use both these compilers, and the Gnu equivalents (gcc and gfortran's g95) to 
build NetCDF on my machine and have run into a few problems (and as a result, 
the program doesn't seem to be able to find or read the NETCDF.mod file).

I will try and provide some background here.

For the Gnu version, I built ZLIB, then MDF5 (--with-zlib --include-fortran 
--include-cxx) and then NetCDF (--with-mdf5 and --with-zlib). Everything in the 
make check looks good for each installation. Still, when I try and run my 
program which includes the following python code:


def legacy_netcdf2ascii(self):
    #------netcdf2ascii------------------------
    #Loop through daily netcdf folders for the season

    iofs = {'filelist': os.path.join(self.curdir.get(), 'netcdf_filelist.txt'),
            'runoutput': os.path.join(self.curdir.get(), 
'dataread_runoutput.txt'),
            'aout': os.path.join(self.curdir.get(), 'a.out')}

    for io in iofs:
        if os.path.isfile(iofs[io]):
            os.remove(iofs[io])

    # call fortran
    f95n = "f95 -O $F90FLAGS -B$NETCDF_ROOT" \
         +"dataread_batch.f95 " \
         +"-L /usr/local/lib -l netcdf " \
         +"$LINK_F90 "

    os.system(f95n)

//--snip--//

and the dataread_batch.95 code:

PROGRAM AWESOME
  USE netcdf
  IMPLICIT NONE

//--snip--//

I get these errors:

USE netcdf
      ^
"dataread_batch.f95", Line = 13, Column = 7: ERROR: "NETCDF" is specified as 
the module name on a USE statement, but the compiler cannot find it.

      status = nf90_open(path=TRIM(inpath)//'
/'//TRIM(ncfilename),mode=nf90_nowrite,ncid=ncid)
               ^
"dataread_batch.f95", Line = 86, Column = 16: ERROR: IMPLICIT NONE is specified 
in the local scope, therefore an explicit type must be specified for function 
"NF90_OPEN".
                             ^
"dataread_batch.f95", Line = 86, Column = 30: ERROR: An actual argument keyword 
is being used when an explicit interface is not known.
                                                                      ^
"dataread_batch.f95", Line = 86, Column = 71: ERROR: An actual argument keyword 
is being used when an explicit interface is not known.
                                                                       ^
"dataread_batch.f95", Line = 86, Column = 72: ERROR: IMPLICIT NONE is specified 
in the local scope, therefore an explicit type must be specified for data 
object "NF90_NOWRITE".
                                                                                
        ^
"dataread_batch.f95", Line = 86, Column = 89: ERROR: An actual argument keyword 
is being used when an explicit interface is not known.

      if (status /= nf90_noerr) WRITE(6,*)'open error = ', 
TRIM(nf90_strerror(status))
                    ^
"dataread_batch.f95", Line = 87, Column = 21: ERROR: IMPLICIT NONE is specified 
in the local scope, therefore an explicit type must be specified for data 
object "NF90_NOERR".
                                                                ^
"dataread_batch.f95", Line = 87, Column = 65: ERROR: IMPLICIT NONE is specified 
in the local scope, therefore an explicit type must be specified for function 
"NF90_STRERROR".

      status = nf90_inq_dimid(ncid, "scanR", scanR_ID)
               ^
"dataread_batch.f95", Line = 90, Column = 16: ERROR: IMPLICIT NONE is specified 
in the local scope, therefore an explicit type must be specified for function 
"NF90_INQ_DIMID".

      status = nf90_inquire_dimension(ncid, scanR_ID, len = scanR)
               ^
"dataread_batch.f95", Line = 98, Column = 16: ERROR: IMPLICIT NONE is specified 
in the local scope, therefore an explicit type must be specified for function 
"NF90_INQUIRE_DIMENSION".
                                                          ^
"dataread_batch.f95", Line = 98, Column = 59: ERROR: An actual argument keyword 
is being used when an explicit interface is not known.

      status = nf90_inquire_dimension(ncid, gateR_ID, len = gateR)
                                                          ^
"dataread_batch.f95", Line = 100, Column = 59: ERROR: An actual argument 
keyword is being used when an explicit interface is not known.

      status = nf90_inquire_dimension(ncid, radR_ID, len = radialR)
                                                         ^
"dataread_batch.f95", Line = 102, Column = 58: ERROR: An actual argument 
keyword is being used when an explicit interface is not known.

      status = nf90_inq_varid(ncid, "Reflectivity",reflect_ID)
               ^
"dataread_batch.f95", Line = 110, Column = 16: ERROR: IMPLICIT NONE is 
specified in the local scope, therefore an explicit type must be specified for 
function "NF90_INQ_VARID".

      status = nf90_get_att(ncid, nf90_global, "time_coverage_start", baseT)
               ^
"dataread_batch.f95", Line = 122, Column = 16: ERROR: IMPLICIT NONE is 
specified in the local scope, therefore an explicit type must be specified for 
function "NF90_GET_ATT".
                                  ^
"dataread_batch.f95", Line = 122, Column = 35: ERROR: IMPLICIT NONE is 
specified in the local scope, therefore an explicit type must be specified for 
data object "NF90_GLOBAL".

      status = nf90_get_var(ncid, reflect_Id, ref)
               ^
"dataread_batch.f95", Line = 126, Column = 16: ERROR: IMPLICIT NONE is 
specified in the local scope, therefore an explicit type must be specified for 
function "NF90_GET_VAR".

      status = nf90_close(ncid)
               ^
"dataread_batch.f95", Line = 262, Column = 16: ERROR: IMPLICIT NONE is 
specified in the local scope, therefore an explicit type must be specified for 
function "NF90_CLOSE".

f90comp: 276 SOURCE LINES
f90comp: 18 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 0 ANSI
/home/woodcreeper/birdprog/Data/DOX/ascii/2008/20080820
sh: ./a.out: not found
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
    return self.func(*args)
  File "BIRDS_gui.py", line 344, in output
    a= self.legacycallback()
  File "BIRDS_gui.py", line 356, in legacycallback
    i.legacy_netcdf2ascii(self)
  File "/home/woodcreeper/birdprog/input_class.py", line 87, in 
legacy_netcdf2ascii
    os.chmod(iofs['runoutput'], 0775)
OSError: [Errno 2] No such file or directory: 
'/home/woodcreeper/birdprog/dataread_runoutput.txt'

-----

I have the correct paths pointing to the netcdf.mod file- so that shouldn't be 
a problem. I'm wondering, though, where I can tell if the netcdf.mod file was 
compiled correctly by viewing its contents.
Here is a bit of it:

------------------

G95 module created on Thu Apr 28 15:41:30 2011 from netcdf4.f90
If you edit this, you'll get what you deserve.
module-version 9
(() () () () () () () () () () () () () () () () () () () () ())

()

(('nf90_def_var' 2 3 4) ('nf90_get_att' 5 6 7 8 9 10 11 12 13 14 15 16
17) ('nf90_get_var' 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 72 73) ('nf90_put_att' 74 75 76
77 78 79 80 81 82 83 84 85 86) ('nf90_put_var' 87 88 89 90 91 92 93 94
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
132 133 134 135 136 137 138 139 140 141 142))

()

()

(143 'nf90_64bit_offset' 'netcdf' 1 ((PARAMETER UNKNOWN UNKNOWN UNKNOWN
NONE NONE) (INTEGER 4) 0 0 () (CONSTANT (INTEGER 4) 0 '512') () () '' ()
())
144 'nf90_abort' 'netcdf' 1 ((PROCEDURE UNKNOWN MODULE-PROC DECL NONE
NONE FUNCTION) (INTEGER 4) 0 0 (145 NONE) () () '' () ())
146 'nf90_align_chunk' 'netcdf' 1 ((PARAMETER UNKNOWN UNKNOWN UNKNOWN
NONE NONE) (INTEGER 4) 0 0 () (CONSTANT (INTEGER 4) 0 '-1') () () '' ()
())
147 'nf90_byte' 'netcdf' 1 ((PARAMETER UNKNOWN UNKNOWN UNKNOWN NONE NONE)
(INTEGER 4) 0 0 () (CONSTANT (INTEGER 4) 0 '1') () () '' () ())
148 'nf90_char' 'netcdf' 1 ((PARAMETER UNKNOWN UNKNOWN UNKNOWN NONE NONE)
(INTEGER 4) 0 0 () (CONSTANT (INTEGER 4) 0 '2') () () '' () ())

-------------------------------


  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: