Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1 @@
XMULTF(X,Y)=X*Y

View file

@ -0,0 +1 @@
MULTF(I,J)=I*J

View file

@ -0,0 +1,4 @@
FUNCTION MULTIPLY(X,Y)
REAL MULTIPLY, X, Y
MULTIPLY = X * Y
END

View file

@ -0,0 +1,4 @@
FUNCTION MULTINT(X,Y)
INTEGER MULTINT, X, Y
MULTINT = X * Y
END

View file

@ -0,0 +1,8 @@
module elemFunc
contains
elemental function multiply(x, y)
real, intent(in) :: x, y
real :: multiply
multiply = x * y
end function multiply
end module elemFunc

View file

@ -0,0 +1,10 @@
program funcDemo
use elemFunc
real :: a = 20.0, b = 30.0, c
real, dimension(5) :: x = (/ 1.0, 2.0, 3.0, 4.0, 5.0 /), y = (/ 32.0, 16.0, 8.0, 4.0, 2.0 /), z
c = multiply(a,b) ! works with either function definition above
z = multiply(x,y) ! element-wise invocation only works with elemental function
end program funcDemo

View file

@ -0,0 +1,2 @@
c = multiply(y=b, x=a) ! the same as multiply(a, b)
z = multiply(y=x, x=y) ! the same as multiply(y, x)

View file

@ -0,0 +1,8 @@
module elemFunc
contains
elemental function multiply(x, y) result(z)
real, intent(in) :: x, y
real :: z
z = x * y
end function multiply
end module elemFunc