      subroutine mpsnam(opr,iswt,name,nchnam,ierror)
      character opr*1,name*80
      include 'iosys.cmn'
      ierror=0
      if(opr.eq.'r'.or.opr.eq.'R') then
        if(iproj.lt.0.or.iproj.gt.9) then
          ierror=1
          return
        endif
        goto (1,2,3,4,5,6,7,8,9,10) iproj+1
    1   name='not specified'
        nchnam=13
        return
    2   name='polyconic'
        nchnam=9
        return
    3   name='ellipsoidal transverse mercator'
        nchnam=31
        return
    4   name='mercator'
        nchnam=8
        return
    5   name='lambert (standard U.S. parallels at 33N and 45N)'
        nchnam=48
        return
    6   name='albers us (parallels at 29.5N and 45.5N)'
        nchnam=40
        return
    7   name='albers alaska (parallels at 55N and 65N)'
        nchnam=40
        return
    8   name='albers hawaii (parallels at 8N and 18N)'
        nchnam=39
        return
    9   name='polar stereographic'
        nchnam=19
        return
   10   name='spherical transverse mercator (DNAG)'
        nchnam=36
        return
      else if(opr.eq.'w'.or.opr.eq.'W') then
        iproj=0
        if(name(1:4).eq.'poly') iproj = 1
        if(name(1:4).eq.'elli') iproj = 2
        if(name(1:4).eq.'merc') iproj = 3
        if(name(1:4).eq.'lamb') iproj = 4
        if(name(1:8).eq.'albers u') iproj = 5
        if(name(1:8).eq.'albers a') iproj = 6
        if(name(1:8).eq.'albers h') iproj = 7
        if(name(1:4).eq.'pola') iproj = 8
        if(name(1:4).eq.'sphe') iproj = 9
      else
        ierror=1
        return
      endif
      end
