Hi! I compile the little program beneath with 'gfortran -fdefault-integer-8 -fdefault-real-8' command. I get: 'call t1 ( dble(r4)) 1 Error: Type mismatch in argument 'r' at (1); passed REAL(16) to REAL(8) ' Since r4 is a single precision variable the dble should make a real*8 of it, or? The same happens when activating the real*4::r4 declaration in the module. Thanks, Maarten Program, that produces the error: ----------------------------------- module test !real*4 :: r4 contains subroutine t1( r) real*8 :: r print*,' hallo r=',r return end subroutine t1 end module program t use test real*4 :: r4 r4 = 4 call t1 ( dble(r4)) end program -----------------------------------
(In reply to comment #0) > Hi! > > I compile the little program beneath with > 'gfortran -fdefault-integer-8 -fdefault-real-8' command. > > I get: > 'call t1 ( dble(r4)) > 1 > Error: Type mismatch in argument 'r' at (1); passed REAL(16) to REAL(8) ' > > Since r4 is a single precision variable the dble should make a real*8 of it, > or? The error message says 'r' not 'r4'. The 'r' here comes from the explicit interface for t1, which has a declaration of real*8. So, if you read the documentation that comes with your compiler, you see that 'r' has been promoted to real*16. `-fdefault-double-8' Set the `DOUBLE PRECISION' type to an 8 byte wide type. If `-fdefault-real-8' is given, `DOUBLE PRECISION' would instead be promoted to 16 bytes if possible, and `-fdefault-double-8' can be used to prevent this. You probably meant to use -freal-4-real-8. I recommend using none of these options and actually writing properly ported code.