c***********************  problem name: message ************************
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine a1xy(x,y,u,ux,uy,rl,itag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            character(len=80) :: su
            common /val0/k0,ku,kx,ky,kl,kuu,kux,kuy,kul,
     +          kxu,kxx,kxy,kxl,kyu,kyx,kyy,kyl,klu,klx,kly,kll
            common /atest2/iu(100),a1x,a1y,a1u,a2x,a2y,a2u,
     +          bux,buy,cu0,cu1,ru(90),su(100)
cy
        values(k0)=a1x*ux+a1y*uy+a1u*u
        values(ku)=a1u
        values(kx)=a1x
        values(ky)=a1y
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine a2xy(x,y,u,ux,uy,rl,itag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            character(len=80) :: su
            common /val0/k0,ku,kx,ky,kl,kuu,kux,kuy,kul,
     +          kxu,kxx,kxy,kxl,kyu,kyx,kyy,kyl,klu,klx,kly,kll
            common /atest2/iu(100),a1x,a1y,a1u,a2x,a2y,a2u,
     +          bux,buy,cu0,cu1,ru(90),su(100)
cy
        values(k0)=a2x*ux+a2y*uy+a2u*u
        values(ku)=a2u
        values(kx)=a2x
        values(ky)=a2y
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine fxy(x,y,u,ux,uy,rl,itag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            character(len=80) :: su
            common /val0/k0,ku,kx,ky,kl,kuu,kux,kuy,kul,
     +          kxu,kxx,kxy,kxl,kyu,kyx,kyy,kyl,klu,klx,kly,kll
            common /atest2/iu(100),a1x,a1y,a1u,a2x,a2y,a2u,
     +          bux,buy,cu0,cu1,ru(90),su(100)
cy
        values(k0)= - bux*ux - buy*uy - cu0 - cu1*u
        values(ku)= - cu1
        values(kx) = - bux
        values(ky) = - buy
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine gnxy(x,y,u,rl,itag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            common /val1/k0,ku,kl,kuu,kul,klu,kll
cy
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine gdxy(x,y,rl,itag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            common /val2/k0,kl,kll,klb,kub,kic,kim,kil
cy
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine p1xy(x,y,u,ux,uy,rl,itag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            common /val0/k0,ku,kx,ky,kl,kuu,kux,kuy,kul,
     +          kxu,kxx,kxy,kxl,kyu,kyx,kyy,kyl,klu,klx,kly,kll
cy
        values(k0)=1.0e0_rknd
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine p2xy(x,y,dx,dy,u,ux,uy,rl,itag,jtag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            common /val0/k0,ku,kx,ky,kl,kuu,kux,kuy,kul,
     +          kxu,kxx,kxy,kxl,kyu,kyx,kyy,kyl,klu,klx,kly,kll
cy
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine qxy(x,y,u,ux,uy,rl,itag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            common /val3/kf,kf1,kf2,kad
cy
        s=x**2+y**2
        values(kf)=real(itag,rknd)
        values(kad)=s
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine sxy(rl,s,itag,values)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            real(kind=rknd), dimension(*) :: values
            common /val4/jx,jy,jxs,jys,jxl,jyl,jxss,jyss,jxll,jyll,
     +          jxsl,jysl,jxls,jyls
cy
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine usrcmd(vx,vy,sf,itnode,ibndry,ip,rp,sp,iu,ru,su)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            integer(kind=iknd), dimension(5,*) :: itnode
            integer(kind=iknd), dimension(7,*) :: ibndry
            integer(kind=iknd), dimension(100) :: ip,iu
            integer(kind=iknd), save :: len
            real(kind=rknd), dimension(*) :: vx,vy
            real(kind=rknd), dimension(2,*) :: sf
            real(kind=rknd), dimension(100) :: rp,ru
            character(len=80), dimension(100) :: sp,su
            character(len=80), save, dimension(50) :: file
            character(len=80), dimension(10) :: ln
cy
            data len/20/
            data (file(i),i=  1, 10)/
     +      'n i= 1,n=a1x,   a=x1,t=r',
     1      'n i= 2,n=a1y,   a=y1,t=r',
     2      'n i= 3,n=a1u,   a=u1,t=r',
     3      'n i= 4,n=a2x,   a=x2,t=r',
     4      'n i= 5,n=a2y,   a=y2,t=r',
     5      'n i= 6,n=a2u,   a=u2,t=r',
     6      'n i= 7,n=bux,   a=bx,t=r',
     7      'n i= 8,n=buy,   a=by,t=r',
     8      'n i= 9,n=cu0,   a=c0,t=r',
     9      'n i=10,n=cu1,   a=c1,t=r'/
            data (file(i),i= 11, 20)/
     +      'n i= 1,n=line0, a=l0,t=l',
     1      'n i= 2,n=line1, a=l1,t=l',
     2      'n i= 3,n=line2, a=l2,t=l',
     3      'n i= 4,n=line3, a=l3,t=l',
     4      'n i= 5,n=line4, a=l4,t=l',
     5      'n i= 6,n=line5, a=l5,t=l',
     6      'n i= 7,n=line6, a=l6,t=l',
     7      'n i= 8,n=line7, a=l7,t=l',
     8      'n i= 9,n=line8, a=l8,t=l',
     9      'n i=10,n=line9, a=l9,t=l'/
c
        do j=1,10
            ln(j)=su(j)
        enddo
c
        call usrset(file,len,iu,ru,su)
c
        do j=1,10
            if(ln(j)/=su(j)) ip(41)=-1
        enddo
c
        ispd=ip(8)
        a1x=ru(1)
        a1y=ru(2)
        a1u=ru(3)
        a2x=ru(4)
        a2y=ru(5)
        a2u=ru(6)
        bux=ru(7)
        buy=ru(8)
        cu0=ru(9)
        cu1=ru(10)
        if(ispd==1) then
            if((a1y/=a2x).or.(a1u/=0.0e0_rknd).or.
     +      (a2u/=0.0e0_rknd).or.(bux/=0.0e0_rknd).or.
     1      (buy/=0.0e0_rknd)) ip(8)=0
        else
            if((a1y==a2x).and.(a1u==0.0e0_rknd).and.
     +      (a2u==0.0e0_rknd).and.(bux==0.0e0_rknd).and.
     1      (buy==0.0e0_rknd)) ip(8)=1
        endif
        if(ispd/=ip(8)) ip(5)=max(ip(5),1)
c
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine gdata(vx,vy,sf,itnode,ibndry,ip,rp,sp,iu,ru,su,sxy)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            integer(kind=iknd), dimension(5,*) :: itnode
            integer(kind=iknd), dimension(7,*) :: ibndry
            integer(kind=iknd), dimension(100) :: ip,iu,ichr,mark,jchr
            integer(kind=iknd), save, dimension(4000) :: ix,iy
            integer(kind=iknd), save, dimension(100) :: width,nseg
            integer(kind=iknd), save, dimension(101) :: iptr
            integer(kind=iknd), dimension(10) :: iwid,iright,ileft,inum
            integer(kind=iknd), dimension(128) :: map
            integer(kind=iknd), save :: iprob,iymin,iymax,numc,ifirst
            real(kind=rknd), dimension(*) :: vx,vy
            real(kind=rknd), dimension(2,*) :: sf
            real(kind=rknd), dimension(100) :: rp,ru
            real(kind=rknd), save :: hmax,grade
            character(len=80), dimension(100) :: sp,su
            character(len=80), dimension(10) :: line
cy
            external sxy
            data hmax,grade/500.0e0_rknd,1.5e0_rknd/
            data iprob,ifirst/1,1/
c
            data (ix(i), i=   1, 120)/
     +         0,  78, 102, 228, 208, 123, 169, 260, 339, 213, 130,   0,
     1        75,  75, 165, 180, 190, 200, 202, 206, 208, 206, 202, 195,
     2       185, 165,  85,  85, 165, 180, 190, 200, 210, 216, 218, 220,
     3       220, 218, 213, 205, 195, 185, 165,  85,  85, 180, 210, 230,
     4       245, 260, 271, 280, 287, 290, 293, 290, 285, 278, 272, 260,
     5       248, 232, 250, 270, 277, 281, 278, 269, 258, 242, 230, 215,
     6       200, 175,   0,   0,   3,   8,  14,  22,  30,  38,  46,  54,
     7        64,  74,  84,  99, 114, 129, 159, 189, 214, 229, 249, 264,
     8       279, 291, 301, 309, 315, 321, 247, 241, 232, 224, 214, 199,
     9       189, 169, 149, 129, 119, 106,  94,  86,  79,  75,  79,  86/
            data (ix(i), i= 121, 240)/
     +        94, 106, 119, 129, 149, 169, 189, 199, 214, 224, 232, 241,
     1       247, 321, 315, 309, 301, 291, 279, 264, 249, 229, 214, 189,
     2       159, 129, 114,  99,  84,  74,  64,  54,  46,  38,  30,  22,
     3        14,   8,   3,   0,  76,  76, 152, 173, 183, 193, 203, 212,
     4       219, 223, 226, 227, 226, 223, 219, 212, 203, 193, 183, 173,
     5       152,  86,  86, 158, 188, 213, 233, 248, 257, 269, 278, 285,
     6       291, 296, 300, 303, 300, 296, 291, 285, 278, 269, 257, 248,
     7       233, 213, 188, 158,   0,   0, 274, 274,  76,  76, 250, 250,
     8        76,  76, 264, 264,   0,   0,  75,  75, 233, 233,  75,  75,
     9       256, 256,   0,   0,   3,   8,  14,  22,  30,  38,  46,  54/
            data (ix(i), i= 241, 360)/
     +        64,  74,  84,  99, 114, 129, 159, 189, 214, 229, 244, 264,
     1       279, 288, 334, 334, 187, 187, 272, 267, 259, 252, 235, 220,
     2       214, 189, 169, 149, 129, 119, 106,  94,  86,  79,  75,  79,
     3        86,  94, 106, 119, 129, 149, 169, 189, 209, 224, 238, 251,
     4       259, 261, 333, 325, 315, 300, 289, 279, 264, 249, 229, 209,
     5       189, 159, 129, 114,  99,  84,  74,  64,  54,  46,  38,  30,
     6        22,  14,   8,   3,   0,  76,  76, 220, 220, 296, 296, 220,
     7       220,  76,  76,   0,   0,  77,  77,   0, 116,  99,  89,  79,
     8        75,  75,   0,   0,   4,  14,  24,  34,  49,  64,  79,  99,
     9       116, 133, 153, 168, 183, 198, 208, 218, 228, 232, 232, 157/
            data (ix(i), i= 361, 480)/
     +       157, 153, 143, 133,   0,  76,  76, 113, 230, 321, 161, 306,
     1       218,  76,  76,   0,   0, 250, 250,  76,  76,   0, 178, 114,
     2         0,   0,  76,  76, 141, 215, 280, 280, 356, 356, 242,   0,
     3        76,  76, 220, 296, 296, 220, 220,  76,   0, 180, 215, 240,
     4       260, 275, 290, 300, 310, 317, 322, 330, 340, 346, 349, 350,
     5       349, 346, 340, 330, 322, 317, 310, 300, 290, 275, 260, 240,
     6       215, 175, 135, 110,  90,  75,  60,  50,  40,  33,  28,  20,
     7        10,   4,   1,   0,   1,   4,  10,  20,  28,  33,  40,  50,
     8        60,  75,  90, 110, 135, 170, 170, 145, 130, 120, 111, 102,
     9        96,  87,  81,  76,  75,  76,  81,  87,  96, 102, 111, 120/
            data (ix(i), i= 481, 600)/
     +       130, 145, 175, 205, 220, 230, 239, 248, 254, 263, 269, 274,
     1       275, 274, 269, 263, 254, 248, 239, 230, 220, 205, 180,  85,
     2       178, 203, 218, 233, 248, 258, 267, 275, 277, 277, 275, 267,
     3       258, 248, 233, 218, 203, 178,   0,   0,  75,  75, 156, 173,
     4       183, 193, 199, 203, 203, 199, 193, 183, 173, 156,  85, 313,
     5       352, 312, 317, 322, 330, 340, 346, 349, 350, 349, 346, 340,
     6       330, 322, 317, 310, 300, 290, 275, 260, 240, 215, 175, 135,
     7       110,  90,  75,  60,  50,  40,  33,  28,  20,  10,   4,   1,
     8         0,   1,   4,  10,  20,  28,  33,  40,  50,  60,  75,  90,
     9       110, 135, 175, 215, 240, 260, 267, 215, 205, 145, 130, 120/
            data (ix(i), i= 601, 720)/
     +       111, 102,  96,  87,  81,  76,  75,  76,  81,  87,  96, 102,
     1       111, 120, 130, 145, 175, 205, 220, 230, 239, 248, 254, 263,
     2       269, 274, 275, 274, 269, 263, 258, 220, 182,  75,  75, 178,
     3       190, 200, 208, 214, 217, 217, 216, 211, 208, 200, 190, 178,
     4        85,  85, 167, 180, 190, 200, 205, 206, 206, 208, 211, 218,
     5       298, 298, 287, 282, 281, 279, 274, 269, 260, 232, 260, 275,
     6       284, 290, 292, 290, 283, 270, 256, 245, 230, 210,   0,   0,
     7       150, 185, 205, 220, 225, 227, 228, 226, 219, 209, 195, 180,
     8       165, 145, 125, 110, 100,  90,  81,  76,  73,   0,   5,  11,
     9        18,  29,  45,  62,  75,  90, 110, 140, 170, 190, 210, 225/
            data (ix(i), i= 721, 840)/
     +       240, 250, 260, 270, 279, 286, 291, 297, 299, 301, 299, 294,
     1       289, 283, 275, 265, 255, 245, 225, 205, 135, 110, 100,  90,
     2        82,  79,  78,  80,  85,  95, 105, 120, 135, 155, 170, 185,
     3       195, 203, 211, 217, 288, 284, 278, 271, 264, 254, 245, 235,
     4       225, 210, 195, 175, 145, 115,  90,  75,  60,  50,  40,  30,
     5        22,  17,  12,   8,   7,   9,  14,  20,  26,  35,  45,  60,
     6        85, 105, 186, 186, 292, 292,   0,   0, 106, 106, 154, 178,
     7       198, 218, 233, 243, 253, 259, 269, 276, 285, 289, 289, 213,
     8       213, 211, 204, 196, 187, 173, 154, 135, 116, 102,  93,  85,
     9        78,  76,  76,   0,   0,   4,  13,  20,  30,  36,  46,  56/
            data (ix(i), i= 841, 960)/
     +        71,  91, 111, 135, 189, 312, 234, 156,  78,   0, 123, 230,
     1       291, 360, 460, 380, 326, 267, 193, 134,  80,   0, 100, 169,
     2       158, 225, 316, 200, 310, 222, 158,  94,   6, 116,   0,  91,
     3       196, 196, 312, 226, 156,  86,   0, 116, 116,   0, 275, 275,
     4        87, 275, 275,   0,   0, 188,   0,   7,  74,  81,  87, 100,
     5       137, 147, 154, 161, 163, 163, 157, 147,  92,  47,  27,   9,
     6         3,   0,   3,  16,  32,  55,  87, 117, 147, 160, 160, 147,
     7       127, 102,  83,  72,  71,  77,  92, 107, 163, 165, 165, 172,
     8       248, 248, 233, 232, 224, 197, 167, 147,  97,  62,  42,  27,
     9        12,   0,  70,  70,  73,  80,  94, 108, 126, 146, 161, 176/
            data (ix(i), i= 961,1080)/
     +       184, 187, 184, 176, 161, 146, 126, 108,  94,  80,  73,  73,
     1        93, 113, 141, 171, 191, 206, 226, 241, 251, 256, 258, 256,
     2       251, 241, 226, 206, 191, 171, 141, 113,  93,  70,  70,   0,
     3         0,   3,   8,  15,  27,  35,  49,  64,  76,  89, 104, 124,
     4       144, 164, 189, 204, 214, 223, 233, 240, 244, 177, 173, 168,
     5       155, 134, 114,  97,  85,  80,  74,  70,  74,  80,  85,  97,
     6       114, 134, 155, 168, 173, 177, 244, 240, 233, 223, 214, 204,
     7       189, 164, 144, 124, 104,  89,  76,  64,  49,  35,  27,  15,
     8         8,   3, 258, 188, 188, 185, 178, 164, 150, 132, 112,  97,
     9        82,  74,  71,  74,  82,  97, 112, 132, 150, 164, 178, 185/
            data (ix(i), i=1081,1200)/
     +       185, 165, 145, 117,  87,  67,  52,  32,  17,   7,   2,   0,
     1         2,   7,  17,  32,  52,  67,  87, 117, 145, 165, 188, 188,
     2       258,   0,   3,   8,  15,  27,  35,  49,  64,  76,  89, 104,
     3       124, 144, 164, 189, 204, 215, 225, 237, 247, 178, 173, 160,
     4       144, 129, 109,  94,  84,  76,  71,  70,  70,  75,  82,  95,
     5       104, 119, 134, 149, 163, 169, 173, 177,  73,  73, 249, 246,
     6       241, 233, 226, 218, 209, 196, 176, 164, 149, 124,  99,  84,
     7        67,  52,  39,  30,  24,  17,  10,   4,   0,  39, 109, 109,
     8       150, 150, 109, 109, 112, 117, 123, 147, 147,  98,  74,  62,
     9        54,  48,  43,  40,  39,  39,   0,   0,  39, 186, 186, 183/
            data (ix(i), i=1201,1320)/
     +       177, 170, 160, 150, 140, 130, 120, 108,  98,  88,  81,  78,
     1         5,   7,  13,  23,  40,  55,  68,  83,  98, 123, 153, 168,
     2       183, 198, 208, 218, 228, 238, 244, 248, 251, 253, 253, 186,
     3       186, 171, 158, 143, 128, 113,  98,  83,  68,  53,  40,  26,
     4        19,  12,   6,   4,   1,   0,   0,   1,   2,   5,  11,  17,
     5        26,  32,  43,  53,  63,  73,  83,  98, 113, 128, 143, 158,
     6       173, 183, 183, 179, 172, 161, 153, 143, 133, 123, 113, 103,
     7        93,  83,  76,  73,  70,  70,  71,  75,  79,  87,  95, 108,
     8       118, 128, 138, 148, 158, 168, 175, 180, 184, 186,   0,  71,
     9        71,  74,  80,  88,  98, 108, 118, 133, 143, 153, 165, 168/
            data (ix(i), i=1321,1440)/
     +       168, 238, 238, 235, 231, 224, 215, 205, 193, 178, 163, 148,
     1       133, 118, 108,  98,  88,  78,  71,  71,   0,  71,   0,   0,
     2        71,  71,   0,   0,  71, 102,  32,  32,  29,  24,  14,   0,
     3         0,  30,  59,  69,  79,  89,  98, 100, 102, 102,  30,  30,
     4       102,   0,  70,  70,  99, 162, 244, 146, 237, 157,  70,  70,
     5         0,   0,  71,  71,   0,   0,  71,  71,  72,  76,  84,  96,
     6       111, 126, 136, 146, 155, 157, 157, 226, 226, 227, 231, 239,
     7       251, 266, 281, 291, 301, 310, 312, 312, 382, 382, 379, 373,
     8       366, 360, 351, 341, 331, 316, 301, 286, 271, 256, 241, 231,
     9       218, 210, 205, 196, 186, 176, 166, 151, 131, 116, 106,  96/
            data (ix(i), i=1441,1560)/
     +        86,  81,  71,  71,   0,   0,  71,  71,  75,  82,  91, 101,
     1       111, 126, 141, 151, 160, 168, 171, 173, 173, 243, 243, 240,
     2       236, 231, 224, 216, 206, 196, 186, 176, 161, 146, 131, 116,
     3       106,  96,  91,  86,  78,  71,  71,   0, 134, 119, 104,  89,
     4        79,  69,  59,  49,  39,  29,  21,  17,  13,   9,   6,   4,
     5         2,   1,   0,   1,   2,   4,   6,   9,  13,  17,  21,  29,
     6        39,  49,  59,  69,  79,  89, 104, 119, 132, 132, 124, 114,
     7       104,  94,  85,  80,  77,  73,  72,  71,  72,  73,  77,  80,
     8        85,  94, 104, 114, 124, 134, 144, 154, 164, 174, 183, 188,
     9       191, 197, 198, 199, 198, 197, 191, 188, 183, 174, 164, 154/
            data (ix(i), i=1561,1680)/
     +       144, 136, 136, 149, 164, 179, 189, 199, 209, 219, 229, 239,
     1       247, 251, 255, 259, 262, 264, 266, 267, 268, 267, 266, 264,
     2       262, 259, 255, 251, 247, 239, 229, 219, 209, 199, 189, 179,
     3       164, 149,   0,  70,  70,  73,  80,  94, 108, 126, 146, 161,
     4       176, 184, 187, 184, 176, 161, 146, 126, 108,  94,  80,  73,
     5        73,  93, 113, 141, 171, 191, 206, 226, 241, 251, 256, 258,
     6       256, 251, 241, 226, 206, 191, 171, 141, 113,  93,  70,  70,
     7         0, 258, 188, 188, 185, 178, 164, 150, 132, 112,  97,  82,
     8        74,  71,  74,  82,  97, 112, 132, 150, 164, 178, 185, 185,
     9       165, 145, 117,  87,  67,  52,  32,  17,   7,   2,   0,   2/
            data (ix(i), i=1681,1800)/
     +         7,  17,  32,  52,  67,  87, 117, 145, 165, 188, 188, 258,
     1         0,  62,  62,  64,  67,  72,  81,  91, 101, 111, 126, 146,
     2       146, 121, 111, 101,  96,  84,  76,  70,  62,  62,   0,   0,
     3         1,   3,   6,  12,  18,  28,  35,  45,  55,  65,  80,  95,
     4       115, 135, 155, 170, 185, 195, 205, 215, 221, 229, 235, 239,
     5       244, 243, 239, 235, 227, 220, 210, 200, 100,  90,  80,  78,
     6        82,  90, 100, 115, 135, 145, 155, 163, 167, 169, 237, 234,
     7       226, 220, 215, 205, 195, 185, 170, 150, 135, 115, 100,  85,
     8        70,  60,  50,  40,  30,  22,  16,  12,   9,   9,  12,  18,
     9        25,  35,  45, 155, 165, 170, 174, 172, 165, 155, 145, 120/
            data (ix(i), i=1801,1920)/
     +       105,  95,  85,  80,  72,  69,  68,  34,  38,  42,  47,  54,
     1        64,  74,  84, 104, 124, 144, 144, 124, 114, 107, 105, 105,
     2       144, 144, 105, 105,  34,  34,   0,   0,  34,   0,   0,   2,
     3         6,  11,  19,  26,  36,  46,  56,  71,  91, 111, 126, 136,
     4       146, 154, 163, 172, 172, 241, 241, 172, 172, 168, 165, 161,
     5       151, 141, 131, 116, 106,  96,  86,  79,  72,  70,  70,   0,
     6        93, 168, 261, 185, 130,  75,   0,  73, 148, 189, 230, 305,
     7       378, 305, 266, 226, 152, 112,  73,   0,  85, 130, 175, 257,
     8       169, 257, 169, 130,  85,   0,  88,   0, 101, 101,  98,  94,
     9        91,  87,  77,  67,  57,  47,  39,  39,  57,  77,  92, 107/
            data (ix(i), i=1921,2040)/
     +       117, 127, 133, 141, 144, 266, 192, 137,  80,   0, 224, 224,
     1        86, 219, 219,   9,   9, 133,   0, 122,  97,  87,  77,  67,
     2        57,  47,  42,  35,  28,  22,  17,  14,  11,   7,   5,   3,
     3         1,   0,   1,   3,   5,   7,  11,  14,  17,  22,  28,  35,
     4        42,  47,  57,  67,  77,  87,  97, 120, 120, 112, 102,  92,
     5        87,  83,  79,  77,  75,  73,  71,  71,  71,  73,  75,  77,
     6        79,  83,  87,  92, 102, 112, 122, 132, 142, 152, 157, 161,
     7       165, 167, 169, 171, 173, 173, 173, 171, 169, 167, 165, 161,
     8       157, 152, 142, 132, 124, 124, 147, 157, 167, 177, 187, 197,
     9       202, 209, 216, 222, 227, 230, 233, 237, 239, 241, 243, 244/
            data (ix(i), i=2041,2160)/
     +       243, 241, 239, 237, 233, 230, 227, 222, 216, 209, 202, 197,
     1       187, 177, 167, 157, 147,   0,  84,  84, 155, 155, 107, 103,
     2        97,  91,  81,  71,  61,  46,  26,   0,   0, 242, 242,  92,
     3       104, 206, 226, 232, 238, 242, 243, 241, 238, 236, 231, 226,
     4       217, 211, 201, 191, 181, 171, 161, 146, 126, 106,  86,  71,
     5        61,  51,  43,  34,  26,  18,  14,  10,   9,   6,   5,  73,
     6        73,  75,  79,  85,  91, 101, 111, 121, 136, 146, 156, 163,
     7       168, 171, 172, 172, 171, 169, 164, 159, 150,  49,  34,  23,
     8        16,  14,   7,   3,  95, 115, 127, 137, 147, 157, 165, 170,
     9       173, 173, 174, 172, 166, 158, 152, 142, 127, 107,  97,  91/
            data (ix(i), i=2161,2280)/
     +        85,  78,  72,  70,   0,   5,  10,  21,  32,  39,  49,  57,
     1        67,  77,  92, 107, 137, 152, 167, 182, 192, 202, 212, 222,
     2       229, 236, 239, 241, 243, 244, 244, 241, 238, 234, 228, 222,
     3       212, 202, 187, 207, 217, 224, 227, 231, 232, 232, 229, 224,
     4       216, 210, 206, 197, 187, 172, 157, 142, 122, 102,  87,  67,
     5        57,  47,  37,  27,  20,  14,  11,   7,   6,  72,  72,  75,
     6        80,  87,  97, 107, 127, 137, 147, 157, 160, 163, 163, 162,
     7       159, 153, 147, 137, 122,  95,   0, 144, 144, 213, 213, 250,
     8       250, 213, 213, 144, 144,  49, 129, 129,   0,   0,   1,   8,
     9        19,  26,  40,  47,  57,  72,  87, 107, 127, 147, 162, 172/
            data (ix(i), i=2281,2400)/
     +       182, 192, 202, 212, 220, 226, 232, 235, 241, 244, 244, 241,
     1       239, 234, 228, 223, 216, 208, 197, 187, 172, 157, 142, 127,
     2       112, 102,  92,  82,  73,  85, 230, 230,  40,   9,  74,  79,
     3        83,  92, 102, 112, 122, 132, 142, 153, 163, 170, 173, 173,
     4       172, 168, 163, 157, 147, 137, 127, 112,  97,  87,  79,  73,
     5        70, 171, 238, 231, 211, 191, 175, 160, 145, 125, 105,  90,
     6        75,  60,  46,  33,  25,  17,  10,   4,   1,   0,   1,   3,
     7         6,  12,  20,  30,  45,  60,  75,  90, 105, 125, 145, 160,
     8       175, 190, 205, 216, 227, 237, 242, 243, 241, 233, 221, 213,
     9       200, 190, 175, 155, 135, 115, 100,  85,  73,  73,  85,  95/
            data (ix(i), i=2401,2520)/
     +       105, 125, 140, 150, 160, 171, 175, 177, 174, 171, 165, 155,
     1       145, 135, 125, 115, 105,  95,  85,  78,  72,  71,  71,  72,
     2        77,  85,  90, 102, 115, 135, 145, 155, 164,   0, 177, 147,
     3       122, 109,  99,  88,  81,  75,  67,  59,  54, 124, 128, 135,
     4       146, 157, 171, 189, 200, 213, 229, 251, 251,   0, 126, 149,
     5       174, 194, 209, 227, 239, 247, 250, 250, 247, 239, 223, 209,
     6       192, 209, 224, 234, 237, 238, 234, 225, 214, 199, 184, 169,
     7       149, 125, 101,  81,  66,  51,  36,  25,  16,  12,  13,  16,
     8        26,  41,  58,  41,  27,  11,   3,   0,   0,   3,  11,  23,
     9        41,  56,  76, 101, 124, 124,  99,  84,  73,  69,  73,  84/
            data (ix(i), i=2521,2640)/
     +        99, 124, 124, 109,  94,  79,  74,  73,  76,  84,  94, 109,
     1       125, 141, 156, 166, 174, 177, 176, 171, 156, 141, 126, 126,
     2       151, 166, 177, 181, 177, 166, 151, 126,  72,   5,  12,  32,
     3        52,  68,  83,  98, 118, 138, 153, 168, 183, 197, 210, 218,
     4       226, 233, 239, 242, 243, 242, 240, 237, 231, 223, 213, 198,
     5       183, 168, 153, 138, 118,  98,  83,  68,  53,  38,  27,  16,
     6         6,   1,   0,   2,  10,  22,  30,  43,  53,  68,  88, 108,
     7       128, 143, 158, 170, 170, 158, 148, 138, 118, 103,  93,  83,
     8        72,  68,  66,  69,  72,  78,  88,  98, 108, 118, 128, 138,
     9       148, 158, 165, 171, 172, 172, 171, 166, 158, 153, 141, 128/
            data (ix(i), i=2641,2760)/
     +       108,  98,  88,  79,  20,  56,  76,  76,   0,   0,   0,  76,
     1        76,   0,   0,   0,  20,  48,  68,  68,   0,   1,   2,   8,
     2        13,  21,  32,  45,  81, 130, 101,  91,  82,  74,  69,  64,
     3        62,  64,  69,  74,  82,  91, 101, 130,  81,  45,  32,  21,
     4        13,   8,   2,   1, 129, 128, 122, 117, 109,  98,  85,  49,
     5         0,  29,  39,  48,  56,  61,  66,  68,  66,  61,  56,  48,
     6        39,  29,   0,  49,  85,  98, 109, 117, 122, 128, 129, 130,
     7        83, 116, 146, 112, 166, 157, 101, 101,  65,  65,   9,   0,
     8        54,  20,  50, 151, 151, 242, 242, 151, 151,  91,  91,   0,
     9         0,  91,  91,   0,  43,  41,  36,  29,  19,   0,   0,  23/
            data (ix(i), i=2761,2880)/
     +        38,  53,  66,  72,  75,   0,   0, 137, 137,   0,   0,  74,
     1        74,   0,   0,  35, 137, 102,  76,   0,   0,  76,  76,   0,
     2         0,  76,  75,   0,   0,  43,  41,  36,  29,  19,   0,   0,
     3        23,  38,  53,  66,  72,  75,   0,   0,  75,   0, 245, 245,
     4        56, 245, 245,   0, 242,   0,   0, 242, 242,   0,   0, 242,
     5       245,   0,   0, 189,   0,   0, 245,  91, 153, 154, 158, 164,
     6       176, 216, 233, 241, 244, 245, 241, 233, 219, 209, 199, 189,
     7       169, 149, 119,  89,  69,  49,  39,  29,  23,  17,  10,   4,
     8         0,  68,  73,  83,  94, 104, 114, 129, 144, 155, 163, 169,
     9       174, 175, 171, 160, 112, 103,  96,  92,  86, 161, 161,  86/
            data (ix(i), i=2881,3000)/
     +         0, 122, 122,  65,  65, 122, 122,   0,  35,   0, 102, 137,
     1       122,   0,   0,  57,  57,   0,   0, 122,   0,  57, 115, 173,
     2       230, 146,  84,   0, 300, 300,   0,   0,  21,  28,  37,  40,
     3        40,  45,  52,  63,  73,  93, 141, 141, 118, 108, 103, 100,
     4       100,  94,  87,  78,  63,  53,  63,  78,  87,  94, 100, 100,
     5       103, 108, 118, 141, 141,  93,  73,  63,  52,  45,  40,  40,
     6        37,  28,  21,   0,   0,  41,  41,   0, 141, 120, 113, 104,
     7       101, 101,  96,  89,  78,  68,  48,   0,   0,  23,  33,  38,
     8        41,  41,  47,  54,  63,  78,  88,  78,  63,  54,  47,  41,
     9        41,  38,  33,  23,   0,   0,  48,  68,  78,  89,  96, 101/
            data (ix(i), i=3001,3039)/
     +       101, 104, 113, 120, 141, 125, 135, 148, 163, 183, 193, 203,
     1       213, 221, 227, 232, 192, 191, 183, 173, 163, 148, 107,  97,
     2        84,  69,  49,  39,  29,  19,  11,   5,   0,  40,  41,  49,
     3        59,  69,  84/
            data (iy(i), i=   1, 120)/
     +        -1,  -1,  72,  72, 136, 136, 277,  -1,  -1, 364, 364,  -1,
     1        -1, 301, 301, 299, 293, 286, 281, 276, 261, 246, 236, 229,
     2       223, 219, 219, 156, 156, 155, 152, 147, 138, 131, 121, 111,
     3       101,  91,  81,  72,  67,  63,  61,  61,  -1,  -1,   4,  10,
     4        18,  28,  41,  56,  71,  86, 101, 121, 136, 151, 161, 171,
     5       181, 191, 206, 226, 241, 271, 291, 311, 326, 341, 350, 357,
     6       360, 363, 363, 179, 136, 111,  91,  71,  56,  46,  36,  26,
     7        19,  13,   7,   0,  -6,  -9, -11, -11,  -6,  -2,   6,  15,
     8        26,  41,  56,  71,  91, 124, 124,  96,  81,  71,  64,  57,
     9        53,  52,  53,  59,  64,  76,  91, 111, 136, 179, 222, 247/
            data (iy(i), i= 121, 240)/
     +       267, 282, 294, 299, 305, 306, 305, 301, 294, 287, 277, 262,
     1       234, 234, 267, 287, 302, 317, 332, 343, 352, 360, 364, 369,
     2       369, 367, 364, 358, 351, 345, 339, 332, 322, 312, 302, 287,
     3       267, 247, 222,  -1,  -1, 302, 302, 296, 292, 285, 274, 261,
     4       246, 231, 211, 181, 151, 131, 116, 101,  88,  77,  70,  66,
     5        60,  60,  -1,  -1,   3,  11,  20,  31,  41,  56,  71,  86,
     6       101, 121, 141, 181, 221, 241, 261, 276, 291, 306, 321, 331,
     7       342, 351, 359, 363, 363,  -1,  -1,  62,  62, 156, 156, 219,
     8       219, 302, 302, 364, 364,  -1,  -1, 156, 156, 219, 219, 301,
     9       301, 364, 364, 179, 136, 111,  91,  71,  56,  46,  36,  26/
            data (iy(i), i= 241, 360)/
     +        19,  13,   7,   0,  -6,  -9, -11, -11,  -6,   0,   8,  25,
     1        47,  -2,  -2, 196, 196, 133, 133, 111,  96,  86,  71,  61,
     2        58,  53,  52,  53,  59,  64,  76,  91, 111, 136, 179, 222,
     3       247, 267, 282, 294, 299, 305, 306, 305, 301, 295, 286, 271,
     4       256, 247, 247, 281, 301, 321, 331, 340, 349, 357, 362, 367,
     5       369, 369, 367, 364, 358, 351, 345, 339, 332, 322, 312, 302,
     6       287, 267, 247, 222,  -1,  -1, 166, 166,  -1,  -1, 364, 364,
     7       227, 227, 364, 364,  -1,  -1, 364, 364,  51,  53,  58,  72,
     8        91, 135, 135,  86,  61,  36,  21,  11,   1,  -4,  -9, -11,
     9       -13, -11,  -9,  -4,   1,  11,  21,  36,  61,  86, 364, 364/
            data (iy(i), i= 361, 480)/
     +        91,  72,  58,  53,  -1,  -1, 121, 159,  -1,  -1, 207, 364,
     1       364, 203, 364, 364,  -1,  -1,  62,  62, 364, 364,  78, 364,
     2       364,  -1,  -1, 282,  -1,  -1, 282,  -1,  -1, 364, 364,  -1,
     3        -1, 249,  -1,  -1, 364, 364, 114, 364, 364, -12,  -9,  -1,
     4         7,  17,  28,  39,  51,  61,  71,  86, 111, 131, 151, 178,
     5       205, 225, 245, 270, 285, 295, 305, 317, 328, 339, 349, 357,
     6       365, 368, 365, 357, 349, 339, 328, 317, 305, 295, 285, 270,
     7       245, 225, 205, 178, 151, 131, 111,  86,  71,  61,  51,  39,
     8        28,  17,   7,  -1,  -9, -12,  53,  56,  62,  69,  76,  86,
     9        96, 111, 126, 146, 178, 210, 230, 245, 260, 270, 280, 287/
            data (iy(i), i= 481, 600)/
     +       294, 300, 303, 300, 294, 287, 280, 270, 260, 245, 230, 210,
     1       178, 146, 126, 111,  96,  86,  76,  69,  62,  56,  53, 129,
     2       129, 135, 139, 148, 161, 174, 191, 211, 231, 262, 282, 302,
     3       319, 332, 345, 354, 358, 364, 364,  -1,  -1, 301, 301, 297,
     4       293, 281, 271, 256, 237, 222, 212, 200, 196, 192, 192, -27,
     5        14,  51,  61,  71,  86, 111, 131, 151, 178, 205, 225, 245,
     6       270, 285, 295, 305, 317, 328, 339, 349, 357, 365, 368, 365,
     7       357, 349, 339, 328, 317, 305, 295, 285, 270, 245, 225, 205,
     8       178, 151, 131, 111,  86,  71,  61,  51,  39,  28,  17,   7,
     9        -1,  -9, -12,  -9,  -1,   7,  11,  59,  56,  56,  62,  69/
            data (iy(i), i= 601, 720)/
     +        76,  86,  96, 111, 126, 146, 178, 210, 230, 245, 260, 270,
     1       280, 287, 294, 300, 303, 300, 294, 287, 280, 270, 260, 245,
     2       230, 210, 178, 146, 126, 111, 102, 138,  97,  -1, 301, 301,
     3       299, 294, 286, 276, 261, 246, 236, 226, 219, 213, 208, 207,
     4       207, 143, 143, 141, 137, 126, 116, 106,  36,  21,  11,  -1,
     5        -1,  14,  21,  31,  61, 111, 136, 151, 161, 175, 191, 206,
     6       221, 241, 261, 291, 311, 331, 346, 354, 359, 364, 364,  -1,
     7       151, 144, 134, 123, 111, 101,  91,  81,  71,  61,  55,  50,
     8        49,  48,  50,  56,  62,  70,  81,  91, 108, 108,  75,  61,
     9        46,  31,  16,   6,  -1,  -5,  -9, -12, -12, -11,  -5,  -1/
            data (iy(i), i= 721, 840)/
     +         6,  11,  18,  25,  36,  46,  56,  71,  91, 111, 131, 146,
     1       156, 166, 173, 183, 189, 195, 202, 206, 219, 227, 231, 237,
     2       246, 256, 266, 276, 286, 296, 302, 307, 309, 309, 307, 301,
     3       293, 286, 276, 252, 252, 286, 306, 316, 326, 336, 344, 350,
     4       355, 361, 364, 368, 370, 368, 362, 357, 352, 345, 337, 329,
     5       316, 306, 291, 271, 251, 231, 216, 206, 196, 188, 181, 174,
     6       167, 160,  -1, 302, 302, 364, 364, 302, 302,  -1, -13,  -9,
     7        -5,   1,   9,  17,  24,  31,  41,  51,  76, 101, 364, 364,
     8       108,  91,  76,  66,  61,  55,  53,  53,  55,  61,  66,  76,
     9        91, 108, 364, 364, 101,  76,  51,  41,  31,  24,  17,   9/
            data (iy(i), i= 841, 960)/
     +         1,  -5,  -9, -13,  -1, 364, 364,  89, 364, 364,  -1, 284,
     1        -1,  -1, 364, 364,  91, 364, 364,  91, 364, 364,  -1,  -1,
     2       127,  -1,  -1, 185, 364, 364, 244, 364, 364, 185,  -1,  -1,
     3        -1, 136, 364, 364, 202, 364, 364, 136,  -1,  -1,  -1,  62,
     4        62, 301, 364, 364, 301, 301,  62, 181, 181, 201, 210, 215,
     5       216, 213, 209, 202, 191, 182, 175, 166, 156, 144, 132, 111,
     6        91,  66,  41,  16,   2,  -9, -11,  -6,  11,  23,  74,  58,
     7        46,  44,  51,  64,  81,  98, 108, 114, 126,  27,  10,  -2,
     8         0,   7,  28, 206, 230, 257, 268, 273, 272, 264, 252, 237,
     9       206,  -1,  -1, 141, 161, 181, 201, 211, 216, 211, 201, 181/
            data (iy(i), i= 961,1080)/
     +       161, 131, 101,  81,  61,  51,  46,  51,  61,  81, 101,  22,
     1         1,  -9, -13,  -8,  -1,  11,  29,  53,  83, 111, 136, 161,
     2       187, 208, 231, 251, 261, 269, 274, 269, 257, 235, 364, 364,
     3       131,  91,  71,  51,  31,  21,  11,   1,  -4,  -9, -11, -12,
     4       -11,  -7,   1,  11,  21,  31,  51,  71,  91,  91,  81,  66,
     5        51,  44,  46,  56,  66,  76, 101, 131, 161, 186, 196, 206,
     6       216, 218, 211, 196, 181, 171, 171, 191, 211, 231, 241, 251,
     7       261, 269, 273, 274, 273, 271, 266, 261, 251, 241, 231, 211,
     8       191, 171,  -1,  -1, 141, 161, 181, 201, 211, 216, 211, 201,
     9       181, 161, 131, 101,  81,  61,  51,  46,  51,  61,  81, 101/
            data (iy(i), i=1081,1200)/
     +        22,   1,  -9, -13,  -8,  -1,  11,  29,  53,  83, 111, 136,
     1       161, 187, 208, 231, 251, 261, 269, 274, 269, 257, 235, 364,
     2       364, 131,  91,  71,  51,  31,  21,  11,   1,  -4,  -9, -11,
     3       -12, -11,  -7,   1,  11,  21,  31,  51,  75,  75,  66,  51,
     4        44,  42,  44,  51,  58,  71,  91, 113, 159, 181, 196, 211,
     5       217, 221, 220, 213, 201, 191, 181, 161, 159, 113, 113, 171,
     6       191, 211, 221, 231, 241, 251, 261, 267, 271, 272, 271, 267,
     7       261, 251, 241, 231, 221, 211, 191, 171, 151,   1,   1, 217,
     8       217, 264, 264, 295, 303, 308, 311, 311, 363, 363, 358, 352,
     9       345, 336, 326, 316, 306, 264, 264, 217, 217,  27, -15, -29/
            data (iy(i), i=1201,1320)/
     +       -39, -49, -57, -60, -63, -65, -64, -62, -59, -52, -42, -34,
     1       -34, -49, -64, -79, -89, -99,-102,-106,-108,-109,-109,-106,
     2      -102, -97, -93, -86, -76, -64, -54, -44, -34, -19, 269, 269,
     3       229, 246, 256, 266, 272, 274, 272, 269, 263, 253, 241, 226,
     4       211, 196, 181, 166, 151, 136, 121, 106,  91,  76,  61,  46,
     5        31,  21,  11,   5,  -3,  -6,  -8, -12, -12, -10,  -6,   0,
     6        11,  24,  95,  85,  71,  61,  55,  49,  47,  47,  48,  53,
     7        60,  71,  86, 101, 121, 136, 151, 166, 181, 191, 201, 210,
     8       214, 215, 214, 209, 203, 191, 181, 171, 161, 151,   0,   0,
     9       171, 181, 191, 201, 208, 213, 214, 214, 210, 201, 186, 161/
            data (iy(i), i=1321,1440)/
     +         0,   0, 191, 206, 221, 236, 246, 256, 263, 268, 273, 274,
     1       272, 268, 264, 258, 249, 239, 231, 364, 364, 270, 270,   0,
     2         0, 364, 364, 302, 302, 270, 270, -39, -46, -51, -52, -52,
     3      -108,-110,-110,-108,-102, -97, -84, -74, -59, 364, 364, 302,
     4       302,   0,   0,  88, 119,   0,   0, 167, 270, 270, 166, 364,
     5       364,   0,   0, 364, 364,   0,   0, 169, 181, 191, 201, 210,
     6       214, 214, 210, 202, 191, 181,   0,   0, 169, 181, 191, 201,
     7       210, 214, 214, 210, 202, 191, 181,   0,   0, 201, 216, 231,
     8       241, 251, 257, 263, 269, 273, 274, 273, 271, 265, 257, 246,
     9       233, 241, 251, 258, 263, 269, 271, 274, 274, 269, 265, 260/
            data (iy(i), i=1441,1560)/
     +       252, 249, 235, 271, 271,   0,   0, 171, 181, 191, 201, 208,
     1       212, 214, 213, 209, 201, 191, 181, 171,   0,   0, 191, 206,
     2       221, 231, 241, 251, 259, 266, 269, 272, 274, 274, 272, 268,
     3       263, 256, 251, 246, 240, 233, 271, 271, 274, 273, 271, 267,
     4       263, 259, 253, 246, 236, 226, 216, 206, 196, 186, 176, 166,
     5       156, 146, 131, 116, 106,  96,  86,  76,  66,  56,  46,  36,
     6        26,  16,   9,   3,  -1,  -5,  -9, -11, -12,  45,  46,  48,
     7        52,  58,  71,  81,  91, 101, 116, 131, 146, 161, 171, 181,
     8       191, 204, 210, 214, 216, 217, 216, 214, 210, 204, 191, 181,
     9       171, 161, 146, 131, 116, 101,  91,  81,  71,  58,  52,  48/
            data (iy(i), i=1561,1680)/
     +        46,  45, -12, -11,  -9,  -5,  -1,   3,   9,  16,  26,  36,
     1        46,  56,  66,  76,  86,  96, 106, 116, 131, 146, 156, 166,
     2       176, 186, 196, 206, 216, 226, 236, 246, 253, 259, 263, 267,
     3       271, 273,-109,-109, 141, 161, 181, 201, 211, 216, 211, 201,
     4       181, 161, 131, 101,  81,  61,  51,  46,  51,  61,  81, 101,
     5        22,   1,  -9, -13,  -8,  -1,  11,  29,  53,  83, 111, 136,
     6       161, 187, 208, 231, 251, 261, 269, 274, 269, 257, 235, 269,
     7       269,-110,-110, 141, 161, 181, 201, 211, 216, 211, 201, 181,
     8       161, 131, 101,  81,  61,  51,  46,  51,  61,  81, 101,  22,
     9         1,  -9, -13,  -8,  -1,  11,  29,  53,  83, 111, 136, 161/
            data (iy(i), i=1681,1800)/
     +       187, 208, 231, 251, 261, 269, 274, 269, 257, 235, 269, 269,
     1         0,   0, 151, 161, 171, 181, 191, 198, 201, 205, 204, 202,
     2       274, 271, 268, 263, 260, 251, 241, 232, 219, 270, 270,  78,
     3        61,  51,  41,  31,  21,  11,   8,   1,  -2,  -6,  -9, -11,
     4       -13, -12, -11,  -8,  -3,   0,   7,  13,  21,  31,  41,  51,
     5        71,  91, 106, 116, 126, 131, 139, 144, 174, 177, 184, 194,
     6       204, 211, 216, 219, 217, 216, 208, 201, 191, 181, 181, 201,
     7       221, 231, 237, 248, 255, 260, 266, 271, 274, 274, 273, 270,
     8       266, 263, 259, 250, 241, 231, 221, 211, 191, 176, 161, 146,
     9       136, 130, 124,  89,  84,  78,  71,  61,  53,  47,  45,  44/
            data (iy(i), i=1801,1920)/
     +        44,  46,  50,  54,  61,  71,  78,  41,  26,  16,   6,   2,
     1        -6, -10, -13, -13, -11,  -8,  42,  42,  43,  51,  61, 219,
     2       219, 265, 265, 338, 338, 265, 265, 219, 219, 270,  73,  51,
     3        36,  26,  16,   8,   0,  -5,  -9, -11, -12, -11,  -7,  -2,
     4         4,  11,  21,  33,  -1,  -1, 270, 270,  95,  86,  76,  67,
     5        59,  53,  50,  48,  48,  50,  55,  61,  71,  86, 270, 271,
     6        -1,  -1, 271, 271,  75, 271, 271,  -1,  -1, 191,  -1,  -1,
     7       271, 271,  83, 271, 271, 105, 271,   0,   0,  83,   0,   0,
     8       135, 270, 270, 188, 270, 270, 135, 271, -11, -22, -29, -39,
     9       -44, -49, -55, -57, -58, -56, -55,-110,-111,-110,-108,-105/
            data (iy(i), i=1921,2040)/
     +      -102, -95, -91, -84, -79, 271, 271,  76, 271,   0,   0,  56,
     1        56, 211, 270, 270, 211, 211,  56, 361, 359, 356, 353, 348,
     2       342, 333, 328, 321, 311, 301, 291, 281, 271, 256, 241, 221,
     3       196, 175, 154, 129, 109,  94,  79,  69,  59,  49,  39,  29,
     4        22,  17,   8,   2,  -3,  -6,  -9, -11,  49,  48,  52,  61,
     5        66,  71,  81,  91, 101, 116, 136, 175, 214, 234, 249, 259,
     6       269, 279, 284, 289, 298, 302, 303, 302, 298, 289, 284, 279,
     7       269, 259, 249, 234, 214, 175, 136, 116, 101,  91,  81,  71,
     8        66,  61,  52,  48,  49, -11,  -9,  -6,  -3,   2,   8,  17,
     9        22,  29,  39,  49,  59,  69,  79,  94, 109, 129, 154, 175/
            data (iy(i), i=2041,2160)/
     +       196, 221, 241, 256, 271, 281, 291, 301, 311, 321, 328, 333,
     1       342, 348, 353, 356, 359, 244, 244,  -1,  -1, 355, 355, 341,
     2       331, 321, 312, 305, 301, 296, 291, 291,  -1,  -1,  61,  61,
     3        81, 164, 190, 201, 211, 226, 241, 271, 281, 291, 301, 311,
     4       321, 328, 336, 343, 349, 353, 357, 359, 361, 360, 358, 351,
     5       348, 343, 336, 326, 316, 306, 296, 286, 276, 261, 230, 230,
     6       251, 266, 276, 286, 291, 298, 302, 303, 302, 297, 291, 281,
     7       271, 261, 251, 241, 231, 221, 211, 201, 191, 111,  96,  81,
     8        71,  61,  46,  26, 158, 157, 156, 154, 148, 142, 131, 121,
     9       111, 101,  91,  81,  71,  61,  57,  51,  49,  50,  52,  56/
            data (iy(i), i=2161,2280)/
     +        61,  71,  86, 104, 104,  71,  51,  31,  21,  11,   6,   0,
     1        -3,  -7, -11, -12, -12,  -9,  -5,   1,   5,  11,  20,  30,
     2        41,  51,  61,  71,  86, 101, 116, 126, 136, 146, 156, 163,
     3       172, 180, 189, 204, 214, 224, 233, 246, 261, 281, 296, 306,
     4       316, 326, 331, 336, 345, 352, 357, 360, 361, 360, 357, 352,
     5       347, 340, 332, 321, 311, 301, 291, 276, 242, 242, 262, 276,
     6       286, 293, 299, 304, 304, 302, 296, 286, 276, 266, 256, 246,
     7       236, 226, 219, 211, 207, 205,  78,  78,  -1,  -1,  78,  78,
     8       136, 136, 354, 354, 136, 136, 264, 354, 136,  92,  72,  51,
     9        31,  21,  11,   6,  -1,  -6, -10, -11, -10,  -8,  -6,   0/
            data (iy(i), i=2281,2400)/
     +         4,   8,  17,  25,  36,  46,  56,  66,  81, 101, 126, 141,
     1       156, 171, 181, 191, 201, 211, 218, 225, 233, 236, 239, 238,
     2       235, 233, 230, 224, 217, 291, 291, 354, 354, 157, 157, 167,
     3       172, 177, 180, 183, 183, 180, 177, 171, 161, 146, 131, 111,
     4        91,  81,  71,  63,  56,  51,  48,  48,  50,  55,  61,  72,
     5        92, 271, 271, 301, 331, 346, 353, 358, 361, 361, 358, 354,
     6       349, 340, 326, 311, 296, 281, 261, 231, 201, 171, 141, 111,
     7        91,  71,  51,  31,  15,   6,  -3,  -9, -11, -13, -11,  -8,
     8        -1,   5,  16,  31,  51,  71,  91, 111, 141, 171, 191, 201,
     9       214, 221, 226, 232, 233, 230, 224, 216, 204, 140, 158, 167/
            data (iy(i), i=2401,2520)/
     +       174, 177, 175, 169, 160, 146, 131, 111,  91,  81,  71,  61,
     1        55,  50,  48,  48,  52,  56,  64,  76,  91, 111, 203, 241,
     2       261, 276, 286, 296, 302, 304, 302, 299, 286, 291, 291, 253,
     3       214, 191, 171, 151, 131, 111,  81,  41,   0,   0,  41,  81,
     4       121, 151, 181, 211, 231, 251, 271, 298, 354, 354, -11, -10,
     5        -4,   5,  15,  31,  51,  71,  91, 111, 131, 151, 171, 183,
     6       192, 202, 215, 231, 251, 271, 291, 311, 326, 338, 347, 354,
     7       359, 361, 359, 354, 347, 338, 326, 311, 291, 271, 251, 231,
     8       215, 202, 192, 183, 171, 151, 131, 111,  91,  71,  51,  31,
     9        15,   5,  -4, -10, -11,  49,  53,  65,  81, 101, 121, 147/
            data (iy(i), i=2521,2640)/
     +       158, 163, 211, 213, 219, 234, 246, 261, 276, 286, 296, 302,
     1       304, 302, 296, 286, 276, 261, 246, 234, 219, 213, 211, 163,
     2       158, 147, 121, 101,  81,  65,  53,  49,  77,  77,  47,  17,
     3         2,  -5, -10, -13, -13, -10,  -6,  -1,   8,  22,  37,  52,
     4        67,  87, 117, 147, 177, 207, 237, 257, 277, 297, 317, 333,
     5       342, 351, 357, 359, 361, 359, 356, 349, 343, 332, 317, 297,
     6       277, 257, 237, 207, 177, 157, 147, 134, 127, 122, 116, 115,
     7       118, 124, 132, 144, 208, 190, 181, 174, 171, 173, 179, 188,
     8       202, 217, 237, 257, 267, 277, 287, 293, 298, 300, 300, 296,
     9       292, 284, 272, 257, 237, 145, 107,  87,  72,  62,  52,  46/
            data (iy(i), i=2641,2760)/
     +        44,  46,  49,  62, 103, 103, 255, 362, 372, 255,  -1,  -1,
     1        72,  72, 364, 299, 234, 234, 299, 364, 132, 111,  86,  61,
     2        36,  11, -14, -39,-100,-100, -39, -14,  11,  36,  61,  86,
     3       132, 178, 203, 228, 253, 278, 303, 364, 364, 303, 278, 253,
     4       228, 203, 178, 153, 153, 178, 203, 228, 253, 278, 303, 364,
     5       364, 303, 278, 253, 228, 203, 178, 132,  86,  61,  36,  11,
     6       -14, -39,-100,-100, -39, -14,  11,  36,  61,  86, 111, 132,
     7       249, 202, 226, 271, 289, 324, 306, 364, 364, 306, 324, 289,
     8       271, 226, 202,  -6,  85,  85, 145, 145, 236, 236, 145, 145,
     9        85,  85,  -6,  -1,  -1, -21, -34, -44, -52, -58, -87, -83/
            data (iy(i), i=2761,2880)/
     +       -76, -64, -49, -29,  72,  72, 103, 103, 171, 171,  -1,  -1,
     1        73,  73,  -9,  -9, 357, 357,  73,  73,  -1,  -1, 260, 260,
     2       186, 186,  72,  72,  -1,  -1, -21, -34, -44, -52, -58, -87,
     3       -83, -76, -64, -49, -29, 260, 260, 186, 186,  85,  -5,  51,
     4       116, 181, 237, 147,  85,  85,  25,  25, 204, 204, 144, 144,
     5       147, 237, 181, 116,  51,  -5,  85, 100, 100, 120, 130, 141,
     6       151, 181, 201, 221, 231, 271, 291, 311, 331, 341, 349, 355,
     7       364, 369, 371, 368, 362, 349, 343, 334, 326, 316, 301, 281,
     8       239, 239, 271, 291, 301, 308, 311, 311, 308, 301, 291, 281,
     9       261, 241, 231, 216, 171, 156, 141, 126,  -1,  -1,  72,  72/
            data (iy(i), i=2881,3000)/
     +      -101,-101, -50, -50, 313, 313, 364, 364, 357, 357,  -9,  -9,
     1       364, 364, 313, 313, -50, -50,-101,-101, 134, 134, 285, 134,
     2       134, 346, 346, -96, -96, -61, -61, 110, 109, 105,  97,  91,
     3       -39, -59, -74, -89, -95,-100,-100, -51, -51, -48, -44, -34,
     4        88, 111, 121, 126, 131, 132, 133, 138, 143, 153, 176, 298,
     5       308, 312, 315, 315, 364, 364, 359, 353, 338, 323, 303, 173,
     6       167, 159, 155, 154,-101,-101, 364, 364, 154, 155, 159, 167,
     7       173, 303, 323, 338, 353, 359, 364, 364, 315, 315, 312, 308,
     8       298, 176, 153, 143, 138, 133, 132, 131, 126, 121, 111,  88,
     9       -34, -44, -48, -51, -51,-100,-100, -95, -89, -74, -59, -39/
            data (iy(i), i=3001,3039)/
     +        91,  97, 105, 109, 110,  83,  76,  72,  70,  71,  75,  78,
     1        86,  96, 111, 144, 144, 126, 116, 111, 112, 114, 143, 150,
     2       154, 156, 155, 151, 148, 140, 130, 115,  82,  82, 100, 110,
     3       115, 114, 112/
            data (iptr(i), i=1,88)/
     +          1,   12,   76,  160,  210,  222,  232,  317,  329,  333,
     1        365,  377,  383,  396,  406,  504,  540,  634,  685,  795,
     2        803,  845,  852,  865,  877,  886,  896,  950,  997, 1059,
     3       1106, 1174, 1198, 1307, 1342, 1350, 1370, 1382, 1386, 1446,
     4       1485, 1599, 1646, 1693, 1716, 1808, 1834, 1872, 1879, 1892,
     5       1904, 1930, 1940, 2058, 2073, 2141, 2251, 2266, 2342, 2434,
     6       2459, 2553, 2645, 2655, 2661, 2693, 2725, 2740, 2752, 2767,
     7       2771, 2775, 2779, 2787, 2806, 2813, 2821, 2828, 2881, 2889,
     8       2893, 2901, 2908, 2912, 2957, 2961, 3006, 3040/
            data (width(i), i=1,88)/
     +       340, 294, 322, 304, 275, 257, 335, 297,  78, 233,
     1       322, 251, 357, 297, 351, 278, 353, 299, 302, 293,
     2       290, 313, 461, 317, 313, 276, 249, 259, 245, 259,
     3       250, 151, 254, 239,  72, 103, 245,  72, 383, 244,
     4       269, 259, 259, 147, 245, 145, 242, 262, 379, 258,
     5       267, 225, 245, 156, 244, 245, 251, 245, 244, 252,
     6       251, 244,  77,  69, 131, 131, 167, 243,  76, 138,
     7        75, 138,  77,  76, 246, 243, 246, 246, 123, 138,
     8       123, 231, 301, 142,  42, 142, 233, 250/
            data (nseg(i), i=1,88)/
     +      1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
     1      1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
     2      1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,2,1,
     3      2,1,2,1,1,1,1,1,1,1,1,1,0/
            data iymin,iymax,numc/-111, 372, 87/
            data (map(i), i=1,128)/
     +      88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,
     1      88,88,88,88,88,88,88,88,88,88,88,88,63,88,88,88,88,88,64,65,
     2      66,67,68,69,70,71,72,53,54,55,56,57,58,59,60,61,62,73,74,75,
     3      76,77,78,88, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,
     4      17,18,19,20,21,22,23,24,25,26,79,80,81,82,83,88,27,28,29,30,
     5      31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,
     6      51,52,84,85,86,87,88,88/
c
        if(ip(41)==1) then
c
c       initialize message
c
            su(1)='Hello World'
            su(2)='pltmg 11.0'
            su(3)='a(u,v)=(f,v)'
            su(4)='Got Math? :-)'
c           su(1)='ABCDEFGHIJKLM'
c           su(2)='NOPQRSTUVWXYZ'
c           su(3)='abcdefghijklm'
c           su(4)='nopqrstuvwxyz'
c           su(5)='0123456789'
c           su(6)='+-/*=<>? .,'
c           su(7)='():;[]^_{}|!~'
c
c       initialize as laplacian with dirichlet b.c.
c
            do i=1,10
                ru(i)=0.0e0_rknd
            enddo
            ru(1)=1.0e0_rknd
            ru(5)=1.0e0_rknd
            ru(9)=1.0e0_rknd
            ip(8)=1
        endif
c
        ip(5)=max(ip(5),ifirst)
        ip(6)=iprob
        ip(20)=5
c
        sp(2)='message'
        sp(1)='message'
        sp(3)='message'
        sp(6)='message_mpixxx.rw'
        sp(7)='message.jnl'
        sp(9)='message_mpixxx.out'
c
        ibord=1000
        ivsp=100
        ihsp=100
c
c       compute nlines
c
        iwidth=0
        nlines=0
        do j=1,10
            call fstr1(line(nlines+1),nchr,su(j),map)
            if(nchr>0) then
                nlines=nlines+1
                inum(nlines)=nchr
                ii=0
                do i=1,nchr
                    jj=ichar(line(nlines)(i:i))
                    ii=ii+width(map(jj))
                enddo
                iwid(nlines)=ii+ihsp*(nchr-1)
                iwidth=max(iwidth,iwid(nlines))
            endif
        enddo
        iwidth=iwidth+2*ibord
        ihght=(iymax-iymin+1)*nlines+ivsp*(nlines-1)+2*ibord
c
c       layout overall box
c
        nbf=2*nlines+4
        nvf=nbf
        do i=1,nbf
            ibndry(1,i)=i
            ibndry(2,i)=i+1
            ibndry(3,i)=0
            ibndry(4,i)=2
            ibndry(5,i)=0
            ibndry(6,i)=0
            ibndry(7,i)=nlines+1
            sf(1,i)=0.0e0_rknd
            sf(2,i)=0.0e0_rknd
        enddo
        ibndry(2,nbf)=1
        vx(1)=0.0e0_rknd
        vy(1)=real(ihght,rknd)
        vx(nlines+2)=0.0e0_rknd
        vy(nlines+2)=0.0e0_rknd
        vx(nlines+3)=real(iwidth,rknd)
        vy(nlines+3)=0.0e0_rknd
        vx(nvf)=real(iwidth,rknd)
        vy(nvf)=real(ihght,rknd)
        ii=ihght-ibord
        do i=1,nlines
            ii=ii-(iymax-iymin+1)
            vx(i+1)=0.0e0_rknd
            vy(i+1)=real(ii,rknd)
            vx(nvf-i)=real(iwidth,rknd)
            vy(nvf-i)=vy(i+1)
            ileft(i)=i+1
            iright(i)=nvf-i
            ii=ii-ivsp
        enddo
c
c       now do each line
c
        iiy=ihght-ibord
        do k=1,nlines
            iix=(iwidth-iwid(k))/2
            iiy=iiy-(iymax-iymin+1)
            nchr=inum(k)
            do i=1,nchr
                jj=ichar(line(k)(i:i))
                ichr(i)=map(jj)
            enddo
            do i=1,nchr
                mark(i)=nvf
                jchr(i)=ichr(i)
c
c       character outline
c
                if(ichr(i)<=numc) then
                    istart=iptr(ichr(i))
                    istop=iptr(ichr(i)+1)-1
                    do j=istart,istop
                        nvf=nvf+1
                        vx(nvf)=real(iix+ix(j),rknd)
                        vy(nvf)=real(iiy+iy(j),rknd)
                        nbf=nbf+1
                        ibndry(1,nbf)=nvf
                        ibndry(2,nbf)=nvf+1
                        ibndry(3,nbf)=0
                        ibndry(4,nbf)=2
                        ibndry(5,nbf)=0
                        ibndry(6,nbf)=0
                        ibndry(7,nbf)=k
                    enddo
                    if(nseg(ichr(i))==1) then
                        ibndry(2,nbf)=mark(i)+1
                    else
c
c       fix up for characters with two pieces
c
                        ibndry(2,nbf)=nvf-3
                        ibndry(2,nbf-4)=mark(i)+1
                        do j=1,7
                           ibndry(j,nbf+1)=0
                           ibndry(j,nbf+2)=0
                        enddo
                        ibndry(1,nbf+1)=mark(i)+1
                        ibndry(2,nbf+1)=nvf
                        ibndry(1,nbf+2)=mark(i)+2
                        ibndry(2,nbf+2)=nvf-1
                        nbf=nbf+2
                    endif
c
c       add connecting interal edges
c
                    if(i==1) then
                        call lcb(ichr(i),-1_iknd,iv,ix,iy,
     +                      iptr,width,ibord)
                        nbf=nbf+1
                        do j=1,7
                           ibndry(j,nbf)=0
                        enddo
                        ibndry(1,nbf)=ileft(k)
                        ibndry(2,nbf)=mark(i)+iv
                    else
                        call lcc(ichr(i),jchr(i-1),iv,jv,
     +                      ix,iy,iptr,width,ihsp)
                        nbf=nbf+1
                        do j=1,7
                           ibndry(j,nbf)=0
                        enddo
                        ibndry(1,nbf)=mark(i-1)+jv
                        ibndry(2,nbf)=mark(i)+iv
                    endif
                    if(i==nchr) then
                        call lcb(ichr(i),1_iknd,iv,ix,iy,
     +                      iptr,width,ibord)
                        nbf=nbf+1
                        do j=1,7
                           ibndry(j,nbf)=0
                        enddo
                        ibndry(1,nbf)=iright(k)
                        ibndry(2,nbf)=mark(i)+iv
                    endif
                else
                    mark(i)=mark(i-1)
                    jchr(i)=jchr(i-1)
                endif
                iix=iix+width(ichr(i))+ihsp
            enddo
            iiy=iiy-ivsp
        enddo
c
c       put the domains inside the unit square
c
        xmin=vx(1)
        xmax=vx(1)
        ymin=vy(1)
        ymax=vy(1)
        do i=1,nvf
            xmin=min(xmin,vx(i))
            xmax=max(xmax,vx(i))
            ymin=min(ymin,vy(i))
            ymax=max(ymax,vy(i))
        enddo
        scale=1.0e0_rknd/max(xmax-xmin,ymax-ymin)
        xmid=(xmin+xmax)/2.0e0_rknd
        ymid=(ymin+ymax)/2.0e0_rknd
        do i=1,nvf
            vx(i)=0.5e0_rknd+scale*(vx(i)-xmid)
            vy(i)=0.5e0_rknd+scale*(vy(i)-ymid)
        enddo
c
        ip(1)=0
        ip(2)=nvf
        ip(3)=nbf
        rp(15)=hmax
        rp(16)=grade
c
c       create itnode
c
        call sklutl(0_iknd,vx,vy,sf,itnode,ibndry,ip,rp,iflag,sxy)
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine lcc(ic,jc,iv,jv,ix,iy,iptr,width,ihsp)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            integer(kind=iknd), dimension(*) :: ix,iy,width,iptr
cy
c       we assume that char jc is following char ic in the message
c
        jv=0
        iv=0
        jshift=width(jc)+ihsp
        ll=(width(ic)+width(jc)+ihsp)**2+500**2
c
        do i=iptr(ic),iptr(ic+1)-1
            do j=iptr(jc),iptr(jc+1)-1
                kk=(ix(i)+jshift-ix(j))**2+(iy(i)-iy(j))**2
                if(kk<ll) then
                    iv=i-iptr(ic)+1
                    jv=j-iptr(jc)+1
                    ll=kk
                endif
            enddo
        enddo
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine lcb(ic,lr,iv,ix,iy,iptr,width,ibord)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            integer(kind=iknd), dimension(*) :: ix,iy,width,iptr
cy
c       distance from ic to boundary
c
        iv=0
        if(lr==1) then
            jshift=width(ic)+ibord
        else
            jshift=-(width(ic)+ibord)
        endif
        ll=(width(ic)+abs(jshift))**2+500**2
c
        iv=0
        do i=iptr(ic),iptr(ic+1)-1
            kk=(ix(i)-jshift)**2+iy(i)**2
            if(kk<ll) then
                iv=i-iptr(ic)+1
                ll=kk
            endif
        enddo
        return
        end
c-----------------------------------------------------------------------
c
c            piecewise lagrange triangle multi grid package
c
c                    edition 11.0 - - - june, 2012
c
c-----------------------------------------------------------------------
        subroutine fstr1(ss,length,sval,map)
cx
            use mthdef
            implicit real(kind=rknd) (a-h,o-z)
            implicit integer(kind=iknd) (i-n)
            integer(kind=iknd), dimension(*) :: map
            integer(kind=iknd), save :: mxchar
            character(len=1), save :: blank,dbleq
            character(len=80) :: ss,sval
cy
            data blank,dbleq,mxchar/' ','"',80/
c
        istart=mxchar+1
        istop=0
        ss=' '
        do i=1,mxchar
            jj=ichar(sval(i:i))
            if(map(jj)/=88) then
                istart=min(istart,i)
                istop=max(istop,i)
            endif
        enddo
        if(istart>istop) then
            length=0
        else
            length=istop-istart+1
            ss(1:length)=sval(istart:istop)
        endif
        return
        end




