c**********************************************************************c
c  Description: Tests picking arguments. Unlike test_picks.for which
c               focuses on basic picking of arguments, this focuses on
c               how different picks of the same argument are handled
c               (i.e. checks the conversions).
c
c  Author:      J. Czechowski IV
c  Version:     $Id: test_args.for,v 1.1 2008/11/14 17:49:27 jxc Exp $
c**********************************************************************c
        program TEST_ARGS
          implicit none
          include 'primitive.inc'
          include 'assert.inc'

          character*(L_Max_ascii) uval1,uval2,uval3
          character*(L_Max_ascii) aval1,aval2,aval3
          real*8                  dval1,      dval3
          real*4                  fval1,      fval3
          integer*4               lval1,      lval3
          integer*2               ival1,      ival3
          integer*1               bval1,      bval3
          character*(L_Max_ascii) str
          integer*4               len
          

          call M$CHECKIN

          call ASSERT_AUTOINIT('DEBUG','STAT')

          uval1 = M$UPICK(1)
          aval1 = M$APICK(1)
          dval1 = M$DPICK(1)
          fval1 = M$FPICK(1)
          lval1 = M$LPICK(1)
          ival1 = M$IPICK(1)
          bval1 = M$BPICK(1)
          
          uval2 = M$UPICK(2)
          aval2 = M$APICK(2)

          uval3 = M$UPICK(3)
          aval3 = M$APICK(3)
          dval3 = M$DPICK(3)
          fval3 = M$FPICK(3)
          lval3 = M$LPICK(3)
          ival3 = M$IPICK(3)
          bval3 = M$BPICK(3)

c          call M$INFO('------------------')
c          call M$INFO(uval1)
c          call M$INFO(aval1)
c          len = M$D2A(dval1,str)
c          call M$INFO(str(1:len))
c          len = M$F2A(fval1,str)
c          call M$INFO(str(1:len))
c          len = M$L2A(lval1,str)
c          call M$INFO(str(1:len))
c          call M$INFO('------------------')          
c          call M$INFO(uval2)
c          call M$INFO(aval2)
c          call M$INFO('------------------')
c          call M$INFO(uval3)
c          call M$INFO(aval3)
c          len = M$D2A(dval3,str)
c          call M$INFO(str(1:len))
c          len = M$F2A(fval3,str)
c          call M$INFO(str(1:len))
c          len = M$L2A(lval3,str)
c          call M$INFO(str(1:len))
          
          call ASSERT('M$UPICK(1)',
     &                (uval1(1:M$LENGTH(uval1)) .eq. 'ABC'))
          call ASSERT('M$APICK(1)',
     &                (aval1(1:M$LENGTH(aval1)) .eq. 'ABC'))
          call ASSERT('M$DPICK(1)', (dval1 .eq. 123d0))
          call ASSERT('M$FPICK(1)', (fval1 .eq. 123e0))
          call ASSERT('M$LPICK(1)', (lval1 .eq. 123))
          call ASSERT('M$IPICK(1)', (ival1 .eq. 123))
          call ASSERT('M$BPICK(1)', (bval1 .eq. 123))
          

          call ASSERT('M$UPICK(2)',
     &                (uval2(1:M$LENGTH(uval2)) .eq. 'XYZ'))
          call ASSERT('M$APICK(2)',
     &                (aval2(1:M$LENGTH(aval2)) .eq. 'XYZ'))
          

          call ASSERT('M$UPICK(3)',
     &                (uval3(1:M$LENGTH(uval3)) .eq. '42'))
          call ASSERT('M$APICK(3)',
     &                (aval3(1:M$LENGTH(aval3)) .eq. '42'))
          call ASSERT('M$DPICK(3)', (dval3 .eq. 42d0))
          call ASSERT('M$FPICK(3)', (fval3 .eq. 42e0))
          call ASSERT('M$LPICK(3)', (lval3 .eq. 42))
          call ASSERT('M$IPICK(3)', (ival3 .eq. 42))
          call ASSERT('M$BPICK(3)', (bval3 .eq. 42))


          call M$SYNC
          call M$RETURN
          call ASSERT_AUTOREPORT()
        end

        include 'assert.for'
