c                                            
c     initialize miscellaneous constants
c                      
      data rt,lf / 1,2 /
      data first,second / 1,2 /
      data x,y,z,cntr,rx,ry,rz / 1,2,3,4,4,5,6 /
      data fx,fy,fz,mx,my,mz / 1,2,3,4,5,6 /
      data fem,aam,iem,mlf,apf,cdf / 1,2,3,4,5,6 /
      data vx,vy,vz,wx,wy,wz / 1,2,3,4,5,6 /
      data distal,proximal / 1,2 /
      data flex,abad,inex / 1,2,3 /
      data DisttoProx,ProxtoDist / 1,2 /      
      data FULL_ANL,UPR_ANL,TDP_ANL,CKC_ANL,HH_ANL,MAX_ANL 
     &     / 1,2,3,4,5,21 /
      data CC_ANL,CCR_ANL,CCL_ANL,CKC_NMA_ANL / 6,7,8,9 /
      data F3DR_ANL,F3DL_ANL,STUP_ANL,STDN_ANL / 10,11,12,13 /
      data STRUP_ANL,STLUP_ANL,STRDN_ANL,STLDN_ANL / 14,15,16,17 /
      data MIR_ANL,MIL_ANL,MAYO_ANL / 18,19,20 /
      data GCS_CS,LCS_CS,PRO_CS,DIS_CS,JCS_CS,EUL_CS / 1,2,3,4,5,6 /     
      data ANLNames /'Full Body Gait OSU  ','Upper Extermity OSU ',
     &               'Time Distance Params','Closed Kinetic Chain',
     &               'Helen Hayes Full    ','Cleveland Clinic    ',
     &               'CC Right Alignment  ','CC Left Alignment   ',
     &               'CKC No Medial Ankle ',
     &               'Foot 3d Right       ','Foot 3d Left        ',
     &               'Stairs Both Sides Up','Stairs Both Sides Dn',
     &               'Stairs Right Side Up','Stairs Left Side Up ',
     &               'Stairs Right Side Dn','Stairs Left Side Dn ',
     &               'Mayo Right Alignment','Mayo Left Alignment ',
     &               'Mayo Marker Set     ',
     &               'Unknown Analysis    '  /
c                
c     initialize segment constants
c
      data rtft,rtcf,rtth / 1,2,3 /
      data lfft,lfcf,lfth / 4,5,6 /
      data pelv,trnk,head / 7,8,13 /
      data rtua,rtla,rthd / 9,10,14 /
      data lfua,lfla,lfhd / 11,12,15 /
c                                     
c     initialize joint constants
c                      
c                   
c     initialize joint names    
c
      data rtak,rtkn,rthp /  1, 2, 3 /
      data lfak,lfkn,lfhp /  4, 5, 6 /
      data pvlb,pvtk,neck /  7, 8,13 /
      data rtwr,rtel,rtsh / 14, 9,10 /
      data lfwr,lfel,lfsh / 15,11,12 /       

c
c     Initialize the signs of the JCS angles and translations.  Also applies
c     to the signs of the moments and forces, respectively, when they are
c     expressed in the JCS Coord System
c
      data AngleSignJCS / -1, 1, 1,  1, 1, 1,  -1, 1, 1,  ! rtak rtkn rthp
     &                    -1,-1,-1,  1,-1,-1,  -1,-1,-1,  ! lfak lfkn lfhp
     &                     1, 1, 1,  1, 1, 1,             ! pvlb pvtk
     &                    -1, 1, 1, -1, 1, 1,             ! rtsh rtel
     &                    -1,-1,-1, -1,-1,-1,             ! lfsh lfel
     &                     1, 1, 1, -1, 1, 1, -1, -1, -1 /! neck rtwr lfwr
      data TransSignJCS /  1, 1, 1,  1, 1, 1,   1, 1, 1,  ! rtak rtkn rthp
     &                    -1, 1, 1, -1, 1, 1,  -1, 1, 1,  ! lfak lfkn lfhp
     &                    -1, 1, 1, -1, 1, 1,             ! pvlb pvtk
     &                     1, 1, 1,  1, 1, 1,             ! rtsh rtel
     &                    -1, 1, 1, -1, 1, 1,             ! lfsh lfel
     &                    -1, 1, 1,  1, 1, 1, -1,  1,  1 /! neck rtwr lfwr
