We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8f7ff2 commit bda3460Copy full SHA for bda3460
standard/intent.f90
@@ -0,0 +1,41 @@
1
+module demo
2
+
3
+implicit none
4
5
+contains
6
7
+subroutine abc()
8
9
+real, allocatable :: a(:)
10
11
+allocate(a(1:4))
12
+call out(a)
13
14
+print *,a
15
+if (.not. allocated(a)) error stop 'should have allocated'
16
17
+end subroutine abc
18
19
20
+subroutine out(a)
21
22
+real, intent(out) :: a(0:4)
23
24
25
+a=[2,3,4,5,6]
26
27
28
+end subroutine out
29
30
+end module demo
31
32
+program intent
33
+!! explore issues that can arrive over misusing argument intent
34
+!! Fortran 2003 brought auto-allocation (see array/auto_allocate.f90)
35
+!! https://wg5-fortran.org/N1351-N1400/N1379.pdf
36
37
+use demo, only : abc
38
39
+call abc()
40
41
+end program
0 commit comments