- #1
- 3,971
- 328
Hello all,
There is a subroutine in the code I'm working on that looks like this:
So there are some inputs psib, psie, etc., which are arrays as declared in the subroutine. However, when the code goes to call this subroutine, the call command looks like this:
All the iegy, jcos, etc. are integer counters for nested do-loops.
This seems that they passed one single complex number psi(1,1,iegy,jcos,iphi,ibeg) into a slot in the subroutine designated for a matrix psib which is an nflavor by nflavor (2-d) matrix.
Can anyone guess what's going on? I would have assumed that the correct way to pass the matrix into the subroutine would be to use something like psi( :,:,iegy,jcos,iphi,ibeg) so that it's passing the first 2 slots into the 2 dimensional array psib.
There is a subroutine in the code I'm working on that looks like this:
Code:
subroutine onestep(iter,iegy,icos,jcos,iphi,rinit,rfin, &
& v2,v2bar,hel,helbar,drdis, &
& psib,psie,psibarb,psibare,err)
use params
use helectron
use angles
use neutrinodist
use parallel
implicit real(kind=reel8) (a-h,o-z)
integer,intent(in) :: iegy,icos,jcos
real(kind=reel16),intent(in) :: rinit,rfin
real(kind=reel16),dimension(ncosth),intent(in) :: drdis
real(kind=reel8),dimension(nflavor,nflavor,negy,nphi),intent(IN) :: hel,helbar
complex(kind=reel8),dimension(nflavor,nflavor,ncosth),intent(in)::v2,v2bar
complex(kind=reel8),dimension(nflavor,nflavor) :: v,exphel,vbar,exphbarel
complex(kind=reel8),dimension(nflavor,nflavor):: psib,psie,psibarb,psibare
complex(kind=reel8),dimension(nflavor):: psio,psibaro
complex(kind=reel8) :: ph1,ph2,csldr
real(kind=reel8) :: xl,xldr,xli
real(kind=reel8) :: cldr,sldr,xbs,xas
real(kind=reel8),intent(out),dimension(nflavor,2) :: err
real(kind=reel8) :: xa,xb,xc
complex(kind=reel8) :: hnow(nflavor,nflavor)
etc.
So there are some inputs psib, psie, etc., which are arrays as declared in the subroutine. However, when the code goes to call this subroutine, the call command looks like this:
Code:
call onestep(iter,iegy,icos,jcos,iphi,rinit,rfin,v2,v2bar,hel,helbar,drdis, &
& psi(1,1,iegy,jcos,iphi,ibeg), &
& psi(1,1,iegy,jcos,iphi,iend), &
& psibar(1,1,iegy,jcos,iphi,ibeg), &
& psibar(1,1,iegy,jcos,iphi,iend), &
& err(1,1,iegy,jcos,iphi))
This seems that they passed one single complex number psi(1,1,iegy,jcos,iphi,ibeg) into a slot in the subroutine designated for a matrix psib which is an nflavor by nflavor (2-d) matrix.
Can anyone guess what's going on? I would have assumed that the correct way to pass the matrix into the subroutine would be to use something like psi( :,:,iegy,jcos,iphi,ibeg) so that it's passing the first 2 slots into the 2 dimensional array psib.