      include 'gplapncd.for'
C This code was written by the program
C <TABLO  Version 5.5   February 2005>
      use tgmnz
      use gpcm
      use gsinc1
      use gsinc3
      use gsinc4
      use gsinc5
      use gsinc5b
      use gsinc6
      use gsinc7
      use gsinc8
      use gscomp
      use TGSMVL
      use gpbas1
      use tgdebg
      use gpmain1
      use smvlst0
      use psimmod1
      use psimmod2
      USE SIMRES0
      use decomp_
      include 'tggsdec1.for'
      CHARACTER*70 PROGNV
      PARAMETER(PROGNV=
     *'<decomp.for 25-JUL-2007 (a TABLO-generated program)>')
      INTEGER PRVERI
      PARAMETER(PRVERI=34000)
      CHARACTER (LEN=9) DATES
      PARAMETER(DATES='1987-2005')
      CHARACTER*6 PRNAME
      PARAMETER(PRNAME='TGPROG')
      INTEGER DMMTOG
C Map from coefficient names in code to names in model specification
C
C      Name in code       Name used in model specification
C      ---------------------------------------------------
C         C00001            BEVOA
C         C00002            BEVFA
C         C00003            BVIFA
C         C00004            BVDFA
C         C00005            BVOA
C         C00006            CNTco2trd
C         C00007            CNTalleffr
C         C00008            CNTendwr
C         C00009            CNTtechr
C         C00010            CNTpopr
C         C00011            CNTtotr
C         C00012            CNTcgdsr
C         C00013            CNTdpar
C         C00014            WELFARE
C         C00015            CNTalleffir
C         C00016            CNTalldemd
C         C00017            CNTqor
C         C00018            CNTqfer
C         C00019            CNTqfmr
C         C00020            CNTqfdr
C         C00021            CNTallir
C         C00022            CNTqpmr
C         C00023            CNTqpdr
C         C00024            CNTallpr
C         C00025            CNTqgmr
C         C00026            CNTqgdr
C         C00027            CNTallgr
C         C00028            CNTqxsr
C         C00029            CNTqimr
C         C00030            CNTalleffkr
C         C00031            BVDPM
C         C00032            BVDGM
C         C00033            BVDFM
C         C00034            UVDPM
C         C00035            UVDGM
C         C00036            UVDFM
C         C00037            UVIFA
C         C00038            UVDFA
C         C00039            BVXMD
C         C00040            UVXMD
C         C00041            CNTqoir
C         C00042            OTAX
C         C00043            BVFM
C         C00044            BVDM
C         C00045            BVST
C         C00046            BVOM
C         C00047            qo
C         C00048            BOUTAX
C         C00049            UVFM
C         C00050            UVDM
C         C00051            UVST
C         C00052            UEVOA
C         C00053            UEVFA
C         C00054            UVOA
C         C00055            UVOM
C         C00056            UOUTAX
C         C00057            OUTPUT
C         C00058            CNTqfmir
C         C00059            CNTqpmir
C         C00060            CNTqgmir
C         C00061            CNTqfdir
C         C00062            CNTqpdir
C         C00063            CNTqgdir
C         C00064            ATAX
C         C00065            CNTqfmijr
C         C00066            CNTqfdijr
C         C00067            STAX
C         C00068            BVIFM
C         C00069            qfm
C         C00070            qfd
C         C00071            UVIFM
C         C00072            FIRM
C         C00073            BVIPM
C         C00074            qpm
C         C00075            qpd
C         C00076            BVIPA
C         C00077            UVIPA
C         C00078            UVIPM
C         C00079            BVDPA
C         C00080            UVDPA
C         C00081            PRIVATE
C         C00082            BVIGM
C         C00083            qgm
C         C00084            qgd
C         C00085            BVIGA
C         C00086            UVIGA
C         C00087            UVIGM
C         C00088            BVDGA
C         C00089            UVDGA
C         C00090            GOVT
C         C00091            CNTqxsirs
C         C00092            CNTqimisr
C         C00093            TTAX
C         C00094            BVIMS
C         C00095            BVIWS
C         C00096            BIMTAX
C         C00097            BVXWD
C         C00098            BEXTAX
C         C00099            UVIMS
C         C00100            UVIWS
C         C00101            UIMTAX
C         C00102            UVXWD
C         C00103            UEXTAX
C         C00104            qxs
C         C00105            TRADE
C         C00106            CNTqfeir
C         C00107            CNTqfeijr
C         C00108            BENDTAX
C         C00109            UENDTAX
C         C00110            qfe
C         C00111            PFACTOR
C         C00112            CNTendwir
C         C00113            CNTendw
C         C00114            CNTkbr
C         C00115            CNTtech_aor
C         C00116            CNTtech_afr
C         C00117            CNTtech_atrr
C         C00118            CNTtech_amsr
C         C00119            CNTtech
C         C00120            CNTtech_aoir
C         C00121            Ctech_afijr
C         C00122            Ctech_mirs
C         C00123            Ctech_amsirs
C         C00124            c1_ir
C         C00125            c2_ir
C         C00126            c3_ir
C         C00127            TOT
C         C00128            BSAVE
C         C00129            BVDEP
C         C00130            NETINV
C         C00131            ISBAL
C         C00132            pcgds
C         C00133            psave
C         C00134            CGDSCOMP
C
C Declarations of all coefficients
C      REAL C00001(0,0),C00002(0,0,0),C00003(0,0,0),C00004(0,0,0)
C      REAL C00005(0,0),C00006(0),C00007(0),C00008(0),C00009(0)
C      REAL C00010(0),C00011(0),C00012(0),C00013(0),C00014(0,8)
C      REAL C00015(0,0),C00016(0,0),C00017(0),C00018(0),C00019(0)
C      REAL C00020(0),C00021(0),C00022(0),C00023(0),C00024(0),C00025(0)
C      REAL C00026(0),C00027(0),C00028(0),C00029(0),C00030(0,7)
C      REAL C00031(0,0),C00032(0,0),C00033(0,0,0),C00034(0,0)
C      REAL C00035(0,0),C00036(0,0,0),C00037(0,0,0),C00038(0,0,0)
C      REAL C00039(0,0,0),C00040(0,0,0),C00041(0,0),C00042(0,0)
C      REAL C00043(0,0,0),C00044(0,0),C00045(0,0),C00046(0,0)
C      REAL C00047(0,0),C00048(0,0),C00049(0,0,0),C00050(0,0)
C      REAL C00051(0,0),C00052(0,0),C00053(0,0,0),C00054(0,0)
C      REAL C00055(0,0),C00056(0,0),C00057(0,0,4),C00058(0,0)
C      REAL C00059(0,0),C00060(0,0),C00061(0,0),C00062(0,0),C00063(0,0)
C      REAL C00064(0,3,0,2),C00065(0,0,0),C00066(0,0,0),C00067(0,0,0,2)
C      REAL C00068(0,0,0),C00069(0,0,0),C00070(0,0,0),C00071(0,0,0)
C      REAL C00072(0,0,0,2,4),C00073(0,0),C00074(0,0),C00075(0,0)
C      REAL C00076(0,0),C00077(0,0),C00078(0,0),C00079(0,0),C00080(0,0)
C      REAL C00081(0,0,2,4),C00082(0,0),C00083(0,0),C00084(0,0)
C      REAL C00085(0,0),C00086(0,0),C00087(0,0),C00088(0,0),C00089(0,0)
C      REAL C00090(0,0,2,4),C00091(0,0,0),C00092(0,0,0),C00093(0,0,0,2)
C      REAL C00094(0,0,0),C00095(0,0,0),C00096(0,0,0),C00097(0,0,0)
C      REAL C00098(0,0,0),C00099(0,0,0),C00100(0,0,0),C00101(0,0,0)
C      REAL C00102(0,0,0),C00103(0,0,0),C00104(0,0,0),C00105(0,0,0,4,2)
C      REAL C00106(0,0),C00107(0,0,0),C00108(0,0,0),C00109(0,0,0)
C      REAL C00110(0,0,0),C00111(0,0,0,4),C00112(0,0),C00113(0,0)
C      REAL C00114(0),C00115(0),C00116(0),C00117(0),C00118(0)
C      REAL C00119(0,4),C00120(0,0),C00121(0,0,0),C00122(0,0,0,0)
C      REAL C00123(0,0,0),C00124(0,0),C00125(0,0),C00126(0,0)
C      REAL C00127(0,0,3,2),C00128(0),C00129(0),C00130(0),C00131(0)
C      REAL C00132(0),C00133(0),C00134(0,3)
C Finish of declarations of all coefficients
C Map from index names in code to names in model specification
C
C      Name in code       Name used in model specification
C      ---------------------------------------------------
C         I00001            i
C         I00002            r
C         I00003            j
C         I00004            k
C         I00005            s
C         I00006            m
C         I00007            h
C         I00009            t
      istgprog=.TRUE.
      isgemsim=.NOT.istgprog
      dmmtog=0
      mxgsrs=0
      mxgsis=0
      mxgslg=0
      mxgsop=0
      mxgsin=0
      mxgsrc=0
      mxgsic=0
      AXSFIL='decomp'
      AXTFIL=AXSFIL
      include 'tggscod1.for'
      include 'tggscod2.for'
      include 'tggscod3.for'
