Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
module arrCallback
|
||||
contains
|
||||
elemental function cube( x )
|
||||
implicit none
|
||||
real :: cube
|
||||
real, intent(in) :: x
|
||||
cube = x * x * x
|
||||
end function cube
|
||||
end module arrCallback
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
program testAC
|
||||
use arrCallback
|
||||
implicit none
|
||||
integer :: i, j
|
||||
real, dimension(3,4) :: b, &
|
||||
a = reshape( (/ ((10 * i + j, i = 1, 3), j = 1, 4) /), (/ 3,4 /) )
|
||||
|
||||
do i = 1, 3
|
||||
write(*,*) a(i,:)
|
||||
end do
|
||||
|
||||
b = cube( a ) ! Applies CUBE to every member of a,
|
||||
! and stores each result in the equivalent element of b
|
||||
do i = 1, 3
|
||||
write(*,*) b(i,:)
|
||||
end do
|
||||
end program testAC
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
program test
|
||||
C
|
||||
C-- Declare array:
|
||||
integer a(5)
|
||||
C
|
||||
C-- Fill it with Data
|
||||
data a /45,22,67,87,98/
|
||||
C
|
||||
C-- Do something with all elements (in this case: print their squares)
|
||||
do i=1,5
|
||||
print *,a(i)*a(i)
|
||||
end do
|
||||
C
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue