      subroutine equipt (isystm,isymce,ibravl,ng,tx,fx,igr)             EQUI001
c ----------------------------------------------------------------------EQUI002
c     interprets the  Herman Mauguin symbol for space group             EQUI003
c     modified from a program by H.Burzlaff, Univ. Erlangen             EQUI004
c     J.Appl.Cryst                                                      EQUI005
c ----------------------------------------------------------------------EQUI006
c     This program module is part of the PhysiSoft X-ray Library        EQUI007
c     and may not be sold or reproduced for commercial purposes.        EQUI008
c     Although it has been tested carefully, there is no warranty       EQUI009
c     regarding accuracy or freedom from side-effects.                  EQUI010
c                   (C) 1986-1990 Bernhard Rupp                         EQUI011
c ----------------------------------------------------------------------EQUI012
      integer e(3,3),sym(3,4),sys,sy(20)                                EQUI013
      dimension igr(36),ibra(7),nul(3),sh(3),ts(24,3),te(3),isys(7),    EQUI014
     &          ss(24,3,3),tx(3,24),fx(3,3,24)                          EQUI015
                                                                        EQUI016
      data (isys(i),i=1,7)/7,1,2,4,6,5,3/                               EQUI017
      data (ibra(i),i=1,7)/'P','A','B','C','F','I','R'/                 EQUI018
      data (nul(i),i=1,3)/0,0,0/                                        EQUI019
      data (sh(i),i=1,3)/0.25,0.25,0.25/                                EQUI020
      data (sy(i),i=1,20)/'1','2','3','4','5','6','A','B','C','D','M',  EQUI021
     &                    'N','P','CU','/','-',' ','  ','    ','SP'/    EQUI022
                                                                        EQUI023
                                                                        EQUI024
 1    nbl=-1                                                            EQUI025
      ng=1                                                              EQUI026
      ns=1                                                              EQUI027
      do 2 i=1,24                                                       EQUI028
         do 2 j=1,3                                                     EQUI029
           ts(i,j)=0.0                                                  EQUI030
           tx(j,i)=0.0                                                  EQUI031
           do 2 k=1,3                                                   EQUI032
              e(j,k)=0                                                  EQUI033
              ss(i,j,k)=0                                               EQUI034
              fx(j,k,i)=0                                               EQUI035
 2    continue                                                          EQUI036
      ss(1,1,1)=1                                                       EQUI037
      ss(1,2,2)=1                                                       EQUI038
      ss(1,3,3)=1                                                       EQUI039
      do 3 i=1,3                                                        EQUI040
         te(i)=0.0                                                      EQUI041
         do 3 j=1,4                                                     EQUI042
            sym(i,j)=0                                                  EQUI043
 3    continue                                                          EQUI044
      do 8 i=1,36                                                       EQUI045
         icr=igr(i)                                                     EQUI046
         if (icr.ne.sy(17)) goto  4                                     EQUI047
         nlq=0                                                          EQUI048
         ic=0                                                           EQUI049
         goto  8                                                        EQUI050
 4       if (nbl.ge.0) goto  7                                          EQUI051
         do 5 j=1,7                                                     EQUI052
            nbr=j                                                       EQUI053
            if (icr.eq.ibra(j)) goto  6                                 EQUI054
 5       continue                                                       EQUI055
 6       nbl=0                                                          EQUI056
         ibravl=icr                                                     EQUI057
         goto  8                                                        EQUI058
 7       if (nlq.eq.0) nbl=nbl+1                                        EQUI059
         ic=ic+1                                                        EQUI060
         sym(nbl,ic)=icr                                                EQUI061
         nlq=1                                                          EQUI062
         if (icr.eq.sy(15)) ns=0                                        EQUI063
 8    continue                                                          EQUI064
      do 9 i=1,4                                                        EQUI065
         if (sym(2,i).ne.sy(3)) goto  9                                 EQUI066
         sys=6                                                          EQUI067
         goto  15                                                       EQUI068
 9    continue                                                          EQUI069
      do 11 i=1,4                                                       EQUI070
         if (sym(1,i).ne.sy(3).and.sym(1,i).ne.sy(6)) goto  10          EQUI071
         sys=5                                                          EQUI072
         goto  15                                                       EQUI073
 10      if (sym(1,i).ne.sy(4)) goto  11                                EQUI074
         sys=4                                                          EQUI075
         goto  15                                                       EQUI076
 11   continue                                                          EQUI077
      if (nbl.gt.1) goto  14                                            EQUI078
      if (sym(1,1).ne.sy(1).and.sym(1,1).ne.sy(16)) goto  12            EQUI079
      sys=1                                                             EQUI080
      goto  15                                                          EQUI081
 12   sys=2                                                             EQUI082
      do 13 i=1,4                                                       EQUI083
         sym(2,i)=sym(1,i)                                              EQUI084
 13   continue                                                          EQUI085
      sym(1,1)=sy(1)                                                    EQUI086
      sym(3,1)=sy(1)                                                    EQUI087
 14   sys=3                                                             EQUI088
      if (sym(1,1).eq.sy(1).or.sym(2,1).eq.sy(1)) sys=2                 EQUI089
 15   goto  (16,17,22,46,58,68), sys                                    EQUI090
                                                                        EQUI091
