From: Piter_ on
Hi all.
I have no experience in fortran at all.
But I need to compile one program :-(
I use debian squeese.
After some googling I tried this command line with following output.
Can anybody tell me what is the problem?


petro(a)cica:~/bin/CDpro/SRC$ fort77 -o cdsstr CDsstr_unix.f
MAIN:
bvpro3:
bvpro4:
rndm:
svd:
ran3:
cdinit:
Error on line 1558: impossible conversion
fctrl:
segment:
message:
plot:
ymax:
ymin:
rms_nrm:
/usr/bin/fort77: aborting compilation



If I go to line 1558 in emacs it contains this:

Code: Select all
If(Iprint.EQ.1)Print='PRNT'


the full source code is here.
http://web.archive.org/web/20070322090321/http://lamar.colostate.edu/~sreeram/CDPro/CDsstr_unix.f
Thanks in advance.
Petro
From: Tobias Burnus on
Hi Piter,

On 05/10/2010 06:26 PM, Piter_ wrote:
> I use debian squeese.

I would suggest to use the gfortran compiler.


> petro(a)cica:~/bin/CDpro/SRC$ fort77 -o cdsstr CDsstr_unix.f
> cdinit:
> Error on line 1558: impossible conversion
> /usr/bin/fort77: aborting compilation


If I use the gfortran compiler, it shows the following errors:


CDsstr_unix.f:1558.29:

If(Iprint.EQ.1)Print='PRNT'
1
Error: Can't convert CHARACTER(1) to REAL(4) at (1)
CDsstr_unix.f:1985.19:

facx= float(wavef-wavei)/60.0
1
Error: 'a' argument of 'float' intrinsic at (1) must be INTEGER



The first one is a non-standard use of Hollerith constants; I think the
quickest way to get it compiling it to use:

If(Iprint.EQ.1) Print = transfer('PRNT',print)


For the second one: FLOAT converts integers to real (to floating point
numbers) but wavef/wavei are already implicitly typed real. The simplest
is to simply remove "float":

facx= (wavef-wavei)/60.0


That should be all what's needed to get it compile. No guarantee that
the program is then doing what you want it to do ;-)


Tobias
From: Bruce Bowler on
On Mon, 10 May 2010 18:54:02 +0200, Tobias Burnus set fingers to keyboard
and typed:

> Hi Piter,
>
> On 05/10/2010 06:26 PM, Piter_ wrote:
>> I use debian squeese.
>
> I would suggest to use the gfortran compiler.

second that suggestion...

> The first one is a non-standard use of Hollerith constants; I think the
> quickest way to get it compiling it to use:
>
> If(Iprint.EQ.1) Print = transfer('PRNT',print)

Actually, I don't think "print" is used anywhere else in the code (at
least that I can see), so the quickest way might be to comment out the
line :-)

Bruce
From: Piter_ on
Thanks a lot.
It worked.
I will have to compare output from windows program and this one.
But its compiled :-)
Best regards.
Petro


On May 10, 6:54 pm, Tobias Burnus <bur...(a)net-b.de> wrote:
> Hi Piter,
>
> On 05/10/2010 06:26 PM, Piter_ wrote:
>
> > I use debian squeese.
>
> I would suggest to use the gfortran compiler.
>
> >     petro(a)cica:~/bin/CDpro/SRC$ fort77 -o cdsstr CDsstr_unix.f
> >        cdinit:
> >     Error on line 1558: impossible conversion
> >     /usr/bin/fort77: aborting compilation
>
> If I use the gfortran compiler, it shows the following errors:
>
> CDsstr_unix.f:1558.29:
>
>         If(Iprint.EQ.1)Print='PRNT'
>                              1
> Error: Can't convert CHARACTER(1) to REAL(4) at (1)
> CDsstr_unix.f:1985.19:
>
>       facx=  float(wavef-wavei)/60.0
>                    1
> Error: 'a' argument of 'float' intrinsic at (1) must be INTEGER
>
> The first one is a non-standard use of Hollerith constants; I think the
> quickest way to get it compiling it to use:
>
>         If(Iprint.EQ.1) Print = transfer('PRNT',print)
>
> For the second one: FLOAT converts integers to real (to floating point
> numbers) but wavef/wavei are already implicitly typed real. The simplest
> is to simply remove "float":
>
>       facx=  (wavef-wavei)/60.0
>
> That should be all what's needed to get it compile. No guarantee that
> the program is then doing what you want it to do ;-)
>
> Tobias

From: Uno on
Tobias Burnus wrote:

> If I use the gfortran compiler, it shows the following errors:
>
>
> CDsstr_unix.f:1558.29:
>
> If(Iprint.EQ.1)Print='PRNT'
> 1
> Error: Can't convert CHARACTER(1) to REAL(4) at (1)
> CDsstr_unix.f:1985.19:
>
> facx= float(wavef-wavei)/60.0
> 1
> Error: 'a' argument of 'float' intrinsic at (1) must be INTEGER
>
>
>
> The first one is a non-standard use of Hollerith constants; I think the
> quickest way to get it compiling it to use:
>
> If(Iprint.EQ.1) Print = transfer('PRNT',print)

I can't imagine the circumstance when a person would have to work around
a hollerith constant. If I read the wiki correctly, it would have been
deprecated by the time f77 rolled along:

http://en.wikipedia.org/wiki/Hollerith_constant

Apparently, Hollerith is the guy who came up with punchcards:

http://en.wikipedia.org/wiki/Herman_Hollerith
--
Uno