c             
c     Initialize force plate size and location constants
c       This information should really be contained in a parameter
c       file that could be easily modified for different systems.
c
      data PltSize / 0.464 , 0.514, ! width, length (m) plate 1
     &               0.464 , 0.514,                   ! plate 2
     &               0.464 , 0.514,                   ! plate 3
     &               0.0   , 0.0    /                 ! plate 4
                                 
      data PltLoc /  0.0,  1.0,  0.0,     ! plate 1     rotation matrix
     &               1.0,  0.0,  0.0,     ! orientation is transposed here
     &               0.0,  0.0, -1.0,
     &              -0.876,0.0,  0.0,     ! position
c     
     &               0.0,  1.0,  0.0,     ! plate 2 
     &               1.0,  0.0,  0.0,     ! orientation
     &               0.0,  0.0, -1.0,
     &              -0.257,0.0,  0.0,     ! position
c      
     &               0.0, -1.0,  0.0,     ! plate 3 
     &              -1.0,  0.0,  0.0,     ! orientation
     &               0.0,  0.0, -1.0,
     &               0.257,0.0, -0.0,     ! position
c
     &               0.0,  0.0,  0.0,     ! plate 4
     &               0.0,  0.0,  0.0,     ! orientation
     &               0.0,  0.0,  0.0,
     &               0.0,  0.0,  0.0   /  ! position
c
c     Initialize force plate calibration matrices.  Note that due
c     to the way in which the data is read in with a data statement
c     the matrices below are transposed relative to their normal
c     representation.
c
c     These are Ohio State's force plates- see read_ads_file for Mayo's force
c     plate calibration coefficients.
c
c     These matrices were calculated on November 3, 1989 by Dwight Meglan
c     as the result of a thorough calibration and checking of the force
c     plates.  These matrices include the amp gains and bridge excitation
c     voltage, whereas those supplied by AMTI do not.  All channels of the 
c     amps were set to 4000x except the fz of plates 2 and 3 which were set to
c     1000x.  Also, the bridge voltage was set to a nominal 10v.  Note the 
c     matrix contents are given in transposed order because of the fortran
c     convention of filling the first dimension the fastest.
c
c plate 1
       Data CalMatrix / 699.56,   4.75,  -9.19,   0.49,  14.89,   1.30,
     &                   -9.56, 674.02, -13.90, -14.13,   0.06,   1.67,
     &                   -7.92,  -6.18,1233.92, -10.69,  -8.18,   1.41,
     &                    5.88,  19.94, -31.60, 195.48,   3.17,  -0.62,
     &                   -9.56,   3.38,  -0.24,  -2.28, 181.92,  -0.06,
     &                   -1.14,   3.64,   1.29,  -1.40,  -1.25,  75.77,
c plate 2
     &                   77.22,  -0.17,  -0.89,   0.10,   2.81,   0.12,
     &                    0.25,  74.99,  -0.98,  -2.60,   0.05,  -0.03,
     &                   -0.49,  -5.04, 577.39,  -0.59,   0.28,   0.17,
     &                   -0.11,   0.93,  -0.68,  38.83,  -0.19,  -0.05,
     &                    0.54,  -0.25,  -0.21,   0.28,  38.61,  -0.06,
     &                   -0.49,  -0.32,  -0.16,   0.07,  -0.04,  19.00,