c --- triclinic                                                         EQUI092
 16   if (sym(1,1).eq.sy(16)) ns=0                                      EQUI093
      goto  76                                                          EQUI094
                                                                        EQUI095
c --- monoclinic                                                        EQUI096
 17   ng=2                                                              EQUI097
      do 18 i=1,3                                                       EQUI098
 18      if (sym(i,1).ne.sy(1)) ind=i                                   EQUI099
      id=1                                                              EQUI100
      if (sym(ind,1).eq.sy(2)) id=-1                                    EQUI101
      do 19 i=1,3                                                       EQUI102
 19      ss(2,i,i)=ss(1,i,i)*id                                         EQUI103
      ss(2,ind,ind)=-ss(2,ind,ind)                                      EQUI104
      do 21 i=1,3                                                       EQUI105
         if (sym(i,1).eq.sy(2).and.sym(i,2).eq.sy(1)) ts(2,i)=0.5       EQUI106
         do 21 j=1,4                                                    EQUI107
            if (sym(i,j).eq.sy(7)) ts(2,1)=0.5                          EQUI108
            if (sym(i,j).eq.sy(8)) ts(2,2)=0.5                          EQUI109
            if (sym(i,j).eq.sy(9)) ts(2,3)=0.5                          EQUI110
            if (sym(i,j).eq.sy(12)) goto  20                            EQUI111
            goto  21                                                    EQUI112
 20         k=i+1                                                       EQUI113
            if (k.gt.3) k=k-3                                           EQUI114
            ts(2,k)=0.5                                                 EQUI115
            ts(2,6-k-i)=0.5                                             EQUI116
 21   continue                                                          EQUI117
      goto  76                                                          EQUI118
                                                                        EQUI119
