I am using Gfortran 4.4.3 on Ubuntu 10.04 operating system.
Can someone explain why the following code works correctly (a):-
program testpresent
real :: a,b,c
call test_present(a,b,c)
contains
subroutine test_present(x1,x2,x3,x4,x5,x6)
real, intent(inout), optional :: x1,x2,x3,x4,x5,x6
write(6,*) present(x1),present(x2),present(x3),present(x4),pr esent(x5),present(x6)
return
end subroutine test_present
end program
works correctly (T T T F F F) while (b):-
program testpresent
real :: a,b,c
call test_present(a,b,c)
end program
subroutine test_present(x1,x2,x3,x4,x5,x6)
real, intent(inout), optional :: x1,x2,x3,x4,x5,x6
write(6,*) present(x1),present(x2),present(x3),present(x4),pr esent(x5),present(x6)
end subroutine test_present
does not. There is nothing in the documentation that says (b) is wrong, and it compiles without error messages.
Any advice would be much appreciated.
Can someone explain why the following code works correctly (a):-
program testpresent
real :: a,b,c
call test_present(a,b,c)
contains
subroutine test_present(x1,x2,x3,x4,x5,x6)
real, intent(inout), optional :: x1,x2,x3,x4,x5,x6
write(6,*) present(x1),present(x2),present(x3),present(x4),pr esent(x5),present(x6)
return
end subroutine test_present
end program
works correctly (T T T F F F) while (b):-
program testpresent
real :: a,b,c
call test_present(a,b,c)
end program
subroutine test_present(x1,x2,x3,x4,x5,x6)
real, intent(inout), optional :: x1,x2,x3,x4,x5,x6
write(6,*) present(x1),present(x2),present(x3),present(x4),pr esent(x5),present(x6)
end subroutine test_present
does not. There is nothing in the documentation that says (b) is wrong, and it compiles without error messages.
Any advice would be much appreciated.