c plate 3
     &                   80.10,   0.24,  -0.16,   0.07,   2.85,  -0.05,
     &                    0.52,  76.04,   0.18,  -2.81,   0.04,   0.12,
     &                   -0.52,  -6.31, 591.28,  -0.62,  -0.42,   0.27,
     &                    0.14,   1.05,  -0.96,  39.42,   0.16,  -0.09,
     &                    0.25,  -0.72,  -0.79,   0.29,  39.30,   0.10,
     &                   -0.08,  -0.39,  -0.88,   0.08,  -0.05,  19.31,
c
     &                    0.0,    0.0,    0.0,    0.0,    0.0,    0.0,
     &                    0.0,    0.0,    0.0,    0.0,    0.0,    0.0,
     &                    0.0,    0.0,    0.0,    0.0,    0.0,    0.0,
     &                    0.0,    0.0,    0.0,    0.0,    0.0,    0.0,
     &                    0.0,    0.0,    0.0,    0.0,    0.0,    0.0,  
     &                    0.0,    0.0,    0.0,    0.0,    0.0,    0.0 /
c
c     Amp Gains - Needed to use the above calibration matrices
c     Gains are in units of uV/V excitation - 10**6uV/Gain/10V
c     where individual amp gains are 1000, 2000, or 4000
c
      data OldAmpGain / 100., 100., 100., 100., 100., 100., ! plate 1
     &                  25.0, 25.0, 50.0, 25.0, 25.0, 25.0, ! plate 2
     &                  25.0, 25.0, 50.0, 25.0, 100., 100., ! plate 3
     &                  25.0, 25.0, 50.0, 25.0, 25.0, 25.0 /! junk

      data NewAmpGain / 100., 100., 100., 100., 100., 100., ! plate 1
     &                  25.0, 25.0, 50.0, 25.0, 25.0, 25.0, ! plate 2
     &                  25.0, 25.0, 50.0, 25.0, 25.0, 25.0, ! plate 3
     &                  25.0, 25.0, 50.0, 25.0, 25.0, 25.0 /! junk
