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

[UDUNITS #QKV-165487]: udunits 1.12.4 bus error



Yolande,

> I cannot find any FORTRAN documentation on #define that uses it in
> quite the way it is used in udunits.inc. The only way I've seen it
> used is for example,
> 
> #define VAR 1
> 
> to define VAR with a specific value. I'm wondering if this is just
> not standard FORTRAN?

C preprocessor directives like "#define VAR 1" are definitely not
standard Fortran: they are directives to the C preprocessor which
the Fortran compiler uses on it's input files before compiling them.

> I tried compiling the code with gfortran
> instead of g77 and got the same error:
> 
> [cassava:~/code2/quikscatjpl] serra% gfortran -ffixed-line-length-132
> -I/sw/include -I/usr/local/hdf4/include qscat3_tropics.f
> read_qscat3_subprg.f handle_err.f get_time.f -L/usr/local/hdf4/lib -
> lmfhdf -ldf -L/sw/lib -lnetcdf -ludunits -ljpeg -lsz -lz -lm -o
> qscat3_tropics
> Warning: udunits.inc:25: Illegal preprocessor directive
> udunits.inc:33.6:
> Included at qscat3_tropics.f:7:
> 
> UD_POINTER utmake
> 1
> Error: Unclassifiable statement at (1)
> [cassava:~/code2/quikscatjpl] serra%
> 
> In this case gfortran also complains about line 25.

I suspect that the file "qscat3_tropics.f" uses directives like

include 'udunits.inc'

rather than directives like

#include "udunits.inc"

The former might be valid g77(1) but it is not standard Fortran
because there is no standard Fortran for including header-files.
The best that can be done is to use C preprocessor directives
instead of any Fortran "include" statements.

Try changing the directives to the C-form and see what happens.

Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: QKV-165487
Department: Support UDUNITS
Priority: Normal
Status: On Hold


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.