Integer Function aphindex(totaltheta,totalchi,rhopt,thetapt,chipt,reflect) Implicit None !================================================================= ! Function to compute APH vector component indices. ! The function name must be declared as an integer in the routine ! in which it is called. Logical reflect Integer,Intent(IN):: totaltheta,totalchi Integer,Intent(IN):: rhopt,thetapt,chipt ! To pick points in nonreactive channel ( chi=0 to 30 degrees ) IF (.not.reflect) THEN aphindex=totalchi*totaltheta*(rhopt-1)+totalchi*(thetapt-1)+chipt ! To pick points in reactive channel ( chi=30 to 60 degrees ) ELSEIF (reflect) THEN aphindex=totalchi*totaltheta*(rhopt-1)+totalchi*(thetapt-1)+(totalchi-chipt+1) ELSE aphindex=0 PRINT*,'INCORRECT value for argument 6 (logical) in aphindex ' STOP 'aphindex' ENDIF End Function aphindex