c --- orthorhombic                                                      EQUI120
 22   ng=4                                                              EQUI121
      ic=0                                                              EQUI122
      ind=1                                                             EQUI123
      if (sym(1,1).ne.sy(2).and.sym(2,1).ne.sy(2).and.sym(3,1).ne.sy(2))EQUI124
     1ind=-1                                                            EQUI125
      if (ind.eq.-1) ns=0                                               EQUI126
      do 24 i=1,3                                                       EQUI127
         id=1                                                           EQUI128
         if (sym(i,1).eq.sy(2)) id=-1                                   EQUI129
         do 23 j=1,3                                                    EQUI130
 23         ss(1+i,j,j)=ss(1,j,j)*id*ind                                EQUI131
 24   ss(1+i,i,i)=-ss(1+i,i,i)                                          EQUI132
      do 28 i=1,3                                                       EQUI133
         if (sym(i,1).eq.sy(2).and.sym(i,2).eq.sy(1)) ts(1+i,i)=0.5     EQUI134
         do 28 j=1,4                                                    EQUI135
            if (sym(i,j).eq.sy(7)) ts(1+i,1)=0.5                        EQUI136
            if (sym(i,j).eq.sy(8)) ts(1+i,2)=0.5                        EQUI137
            if (sym(i,j).eq.sy(9)) ts(1+i,3)=0.5                        EQUI138
            if (sym(i,j).eq.sy(12).or.sym(i,j).eq.sy(10)) goto  25      EQUI139
            goto  28                                                    EQUI140
 25         k=i+1                                                       EQUI141
            if (k.gt.3) k=k-3                                           EQUI142
            if (sym(i,j).eq.sy(10)) goto  26                            EQUI143
            ts(1+i,k)=0.5                                               EQUI144
            ts(1+i,6-k-i)=0.5                                           EQUI145
            goto  28                                                    EQUI146
 26         ic=1                                                        EQUI147
            if (ns.eq.1) goto  27                                       EQUI148
            ts(1+i,k)=0.25                                              EQUI149
            ts(1+i,6-k-i)=0.25                                          EQUI150
            goto  28                                                    EQUI151
 27         ts(1+i,1)=0.25                                              EQUI152
            ts(1+i,2)=0.25                                              EQUI153
            ts(1+i,3)=0.25                                              EQUI154
 28   continue                                                          EQUI155
      if (ic.eq.1) goto  76                                             EQUI156
      if (ns.eq.1) goto  36                                             EQUI157
      do 29 i=1,3                                                       EQUI158
         k=1+i                                                          EQUI159
         if (k.gt.3) k=k-3                                              EQUI160
         tc=ts(1+k,i)+ts(1+6-i-k,i)                                     EQUI161
         if (tc.eq.1.0) tc=0.0                                          EQUI162
 29   ts(1+i,i)=tc                                                      EQUI163
                                                                        EQUI164
c --- special treatment of C m m a, C m c a, I m m a                    EQUI165
      if (nbr.eq.1.or.nbr.eq.5) goto  76                                EQUI166
      ma=0                                                              EQUI167
      do 31 i=1,3                                                       EQUI168
         do 30 j=1,4                                                    EQUI169
 30   if (sym(i,j).eq.sy(11)) nul(i)=1                                  EQUI170
 31   ma=ma+nul(i)                                                      EQUI171
      if (nbr.eq.6.and.ma.eq.2) goto  33                                EQUI172
      if (ma.eq.0.or.ma.eq.3.or.nbr.eq.6) goto  76                      EQUI173
      do 32 i=1,3                                                       EQUI174
         if (nul(nbr-1).eq.1) goto  76                                  EQUI175
 32   sh(nbr-1)=0.                                                      EQUI176
                                                                        EQUI177
