Page 350 - Handbook Of Multiphase Flow Assurance
P. 350

Computer code (Makogon, 1994, 1997)              349

            srin,                               {temporary list of short circuit}
            srinm,                              {list of next:pointers}
            sbonds                              {list of bond numbers for short circ.}
            :array[1..nmax div 2] of integer;
            srinn:array[1..nmax div 2] of boolean;     {flags of next-pointers}
            proceed,                          {all checked fine}
            scontin,                          {use same bond to seek short circuit}
            snothere,                         {atom not in short circuit}
            sfound                            {found next link}
            :boolean;




            Procedure Output;

            var io,jo:integer;
            begin
            rewrite (f1, 'NAME=ring.out');
            for io:=1 to ntot do
              begin
              for jo:=1 to nmax do
                if ring[io,jo]<>0 then
                  write(f1,ring[io,jo]:4,' ');
              writeln(f1);
              end;
            close(f1);
            end;

            Procedure Choice;                {Used to determine branching and to
                                              define the next-branch in the path
                                              for each point in the ring.}
            label C1,C2;
            var kc,ic,jc,jc2:integer;        {counters}

            begin
            if closed then kc:=nr            {If ring is not complete then don't}
                     else kc:=nr−1;         {seek branches at last point reached}
            for ic:=1 to kc do
            begin
            rinn[ic]:=False;                 {Specify no branching at nhb[nbond,1]}
            rinm[ic]:=0;
              for jc:=bonds[ic]+1 to n d     {See if choices are present:    }
                begin                        {if a bond from list i+1..n has a  }
                nothere:=False;              {check point and not in ring itself.}
                if (nhb[jc,1]=rin[ic]) then
                  begin                      {one end of the bond fits}
   345   346   347   348   349   350   351   352   353   354   355