Try to compare different types in old fortran

Viewed 147

I'm using gfortran 7 (Ubuntu) to compile an old fortran code.

I'm facing the follow error:

MYOLDCODE.f90:864:13:

         if  (star (i) .eq. ' '   .and.&
             1
Error: Operands of comparison operator â.eq.â at (1) are REAL(4)/CHARACTER(1)

I think I'm trying to compare a real number to a blank space char. I don't know why the original coder do this. He dead in 90's so I can only ask him when I go to same place he is now, but then it will be too late. Here are the code:

DO I = 1,KJ

    ( some code )

    WRITE(impre,7100,IOSTAT=IERRO) I,STAR(I),A2(I),B2(I),A3(I),AMPL(I),&
        &CIA(I),SITU(I),A4(I),A5(I),CIF(I)
    if  (star (i) .eq. ' '   .and.& 
        &    ampl (i) .ne. 1.E20 .and.& 
        &    ampl (i) .ge. 0.5   .and.& 
        &    situ (i) .ne. 1.E20 )  then
            write (15,7777) a2(i), b2(i), a3(i), ampl(i), situ(i)
    end if
    7777    format (a3,a4,f11.7,f8.2,f8.2)
end do
7100 FORMAT (t25,I3,2X,A1,A3,A4,2X,F11.7,6(2X,F8.2) )

How can I compare star (i) .eq. ' ' ?

I know nothing about fortran so please ask if you need more code/information

0 Answers
Related