designer wrote:I'll look for the PURE and ELEMENTAL designations but if you have the time, could you please point me in the direction to look for them.
There's a simple writeup of elemental functions here. Essentially, the function accepts and returns a scalar value, but, since it is marked elemental, you can just pass an array to the function, and the function will be called on each element of said array, returning another array where every value is the return value from the function for its corresponding input element.
For example, we can write a trivial elemental function that doubles a number:
elemental function double_it(x)
implicit none
real::double_it
real, intent(in)::x
double_it = 2.0*x
end function double_it
Now, in our calling routine, we could have this:
real, dimension(4)::x
real, dimension(4)::doubled_x
x = (/ 1.0, 2.0, 3.0, 4.0 /)
doubled_x = double_it(x)
print *, doubled_x
The output would be:
2.00000000 4.00000000 6.00000000 8.00000000
Even though my function only accepts a scalar, the elemental modifier means that it will call it for each and every array element if I pass it an array.
designer wrote:Before this last update, for another problem, you had me change a compiler setting from Native to Generic. I don't see that compiler setting (Native vs Generic) in the latest Apple Silcone release (Version 3.41, Build 4440).
We removed the option entirely since Apple decided to change how it reports the name of their chips, which wasn't compatible with our compiler at this time. You shouldn't need to access that option any longer. I believe the latest build also disables the option when creating the makefile as a safety precaution.
Jeff Armstrong
Approximatrix, LLC