200    CONTINUE
      include 'tggscod4.for'
      CALL M00001(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL M00002(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL M00003(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL M00004(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL M00005(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL M00006(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(EXSUSE) THEN
        CALL GPREW(EXSUN,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
1000  CONTINUE
      include 'tgdeac3t.for'
      include 'tggscod6.for'
3000  CONTINUE
 3380 CONTINUE
      GOTO 5900
5850  CONTINUE
      include 'tggspre1.for'
      include 'tggsei0.for'
8300  continue
7006  CONTINUE
8100  CONTINUE
      include 'tggsend2.for'
9000  CONTINUE
      include 'tggsend3.for'
      END
      SUBROUTINE S00001(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00001,C00005,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00001(SSZ(6),SSZ(1))
      REAL C00005(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BVOA"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(6)
      C00005(SSMP(SSMPST(7)-1+SSMP(SSMPST(5)-1+I00001)),I00002)=
     *  C00001(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BVOA"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00001')
      RETURN
      END
      SUBROUTINE S00002(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00002,C00003,C00004,C00005,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2
      LOGICAL ECHO1
      REAL C00002(SSZ(6),SSZ(8),SSZ(1))
      REAL C00003(SSZ(2),SSZ(8),SSZ(1))
      REAL C00004(SSZ(2),SSZ(8),SSZ(1))
      REAL C00005(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BVOA"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(8)
      RS1=0.0
      DO 3 I00003=1,SSZ(6)
      RS1=RS1+C00002(I00003,I00001,I00002)
    3 CONTINUE
      RS2=0.0
      DO 4 I00003=1,SSZ(2)
      RS2=RS2+C00003(I00003,I00001,I00002)+C00004(I00003,I00001,I00002)
    4 CONTINUE
      C00005(SSMP(SSMPST(9)-1+I00001),I00002)=RS1+RS2
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BVOA"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00002')
      RETURN
      END
      SUBROUTINE S00003(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00006,C00014,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00006(SSZ(1))
      REAL C00014(SSZ(1),SSZ(13))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00014(I00002,1)=C00006(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00003')
      RETURN
      END
      SUBROUTINE S00004(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00007,C00014,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00007(SSZ(1))
      REAL C00014(SSZ(1),SSZ(13))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00014(I00002,2)=C00007(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00004')
      RETURN
      END
      SUBROUTINE S00005(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00008,C00014,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00008(SSZ(1))
      REAL C00014(SSZ(1),SSZ(13))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00014(I00002,3)=C00008(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00005')
      RETURN
      END
      SUBROUTINE S00006(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00009,C00014,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00009(SSZ(1))
      REAL C00014(SSZ(1),SSZ(13))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00014(I00002,4)=C00009(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00006')
      RETURN
      END
      SUBROUTINE M00001(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      USE GSINC4
      USE GSINC7
      USE GSINC4
      USE decomp_c5
      USE TGSMVL
      USE GSINC1
      USE GSINC5
      USE SMVLST0
      USE TGDEBG
      USE PSIMMOD1
      USE SIMRES0
      USE GSINC3
      USE GSINC6
      INTEGER MMI,MMR
      INTEGER RDUN,WRUN,CWKUN,MMRDR
      INTEGER NUMFL,AXSUN,AXTUN
      INTEGER KSINT,NSINT,KSINTA
      REAL RWA(DWA)
      INTEGER DSPUN,DSPPW,DSPPL,DSPDEC
      INTEGER IWA(DIWA),TMPI1
      INTEGER KMSTSL
      LOGICAL AUTACC,CONTSI
      CHARACTER*(*) MINSFL,UDRTST,INRTST
      REAL MINSIL
      DOUBLE PRECISION SILEN
      INTEGER DRCOW
      PARAMETER(DRCOW=1)
      REAL RCOW(DRCOW)
      CHARACTER*(*) LFFOWR,WTMO
      CHARACTER*(*) ERRMES
      LOGICAL DOUD
      LOGICAL SKPSMD,LOWMEM,CALC1,FSTPAS,CTRTHR,SUVFI,TMPLG1
      LOGICAL DSALLS,WTALLS,DODS,DOWR,DOEQ,OVOK,SERTAB
      LOGICAL DSPANP,DSPOIM,D1DROW,NELTX
      INTEGER KSTEPA,NPASSA,DSPCPN,DSPCLN
      INTEGER DSSMAP,SSMAP(DSSMAP)
      INTEGER LFNORD,LFNOWR,RDFSNO,WRFSNO
      INTEGER SSNO,LITSN,SETNO
      CHARACTER SSTP,SETTP
      LOGICAL DOTHIS
      COMMON/DTHIS/DOTHIS
      LOWMEM=.FALSE.
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(6,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(7,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(8,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(9,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(10,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(11,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(12,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(13,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(17,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(18,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(19,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(20,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(21,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(22,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(23,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(24,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(25,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(26,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(27,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(28,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(29,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(114,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(115,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(116,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(117,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(118,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(128,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(129,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(130,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(131,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(132,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(133,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(31,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(32,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(34,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(35,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(39,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(40,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(44,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(50,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(58,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(59,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(60,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(61,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(62,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(63,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(73,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(74,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(75,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(76,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(77,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(78,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(79,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(80,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(82,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(83,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(84,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(85,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(86,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(87,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(88,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(89,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(91,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(92,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(94,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(95,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(96,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(97,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(98,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(99,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(100,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(101,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(102,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(103,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(104,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(123,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(124,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(125,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(126,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(45,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(51,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(122,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=3
       SSNO=1
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,1,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=4
       SSNO=2
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,2,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(1,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(52,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(106,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(112,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(113,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(2,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(3,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(4,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(33,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(36,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(37,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(38,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(43,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(49,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(53,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(65,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(66,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(68,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(69,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(70,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(71,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(107,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(108,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(109,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(110,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(120,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=2
       SSNO=3
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,3,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=5
       SSNO=4
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,4,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(15,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(16,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=6
       SSNO=5
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,5,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=2
       SSNO=6
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,6,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(5,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(41,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(42,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(46,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(47,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(48,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(54,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(55,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(56,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=9
       SSNO=7
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,7,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=5
       SSNO=8
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,8,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=8
       SSNO=9
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,9,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=7
       SSNO=10
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,10,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(30,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(93,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=12
       SSNO=11
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,11,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(14,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(119,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(67,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(64,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(57,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(72,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(81,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(90,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM) THEN
       CALL SSAL1C(111,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(105,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(127,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(134,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(47).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BVOA',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(47).NE.'n') then
      CALL S00001(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(47),
     *  C00001,C00005,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(48).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BVOA',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(48).NE.'n') then
      CALL S00002(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(48),
     *  C00002,C00003,C00004,C00005,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(66).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'WELFARE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(66).NE.'n') then
      CALL S00003(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(66),
     *  C00006,C00014,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(67).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'WELFARE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(67).NE.'n') then
      CALL S00004(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(67),
     *  C00007,C00014,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(68).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'WELFARE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(68).NE.'n') then
      CALL S00005(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(68),
     *  C00008,C00014,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(69).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'WELFARE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(69).NE.'n') then
      CALL S00006(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(69),
     *  C00009,C00014,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      RETURN
15000 CALL PERET('M00001')
      RETURN
      END
      SUBROUTINE S00007(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00010,C00014,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00010(SSZ(1))
      REAL C00014(SSZ(1),SSZ(13))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00014(I00002,5)=C00010(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00007')
      RETURN
      END
      SUBROUTINE S00008(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00011,C00014,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00011(SSZ(1))
      REAL C00014(SSZ(1),SSZ(13))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00014(I00002,6)=C00011(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00008')
      RETURN
      END
      SUBROUTINE S00009(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00012,C00014,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00012(SSZ(1))
      REAL C00014(SSZ(1),SSZ(13))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00014(I00002,7)=C00012(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00009')
      RETURN
      END
      SUBROUTINE S00010(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00013,C00014,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00013(SSZ(1))
      REAL C00014(SSZ(1),SSZ(13))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00014(I00002,8)=C00013(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "WELFARE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00010')
      RETURN
      END
      SUBROUTINE S00011(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00015,C00016,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00015(SSZ(9),SSZ(1))
      REAL C00016(SSZ(1),SSZ(9))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTalldemd"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      DO 2 I00001=1,SSZ(9)
      C00016(I00002,I00001)=C00015(I00001,I00002)
    2 CONTINUE
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTalldemd"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00011')
      RETURN
      END
      SUBROUTINE S00012(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00019,C00020,C00021,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00019(SSZ(1))
      REAL C00020(SSZ(1))
      REAL C00021(SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTallir"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00021(I00002)=C00019(I00002)+C00020(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTallir"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00012')
      RETURN
      END
      SUBROUTINE S00013(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00022,C00023,C00024,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00022(SSZ(1))
      REAL C00023(SSZ(1))
      REAL C00024(SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTallpr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00024(I00002)=C00022(I00002)+C00023(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTallpr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00013')
      RETURN
      END
      SUBROUTINE S00014(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00025,C00026,C00027,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00025(SSZ(1))
      REAL C00026(SSZ(1))
      REAL C00027(SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTallgr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00027(I00002)=C00025(I00002)+C00026(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTallgr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00014')
      RETURN
      END
      SUBROUTINE S00015(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00018,C00030,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00018(SSZ(1))
      REAL C00030(SSZ(1),SSZ(11))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00030(I00002,1)=C00018(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00015')
      RETURN
      END
      SUBROUTINE S00016(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00017,C00030,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00017(SSZ(1))
      REAL C00030(SSZ(1),SSZ(11))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00030(I00002,2)=C00017(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00016')
      RETURN
      END
      SUBROUTINE S00017(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00021,C00030,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00021(SSZ(1))
      REAL C00030(SSZ(1),SSZ(11))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00030(I00002,3)=C00021(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00017')
      RETURN
      END
      SUBROUTINE S00018(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00024,C00030,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00024(SSZ(1))
      REAL C00030(SSZ(1),SSZ(11))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00030(I00002,4)=C00024(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00018')
      RETURN
      END
      SUBROUTINE S00019(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00027,C00030,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00027(SSZ(1))
      REAL C00030(SSZ(1),SSZ(11))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00030(I00002,5)=C00027(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00019')
      RETURN
      END
      SUBROUTINE S00020(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00028,C00030,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00028(SSZ(1))
      REAL C00030(SSZ(1),SSZ(11))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00030(I00002,6)=C00028(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00020')
      RETURN
      END
      SUBROUTINE S00021(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00029,C00030,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00029(SSZ(1))
      REAL C00030(SSZ(1),SSZ(11))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00030(I00002,7)=C00029(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTalleffkr"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00021')
      RETURN
      END
      SUBROUTINE S00022(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00041,C00042,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00041(SSZ(10),SSZ(1))
      REAL C00042(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "OTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(10)
      C00042(I00001,I00002)=C00041(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "OTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00022')
      RETURN
      END
      SUBROUTINE S00023(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00031,C00032,C00033,C00044,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00031(SSZ(2),SSZ(1))
      REAL C00032(SSZ(2),SSZ(1))
      REAL C00033(SSZ(2),SSZ(8),SSZ(1))
      REAL C00044(SSZ(2),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BVDM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=0.0
      DO 3 I00003=1,SSZ(8)
      RS1=RS1+C00033(I00001,I00003,I00002)
    3 CONTINUE
      C00044(I00001,I00002)=C00031(I00001,I00002)+C00032(I00001,I00002)+
     *  RS1
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BVDM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00023')
      RETURN
      END
      SUBROUTINE S00024(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00043,C00046,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00043(SSZ(6),SSZ(8),SSZ(1))
      REAL C00046(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(6)
      RS1=0.0
      DO 3 I00003=1,SSZ(8)
      RS1=RS1+C00043(I00001,I00003,I00002)
    3 CONTINUE
      C00046(SSMP(SSMPST(7)-1+SSMP(SSMPST(5)-1+I00001)),I00002)=RS1
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00024')
      RETURN
      END
      SUBROUTINE S00025(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00039,C00044,C00045,C00046,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER I00005
      INTEGER I00006
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00039(SSZ(2),SSZ(1),SSZ(1))
      REAL C00044(SSZ(2),SSZ(1))
      REAL C00045(SSZ(3),SSZ(1))
      REAL C00046(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00006=1,SSZ(3)
      RS1=0.0
      DO 3 I00005=1,SSZ(1)
      RS1=RS1+C00039(SSMP(SSMPST(1)-1+I00006),I00002,I00005)
    3 CONTINUE
      C00046(SSMP(SSMPST(9)-1+SSMP(SSMPST(3)-1+SSMP(SSMPST(1)-1+
     *  I00006))),I00002)=C00044(SSMP(SSMPST(1)-1+I00006),I00002)+RS1+
     *  C00045(I00006,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00025')
      RETURN
      END
      SUBROUTINE S00026(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00039,C00044,C00046,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00039(SSZ(2),SSZ(1),SSZ(1))
      REAL C00044(SSZ(2),SSZ(1))
      REAL C00046(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(4)
      RS1=0.0
      DO 3 I00005=1,SSZ(1)
      RS1=RS1+C00039(SSMP(SSMPST(2)-1+I00001),I00002,I00005)
    3 CONTINUE
      C00046(SSMP(SSMPST(9)-1+SSMP(SSMPST(3)-1+SSMP(SSMPST(2)-1+
     *  I00001))),I00002)=C00044(SSMP(SSMPST(2)-1+I00001),I00002)+RS1
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00026')
      RETURN
      END
      SUBROUTINE S00027(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00005,C00046,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER I00007
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00005(SSZ(10),SSZ(1))
      REAL C00046(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00007=1,SSZ(5)
      C00046(SSMP(SSMPST(9)-1+SSMP(SSMPST(4)-1+I00007)),I00002)=
     *  C00005(SSMP(SSMPST(9)-1+SSMP(SSMPST(4)-1+I00007)),I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00027')
      RETURN
      END
      SUBROUTINE M00002(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      USE GSINC4
      USE GSINC7
      USE GSINC4
      USE decomp_c5
      USE TGSMVL
      USE GSINC1
      USE GSINC5
      USE SMVLST0
      USE TGDEBG
      USE PSIMMOD1
      USE SIMRES0
      USE GSINC3
      USE GSINC6
      INTEGER MMI,MMR
      INTEGER RDUN,WRUN,CWKUN,MMRDR
      INTEGER NUMFL,AXSUN,AXTUN
      INTEGER KSINT,NSINT,KSINTA
      REAL RWA(DWA)
      INTEGER DSPUN,DSPPW,DSPPL,DSPDEC
      INTEGER IWA(DIWA),TMPI1
      INTEGER KMSTSL
      LOGICAL AUTACC,CONTSI
      CHARACTER*(*) MINSFL,UDRTST,INRTST
      REAL MINSIL
      DOUBLE PRECISION SILEN
      INTEGER DRCOW
      PARAMETER(DRCOW=1)
      REAL RCOW(DRCOW)
      CHARACTER*(*) LFFOWR,WTMO
      CHARACTER*(*) ERRMES
      LOGICAL DOUD
      LOGICAL SKPSMD,LOWMEM,CALC1,FSTPAS,CTRTHR,SUVFI,TMPLG1
      LOGICAL DSALLS,WTALLS,DODS,DOWR,DOEQ,OVOK,SERTAB
      LOGICAL DSPANP,DSPOIM,D1DROW,NELTX
      INTEGER KSTEPA,NPASSA,DSPCPN,DSPCLN
      INTEGER DSSMAP,SSMAP(DSSMAP)
      INTEGER LFNORD,LFNOWR,RDFSNO,WRFSNO
      INTEGER SSNO,LITSN,SETNO
      CHARACTER SSTP,SETTP
      LOGICAL DOTHIS
      COMMON/DTHIS/DOTHIS
      LOWMEM=.FALSE.
      IF(ECHO1.AND.DOIG(70).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'WELFARE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(70).NE.'n') then
      CALL S00007(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(70),
     *  C00010,C00014,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(71).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'WELFARE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(71).NE.'n') then
      CALL S00008(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(71),
     *  C00011,C00014,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(72).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'WELFARE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(72).NE.'n') then
      CALL S00009(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(72),
     *  C00012,C00014,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(73).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'WELFARE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(73).NE.'n') then
      CALL S00010(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(73),
     *  C00013,C00014,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(78).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTalldemd',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(78).NE.'n') then
      CALL S00011(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(78),
     *  C00015,C00016,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(89).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTallir',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(89).NE.'n') then
      CALL S00012(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(89),
     *  C00019,C00020,C00021,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(95).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTallpr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(95).NE.'n') then
      CALL S00013(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(95),
     *  C00022,C00023,C00024,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(101).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTallgr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(101).NE.'n') then
      CALL S00014(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(101),
     *  C00025,C00026,C00027,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(107).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTalleffkr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(107).NE.'n') then
      CALL S00015(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(107),
     *  C00018,C00030,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(108).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTalleffkr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(108).NE.'n') then
      CALL S00016(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(108),
     *  C00017,C00030,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(109).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTalleffkr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(109).NE.'n') then
      CALL S00017(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(109),
     *  C00021,C00030,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(110).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTalleffkr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(110).NE.'n') then
      CALL S00018(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(110),
     *  C00024,C00030,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(111).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTalleffkr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(111).NE.'n') then
      CALL S00019(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(111),
     *  C00027,C00030,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(112).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTalleffkr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(112).NE.'n') then
      CALL S00020(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(112),
     *  C00028,C00030,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(113).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTalleffkr',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(113).NE.'n') then
      CALL S00021(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(113),
     *  C00029,C00030,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(138).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'OTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(138).NE.'n') then
      CALL S00022(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(138),
     *  C00041,C00042,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(143).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BVDM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(143).NE.'n') then
      CALL S00023(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(143),
     *  C00031,C00032,C00033,C00044,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(147).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BVOM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(147).NE.'n') then
      CALL S00024(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(147),
     *  C00043,C00046,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(148).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BVOM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(148).NE.'n') then
      CALL S00025(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(148),
     *  C00039,C00044,C00045,C00046,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(149).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BVOM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(149).NE.'n') then
      CALL S00026(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(149),
     *  C00039,C00044,C00046,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(150).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BVOM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(150).NE.'n') then
      CALL S00027(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(150),
     *  C00005,C00046,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(.NOT.POSTSIMPASS2.AND.(.NOT.POSTSIMPASS3)) THEN
      NDZVAL=0
      END IF
      RETURN
15000 CALL PERET('M00002')
      RETURN
      END
      SUBROUTINE S00028(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00005,C00046,C00048,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00005(SSZ(10),SSZ(1))
      REAL C00046(SSZ(10),SSZ(1))
      REAL C00048(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BOUTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(10)
      RS1=C00046(I00001,I00002)-C00005(I00001,I00002)
      RS2=C00046(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00048(I00001,I00002)=(RS3)*100
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BOUTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00028')
      RETURN
      END
      SUBROUTINE S00029(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00034,C00035,C00036,C00050,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00034(SSZ(2),SSZ(1))
      REAL C00035(SSZ(2),SSZ(1))
      REAL C00036(SSZ(2),SSZ(8),SSZ(1))
      REAL C00050(SSZ(2),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UVDM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=0.0
      DO 3 I00003=1,SSZ(8)
      RS1=RS1+C00036(I00001,I00003,I00002)
    3 CONTINUE
      C00050(I00001,I00002)=C00034(I00001,I00002)+C00035(I00001,I00002)+
     *  RS1
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UVDM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00029')
      RETURN
      END
      SUBROUTINE S00030(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00052,C00054,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00052(SSZ(6),SSZ(1))
      REAL C00054(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UVOA"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(6)
      C00054(SSMP(SSMPST(7)-1+SSMP(SSMPST(5)-1+I00001)),I00002)=
     *  C00052(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UVOA"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00030')
      RETURN
      END
      SUBROUTINE S00031(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00037,C00038,C00053,C00054,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2
      LOGICAL ECHO1
      REAL C00037(SSZ(2),SSZ(8),SSZ(1))
      REAL C00038(SSZ(2),SSZ(8),SSZ(1))
      REAL C00053(SSZ(6),SSZ(8),SSZ(1))
      REAL C00054(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UVOA"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(8)
      RS1=0.0
      DO 3 I00003=1,SSZ(6)
      RS1=RS1+C00053(I00003,I00001,I00002)
    3 CONTINUE
      RS2=0.0
      DO 4 I00003=1,SSZ(2)
      RS2=RS2+C00037(I00003,I00001,I00002)+C00038(I00003,I00001,I00002)
    4 CONTINUE
      C00054(SSMP(SSMPST(9)-1+I00001),I00002)=RS1+RS2
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UVOA"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00031')
      RETURN
      END
      SUBROUTINE S00032(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00049,C00055,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00049(SSZ(6),SSZ(8),SSZ(1))
      REAL C00055(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(6)
      RS1=0.0
      DO 3 I00003=1,SSZ(8)
      RS1=RS1+C00049(I00001,I00003,I00002)
    3 CONTINUE
      C00055(SSMP(SSMPST(7)-1+SSMP(SSMPST(5)-1+I00001)),I00002)=RS1
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00032')
      RETURN
      END
      SUBROUTINE S00033(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00040,C00050,C00051,C00055,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER I00005
      INTEGER I00006
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00040(SSZ(2),SSZ(1),SSZ(1))
      REAL C00050(SSZ(2),SSZ(1))
      REAL C00051(SSZ(3),SSZ(1))
      REAL C00055(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00006=1,SSZ(3)
      RS1=0.0
      DO 3 I00005=1,SSZ(1)
      RS1=RS1+C00040(SSMP(SSMPST(1)-1+I00006),I00002,I00005)
    3 CONTINUE
      C00055(SSMP(SSMPST(9)-1+SSMP(SSMPST(3)-1+SSMP(SSMPST(1)-1+
     *  I00006))),I00002)=C00050(SSMP(SSMPST(1)-1+I00006),I00002)+RS1+
     *  C00051(I00006,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00033')
      RETURN
      END
      SUBROUTINE S00034(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00040,C00050,C00055,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00040(SSZ(2),SSZ(1),SSZ(1))
      REAL C00050(SSZ(2),SSZ(1))
      REAL C00055(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(4)
      RS1=0.0
      DO 3 I00005=1,SSZ(1)
      RS1=RS1+C00040(SSMP(SSMPST(2)-1+I00001),I00002,I00005)
    3 CONTINUE
      C00055(SSMP(SSMPST(9)-1+SSMP(SSMPST(3)-1+SSMP(SSMPST(2)-1+
     *  I00001))),I00002)=C00050(SSMP(SSMPST(2)-1+I00001),I00002)+RS1
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00034')
      RETURN
      END
      SUBROUTINE S00035(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00054,C00055,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER I00007
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00054(SSZ(10),SSZ(1))
      REAL C00055(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00007=1,SSZ(5)
      C00055(SSMP(SSMPST(9)-1+SSMP(SSMPST(4)-1+I00007)),I00002)=
     *  C00054(SSMP(SSMPST(9)-1+SSMP(SSMPST(4)-1+I00007)),I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UVOM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00035')
      RETURN
      END
      SUBROUTINE S00036(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00054,C00055,C00056,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00054(SSZ(10),SSZ(1))
      REAL C00055(SSZ(10),SSZ(1))
      REAL C00056(SSZ(10),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UOUTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(10)
      RS1=C00055(I00001,I00002)-C00054(I00001,I00002)
      RS2=C00055(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00056(I00001,I00002)=(RS3)*100
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UOUTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00036')
      RETURN
      END
      SUBROUTINE S00037(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00042,C00057,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00042(SSZ(10),SSZ(1))
      REAL C00057(SSZ(10),SSZ(1),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "OUTPUT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(10)
      C00057(I00001,I00002,1)=C00042(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "OUTPUT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00037')
      RETURN
      END
      SUBROUTINE S00038(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00046,C00047,C00057,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00046(SSZ(10),SSZ(1))
      REAL C00047(SSZ(10),SSZ(1))
      REAL C00057(SSZ(10),SSZ(1),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "OUTPUT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(10)
      C00057(I00001,I00002,2)=C00046(I00001,I00002)*
     *  C00047(I00001,I00002)/100.
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "OUTPUT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00038')
      RETURN
      END
      SUBROUTINE S00039(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00048,C00057,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00048(SSZ(10),SSZ(1))
      REAL C00057(SSZ(10),SSZ(1),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "OUTPUT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(10)
      C00057(I00001,I00002,3)=C00048(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "OUTPUT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00039')
      RETURN
      END
      SUBROUTINE S00040(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00056,C00057,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00056(SSZ(10),SSZ(1))
      REAL C00057(SSZ(10),SSZ(1),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "OUTPUT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(10)
      C00057(I00001,I00002,4)=C00056(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "OUTPUT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00040')
      RETURN
      END
      SUBROUTINE S00041(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00058,C00064,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00058(SSZ(2),SSZ(1))
      REAL C00064(SSZ(2),SSZ(17),SSZ(1),SSZ(16))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00064(I00001,1,I00002,1)=C00058(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00041')
      RETURN
      END
      SUBROUTINE S00042(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00059,C00064,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00059(SSZ(2),SSZ(1))
      REAL C00064(SSZ(2),SSZ(17),SSZ(1),SSZ(16))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00064(I00001,2,I00002,1)=C00059(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00042')
      RETURN
      END
      SUBROUTINE S00043(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00060,C00064,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00060(SSZ(2),SSZ(1))
      REAL C00064(SSZ(2),SSZ(17),SSZ(1),SSZ(16))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00064(I00001,3,I00002,1)=C00060(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00043')
      RETURN
      END
      SUBROUTINE S00044(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00061,C00064,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00061(SSZ(2),SSZ(1))
      REAL C00064(SSZ(2),SSZ(17),SSZ(1),SSZ(16))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00064(I00001,1,I00002,2)=C00061(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00044')
      RETURN
      END
      SUBROUTINE S00045(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00062,C00064,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00062(SSZ(2),SSZ(1))
      REAL C00064(SSZ(2),SSZ(17),SSZ(1),SSZ(16))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00064(I00001,2,I00002,2)=C00062(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00045')
      RETURN
      END
      SUBROUTINE S00046(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00063,C00064,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00063(SSZ(2),SSZ(1))
      REAL C00064(SSZ(2),SSZ(17),SSZ(1),SSZ(16))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00064(I00001,3,I00002,2)=C00063(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "ATAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00046')
      RETURN
      END
      SUBROUTINE S00047(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00065,C00067,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00065(SSZ(2),SSZ(8),SSZ(1))
      REAL C00067(SSZ(2),SSZ(8),SSZ(1),SSZ(16))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "STAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      C00067(I00001,I00003,I00002,1)=C00065(I00001,I00003,I00002)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "STAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00047')
      RETURN
      END
      SUBROUTINE S00048(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00066,C00067,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00066(SSZ(2),SSZ(8),SSZ(1))
      REAL C00067(SSZ(2),SSZ(8),SSZ(1),SSZ(16))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "STAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      C00067(I00001,I00003,I00002,2)=C00066(I00001,I00003,I00002)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "STAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00048')
      RETURN
      END
      SUBROUTINE S00049(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00067,C00072,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER I00009
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00067(SSZ(2),SSZ(8),SSZ(1),SSZ(16))
      REAL C00072(SSZ(2),SSZ(8),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 4 I00009=1,SSZ(16)
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      C00072(I00001,I00003,I00002,I00009,1)=
     *  C00067(I00001,I00003,I00002,I00009)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
    4 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00049')
      RETURN
      END
      SUBROUTINE S00050(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00068,C00069,C00072,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00068(SSZ(2),SSZ(8),SSZ(1))
      REAL C00069(SSZ(2),SSZ(8),SSZ(1))
      REAL C00072(SSZ(2),SSZ(8),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      C00072(I00001,I00003,I00002,1,2)=C00068(I00001,I00003,I00002)*
     *  C00069(I00001,I00003,I00002)/100.
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00050')
      RETURN
      END
      SUBROUTINE S00051(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00033,C00070,C00072,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00033(SSZ(2),SSZ(8),SSZ(1))
      REAL C00070(SSZ(2),SSZ(8),SSZ(1))
      REAL C00072(SSZ(2),SSZ(8),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      C00072(I00001,I00003,I00002,2,2)=C00033(I00001,I00003,I00002)*
     *  C00070(I00001,I00003,I00002)/100.
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00051')
      RETURN
      END
      SUBROUTINE S00052(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00003,C00068,C00072,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00003(SSZ(2),SSZ(8),SSZ(1))
      REAL C00068(SSZ(2),SSZ(8),SSZ(1))
      REAL C00072(SSZ(2),SSZ(8),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00003(I00001,I00003,I00002)-
     *  C00068(I00001,I00003,I00002))
      RS2=C00068(I00001,I00003,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00072(I00001,I00003,I00002,1,3)=RS3
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00052')
      RETURN
      END
      SUBROUTINE S00053(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00037,C00071,C00072,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00037(SSZ(2),SSZ(8),SSZ(1))
      REAL C00071(SSZ(2),SSZ(8),SSZ(1))
      REAL C00072(SSZ(2),SSZ(8),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00037(I00001,I00003,I00002)-
     *  C00071(I00001,I00003,I00002))
      RS2=C00071(I00001,I00003,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00072(I00001,I00003,I00002,1,4)=RS3
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00053')
      RETURN
      END
      SUBROUTINE S00054(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00004,C00033,C00072,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00004(SSZ(2),SSZ(8),SSZ(1))
      REAL C00033(SSZ(2),SSZ(8),SSZ(1))
      REAL C00072(SSZ(2),SSZ(8),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00004(I00001,I00003,I00002)-
     *  C00033(I00001,I00003,I00002))
      RS2=C00033(I00001,I00003,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00072(I00001,I00003,I00002,2,3)=RS3
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00054')
      RETURN
      END
      SUBROUTINE S00055(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00036,C00038,C00072,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00036(SSZ(2),SSZ(8),SSZ(1))
      REAL C00038(SSZ(2),SSZ(8),SSZ(1))
      REAL C00072(SSZ(2),SSZ(8),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00038(I00001,I00003,I00002)-
     *  C00036(I00001,I00003,I00002))
      RS2=C00036(I00001,I00003,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00072(I00001,I00003,I00002,2,4)=RS3
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "FIRM"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00055')
      RETURN
      END
      SUBROUTINE M00003(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      USE GSINC4
      USE GSINC7
      USE GSINC4
      USE decomp_c5
      USE TGSMVL
      USE GSINC1
      USE GSINC5
      USE SMVLST0
      USE TGDEBG
      USE PSIMMOD1
      USE SIMRES0
      USE GSINC3
      USE GSINC6
      INTEGER MMI,MMR
      INTEGER RDUN,WRUN,CWKUN,MMRDR
      INTEGER NUMFL,AXSUN,AXTUN
      INTEGER KSINT,NSINT,KSINTA
      REAL RWA(DWA)
      INTEGER DSPUN,DSPPW,DSPPL,DSPDEC
      INTEGER IWA(DIWA),TMPI1
      INTEGER KMSTSL
      LOGICAL AUTACC,CONTSI
      CHARACTER*(*) MINSFL,UDRTST,INRTST
      REAL MINSIL
      DOUBLE PRECISION SILEN
      INTEGER DRCOW
      PARAMETER(DRCOW=1)
      REAL RCOW(DRCOW)
      CHARACTER*(*) LFFOWR,WTMO
      CHARACTER*(*) ERRMES
      LOGICAL DOUD
      LOGICAL SKPSMD,LOWMEM,CALC1,FSTPAS,CTRTHR,SUVFI,TMPLG1
      LOGICAL DSALLS,WTALLS,DODS,DOWR,DOEQ,OVOK,SERTAB
      LOGICAL DSPANP,DSPOIM,D1DROW,NELTX
      INTEGER KSTEPA,NPASSA,DSPCPN,DSPCLN
      INTEGER DSSMAP,SSMAP(DSSMAP)
      INTEGER LFNORD,LFNOWR,RDFSNO,WRFSNO
      INTEGER SSNO,LITSN,SETNO
      CHARACTER SSTP,SETTP
      LOGICAL DOTHIS
      COMMON/DTHIS/DOTHIS
      LOWMEM=.FALSE.
      IF(ECHO1.AND.DOIG(155).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BOUTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(155).NE.'n') then
      CALL S00028(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(155),
     *  C00005,C00046,C00048,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(160).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UVDM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(160).NE.'n') then
      CALL S00029(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(160),
     *  C00034,C00035,C00036,C00050,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(168).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UVOA',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(168).NE.'n') then
      CALL S00030(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(168),
     *  C00052,C00054,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(169).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UVOA',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(169).NE.'n') then
      CALL S00031(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(169),
     *  C00037,C00038,C00053,C00054,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(171).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UVOM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(171).NE.'n') then
      CALL S00032(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(171),
     *  C00049,C00055,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(172).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UVOM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(172).NE.'n') then
      CALL S00033(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(172),
     *  C00040,C00050,C00051,C00055,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(173).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UVOM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(173).NE.'n') then
      CALL S00034(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(173),
     *  C00040,C00050,C00055,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(174).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UVOM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(174).NE.'n') then
      CALL S00035(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(174),
     *  C00054,C00055,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(.NOT.POSTSIMPASS2.AND.(.NOT.POSTSIMPASS3)) THEN
      NDZVAL=0
      END IF
      IF(ECHO1.AND.DOIG(177).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UOUTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(177).NE.'n') then
      CALL S00036(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(177),
     *  C00054,C00055,C00056,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(180).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'OUTPUT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(180).NE.'n') then
      CALL S00037(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(180),
     *  C00042,C00057,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(181).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'OUTPUT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(181).NE.'n') then
      CALL S00038(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(181),
     *  C00046,C00047,C00057,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(182).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'OUTPUT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(182).NE.'n') then
      CALL S00039(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(182),
     *  C00048,C00057,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(183).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'OUTPUT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(183).NE.'n') then
      CALL S00040(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(183),
     *  C00056,C00057,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(198).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'ATAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(198).NE.'n') then
      CALL S00041(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(198),
     *  C00058,C00064,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(199).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'ATAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(199).NE.'n') then
      CALL S00042(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(199),
     *  C00059,C00064,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(200).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'ATAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(200).NE.'n') then
      CALL S00043(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(200),
     *  C00060,C00064,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(201).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'ATAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(201).NE.'n') then
      CALL S00044(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(201),
     *  C00061,C00064,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(202).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'ATAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(202).NE.'n') then
      CALL S00045(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(202),
     *  C00062,C00064,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(203).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'ATAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(203).NE.'n') then
      CALL S00046(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(203),
     *  C00063,C00064,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(210).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'STAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(210).NE.'n') then
      CALL S00047(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(210),
     *  C00065,C00067,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(211).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'STAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(211).NE.'n') then
      CALL S00048(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(211),
     *  C00066,C00067,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(.NOT.POSTSIMPASS2.AND.(.NOT.POSTSIMPASS3)) THEN
      NDZVAL=0
      END IF
      IF(ECHO1.AND.DOIG(223).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'FIRM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(223).NE.'n') then
      CALL S00049(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(223),
     *  C00067,C00072,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(224).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'FIRM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(224).NE.'n') then
      CALL S00050(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(224),
     *  C00068,C00069,C00072,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(225).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'FIRM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(225).NE.'n') then
      CALL S00051(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(225),
     *  C00033,C00070,C00072,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(226).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'FIRM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(226).NE.'n') then
      CALL S00052(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(226),
     *  C00003,C00068,C00072,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(227).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'FIRM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(227).NE.'n') then
      CALL S00053(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(227),
     *  C00037,C00071,C00072,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(228).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'FIRM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(228).NE.'n') then
      CALL S00054(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(228),
     *  C00004,C00033,C00072,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(229).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'FIRM',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(229).NE.'n') then
      CALL S00055(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(229),
     *  C00036,C00038,C00072,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('M00003')
      RETURN
      END
      SUBROUTINE S00056(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00064,C00081,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00009
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00064(SSZ(2),SSZ(17),SSZ(1),SSZ(16))
      REAL C00081(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00009=1,SSZ(16)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00081(I00001,I00002,I00009,1)=C00064(I00001,2,I00002,I00009)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00056')
      RETURN
      END
      SUBROUTINE S00057(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00073,C00074,C00081,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00073(SSZ(2),SSZ(1))
      REAL C00074(SSZ(2),SSZ(1))
      REAL C00081(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00081(I00001,I00002,1,2)=C00073(I00001,I00002)*
     *  C00074(I00001,I00002)/100.
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00057')
      RETURN
      END
      SUBROUTINE S00058(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00031,C00075,C00081,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00031(SSZ(2),SSZ(1))
      REAL C00075(SSZ(2),SSZ(1))
      REAL C00081(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00081(I00001,I00002,2,2)=C00031(I00001,I00002)*
     *  C00075(I00001,I00002)/100.
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00058')
      RETURN
      END
      SUBROUTINE S00059(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00073,C00076,C00081,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00073(SSZ(2),SSZ(1))
      REAL C00076(SSZ(2),SSZ(1))
      REAL C00081(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00076(I00001,I00002)-C00073(I00001,I00002))
      RS2=C00073(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00081(I00001,I00002,1,3)=RS3
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00059')
      RETURN
      END
      SUBROUTINE S00060(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00077,C00078,C00081,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00077(SSZ(2),SSZ(1))
      REAL C00078(SSZ(2),SSZ(1))
      REAL C00081(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00077(I00001,I00002)-C00078(I00001,I00002))
      RS2=C00078(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00081(I00001,I00002,1,4)=RS3
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00060')
      RETURN
      END
      SUBROUTINE S00061(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00031,C00079,C00081,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00031(SSZ(2),SSZ(1))
      REAL C00079(SSZ(2),SSZ(1))
      REAL C00081(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00079(I00001,I00002)-C00031(I00001,I00002))
      RS2=C00031(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00081(I00001,I00002,2,3)=RS3
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00061')
      RETURN
      END
      SUBROUTINE S00062(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00034,C00080,C00081,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00034(SSZ(2),SSZ(1))
      REAL C00080(SSZ(2),SSZ(1))
      REAL C00081(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00080(I00001,I00002)-C00034(I00001,I00002))
      RS2=C00034(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00081(I00001,I00002,2,4)=RS3
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PRIVATE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00062')
      RETURN
      END
      SUBROUTINE S00063(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00064,C00090,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00009
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00064(SSZ(2),SSZ(17),SSZ(1),SSZ(16))
      REAL C00090(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00009=1,SSZ(16)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00090(I00001,I00002,I00009,1)=C00064(I00001,3,I00002,I00009)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00063')
      RETURN
      END
      SUBROUTINE S00064(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00082,C00083,C00090,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00082(SSZ(2),SSZ(1))
      REAL C00083(SSZ(2),SSZ(1))
      REAL C00090(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00090(I00001,I00002,1,2)=C00082(I00001,I00002)*
     *  C00083(I00001,I00002)/100.
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00064')
      RETURN
      END
      SUBROUTINE S00065(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00032,C00084,C00090,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00032(SSZ(2),SSZ(1))
      REAL C00084(SSZ(2),SSZ(1))
      REAL C00090(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00090(I00001,I00002,2,2)=C00032(I00001,I00002)*
     *  C00084(I00001,I00002)/100.
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00065')
      RETURN
      END
      SUBROUTINE S00066(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00082,C00085,C00090,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00082(SSZ(2),SSZ(1))
      REAL C00085(SSZ(2),SSZ(1))
      REAL C00090(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00085(I00001,I00002)-C00082(I00001,I00002))
      RS2=C00082(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00090(I00001,I00002,1,3)=RS3
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00066')
      RETURN
      END
      SUBROUTINE S00067(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00086,C00087,C00090,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00086(SSZ(2),SSZ(1))
      REAL C00087(SSZ(2),SSZ(1))
      REAL C00090(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00086(I00001,I00002)-C00087(I00001,I00002))
      RS2=C00087(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00090(I00001,I00002,1,4)=RS3
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00067')
      RETURN
      END
      SUBROUTINE S00068(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00032,C00088,C00090,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00032(SSZ(2),SSZ(1))
      REAL C00088(SSZ(2),SSZ(1))
      REAL C00090(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00088(I00001,I00002)-C00032(I00001,I00002))
      RS2=C00032(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00090(I00001,I00002,2,3)=RS3
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00068')
      RETURN
      END
      SUBROUTINE S00069(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00035,C00089,C00090,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00035(SSZ(2),SSZ(1))
      REAL C00089(SSZ(2),SSZ(1))
      REAL C00090(SSZ(2),SSZ(1),SSZ(16),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=100*(C00089(I00001,I00002)-C00035(I00001,I00002))
      RS2=C00035(I00001,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=NDZVAL
        NNDZ=NNDZ+1
      END IF
      C00090(I00001,I00002,2,4)=RS3
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "GOVT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00069')
      RETURN
      END
      SUBROUTINE S00070(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00091,C00093,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00091(SSZ(2),SSZ(1),SSZ(1))
      REAL C00093(SSZ(2),SSZ(1),SSZ(1),SSZ(12))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00093(I00001,I00002,I00005,1)=C00091(I00001,I00002,I00005)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00070')
      RETURN
      END
      SUBROUTINE S00071(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00092,C00093,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00092(SSZ(2),SSZ(1),SSZ(1))
      REAL C00093(SSZ(2),SSZ(1),SSZ(1),SSZ(12))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00093(I00001,I00002,I00005,2)=C00092(I00001,I00002,I00005)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00071')
      RETURN
      END
      SUBROUTINE S00072(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00094,C00095,C00096,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00094(SSZ(2),SSZ(1),SSZ(1))
      REAL C00095(SSZ(2),SSZ(1),SSZ(1))
      REAL C00096(SSZ(2),SSZ(1),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BIMTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=C00094(I00001,I00002,I00005)-C00095(I00001,I00002,I00005)
      RS2=C00095(I00001,I00002,I00005)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=1.0
        IER=4
      END IF
      C00096(I00001,I00002,I00005)=(RS3)*100
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BIMTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00072')
      RETURN
      END
      SUBROUTINE S00073(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00039,C00097,C00098,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00039(SSZ(2),SSZ(1),SSZ(1))
      REAL C00097(SSZ(2),SSZ(1),SSZ(1))
      REAL C00098(SSZ(2),SSZ(1),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BEXTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=C00097(I00001,I00002,I00005)-C00039(I00001,I00002,I00005)
      RS2=C00097(I00001,I00002,I00005)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=1.0
        IER=4
      END IF
      C00098(I00001,I00002,I00005)=(RS3)*100
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BEXTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00073')
      RETURN
      END
      SUBROUTINE S00074(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00099,C00100,C00101,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00099(SSZ(2),SSZ(1),SSZ(1))
      REAL C00100(SSZ(2),SSZ(1),SSZ(1))
      REAL C00101(SSZ(2),SSZ(1),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UIMTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=C00099(I00001,I00002,I00005)-C00100(I00001,I00002,I00005)
      RS2=C00100(I00001,I00002,I00005)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=1.0
        IER=4
      END IF
      C00101(I00001,I00002,I00005)=(RS3)*100
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UIMTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00074')
      RETURN
      END
      SUBROUTINE S00075(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00040,C00102,C00103,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00040(SSZ(2),SSZ(1),SSZ(1))
      REAL C00102(SSZ(2),SSZ(1),SSZ(1))
      REAL C00103(SSZ(2),SSZ(1),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UEXTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=C00102(I00001,I00002,I00005)-C00040(I00001,I00002,I00005)
      RS2=C00102(I00001,I00002,I00005)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=1.0
        IER=4
      END IF
      C00103(I00001,I00002,I00005)=(RS3)*100
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UEXTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00075')
      RETURN
      END
      SUBROUTINE S00076(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00093,C00105,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00093(SSZ(2),SSZ(1),SSZ(1),SSZ(12))
      REAL C00105(SSZ(2),SSZ(1),SSZ(1),SSZ(18),SSZ(19))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00105(I00001,I00002,I00005,1,1)=C00093(I00001,I00002,I00005,2)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00076')
      RETURN
      END
      SUBROUTINE S00077(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00093,C00105,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00093(SSZ(2),SSZ(1),SSZ(1),SSZ(12))
      REAL C00105(SSZ(2),SSZ(1),SSZ(1),SSZ(18),SSZ(19))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00105(I00001,I00002,I00005,1,2)=C00093(I00001,I00002,I00005,1)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00077')
      RETURN
      END
      SUBROUTINE S00078(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00039,C00104,C00105,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00039(SSZ(2),SSZ(1),SSZ(1))
      REAL C00104(SSZ(2),SSZ(1),SSZ(1))
      REAL C00105(SSZ(2),SSZ(1),SSZ(1),SSZ(18),SSZ(19))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00105(I00001,I00002,I00005,2,1)=C00039(I00001,I00002,I00005)*
     *  C00104(I00001,I00002,I00005)/100.
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00078')
      RETURN
      END
      SUBROUTINE S00079(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00039,C00104,C00105,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00039(SSZ(2),SSZ(1),SSZ(1))
      REAL C00104(SSZ(2),SSZ(1),SSZ(1))
      REAL C00105(SSZ(2),SSZ(1),SSZ(1),SSZ(18),SSZ(19))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00105(I00001,I00002,I00005,2,2)=C00039(I00001,I00002,I00005)*
     *  C00104(I00001,I00002,I00005)/100.
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00079')
      RETURN
      END
      SUBROUTINE M00004(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      USE GSINC4
      USE GSINC7
      USE GSINC4
      USE decomp_c5
      USE TGSMVL
      USE GSINC1
      USE GSINC5
      USE SMVLST0
      USE TGDEBG
      USE PSIMMOD1
      USE SIMRES0
      USE GSINC3
      USE GSINC6
      INTEGER MMI,MMR
      INTEGER RDUN,WRUN,CWKUN,MMRDR
      INTEGER NUMFL,AXSUN,AXTUN
      INTEGER KSINT,NSINT,KSINTA
      REAL RWA(DWA)
      INTEGER DSPUN,DSPPW,DSPPL,DSPDEC
      INTEGER IWA(DIWA),TMPI1
      INTEGER KMSTSL
      LOGICAL AUTACC,CONTSI
      CHARACTER*(*) MINSFL,UDRTST,INRTST
      REAL MINSIL
      DOUBLE PRECISION SILEN
      INTEGER DRCOW
      PARAMETER(DRCOW=1)
      REAL RCOW(DRCOW)
      CHARACTER*(*) LFFOWR,WTMO
      CHARACTER*(*) ERRMES
      LOGICAL DOUD
      LOGICAL SKPSMD,LOWMEM,CALC1,FSTPAS,CTRTHR,SUVFI,TMPLG1
      LOGICAL DSALLS,WTALLS,DODS,DOWR,DOEQ,OVOK,SERTAB
      LOGICAL DSPANP,DSPOIM,D1DROW,NELTX
      INTEGER KSTEPA,NPASSA,DSPCPN,DSPCLN
      INTEGER DSSMAP,SSMAP(DSSMAP)
      INTEGER LFNORD,LFNOWR,RDFSNO,WRFSNO
      INTEGER SSNO,LITSN,SETNO
      CHARACTER SSTP,SETTP
      LOGICAL DOTHIS
      COMMON/DTHIS/DOTHIS
      LOWMEM=.FALSE.
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(.NOT.POSTSIMPASS2.AND.(.NOT.POSTSIMPASS3)) THEN
      NDZVAL=0
      END IF
      IF(ECHO1.AND.DOIG(250).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PRIVATE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(250).NE.'n') then
      CALL S00056(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(250),
     *  C00064,C00081,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(251).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PRIVATE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(251).NE.'n') then
      CALL S00057(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(251),
     *  C00073,C00074,C00081,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(252).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PRIVATE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(252).NE.'n') then
      CALL S00058(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(252),
     *  C00031,C00075,C00081,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(253).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PRIVATE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(253).NE.'n') then
      CALL S00059(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(253),
     *  C00073,C00076,C00081,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(254).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PRIVATE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(254).NE.'n') then
      CALL S00060(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(254),
     *  C00077,C00078,C00081,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(255).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PRIVATE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(255).NE.'n') then
      CALL S00061(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(255),
     *  C00031,C00079,C00081,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(256).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PRIVATE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(256).NE.'n') then
      CALL S00062(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(256),
     *  C00034,C00080,C00081,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(.NOT.POSTSIMPASS2.AND.(.NOT.POSTSIMPASS3)) THEN
      NDZVAL=0
      END IF
      IF(ECHO1.AND.DOIG(277).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'GOVT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(277).NE.'n') then
      CALL S00063(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(277),
     *  C00064,C00090,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(278).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'GOVT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(278).NE.'n') then
      CALL S00064(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(278),
     *  C00082,C00083,C00090,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(279).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'GOVT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(279).NE.'n') then
      CALL S00065(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(279),
     *  C00032,C00084,C00090,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(280).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'GOVT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(280).NE.'n') then
      CALL S00066(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(280),
     *  C00082,C00085,C00090,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(281).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'GOVT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(281).NE.'n') then
      CALL S00067(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(281),
     *  C00086,C00087,C00090,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(282).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'GOVT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(282).NE.'n') then
      CALL S00068(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(282),
     *  C00032,C00088,C00090,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(283).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'GOVT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(283).NE.'n') then
      CALL S00069(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(283),
     *  C00035,C00089,C00090,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(291).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(291).NE.'n') then
      CALL S00070(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(291),
     *  C00091,C00093,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(292).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(292).NE.'n') then
      CALL S00071(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(292),
     *  C00092,C00093,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(299).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BIMTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(299).NE.'n') then
      CALL S00072(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(299),
     *  C00094,C00095,C00096,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(303).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BEXTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(303).NE.'n') then
      CALL S00073(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(303),
     *  C00039,C00097,C00098,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(309).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UIMTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(309).NE.'n') then
      CALL S00074(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(309),
     *  C00099,C00100,C00101,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(313).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UEXTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(313).NE.'n') then
      CALL S00075(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(313),
     *  C00040,C00102,C00103,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(317).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TRADE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(317).NE.'n') then
      CALL S00076(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(317),
     *  C00093,C00105,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(318).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TRADE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(318).NE.'n') then
      CALL S00077(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(318),
     *  C00093,C00105,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(319).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TRADE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(319).NE.'n') then
      CALL S00078(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(319),
     *  C00039,C00104,C00105,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(320).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TRADE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(320).NE.'n') then
      CALL S00079(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(320),
     *  C00039,C00104,C00105,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      RETURN
15000 CALL PERET('M00004')
      RETURN
      END
      SUBROUTINE S00080(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00096,C00105,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00096(SSZ(2),SSZ(1),SSZ(1))
      REAL C00105(SSZ(2),SSZ(1),SSZ(1),SSZ(18),SSZ(19))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00105(I00001,I00002,I00005,3,1)=C00096(I00001,I00002,I00005)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00080')
      RETURN
      END
      SUBROUTINE S00081(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00101,C00105,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00101(SSZ(2),SSZ(1),SSZ(1))
      REAL C00105(SSZ(2),SSZ(1),SSZ(1),SSZ(18),SSZ(19))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00105(I00001,I00002,I00005,4,1)=C00101(I00001,I00002,I00005)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00081')
      RETURN
      END
      SUBROUTINE S00082(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00098,C00105,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00098(SSZ(2),SSZ(1),SSZ(1))
      REAL C00105(SSZ(2),SSZ(1),SSZ(1),SSZ(18),SSZ(19))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00105(I00001,I00002,I00005,3,2)=C00098(I00001,I00002,I00005)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00082')
      RETURN
      END
      SUBROUTINE S00083(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00103,C00105,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00005
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00103(SSZ(2),SSZ(1),SSZ(1))
      REAL C00105(SSZ(2),SSZ(1),SSZ(1),SSZ(18),SSZ(19))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00005=1,SSZ(1)
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00105(I00001,I00002,I00005,4,2)=C00103(I00001,I00002,I00005)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TRADE"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00083')
      RETURN
      END
      SUBROUTINE S00084(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00002,C00043,C00108,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00002(SSZ(6),SSZ(8),SSZ(1))
      REAL C00043(SSZ(6),SSZ(8),SSZ(1))
      REAL C00108(SSZ(6),SSZ(8),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "BENDTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(6)
      RS1=C00002(I00001,I00003,I00002)-C00043(I00001,I00003,I00002)
      RS2=C00043(I00001,I00003,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=1.0
        IER=4
      END IF
      C00108(I00001,I00003,I00002)=(RS3)*100
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "BENDTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00084')
      RETURN
      END
      SUBROUTINE S00085(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00049,C00053,C00109,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3
      LOGICAL ECHO1
      REAL C00049(SSZ(6),SSZ(8),SSZ(1))
      REAL C00053(SSZ(6),SSZ(8),SSZ(1))
      REAL C00109(SSZ(6),SSZ(8),SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "UENDTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(6)
      RS1=C00053(I00001,I00003,I00002)-C00049(I00001,I00003,I00002)
      RS2=C00049(I00001,I00003,I00002)
      IF(RS2.NE.0.0) THEN
        RS3=RS1/RS2
      ELSE IF(RS1.EQ.0.0) THEN
        RS3=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS3=1.0
        IER=4
      END IF
      C00109(I00001,I00003,I00002)=(RS3)*100
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "UENDTAX"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00085')
      RETURN
      END
      SUBROUTINE S00086(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00107,C00111,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00107(SSZ(6),SSZ(8),SSZ(1))
      REAL C00111(SSZ(6),SSZ(8),SSZ(1),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PFACTOR"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(6)
      C00111(I00001,I00003,I00002,1)=C00107(I00001,I00003,I00002)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PFACTOR"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00086')
      RETURN
      END
      SUBROUTINE S00087(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00043,C00110,C00111,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00043(SSZ(6),SSZ(8),SSZ(1))
      REAL C00110(SSZ(6),SSZ(8),SSZ(1))
      REAL C00111(SSZ(6),SSZ(8),SSZ(1),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PFACTOR"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(6)
      C00111(I00001,I00003,I00002,2)=C00043(I00001,I00003,I00002)*
     *  C00110(I00001,I00003,I00002)/100.
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PFACTOR"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00087')
      RETURN
      END
      SUBROUTINE S00088(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00108,C00111,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00108(SSZ(6),SSZ(8),SSZ(1))
      REAL C00111(SSZ(6),SSZ(8),SSZ(1),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PFACTOR"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(6)
      C00111(I00001,I00003,I00002,3)=C00108(I00001,I00003,I00002)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PFACTOR"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00088')
      RETURN
      END
      SUBROUTINE S00089(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00109,C00111,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00109(SSZ(6),SSZ(8),SSZ(1))
      REAL C00111(SSZ(6),SSZ(8),SSZ(1),SSZ(18))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "PFACTOR"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 3 I00002=1,SSZ(1)
      DO 2 I00003=1,SSZ(8)
      DO 1 I00001=1,SSZ(6)
      C00111(I00001,I00003,I00002,4)=C00109(I00001,I00003,I00002)
    1 CONTINUE
    2 CONTINUE
    3 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "PFACTOR"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00089')
      RETURN
      END
      SUBROUTINE S00090(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00112,C00113,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00112(SSZ(6),SSZ(1))
      REAL C00113(SSZ(1),SSZ(6))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTendw"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      DO 2 I00001=1,SSZ(6)
      C00113(I00002,I00001)=C00112(I00001,I00002)
    2 CONTINUE
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTendw"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00090')
      RETURN
      END
      SUBROUTINE S00091(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00115,C00119,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00115(SSZ(1))
      REAL C00119(SSZ(1),SSZ(14))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTtech"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00119(I00002,1)=C00115(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTtech"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00091')
      RETURN
      END
      SUBROUTINE S00092(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00116,C00119,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00116(SSZ(1))
      REAL C00119(SSZ(1),SSZ(14))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTtech"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00119(I00002,2)=C00116(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTtech"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00092')
      RETURN
      END
      SUBROUTINE S00093(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00117,C00119,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00117(SSZ(1))
      REAL C00119(SSZ(1),SSZ(14))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTtech"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00119(I00002,3)=C00117(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTtech"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00093')
      RETURN
      END
      SUBROUTINE S00094(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00118,C00119,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00118(SSZ(1))
      REAL C00119(SSZ(1),SSZ(14))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CNTtech"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00119(I00002,4)=C00118(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CNTtech"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00094')
      RETURN
      END
      SUBROUTINE S00095(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00124,C00127,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00124(SSZ(2),SSZ(1))
      REAL C00127(SSZ(2),SSZ(1),SSZ(15),SSZ(20))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00127(I00001,I00002,1,1)=C00124(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00095')
      RETURN
      END
      SUBROUTINE S00096(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00125,C00127,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00125(SSZ(2),SSZ(1))
      REAL C00127(SSZ(2),SSZ(1),SSZ(15),SSZ(20))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00127(I00001,I00002,2,1)=C00125(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00096')
      RETURN
      END
      SUBROUTINE S00097(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00126,C00127,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00126(SSZ(2),SSZ(1))
      REAL C00127(SSZ(2),SSZ(1),SSZ(15),SSZ(20))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      C00127(I00001,I00002,3,1)=-C00126(I00001,I00002)
    1 CONTINUE
    2 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00097')
      RETURN
      END
      SUBROUTINE S00098(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00011,C00124,C00127,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER I00009
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3,RS4,RS5
      LOGICAL ECHO1
      REAL C00011(SSZ(1))
      REAL C00124(SSZ(2),SSZ(1))
      REAL C00127(SSZ(2),SSZ(1),SSZ(15),SSZ(20))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=0.0
      DO 4 I00009=1,SSZ(15)
      RS2=0.0
      DO 3 I00003=1,SSZ(2)
      RS2=RS2+C00127(I00003,I00002,I00009,1)
    3 CONTINUE
      RS1=RS1+RS2
    4 CONTINUE
      RS3=C00011(I00002)*C00124(I00001,I00002)
      RS4=RS1
      IF(RS4.NE.0.0) THEN
        RS5=RS3/RS4
      ELSE IF(RS3.EQ.0.0) THEN
        RS5=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS5=1.0
        IER=4
      END IF
      C00127(I00001,I00002,1,2)=RS5
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00098')
      RETURN
      END
      SUBROUTINE S00099(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00011,C00125,C00127,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER I00009
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3,RS4,RS5
      LOGICAL ECHO1
      REAL C00011(SSZ(1))
      REAL C00125(SSZ(2),SSZ(1))
      REAL C00127(SSZ(2),SSZ(1),SSZ(15),SSZ(20))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=0.0
      DO 3 I00009=1,SSZ(15)
      RS2=0.0
      DO 4 I00003=1,SSZ(2)
      RS2=RS2+C00127(I00003,I00002,I00009,1)
    4 CONTINUE
      RS1=RS1+RS2
    3 CONTINUE
      RS3=C00011(I00002)*C00125(I00001,I00002)
      RS4=RS1
      IF(RS4.NE.0.0) THEN
        RS5=RS3/RS4
      ELSE IF(RS3.EQ.0.0) THEN
        RS5=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS5=1.0
        IER=4
      END IF
      C00127(I00001,I00002,2,2)=RS5
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00099')
      RETURN
      END
      SUBROUTINE M00005(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      USE GSINC4
      USE GSINC7
      USE GSINC4
      USE decomp_c5
      USE TGSMVL
      USE GSINC1
      USE GSINC5
      USE SMVLST0
      USE TGDEBG
      USE PSIMMOD1
      USE SIMRES0
      USE GSINC3
      USE GSINC6
      INTEGER MMI,MMR
      INTEGER RDUN,WRUN,CWKUN,MMRDR
      INTEGER NUMFL,AXSUN,AXTUN
      INTEGER KSINT,NSINT,KSINTA
      REAL RWA(DWA)
      INTEGER DSPUN,DSPPW,DSPPL,DSPDEC
      INTEGER IWA(DIWA),TMPI1
      INTEGER KMSTSL
      LOGICAL AUTACC,CONTSI
      CHARACTER*(*) MINSFL,UDRTST,INRTST
      REAL MINSIL
      DOUBLE PRECISION SILEN
      INTEGER DRCOW
      PARAMETER(DRCOW=1)
      REAL RCOW(DRCOW)
      CHARACTER*(*) LFFOWR,WTMO
      CHARACTER*(*) ERRMES
      LOGICAL DOUD
      LOGICAL SKPSMD,LOWMEM,CALC1,FSTPAS,CTRTHR,SUVFI,TMPLG1
      LOGICAL DSALLS,WTALLS,DODS,DOWR,DOEQ,OVOK,SERTAB
      LOGICAL DSPANP,DSPOIM,D1DROW,NELTX
      INTEGER KSTEPA,NPASSA,DSPCPN,DSPCLN
      INTEGER DSSMAP,SSMAP(DSSMAP)
      INTEGER LFNORD,LFNOWR,RDFSNO,WRFSNO
      INTEGER SSNO,LITSN,SETNO
      CHARACTER SSTP,SETTP
      LOGICAL DOTHIS
      COMMON/DTHIS/DOTHIS
      LOWMEM=.FALSE.
      IF(ECHO1.AND.DOIG(321).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TRADE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(321).NE.'n') then
      CALL S00080(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(321),
     *  C00096,C00105,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(322).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TRADE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(322).NE.'n') then
      CALL S00081(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(322),
     *  C00101,C00105,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(323).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TRADE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(323).NE.'n') then
      CALL S00082(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(323),
     *  C00098,C00105,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(324).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TRADE',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(324).NE.'n') then
      CALL S00083(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(324),
     *  C00103,C00105,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(332).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'BENDTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(332).NE.'n') then
      CALL S00084(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(332),
     *  C00002,C00043,C00108,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(334).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'UENDTAX',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(334).NE.'n') then
      CALL S00085(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(334),
     *  C00049,C00053,C00109,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(338).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PFACTOR',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(338).NE.'n') then
      CALL S00086(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(338),
     *  C00107,C00111,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(339).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PFACTOR',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(339).NE.'n') then
      CALL S00087(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(339),
     *  C00043,C00110,C00111,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(340).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PFACTOR',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(340).NE.'n') then
      CALL S00088(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(340),
     *  C00108,C00111,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(341).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'PFACTOR',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(341).NE.'n') then
      CALL S00089(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(341),
     *  C00109,C00111,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(346).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTendw',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(346).NE.'n') then
      CALL S00090(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(346),
     *  C00112,C00113,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(360).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTtech',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(360).NE.'n') then
      CALL S00091(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(360),
     *  C00115,C00119,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(361).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTtech',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(361).NE.'n') then
      CALL S00092(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(361),
     *  C00116,C00119,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(362).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTtech',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(362).NE.'n') then
      CALL S00093(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(362),
     *  C00117,C00119,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(363).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CNTtech',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(363).NE.'n') then
      CALL S00094(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(363),
     *  C00118,C00119,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGST('tg',AXSUN,SETNO,MMNST,NUMST,SSZ,SZUB,
     *  STIST,ELAD,STNM,STELST,STTP,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,
     *  MMNCS,CSPOS,CSPOSTSIM,MMNVC,VCWKST,
     *  DSSMP,SSMP,MMNSS,SSMPST,SERTAB,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM) THEN
       CALL SSAL1C(121,MMNST,SSZ,ERRMES)
       IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=9
       SSNO=12
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,12,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(PRELIM.OR.POSTSIMPASS2) THEN
       LITSN=22
       SSNO=13
       IF((PRELIM.AND.SSPOSTSIM(SSNO).EQ.'n').OR.
     *     (POSTSIMPASS2.AND.SSPOSTSIM(SSNO).EQ.'y')) THEN
        IF(SSMPST(SSNO).LE.0) THEN
         SSMPST(SSNO)=NSSMP+1
         NSSMP=NSSMP+SSZ(LITSN)
         CALL TGINCP(NSSMP+MAX(1,SSZ(LITSN))-SSZ(LITSN),
     *     DSSMP,'DSSMP',ERRMES)
         IF(ERRMES(1:1).EQ.'E') GOTO 15000
        END IF
       END IF
      END IF
      CALL TGNISS('tg',AXSUN,13,DSSMP,SSMP,
     *  MMNST,STNM,SSZ,SZUB,ELAD,MMEL,STEL,
     *  MMNFL,AFN,AFS,LFNORD,RDFSNO,RDUN,FSTPAS,MMNSS,SSMPST,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(388).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TOT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(388).NE.'n') then
      CALL S00095(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(388),
     *  C00124,C00127,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(389).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TOT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(389).NE.'n') then
      CALL S00096(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(389),
     *  C00125,C00127,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(390).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TOT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(390).NE.'n') then
      CALL S00097(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(390),
     *  C00126,C00127,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(391).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TOT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(391).NE.'n') then
      CALL S00098(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(391),
     *  C00011,C00124,C00127,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(392).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TOT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(392).NE.'n') then
      CALL S00099(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(392),
     *  C00011,C00125,C00127,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      RETURN
15000 CALL PERET('M00005')
      RETURN
      END
      SUBROUTINE S00100(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00011,C00126,C00127,
     *  ZDZVAL,NDZVAL,ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00001
      INTEGER I00002
      INTEGER I00003
      INTEGER I00009
      REAL ZDZVAL,NDZVAL
      INTEGER NZDZ,NNDZ
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1,RS2,RS3,RS4,RS5
      LOGICAL ECHO1
      REAL C00011(SSZ(1))
      REAL C00126(SSZ(2),SSZ(1))
      REAL C00127(SSZ(2),SSZ(1),SSZ(15),SSZ(20))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      NZDZ=0
      NNDZ=0
      DO 2 I00002=1,SSZ(1)
      DO 1 I00001=1,SSZ(2)
      RS1=0.0
      DO 3 I00009=1,SSZ(15)
      RS2=0.0
      DO 4 I00003=1,SSZ(2)
      RS2=RS2+C00127(I00003,I00002,I00009,1)
    4 CONTINUE
      RS1=RS1+RS2
    3 CONTINUE
      RS3=-C00126(I00001,I00002)*C00011(I00002)
      RS4=RS1
      IF(RS4.NE.0.0) THEN
        RS5=RS3/RS4
      ELSE IF(RS3.EQ.0.0) THEN
        RS5=ZDZVAL
        NZDZ=NZDZ+1
      ELSE
        RS5=1.0
        IER=4
      END IF
      C00127(I00001,I00002,3,2)=RS5
    1 CONTINUE
    2 CONTINUE
      IF(ECHO1.AND.IER.EQ.0) THEN
       CALL TBEDZ(NZDZ,ZDZVAL,NNDZ,NDZVAL,'fm',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "TOT"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00100')
      RETURN
      END
      SUBROUTINE S00101(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00005,C00129,C00130,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER I00004
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      REAL RS1
      LOGICAL ECHO1
      REAL C00005(SSZ(10),SSZ(1))
      REAL C00129(SSZ(1))
      REAL C00130(SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "NETINV"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      RS1=0.0
      DO 2 I00004=1,SSZ(5)
      RS1=RS1+C00005(SSMP(SSMPST(9)-1+SSMP(SSMPST(4)-1+I00004)),I00002)
    2 CONTINUE
      C00130(I00002)=RS1-C00129(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "NETINV"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00101')
      RETURN
      END
      SUBROUTINE S00102(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00128,C00130,C00131,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00128(SSZ(1))
      REAL C00130(SSZ(1))
      REAL C00131(SSZ(1))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "ISBAL"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00131(I00002)=C00130(I00002)-C00128(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "ISBAL"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00102')
      RETURN
      END
      SUBROUTINE S00103(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00131,C00134,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00131(SSZ(1))
      REAL C00134(SSZ(1),SSZ(21))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CGDSCOMP"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00134(I00002,1)=C00131(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CGDSCOMP"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00103')
      RETURN
      END
      SUBROUTINE S00104(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00132,C00134,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00132(SSZ(1))
      REAL C00134(SSZ(1),SSZ(21))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CGDSCOMP"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00134(I00002,2)=C00132(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CGDSCOMP"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00104')
      RETURN
      END
      SUBROUTINE S00105(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOCIG,
     *  C00133,C00134,
     *  ERRMES)
      USE PSIMMOD1
      USE GSINC6
      INTEGER MMNSS,SSIOS(MMNSS),SSMPST(MMNSS+1)
      CHARACTER*(*) DOCIG
      INTEGER I00002
      INTEGER MMNST,SSZ(MMNST),STIST(MMNST),IER,KK,TGSSP
      LOGICAL LGX
      INTEGER MMEL,ELAD(MMNST),TGEPOS
      CHARACTER*(*) STELST(MMNST),STNM(MMNST),STEL(MMEL)
      LOGICAL ECHO1
      REAL C00133(SSZ(1))
      REAL C00134(SSZ(1),SSZ(21))
      CHARACTER*(*) ERRMES
      REAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      EXTERNAL ID01,ID0V,GPRAND,TGFCMN,TGFNOR
      IER=0
      CALL GPAPRW(
     *  ' before calculating formula for coefficient "CGDSCOMP"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(DOCIG.EQ.'n') RETURN
      DO 1 I00002=1,SSZ(1)
      C00134(I00002,3)=C00133(I00002)
    1 CONTINUE
      IF(IER.NE.0) THEN
        CALL TGIER('fm',IER,ERRMES)
        GOTO 15000
      END IF
      CALL GPAPRW(
     *  ' while calculating formula for coefficient "CGDSCOMP"',
     *  ' ',ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('S00105')
      RETURN
      END
      SUBROUTINE M00006(RDUN,MMI,MMR,
     *  LFNORD,LFNOWR,LFFOWR,RDFSNO,WRFSNO,WTMO,
     *  KSINT,NSINT,KSINTA,
     *  RWA,NUMFL,
     *  IWA,OVOK,
     *  KMSTSL,AUTACC,SILEN,MINSIL,MINSFL,
     *  UDRTST,INRTST,CONTSI,
     *  AXSUN,AXTUN,WRUN,CWKUN,MMRDR,DSPUN,DSPPW,DSPPL,DSPDEC,
     *  DODS,DOWR,DOEQ,DSALLS,WTALLS,KSTEPA,NPASSA,SERTAB,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  DSSMAP,SSMAP,
     *  DOUD,
     *  CALC1,FSTPAS,CTRTHR,SUVFI,ERRMES)
      USE GSINC4
      USE GSINC7
      USE GSINC4
      USE decomp_c5
      USE TGSMVL
      USE GSINC1
      USE GSINC5
      USE SMVLST0
      USE TGDEBG
      USE PSIMMOD1
      USE SIMRES0
      USE GSINC3
      USE GSINC6
      INTEGER MMI,MMR
      INTEGER RDUN,WRUN,CWKUN,MMRDR
      INTEGER NUMFL,AXSUN,AXTUN
      INTEGER KSINT,NSINT,KSINTA
      REAL RWA(DWA)
      INTEGER DSPUN,DSPPW,DSPPL,DSPDEC
      INTEGER IWA(DIWA),TMPI1
      INTEGER KMSTSL
      LOGICAL AUTACC,CONTSI
      CHARACTER*(*) MINSFL,UDRTST,INRTST
      REAL MINSIL
      DOUBLE PRECISION SILEN
      INTEGER DRCOW
      PARAMETER(DRCOW=1)
      REAL RCOW(DRCOW)
      CHARACTER*(*) LFFOWR,WTMO
      CHARACTER*(*) ERRMES
      LOGICAL DOUD
      LOGICAL SKPSMD,LOWMEM,CALC1,FSTPAS,CTRTHR,SUVFI,TMPLG1
      LOGICAL DSALLS,WTALLS,DODS,DOWR,DOEQ,OVOK,SERTAB
      LOGICAL DSPANP,DSPOIM,D1DROW,NELTX
      INTEGER KSTEPA,NPASSA,DSPCPN,DSPCLN
      INTEGER DSSMAP,SSMAP(DSSMAP)
      INTEGER LFNORD,LFNOWR,RDFSNO,WRFSNO
      INTEGER SSNO,LITSN,SETNO
      CHARACTER SSTP,SETTP
      LOGICAL DOTHIS
      COMMON/DTHIS/DOTHIS
      LOWMEM=.FALSE.
      IF(ECHO1.AND.DOIG(393).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'TOT',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(393).NE.'n') then
      CALL S00100(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(393),
     *  C00011,C00126,C00127,
     *  ZDZVAL,NDZVAL,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(400).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'NETINV',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(400).NE.'n') then
      CALL S00101(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(400),
     *  C00005,C00129,C00130,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(402).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'ISBAL',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(402).NE.'n') then
      CALL S00102(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(402),
     *  C00128,C00130,C00131,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      IF(ECHO1.AND.DOIG(408).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CGDSCOMP',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(408).NE.'n') then
      CALL S00103(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(408),
     *  C00131,C00134,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(409).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CGDSCOMP',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(409).NE.'n') then
      CALL S00104(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(409),
     *  C00132,C00134,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      IF(ECHO1.AND.DOIG(410).EQ.'y') THEN
        CALL GPTO1(' Formula for ''%t''',
     *    'CGDSCOMP',0,ERRMES)
        IF(ERRMES(1:1).EQ.'E') GOTO 15000
      END IF
      IF(DOIG(410).NE.'n') then
      CALL S00105(MMNSS,SSIOS,ECHO1,
     *  MMNST,SSZ,STIST,ELAD,STELST,STNM,MMEL,STEL,
     *  SSMPST,
     *  DOIG(410),
     *  C00133,C00134,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      ENDIF
      CALL TGSCRS('tg',1,CALC1,DODS,DOWR,CTRTHR,
     *  AXSUN,RDUN,WRUN,DSPUN,CWKUN,
     *  LFNORD,LFNOWR,LFFOWR,NUMFL,RDFSNO,WRFSNO,
     *  DSPPW,DSPPL,DSPDEC,MMR,MMRDR,
     *  KSTEPA,NPASSA,KSINT,KSINTA,NSINT,
     *  DSALLS,WTALLS,WTMO,.FALSE.,
     *  DSPANP,DSPOIM,D1DROW,DSPCPN,DSPCLN,NELTX,
     *  SUVFI,
     *  TMPLG1,TMPI1,
     *  ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      CALL TGPCUV('tg',KSTEPA,KMSTSL,KSINTA,AXSUN,SIZE(C00129),C00129,
     *  MMNCS,NUMCS,CSNAM,CSNIND,CSPOSTSIM,
     *  MMNST,SSZ,SZUB,ELAD,STELST,STNM,MMEL,STEL,
     *  AUTACC,POSTSIMPASS3,SILEN,MINSIL,MINSFL,UDRTST,INRTST,
     *  MMDEBG,DEBG,OVOK,CONTSI,ERRMES)
      IF(ERRMES(1:1).EQ.'E') GOTO 15000
      RETURN
15000 CALL PERET('M00006')
      RETURN
      END
      SUBROUTINE SSDAUC(ERRMES)
      CHARACTER*(*) ERRMES
      RETURN
      END
      SUBROUTINE SSCTU(MMNST,SSZ,CSNO,
     *  DUCMEM,UCMEM,ERRMES)
      INTEGER CSNO,MMNST,SSZ(MMNST)
      INTEGER DUCMEM
      REAL UCMEM(DUCMEM)
      CHARACTER*(*) ERRMES
      RETURN
      END
      SUBROUTINE GPEQN1(EQNUM,CHAR,LCHAR,ERRMES)
      INTEGER EQNUM,LCHAR
      CHARACTER*(*) CHAR,ERRMES
      return
      END
      SUBROUTINE SSVFTS(FROMTO,NUMVC,VCSTAT,DSMRES,SIMRES,ERRMES)
      INTEGER NUMVC,DSMRES
      CHARACTER*(*) FROMTO,VCSTAT(NUMVC),ERRMES
      REAL SIMRES(DSMRES)
      RETURN
      END
      include 'tgscrs1.for'
      USE decomp_c3
      USE decomp_c4
      INTEGER SSVSZ
      include 'tgscrs2.for'
      include 'tgst1.for'
      USE decomp_c3
      include 'tgst2.for'
      include 'tgwacv1.for'
      USE decomp_c3
      include 'tgwacv2.for'
      include 'tgwcvv1.for'
      USE decomp_c3
      include 'tgwcvv2.for'
      include 'tgctri1.for'
      USE decomp_c3
      include 'tgctri2.for'
      include 'ssrsmv1.for'
      USE decomp_c3
      include 'ssrsmv2.for'
      include 'tgpmp1.for'
      USE decomp_c4
      include 'tgpmp2.for'
      include 'tbsstp1.for'
      USE gsinc5
      include 'tbsstp2.for'
      include 'tbsssp1.for'
      USE gsinc5
      include 'tbsssp2.for'
      include 'tbscsp1.for'
      USE gsinc1
      include 'tbscsp2.for'
