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