Hi guys,(adsbygoogle = window.adsbygoogle || []).push({});

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.Code (Text):

function hspinm

real(kind=reel8),dimension(nflavor,nflavor) :: hspinm

end function hspinm

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?Code (Text):

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

Thanks

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# [Fortran] Functions and naming conventions

Loading...

Similar Threads for Fortran Functions naming |
---|

Fortran Successive Over Relaxation Method in FORTRAN |

If statement for Monte Carlo integration |

C/++/# How to use C++ in studying calculus |

Fortran How to buy Fortran Programming Software Commersial License |

Fortran Fortran external functions vs subroutines |

**Physics Forums | Science Articles, Homework Help, Discussion**