*FILE MEMBER=CALC_EXPRESSION LIBRARY=SNOMAN LANGUAGE=FORTRAN77 DATE=25:Sep:1995 <<< SUBROUTINE CALC_EXPRESSION * Diagnostic Aid: Calculate some simple vector expressions. * Contact: N. West, Oxford. * Verified: * Refereed: * Parameters:- * ========== * See individual entry points. * Common Block Access:- * =================== * (ignoring internal and environmental access) * None. * Specification:- * ============= * o Use this routine via an interactive debugger to perform a set of * simple vector operations. See individual entry points for details. * Program Notes:- * ============= * This routine does not form part of the SNOMAN production code but * it can be called from the debugger so long as the routine has been linked. * Revision History:- * ================ * 2.06 N. West First version. * 2.08 N. West Code tidy-up. IMPLICIT NONE * Argument Declarations:- * ===================== real vp1(3), vp2(3), sp1 * Local Variable Declarations:- * =========================== * These can be used as a local work space. integer i_s real v(3) , v1(3) , v2(3) , v3(3) , + s , s1 , s2 , s3 , + vdot , vdist equivalence ( i_s , s ) save data s1 , s2 , s3 / 3*0. /, + v1 , v2 , v3 / 9*0. / <<< entry calc_diff( vp1 , vp2 ) * **************************** v(1) = vp1(1) - vp2(1) v(2) = vp1(2) - vp2(2) v(3) = vp1(3) - vp2(3) print * , v return <<< entry calc_dist( vp1 , vp2 ) * **************************** s = vdist( vp1 , vp2 , 3 ) print * , s return <<< entry calc_dot( vp1 , vp2 ) * **************************** s = vdot( vp1 , vp2 , 3 ) print * , s return <<< entry calc_mag( vp1 ) * ********************** s = sqrt( vdot( vp1 , vp1 , 3 ) ) print * , s return <<< entry calc_shift( vp1 , sp1 , vp2 ) * ************************************ v(1) = vp1(1) + sp1 * vp2(1) v(2) = vp1(2) + sp1 * vp2(2) v(3) = vp1(3) + sp1 * vp2(3) print * , v return <<< entry calc_show * **************** print * , 's1 = ' , s1 print * , 's2 = ' , s2 print * , 's3 = ' , s3 print * , 'v1 = ' , v1 print * , 'v2 = ' , v2 print * , 'v3 = ' , v3 end *ENDFILE MEMBER=CALC_EXPRESSION