- #1
- 3,971
- 328
Hi guys,
In the code I'm working on there are a few functions that will be used to find a Hamiltonian, which I will then use in later parts of the code to find the time evolution of my system. Right now I have it set up so that the function names are actually the names I want to give the Hamiltonian matrix.
So, for example, I have something like:
Right now, I don't know how to calculate this Hamiltonian so it is an empty function, but it should return an nflavor by nflavor matrix.
Now, if in my main code I declare an array and also call it hspinm and write something like
Will this work? I'm guessing I should name it something different? What I mean with this piece of code is the matrix hspinm should be filled with the elements after calling the function hspinm. Will the compiler get confused on the names, or will the presence of arguments inside the second hspinm statement make it understand that I am calling the function?
Thanks
In the code I'm working on there are a few functions that will be used to find a Hamiltonian, which I will then use in later parts of the code to find the time evolution of my system. Right now I have it set up so that the function names are actually the names I want to give the Hamiltonian matrix.
So, for example, I have something like:
Code:
function hspinm
real(kind=reel8),dimension(nflavor,nflavor) :: hspinm
end function hspinm
Right now, I don't know how to calculate this Hamiltonian so it is an empty function, but it should return an nflavor by nflavor matrix.
Now, if in my main code I declare an array and also call it hspinm and write something like
Code:
program bulb
real(kind=reel8),dimension(nflavor,nflavor)::hspinm
hspinm=hspinm(arguments)
end program bulb
function hspinm
real(kind=reel8),dimension(nflavor,nflavor) :: hspinm
end function hspinm
Will this work? I'm guessing I should name it something different? What I mean with this piece of code is the matrix hspinm should be filled with the elements after calling the function hspinm. Will the compiler get confused on the names, or will the presence of arguments inside the second hspinm statement make it understand that I am calling the function?
Thanks