The first #computer #language I ever learned was #fortran back in grade 11 and then in #university
Well it is back in the TIOBE top 10 at the time this article was published, currently number 11.
The first #computer #language I ever learned was #fortran back in grade 11 and then in #university
Well it is back in the TIOBE top 10 at the time this article was published, currently number 11.
Decided to add a little Easter egg to my hobby project's source code.
My first experience with #chatgpt5.
I queried how to write some #python code to write out unformatted, binary files so my #fortran code could read it.
Proceeds to give me a load of #NumPy code. Completely neglects to mention the #SciPy FortranFile class that can trivially read and write, and appears on the first page of a search.
This is going to be a bumpy ride!
Fortran: I could totally code in this
This is what I'm doing today: https://fortran-lang.org/
Dear fellow Fortran nerds!
Is there an equivalent way to do something like this numpy code without using a loop? Performance is not critical.
term1 = np.sum(
n_pic[:,mask] * charge[None, mask], axis=1
)
I see 2 problems here.
a) broadcasting a 2D array (n,m) with a 1D array (m)
b) the mask= option of Fortran's sum must(??) take an array the same shape as the summed array. Is there any way to say "this 1D mask should apply in the 2nd dimension?"
1/2