c --- origin shift                                                      EQUI178
 33   do 35 i=1,ng                                                      EQUI179
         do 35 j=1,3                                                    EQUI180
            do 34 k=1,3                                                 EQUI181
               id=1                                                     EQUI182
               if (j.ne.k) id=0                                         EQUI183
 34         ts(i,j)=ts(i,j)+(id-ss(i,j,k))*sh(k)                        EQUI184
            if (ts(i,j).gt.1.) ts(i,j)=ts(i,j)-1.                       EQUI185
 35   if (ts(i,j).lt.1.0) ts(i,j)=ts(i,j)+1.                            EQUI186
      goto  76                                                          EQUI187
 36   ic=0                                                              EQUI188
      do 37 i=1,3                                                       EQUI189
 37      if (ss(1+i,1,1)*ss(1+i,2,2)*ss(1+i,3,3).eq.-1) ic=1            EQUI190
      if (ic.eq.1) goto  41                                             EQUI191
      tc=ts(2,1)+ts(3,2)+ts(4,3)                                        EQUI192
      if (tc.eq.0.0) goto  76                                           EQUI193
      do 40 i=1,3                                                       EQUI194
         k=i+1                                                          EQUI195
         if (k.gt.3) k=k-3                                              EQUI196
         if (tc.gt.0.5) goto  38                                        EQUI197
         if (ts(1+i,i).eq.0.0) goto  40                                 EQUI198
         m=i-1                                                          EQUI199
         if (m.eq.0) m=m+3                                              EQUI200
         ts(1+m,i)=0.5                                                  EQUI201
         goto  40                                                       EQUI202
 38      if (tc.gt.1.0) goto  39                                        EQUI203
         if (ts(1+i,i).ne.0.0) goto  40                                 EQUI204
         l=k+1                                                          EQUI205
         if (l.gt.3) l=l-3                                              EQUI206
         ts(1+k,l)=0.5                                                  EQUI207
         ts(1+l,k)=0.5                                                  EQUI208
         goto  40                                                       EQUI209
 39      ts(1+i,k)=0.5                                                  EQUI210
 40   continue                                                          EQUI211
      goto  76                                                          EQUI212
 41   do 42 i=1,3                                                       EQUI213
 42      if (ss(1+i,1,1)*ss(1+i,2,2)*ss(1+i,3,3).eq.1) id=i             EQUI214
      do 45 i=1,3                                                       EQUI215
         tc=ts(2,i)+ts(3,i)+ts(4,i)                                     EQUI216
         if (tc.eq.0.0.or.tc.eq.1.0) goto  45                           EQUI217
         if (sym(1,1).eq.sy(11).and.sym(2,1).eq.sy(12).or.sym(2,1).eq.  EQUI218
     1  sy(11).and.sym(3,1).eq.sy(12).or.sym(3,1).eq.sy(11).and.sym(1,1)EQUI219
     2  .eq.sy(12)) goto  44                                            EQUI220
         do 43 j=1,3                                                    EQUI221
            if (id.eq.j) goto  43                                       EQUI222
            if (ts(1+j,i).eq.0.5) goto  43                              EQUI223
            ts(1+j,i)=0.5                                               EQUI224
 43      continue                                                       EQUI225
         goto  45                                                       EQUI226
 44      k=i-1                                                          EQUI227
         if (k.eq.0) k=k+3                                              EQUI228
         ts(1+k,i)=0.5                                                  EQUI229
 45   continue                                                          EQUI230
      goto  76                                                          EQUI231
                                                                        EQUI232
