mirror of
https://github.com/cs01/gdbgui
synced 2024-11-17 07:48:57 +01:00
Fix makefile, add simple fortran program (#93)
* Add simple fortran program to examples * Fix makefile bug
This commit is contained in:
parent
fa509618fb
commit
79b01e701e
2 changed files with 33 additions and 1 deletions
28
examples/fortran_array.f90
Normal file
28
examples/fortran_array.f90
Normal file
|
@ -0,0 +1,28 @@
|
|||
program array
|
||||
integer, parameter :: n=3
|
||||
integer :: ii
|
||||
real, dimension(n) :: a, b
|
||||
real, dimension(n,n) :: c
|
||||
|
||||
a = [( real(ii), ii=1, n )]
|
||||
|
||||
do ii = 1,n
|
||||
print *, a(ii)
|
||||
enddo
|
||||
|
||||
b = 0.
|
||||
do ii = 1, n
|
||||
! You could just write b = a ** 2., but I want to see the loop progress
|
||||
b(ii) = a(ii) ** 2.
|
||||
enddo
|
||||
|
||||
do ii = 1, n
|
||||
print *, b(ii)
|
||||
enddo
|
||||
|
||||
c = reshape( [( real(ii), ii=1,n**2 )], [n,n] )
|
||||
do ii = 1, n
|
||||
print *, c(ii,:)
|
||||
enddo
|
||||
|
||||
end program
|
|
@ -24,5 +24,9 @@ tree: tree.c
|
|||
|
||||
linked_list: linked_list.cpp
|
||||
g++ linked_list.cpp -o linked_list_cpp.a -std=c++11 -g
|
||||
../gdbgui/backend.py linked_list.a
|
||||
../gdbgui/backend.py linked_list_cpp.a
|
||||
|
||||
fortran: fortran_array.f90
|
||||
gfortran fortran_array.f90 -o fortran_array.a -g
|
||||
../gdbgui/backend.py fortran_array.a
|
||||
|
||||
|
|
Loading…
Reference in a new issue