c
c     Initialize the names of the various quantities stored in the
c     ANZ format files.  These are used to display the current status
c     of the file reading process.
c
      data AnzVarName  / 'General Parameters  ',  'Motion Parameters   ',
     &                   'Force Parameters    ',  'Gait Parameters     ',

     &                   'Marker Position GCS ',  'Marker Position LCS ',
     &                   'InterMarker Distance',

     &                   'Segment Parameters  ',  'Segment Position    ',
     &                   'Segment Velocity GCS',  'Segment Accel GCS   ',
     &                   'Segment Velocity LCS',  'Segment Accel LCS   ',
     &                   'Segment Kinetic Enr ',  'Segment Potential En',
     &                   'Segment Total Energy',  'Body Kinetic Energy ',
     &                   'Body Potential Enrgy',  'Body Total Energy   ',
     &                   'Segment Finite Screw',  'Body Center of Mass ',
     &                   'Segment Momentum    ',  'Body Momentum       ',
     &                   'Segment Angle GCS   ',
                                                                  
     &                   'Force Plate GRL Data',  'Force Data Validity ',
     &                   'Foot-Floor Contact  ',  'Ind Foot GRL Data   ',
     &                   'Combined Plate GRL  ',  'Foot Center Pressure',
     &                   'Combined Plate CP   ',  'Foot Cntr Pres LCS  ',
     &                   'Foot Strike Index   ',  'Ind Foot GRL Wrench ',
     &                   'Combined GRL Wrench ',  'Ind Ft GRL Integral ',
     &                   'Comb GRL Integral   ',  'Plate Cntr Pressure ',
     &                   'Plate GRL Wrench    ',  'Plate GRL Integral  ',

     &                   'Joint Angle JCS     ',  'Joint Velocity JCS  ',
     &                   'Joint Accel JCS     ',  'Joint Axes JCS      ',
     &                   'Joint Angle Euler   ',  'Joint Velocity Euler',
     &                   'Joint Accel Euler   ',  'Joint Axes Euler    ',
     &                   'Joint Load Validity ',  'Joint Load Calc Type',
     &                   'Joint Load GCS      ',  'Joint Load JCS      ',
     &                   'Joint Load Dist LCS ',  'Joint Load Prox LCS ',
     &                   'Joint Leg Load JCS  ',  'Joint Leg Load GCS  ',
     &                   'Joint Load Wrench   ',  'Joint Power Transfer',
     &                   'Joint Leg Power     ',  'Joint Finite Screw  ',

     &                   'Avg Segment Position',  'Avg Joint Angle JCS ',
     &                   'Avg Joint Angle EUL ',

     &                   'Rec Foot Load LCS   ',  'Rec Foot Load GCS   ',
     &                   'Rec Ft Cntr Pres LCS',  'Rec Ft Cntr Pres GCS',
     &                   'Rec Combined GRL    ',  'Rec Combined CP     ',
     &                   'Rec Ft Strike Index ',

     &                   'EMG Parameters      ',  'EMG Data            ',
     &                   'Seg Instant Screw   ',  'Joint Instant Screw ',
     &                   'Plate GRL Validity  ',  'Comb GRL Validity   ',
     &                   'Foot GRL in LCS     ',  'Joint Trans GCS     ',
     &                   'Joint Trans JCS     ',  'Joint Trans Prox LCS',
     &                   'Joint Trans Dist LCS',
     &                   'Jnt Screw Ang JCS   ',  'Jnt Fsc Ang Prox LCS',
     &                   'Jnt Fsc Ang Dist LCS',
     &                   'Pitch Moment Arm Pnt',  'Pitch Moment Arm Trk',
     &                   'Pitch Moment Arm Plv',  'Pitch Moment Arm GCS',
     &                   'Pitch Wrench Arm Pnt',  'Pitch Wrench Arm Trk',
     &                   'Pitch Wrench Arm Plv',  'Pitch Wrench Arm GCS',
     &                   'Jnt Mom Arm Prox LCS',  'Jnt Mom Arm Dist LCS',
     &                   'Joint Moment Arm GCS',
     &                   'Jnt Wre Arm Prox LCS',  'Jnt Wre Arm Dist LCS',
     &                   'Joint Wrench Arm GCS',
     &                   'Marker Velocity     ',  'Marker Acceleration ',
     &                   'Ind Ft GRL Integral2',  'Comb GRL Integral2  ',
     &                   'Plate GRL Integral2 ',  'Ft GRL CP Velocity  ',
     &                   'Seg Pos Correct Trfm',  'Jnt Ang Correct Trfm',
     &                   'Calculation Flags   ',  'Body CM Velocity    ',
     &                   'Command History     ',
     &                   'Segment/Joint Info  ',
     &                   'Joint Ext Load GCS  ',  'Joint Ext Load JCS  ',
     &                   'Joint Ext Load Pro  ',  'Joint Ext Load Dis  ',
     &                   'JRL Angle GCS       ',  'JRL Angle Proximal  ',
     &                   'JRL Angle Distal    ',                      
     &                   'Joint GRL Dist GCS  ',
     &                   'Joint GRL Dist Prox ',  'Joint GRL Dist Dist ',
     &                   'Jnt Mechanical Work ',  'Leg Mechanical Work ',
     &                   'Body Mechanical Work',
     &                   'Dynam Jnt Center GCS',  'Dynam Jnt Cntr Prox ',
     &                   'Dynam Jnt Cntr Dist ',
     &                   'Avg Jnt Cntr Prox   ',  'Avg Jnt Cntr Dist   '/
c
c     Set the version letter for the ANZ file
c 
c     'c' - Added rigid body calculation capabilities 10/92
c     'd' - Added storage of segment and joint names/connectivity 1/93
c
      data ANZFileVersion / 'e' /
                                                                 
