It is very simple query but I\'m not able to find the exact solution. How to break to new line when printing in Fortran?
for example
print*,\'This i
There are a number of ways to manage what you want. We can either print blank records or explicitly add a newline character.
A newline character is returned by the intrinsic function NEW_LINE:
print '(2A)', 'First line', NEW_LINE('a')
print '(A)', 'Second line'
NEW_LINE('a') is likely to have an effect like ACHAR(10) or CHAR(10,KIND('a')).
A blank record can be printed by having no output item:
print '(A)', 'First line'
print '(A)'
print '(A)', 'Second line'
Or we can use slash editing:
print '(A,/)', 'First line'
print '(A)', 'Second line'
If we aren't using multiple print statements we can even combine the writing using these same ideas. Such as:
print '(A,:/)', 'First line', 'Second line'
print '(*(A))', 'First line', NEW_LINE('a'), NEW_LINE('a'), 'Second line'
NEW_LINE('a') could also be used in the format string but this doesn't seem to add much value beyond slash editing.