- #1
- 3,971
- 328
Hello guys,
As, you probably know by now, I've been trying to run this piece of code for a while now. I finally got it to run and then I realized something very weird is happening!
So in my code, which simulates neutrino evolution, I have made 3 conditional statements in the evolution stage of the code, depending on a parameter that I defined in a module called params.
In my module called params there is a line:
spinco should be a parameter defining if I want to run the simulation with or without a "spin-coherence term" in the Hamiltonian. spinco=0 means no spin-coherence, spinco=1 means majorana type spin-coherence, and spinco=2 means dirac type spin-coherence. (It's not important that you understand what this means, but just that spinco governs what kind of Hamiltonian I'm using).
In my main code there are lines like:
Now, this part of the code is VERY IMPORTANT because this is the part of the code that actually evolves the wave function (the rest of the code is finding the Hamiltonian lol). Here's the weird part. I FORGOT to put the parameter spinco in my params.F90 file (meaning, I did not define it at all, there was no integer,parameter:: spinco line in the params file), and tried to run the code (only realizing I forgot this afterwards). The code ran! I didn't get any errors like "undefined variable 'spinco'" or anything like that! It went through several hundred loops before I stopped it, and the output looked normal! I am so perplexed by this. How can this code run if I didn't declare the parameter spinco?
This question is very important to me because the first "proof of concept" test I am running is to show that my code gives the same output as an unmodified set of code that has none of this "spin coherence" stuff in it if I set spinco=1 and set all the "majorana terms" in the Hamiltonian to 0. If I set all the "majorana terms" to 0, the problem SHOULD reduce to the spinco=0 case and I SHOULD get the same result as the old un-modified code. This should prove that my architecture is valid, and that I can proceed to the next phase.
But since WITHOUT DEFINING spinco AT ALL, the code ran AND seemed to give me the "correct" output, I am now not certain if my modifications to the code is actually doing anything at all...:(
Anyone have any insights into this?
As, you probably know by now, I've been trying to run this piece of code for a while now. I finally got it to run and then I realized something very weird is happening!
So in my code, which simulates neutrino evolution, I have made 3 conditional statements in the evolution stage of the code, depending on a parameter that I defined in a module called params.
In my module called params there is a line:
Code:
integer, parameter::spinco=1
spinco should be a parameter defining if I want to run the simulation with or without a "spin-coherence term" in the Hamiltonian. spinco=0 means no spin-coherence, spinco=1 means majorana type spin-coherence, and spinco=2 means dirac type spin-coherence. (It's not important that you understand what this means, but just that spinco governs what kind of Hamiltonian I'm using).
In my main code there are lines like:
Code:
if(spinco.eq.0) then
XXX
else if(spinco.eq.1) then
XXX
else if(spinco.eq.2) then
XXX
endif
Now, this part of the code is VERY IMPORTANT because this is the part of the code that actually evolves the wave function (the rest of the code is finding the Hamiltonian lol). Here's the weird part. I FORGOT to put the parameter spinco in my params.F90 file (meaning, I did not define it at all, there was no integer,parameter:: spinco line in the params file), and tried to run the code (only realizing I forgot this afterwards). The code ran! I didn't get any errors like "undefined variable 'spinco'" or anything like that! It went through several hundred loops before I stopped it, and the output looked normal! I am so perplexed by this. How can this code run if I didn't declare the parameter spinco?
This question is very important to me because the first "proof of concept" test I am running is to show that my code gives the same output as an unmodified set of code that has none of this "spin coherence" stuff in it if I set spinco=1 and set all the "majorana terms" in the Hamiltonian to 0. If I set all the "majorana terms" to 0, the problem SHOULD reduce to the spinco=0 case and I SHOULD get the same result as the old un-modified code. This should prove that my architecture is valid, and that I can proceed to the next phase.
But since WITHOUT DEFINING spinco AT ALL, the code ran AND seemed to give me the "correct" output, I am now not certain if my modifications to the code is actually doing anything at all...:(
Anyone have any insights into this?