xref: /OpenGrok/opengrok-indexer/src/test/resources/sources/fortran/hello.f90 (revision 2bcacabbe843448903326d34ff21a265b5f37596)
1!
2! CDDL HEADER START
3!
4! The contents of this file are subject to the terms of the
5! Common Development and Distribution License (the "License").
6! You may not use this file except in compliance with the License.
7!
8! See LICENSE.txt included in this distribution for the specific
9! language governing permissions and limitations under the License.
10!
11! When distributing Covered Code, include this CDDL HEADER in each
12! file and include the License file at LICENSE.txt.
13! If applicable, add the following below this CDDL HEADER, with the
14! fields enclosed by brackets "[]" replaced with your own identifying
15! information: Portions Copyright [yyyy] [name of copyright owner]
16!
17! CDDL HEADER END
18!
19PROGRAM hello
20!
21! This is a comment
22!
23
24  REAL, PARAMETER :: start = 0.0
25  REAL, PARAMETER :: end = 12.0
26  REAL count, incr ! In line comment
27
28  count = start
29  incr = 2.0
30  DO WHILE  (count .lt. end)
31    CALL say_hello( 'World' )
32    IF (count /= 8) THEN
33      WRITE(*, fmt="(F8.0)") count
34    END IF
35    count = count + incr
36  END DO
37
38  CONTAINS
39
40  SUBROUTINE say_hello(who)
41    CHARACTER(LEN=*), INTENT(in) :: who
42
43    PRINT *, 'Hello ', who
44  END SUBROUTINE say_hello
45
46END PROGRAM hello
47