c --- tetragonal                                                        EQUI233
 46   ng=4                                                              EQUI234
      if (nbl.eq.3) ng=8                                                EQUI235
      ss(2,1,2)=-1                                                      EQUI236
      ss(2,2,1)=1                                                       EQUI237
      ss(2,3,3)=1                                                       EQUI238
      m=sym(1,1)                                                        EQUI239
      n=sym(1,2)                                                        EQUI240
      do 47 i=1,3                                                       EQUI241
         do 47 j=1,3                                                    EQUI242
            if (m.eq.sy(16)) ss(2,i,j)=-ss(2,i,j)                       EQUI243
 47   continue                                                          EQUI244
      if (m.eq.sy(16)) goto  50                                         EQUI245
      if (n.eq.sy(1)) ts(2,3)=0.25                                      EQUI246
      if (n.eq.sy(2)) ts(2,3)=0.5                                       EQUI247
      if (n.eq.sy(3)) ts(2,3)=0.75                                      EQUI248
      if (sym(1,3).eq.sy(12).or.(sym(1,4).eq.sy(12).and.nbl.eq.3))      EQUI249
     1ts(2,1)=0.5                                                       EQUI250
      if ((sym(1,4).eq.sy(12).and.nbl.eq.1).or.(n.eq.sy(1).and.ns.eq.1. EQUI251
     1and.nbr.eq.6)) ts(2,2)=0.5                                        EQUI252
      if (n.eq.sy(1).and.ns.eq.0.and.nbr.eq.6) goto  48                 EQUI253
      if (sym(2,2).eq.sy(1).or.(sym(1,4).ne.sy(12).and.sym(2,1).eq.     EQUI254
     1sy(12).and.sym(3,1).eq.sy(11))) goto  49                          EQUI255
      goto  50                                                          EQUI256
 48   ts(2,1)=0.25                                                      EQUI257
      ts(2,2)=0.75                                                      EQUI258
      if (nbl.eq.1) ts(2,1)=0.75                                        EQUI259
      if (nbl.eq.1) ts(2,2)=0.25                                        EQUI260
      goto  50                                                          EQUI261
 49   ts(2,1)=0.5                                                       EQUI262
      ts(2,2)=0.5                                                       EQUI263
 50   ss(3,1,1)=-1                                                      EQUI264
      ss(3,2,2)=-1                                                      EQUI265
      ss(3,3,3)=1                                                       EQUI266
      ts(3,1)=ss(2,1,2)*ts(2,2)+ts(2,1)                                 EQUI267
      ts(3,2)=ss(2,2,1)*ts(2,1)+ts(2,2)                                 EQUI268
      ts(3,3)=ss(2,3,3)*ts(2,3)+ts(2,3)                                 EQUI269
      do 51 i=1,3                                                       EQUI270
 51   if (nbr.eq.6.and.ts(3,1).eq.0.5.and.ts(3,2).eq.0.5.and.ts(3,3).eq.EQUI271
     10.5) ts(3,i)=0.0                                                  EQUI272
      do 52 i=1,3                                                       EQUI273
         ts(4,i)=ts(2,i)                                                EQUI274
         do 52 j=1,3                                                    EQUI275
            ts(4,i)=ts(4,i)+ss(2,i,j)*ts(3,j)                           EQUI276
             do 52 k=1,3                                                EQUI277
                ss(4,i,j)=ss(4,i,j)+ss(2,i,k)*ss(3,k,j)                 EQUI278
 52   continue                                                          EQUI279
      if (nbl.eq.1) goto  76                                            EQUI280
      if (ns.eq.0) goto  56                                             EQUI281
      m=sym(2,1)                                                        EQUI282
      n=sym(3,1)                                                        EQUI283
      if (m.ne.sy(2).and.n.ne.sy(2)) goto  55                           EQUI284
      if (m.eq.sy(2).and.n.eq.sy(2)) goto  54                           EQUI285
      if (m.eq.sy(2)) goto  53                                          EQUI286
      if (m.eq.sy(9).or.m.eq.sy(12)) te(3)=0.5                          EQUI287
      e(1,1)=-1                                                         EQUI288
      e(2,2)=1                                                          EQUI289
      e(3,3)=1                                                          EQUI290
      if (m.ne.sy(12).and.m.ne.sy(8)) goto  57                          EQUI291
      te(1)=0.5                                                         EQUI292
      te(2)=0.5                                                         EQUI293
      goto  57                                                          EQUI294
 53   e(1,1)=1                                                          EQUI295
      e(2,2)=-1                                                         EQUI296
      e(3,3)=-1                                                         EQUI297
      if (n.eq.sy(9)) te(3)=0.5                                         EQUI298
      if (n.eq.sy(10)) te(3)=0.25                                       EQUI299
      if (n.eq.sy(10)) te(2)=0.5                                        EQUI300
      if (sym(2,2).ne.sy(1)) goto  57                                   EQUI301
      te(1)=0.5                                                         EQUI302
      te(2)=0.5                                                         EQUI303
      goto  57                                                          EQUI304
 54   e(1,2)=1                                                          EQUI305
      e(2,1)=1                                                          EQUI306
      e(3,3)=-1                                                         EQUI307
      if (sym(2,2).ne.0.or.nbr.eq.6.or.sym(1,2).eq.0) goto  57          EQUI308
      if (sym(1,2).eq.sy(1)) te(3)=0.75                                 EQUI309
      if (sym(1,2).eq.sy(2)) te(3)=0.5                                  EQUI310
      if (sym(1,2).eq.sy(3)) te(3)=0.25                                 EQUI311
      goto  57                                                          EQUI312
 55   m=sym(2,1)                                                        EQUI313
      e(1,1)=-1                                                         EQUI314
      e(2,2)=1                                                          EQUI315
      e(3,3)=1                                                          EQUI316
      if (m.eq.sy(9).or.m.eq.sy(12)) te(3)=0.5                          EQUI317
      if (m.eq.sy(12).or.m.eq.sy(8)) te(1)=0.5                          EQUI318
      if (m.eq.sy(12).or.m.eq.sy(8)) te(2)=0.5                          EQUI319
      goto  57                                                          EQUI320
 56   e(1,1)=-1                                                         EQUI321
      e(2,2)=1                                                          EQUI322
      e(3,3)=1                                                          EQUI323
      if (sym(2,1).eq.sy(9).or.sym(2,1).eq.sy(12)) te(3)=0.5            EQUI324
      if (sym(2,1).eq.sy(8).or.sym(2,1).eq.sy(12)) te(2)=0.5            EQUI325
      if (sym(2,1).eq.sy(8).or.sym(2,1).eq.sy(12)) te(1)=0.5            EQUI326
      if (sym(1,3).eq.sy(12).or.sym(1,4).eq.sy(12)) te(1)=te(1)+0.5     EQUI327
 57   ne=4                                                              EQUI328
      goto  74                                                          EQUI329
