| program testoptional |
| interface |
| subroutine testsub(*,B,*,A,D,C,E,F) |
| integer, optional :: C |
| integer, optional :: E |
| end subroutine |
| end interface |
| |
| call testsub(200,2,200,1,4,3,5,6) |
| |
| call testsub(200,2,200,1,D=4,F=3) |
| |
| 200 print *, "hello, world!" |
| end program testoptional |
| |
| subroutine testsub(*,B,*,A,D,C,E,F) !<<<<< 16,1,16,5,2,1,3,0,5,4,6,7,pass |
| integer, optional :: C |
| integer, optional :: E |
| end subroutine |
| |
| subroutine testsub2 |
| interface |
| subroutine testsub(*,B,*,A,D,C,E,F) |
| integer, optional :: C |
| integer, optional :: E |
| end subroutine |
| end interface |
| |
| call testsub(300,2,300,1,D=20,C=5,E=30,F=2) |
| |
| 300 print *, "world, hello!!" |
| |
| end subroutine |