-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample0.f90
More file actions
51 lines (34 loc) · 982 Bytes
/
Example0.f90
File metadata and controls
51 lines (34 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
! ***************************************************
! OpenMP tutorial
! J. E. Drut
! University of North Carolina
! Chapel Hill
!
! CAP-REU program, July 2015
!
! Example 0: Basic syntax and tools of Fortran 90;
! First foray into OpenMP.
! ***************************************************
PROGRAM Example0
! Some libraries that we will use are declared next
USE defs
USE omp_lib
! Always use the following line to avoid implicit declarations!
IMPLICIT NONE
! Here are some variable declarations
INTEGER :: i,j,k
REAL(DP) :: x,y,z
CHARACTER(50) :: filename
LOGICAL(LGT) :: TrueFalse
! Printing stuff out to the screen
PRINT*, 'This will appear on the screen'
! A most basic loop
DO i = 1, 100
print*, 'I should not be doing this so many times', i
END DO
! First steps into OpenMP…
! Get the maximum possible number of threads
print*, OMP_GET_MAX_THREADS()
! Set the number of available threads by hand
!CALL OMP_SET_NUM_THREADS(N_thread)
END PROGRAM