c --- hexagonal                                                         EQUI330
 58   ng=3                                                              EQUI331
      m=sym(1,1)                                                        EQUI332
      n=sym(1,2)                                                        EQUI333
      if (m.eq.sy(16).and.n.eq.sy(3)) ns=0                              EQUI334
      if (m.eq.sy(6)) goto  61                                          EQUI335
      ss(2,1,2)=-1                                                      EQUI336
      ss(2,2,1)=1                                                       EQUI337
      ss(2,2,2)=-1                                                      EQUI338
      ss(2,3,3)=1                                                       EQUI339
      if (n.eq.sy(1)) ts(2,3)=1.0/3.0                                   EQUI340
      if (n.eq.sy(2)) ts(2,3)=2.0/3.0                                   EQUI341
      ss(3,1,1)=-1                                                      EQUI342
      ss(3,2,1)=-1                                                      EQUI343
      ss(3,1,2)=1                                                       EQUI344
      ss(3,3,3)=1                                                       EQUI345
      ts(3,3)=2.0*ts(2,3)                                               EQUI346
      if (ts(3,3).ge.1.0) ts(3,3)=ts(3,3)-1.0                           EQUI347
      if (nbl.eq.1.and.n.ne.sy(6)) goto  76                             EQUI348
      if (n.ne.sy(6)) goto  60                                          EQUI349
      ng=ng+ng                                                          EQUI350
      do 59 i=1,3                                                       EQUI351
         do 59 j=1,3                                                    EQUI352
            do 59 k=1,3                                                 EQUI353
               ss(3+i,j,k)=ss(i,j,k)                                    EQUI354
               ss(3+i,3,3)=-1                                           EQUI355
 59   continue                                                          EQUI356
 60   if (nbl.eq.1) goto  76                                            EQUI357
      if (sym(2,1).ne.sy(9).and.sym(3,1).ne.sy(9)) goto  63             EQUI358
      ts(4,3)=0.5                                                       EQUI359
      ts(5,3)=0.5                                                       EQUI360
      ts(6,3)=0.5                                                       EQUI361
      goto  63                                                          EQUI362
 61   ng=ng+ng                                                          EQUI363
      ss(2,1,1)=1                                                       EQUI364
      ss(2,1,2)=-1                                                      EQUI365
      ss(2,2,1)=1                                                       EQUI366
      ss(2,3,3)=1                                                       EQUI367
      if (n.eq.sy(1)) ts(2,3)=1.0/6.0                                   EQUI368
      if (n.eq.sy(2)) ts(2,3)=2.0/6.0                                   EQUI369
      if (n.eq.sy(3)) ts(2,3)=3.0/6.0                                   EQUI370
      if (n.eq.sy(4)) ts(2,3)=4.0/6.0                                   EQUI371
      if (n.eq.sy(5)) ts(2,3)=5.0/6.0                                   EQUI372
      do 62 i=1,4                                                       EQUI373
         do 62 j=1,3                                                    EQUI374
            ts(2+i,j)=ts(2,j)                                           EQUI375
            do 62 k=1,3                                                 EQUI376
               ts(2+i,j)=ts(2+i,j)+ss(2,j,k)*ts(1+i,k)                  EQUI377
               if (ts(2+i,j).gt.1.0) ts(2+i,j)=ts(2+i,j)-1.0            EQUI378
               do 62 l=1,3                                              EQUI379
                  ss(2+i,j,k)=ss(2+i,j,k)+ss(2,j,l)*ss(1+i,l,k)         EQUI380
 62   continue                                                          EQUI381
      if (nbl.eq.1) goto  76                                            EQUI382
 63   ng=ng+ng                                                          EQUI383
      m=sym(2,1)                                                        EQUI384
      n=sym(3,1)                                                        EQUI385
      if (m.eq.sy(1)) goto  65                                          EQUI386
      if (m.eq.sy(2)) goto  64                                          EQUI387
      e(1,2)=-1                                                         EQUI388
      e(2,1)=-1                                                         EQUI389
      e(3,3)=1                                                          EQUI390
      if (m.eq.sy(9)) te(3)=0.5                                         EQUI391
      goto  67                                                          EQUI392
 64   e(1,2)=1                                                          EQUI393
      e(2,1)=1                                                          EQUI394
      e(3,3)=-1                                                         EQUI395
      te(3)=2.0*ts(2,3)                                                 EQUI396
                                                                        EQUI397
