Peptid
- 4
- 0
Hi all,
I am trying to run a long FORTRAN 77 code in my laptop. Document contains a makefile and it is instructed to use 'make pgi' command to compile. Beside many warnings, each time I enter that command, it returns me ' Return type mismatch of function 'cmod' at (1) (REAL(4)/REAL(8))
analsubs.f90:766.13'
The relevant part of the code is:
REAL*8 FUNCTION ERREV(NN,QR,QI,MS,MP,ARE,MRE)
REAL*8 QI(NN), QR(NN),MS,MP,ARE,MRE,E
E =CMOD(QR(1),QI(1))*MRE/(ARE+MRE)
DO 10 I=1,NN
E = E*MS+CMOD(QR(I),QI(I))
10 CONTINUE
ERREV = E*(ARE+MRE)-MP*MRE
END FUNCTION errev
and part for 'cmod' is:
REAL*8 FUNCTION CMOD(R,I)
REAL*8 R,I,AR,AI,DABS,DSQRT
AR = DABS(R)
AI = DABS(I)
IF (AR .GE. AI) GO TO 10
CMOD = AI*DSQRT(1.0D0+(AR/AI)**2)
RETURN
10 IF (AR .LE. AI) GO TO 20
CMOD = AR*DSQRT(1.0D0+(AI/AR)**2)
RETURN
20 CMOD = AR*DSQRT(2.0D0)
END FUNCTION cmod
I don't understand the reason of the error since I believe that both AR and AI in cmod are defined in type REAL*8. Is there anyone who has an idea about it?
Thanks in advance,
Batu
I am trying to run a long FORTRAN 77 code in my laptop. Document contains a makefile and it is instructed to use 'make pgi' command to compile. Beside many warnings, each time I enter that command, it returns me ' Return type mismatch of function 'cmod' at (1) (REAL(4)/REAL(8))
analsubs.f90:766.13'
The relevant part of the code is:
REAL*8 FUNCTION ERREV(NN,QR,QI,MS,MP,ARE,MRE)
REAL*8 QI(NN), QR(NN),MS,MP,ARE,MRE,E
E =CMOD(QR(1),QI(1))*MRE/(ARE+MRE)
DO 10 I=1,NN
E = E*MS+CMOD(QR(I),QI(I))
10 CONTINUE
ERREV = E*(ARE+MRE)-MP*MRE
END FUNCTION errev
and part for 'cmod' is:
REAL*8 FUNCTION CMOD(R,I)
REAL*8 R,I,AR,AI,DABS,DSQRT
AR = DABS(R)
AI = DABS(I)
IF (AR .GE. AI) GO TO 10
CMOD = AI*DSQRT(1.0D0+(AR/AI)**2)
RETURN
10 IF (AR .LE. AI) GO TO 20
CMOD = AR*DSQRT(1.0D0+(AI/AR)**2)
RETURN
20 CMOD = AR*DSQRT(2.0D0)
END FUNCTION cmod
I don't understand the reason of the error since I believe that both AR and AI in cmod are defined in type REAL*8. Is there anyone who has an idea about it?
Thanks in advance,
Batu