Due to some restriction on my assignment, F77 is used. I am learning to use subroutine but I encounter error when trying to write string out.
PROGRAM test
IMPLICIT NONE
INTEGER a
CHARACTER*20 STR,str1
STR = 'Hello world'
a = 1
WRITE (*,*) a
WRITE (*,10) STR
CALL TEST(str1)
STOP
END
SUBROUTINE test(str2)
CHARACTER*20 str2
str2 = 'testing'
WRITE (*,10) STR2
RETURN
END
When trying to compile this code, it returns that 'Error: missing statement number 10'
Also, I have some other questions:
What does the
*20
mean inCHARACTER*20 STR
? Is this the size of the string?How about
10
inWRITE (*,10) STR
? Is this the length of string to be written?what does
(*,*)
mean in WRITE(*,*) a