File: map.f

package info (click to toggle)
x13as 1.1-b59-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm
  • size: 9,088 kB
  • sloc: fortran: 114,121; makefile: 14
file content (30 lines) | stat: -rw-r--r-- 1,394 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
**==map.f    processed by SPAG 4.03F  at 09:51 on  1 Mar 1994
      SUBROUTINE map(Frcset,Tocset,Str1,Str2)
      IMPLICIT NONE
c----------------------------------------------------------------------
c     Maps fromcset characters to tocset characters within the domain
c of fromcset and copies otherwise.
c----------------------------------------------------------------------
      INCLUDE 'lex.i'
c     -----------------------------------------------------------------
      CHARACTER Frcset*(*),Tocset*(*),Str1*(*),Str2*(*)
      INTEGER ichr,indx,mapind
      EXTERNAL indx
c     -----------------------------------------------------------------
      IF(len(Frcset).ne.len(Tocset))THEN
       CALL inpter(PERROR,Pos,'Map cset''s not the same length')
c     -----------------------------------------------------------------
      ELSE IF(len(Str2).lt.len(Str1))THEN
       CALL inpter(PERROR,Pos,'Map output string not long enough')
c     -----------------------------------------------------------------
      ELSE
       Str2=Str1
c     -----------------------------------------------------------------
       DO ichr=1,len(Str1)
        mapind=indx(Frcset,Str1(ichr:ichr))
        IF(mapind.gt.0)Str2(ichr:ichr)=Tocset(mapind:mapind)
       END DO
      END IF
c     -----------------------------------------------------------------
      RETURN
      END