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

: 20040727: udunits installation on Redhat linux



Bai xuezhi,

>Date: Tue, 27 Jul 2004 09:56:28 +0800
>From: Bai xuezhi <address@hidden>
>Organization: Institute of Oceanology, Chinese Academy of Sciences
>To: Steve Emmerson <address@hidden>
>Subject: Re: 20040726: udunits installation on Redhat linux
> Keywords: 200407230327.i6N3R5aW001217

The above message contained the following:

> As you say, I set the environment variable CPPFLAGS=-Df2cFortran and
> installed the package successfully. Thank you very much.
> However, when I compiled a fortran programe named readgeneral.f to read
> NCEP data, four severe erros appeared as following:
> 
> PGF90-S-0021-Label field of continuation line is not blank
> (/usr/local/udunits/include/udunits.inc: 27)
> PGF90-S-0021-Label field of continuation line is not blank
> (/usr/local/udunits/include/udunits.inc: 28)
> PGF90-S-0021-Label field of continuation line is not blank
> (/usr/local/udunits/include/udunits.inc: 29)
> PGF90-S-0034-Syntax error at or near end of line
> (/usr/local/udunits/include/udunits.inc: 37)
> 
> The four lines in udunits.inc are:
> #ifndef PTR !! line 27
> # define PTR integer !! 28
> # endif !!29
> PTR utmake !!37

The utmake(3f) function returns a pointer to a unit object in memory.
Because Fortran-77 doesn't have pointers, it is necessary to store the
pointer value in a Fortran variable of the right primitive type.  The
include-file "udunits.inc" is designed to make this easier by defining
the C macro PTR to be the right type.  Unfortunately, this means that
any Fortran code that includes "udunits.inc" must be processed by the C
pre-processor, which might not occur automatically or correctly.

If you ensure that the pointer values are stored in Fortran variables of
the right type, then you can remove the include of "udunits.inc" without
any problems.

> If I deleted the above four lines in udunits.inc, the programe will be
> compiled successfully, but I do not know whether or not the deletion
> will affect the udunits' functions.

The functions will be unaffected by this action.

> It would be very thankful if you give me a solution.
> 
> Attached please find udunits.inc and readgeneral.f.
> 
> 
> Best Regards
> 
> 
> Bai Xuezhi

Regards,
Steve Emmerson