alignment Function

public function alignment(n)

Uses

  • proc~~alignment~~UsesGraph proc~alignment alignment module~modglobal modglobal proc~alignment->module~modglobal

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension(3) :: n

Return Value integer


Calls

proc~~alignment~~CallsGraph proc~alignment alignment proc~is_equal is_equal proc~alignment->proc~is_equal

Called by

proc~~alignment~~CalledByGraph proc~alignment alignment proc~initibmwallfun initibmwallfun proc~initibmwallfun->proc~alignment proc~wallfunmom wallfunmom proc~wallfunmom->proc~alignment proc~ibmwallfun ibmwallfun proc~ibmwallfun->proc~wallfunmom proc~initibm initibm proc~initibm->proc~initibmwallfun program~dalesurban DALESURBAN program~dalesurban->proc~ibmwallfun program~dalesurban->proc~initibm

Source Code

   integer function alignment(n)
     ! returns an integer determining whether a unit vector n is aligned with the
     ! coordinates axes.
     use modglobal, only : xhat, yhat, zhat
     implicit none
     real, dimension(3), intent(in) :: n ! must be unit vector

     if     (is_equal(n, xhat)) then
       alignment = 1
     elseif (is_equal(n, yhat)) then
       alignment = 2
     elseif (is_equal(n, zhat)) then
       alignment = 3
     elseif (is_equal(n, -xhat)) then
       alignment = -1
     elseif (is_equal(n, -yhat)) then
       alignment = -2
     elseif (is_equal(n, -zhat)) then
       alignment = -3
     else
       alignment = 0
     end if

   end function alignment