c --- group p 31 i 2 and p 32 i 2                                       EQUI398
      if (sym(1,1).eq.sy(3).and.(sym(1,2).eq.sy(1).or.sym(1,2).eq.      EQUI399
     1sy(2))) te(3)=0.                                                  EQUI400
      goto  67                                                          EQUI401
 65   if (n.eq.sy(2)) goto  66                                          EQUI402
      e(1,2)=1                                                          EQUI403
      e(2,1)=1                                                          EQUI404
      e(3,3)=1                                                          EQUI405
      if (n.eq.sy(9)) te(3)=0.5                                         EQUI406
      goto  67                                                          EQUI407
 66   e(1,2)=-1                                                         EQUI408
      e(2,1)=-1                                                         EQUI409
      e(3,3)=-1                                                         EQUI410
      te(3)=2.0*ts(2,3)                                                 EQUI411
      if (te(3).gt.1.0) te(3)=te(3)-1.0                                 EQUI412
 67   ne=6                                                              EQUI413
      if (sym(1,1).eq.sy(3).or.(sym(1,2).eq.sy(3).and.sym(1,1).eq.      EQUI414
     1sy(16))) ne=3                                                     EQUI415
      goto  74                                                          EQUI416
                                                                        EQUI417
c --- cubic                                                             EQUI418
 68   ng=12                                                             EQUI419
      if (nbl.eq.3) ng=24                                               EQUI420
      if (sym(1,1).ne.sy(2).and.sym(1,1).ne.sy(4).and.sym(1,1).ne.      EQUI421
     1sy(16)) ns=0                                                      EQUI422
      do 69 i=1,3                                                       EQUI423
         do 69 j=1,3                                                    EQUI424
            ss(1+i,j,j)=1                                               EQUI425
            if (i.eq.j) goto  69                                        EQUI426
            ss(1+i,j,j)=-1                                              EQUI427
            if (sym(1,1).eq.sy(12)) ts(1+i,j)=0.5                       EQUI428
            if (sym(1,1).eq.sy(10)) ts(1+i,j)=0.25                      EQUI429
 69   continue                                                          EQUI430
      if (sym(1,1).ne.sy(7).and.sym(3,1).ne.sy(10).and.sym(1,2).ne.sy(3)EQUI431
     1.and.sym(1,2).ne.sy(1).or.nbr.eq.5) goto  71                      EQUI432
      do 70 i=1,3                                                       EQUI433
         ts(1+i,i)=0.5                                                  EQUI434
         k=i+1                                                          EQUI435
         if (k.eq.4) k=1                                                EQUI436
 70   ts(1+i,k)=0.5                                                     EQUI437
 71   do 72 i=1,4                                                       EQUI438
         do 72 j=1,3                                                    EQUI439
            do 72 k=1,3                                                 EQUI440
               l=j+1                                                    EQUI441
               if (l.eq.4) l=1                                          EQUI442
               m=j-1                                                    EQUI443
               if (m.eq.0) m=3                                          EQUI444
               ss(4+i,j,k)=ss(i,l,k)                                    EQUI445
               ss(8+i,j,k)=ss(i,m,k)                                    EQUI446
               ts(4+i,j)=ts(i,l)                                        EQUI447
 72   ts(8+i,j)=ts(i,m)                                                 EQUI448
      if (ng.eq.12) goto  76                                            EQUI449
      ne=12                                                             EQUI450
      e(1,2)=1                                                          EQUI451
      e(2,1)=1                                                          EQUI452
      e(3,3)=1                                                          EQUI453
      if (sym(3,1).eq.sy(2)) e(3,3)=-1                                  EQUI454
      if (sym(3,1).eq.sy(9)) te(3)=0.5                                  EQUI455
      do 73 i=1,3                                                       EQUI456
         if (sym(3,1).eq.sy(12).or.sym(1,2).eq.sy(2)) te(i)=0.5         EQUI457
 73   if (sym(3,1).eq.sy(10).or.sym(1,2).eq.sy(1).or.sym(1,2).eq.sy(3)) EQUI458
     1te(i)=0.25                                                        EQUI459
      if (sym(1,2).eq.sy(1).and.nbr.eq.1) te(1)=0.75                    EQUI460
      if ((sym(1,2).ne.sy(1).or.nbr.ne.6).and.(sym(1,2).ne.sy(3).or.nbr EQUI461
     1.ne.1)) goto  74                                                  EQUI462
      te(2)=0.75                                                        EQUI463
      te(3)=0.75                                                        EQUI464
 74   do 75 i=1,ne                                                      EQUI465
         do 75 j=1,3                                                    EQUI466
            ts(ne+i,j)=te(j)                                            EQUI467
            do 75 k=1,3                                                 EQUI468
               ts(ne+i,j)=ts(ne+i,j)+e(j,k)*ts(i,k)                     EQUI469
               do 75 l=1,3                                              EQUI470
                  ss(ne+i,j,k)=ss(ne+i,j,k)+e(j,l)*ss(i,l,k)            EQUI471
 75   continue                                                          EQUI472
 76   do 81 i=1,ng                                                      EQUI473
         do 81 j=1,3                                                    EQUI474
 77         if (ts(i,j).ge.1.0) goto  78                                EQUI475
            goto  79                                                    EQUI476
 78         ts(i,j)=ts(i,j)-1.0                                         EQUI477
            goto  77                                                    EQUI478
 79         if (ts(i,j).lt.0.0) goto  80                                EQUI479
            goto  81                                                    EQUI480
 80         ts(i,j)=ts(i,j)+1.0                                         EQUI481
            goto  79                                                    EQUI482
 81   continue                                                          EQUI483
      isystm=isys(sys)                                                  EQUI484
      if (ns.eq.0) isymce=1                                             EQUI485
      if (ns.eq.1) isymce=0                                             EQUI486
                                                                        EQUI487
c --- swap ss(i,j,k) to fx(k,i,j)                                       EQUI488
      do 2004 i=1,3                                                     EQUI489
         do 2004 ij=1,3                                                 EQUI490
            do 2004 ik=1,ng                                             EQUI491
               fx(i,ij,ik)=ss(ik,ij,i)                                  EQUI492
               tx(ij,ik)=ts(ik,ij)                                      EQUI493
 2004 continue                                                          EQUI494
                                                                        EQUI495
c --- increase ng by one (identity transformation)                      EQUI496
      if (ng.eq.0) ng=1                                                 EQUI497
      return                                                            EQUI498
      end                                                               EQUI499
                                                                        EQUI500
                                                                        EQUI501
