<div dir="ltr">Hi all,<div>I've been banging my head against the wall with this problem for so long I may have too much brain damage to come up with a solution.</div><div><br></div><div>The problem is this: I want to solve some equations to solve for the magnetic field associated with the ocean circulation, and these equations involve the inverse of a penta-diagonal matrix.  I translated what would be the following in Matlab (I know, I know...):</div><div><br></div><div>difFluxw = spdiags([-Cw(:),[Cw(2:end);nan]],                  [0, -1],    Ngrid,Ngrid);<br>difFluxe = spdiags([-Ce(:),[nan;Ce(1:end-1)]],                [0, 1],     Ngrid,Ngrid);<br>difFluxs = spdiags([-Cs(:),[Cs(1+Nlon:end);nan*ones(Nlon,1)]],[0, -Nlon], Ngrid,Ngrid);<br>difFluxn = spdiags([-Cn(:),[nan*ones(Nlon,1);Cn(1:end-Nlon)]],[0, Nlon],  Ngrid,Ngrid);<br></div><div>advFluxw = spdiags([-aCw(:),-[aCw(2:end);nan]],                  [0, -1],    Ngrid,Ngrid);<br>advFluxe = spdiags([ aCe(:), [nan;aCe(1:end-1)]],                [0, 1],     Ngrid,Ngrid);<br>advFluxs = spdiags([-aCs(:),-[aCs(1+Nlon:end);nan*ones(Nlon,1)]],[0, -Nlon], Ngrid,Ngrid);<br>advFluxn = spdiags([ aCn(:), [nan*ones(Nlon,1);aCn(1:end-Nlon)]],[0, Nlon],  Ngrid,Ngrid);<br></div><div>Fluxw = difFluxw + advFluxw; <br>Fluxe = difFluxe + advFluxe; <br>Fluxs = difFluxs + advFluxs; <br>Fluxn = difFluxn + advFluxn; <br></div><div>bjunk=find(lon==min(lon(:)) & lat>min(lat(:)) & lat<max(lat(:))); <br>Fluxw(bjunk,:) = 0;<br>Fluxw = Fluxw + sparse(bjunk,bjunk,        -Cw(bjunk), Ngrid,Ngrid);<br>Fluxw = Fluxw + sparse(bjunk,bjunk-1+Nlon,  Cw(bjunk), Ngrid,Ngrid);<br>% flux through east side of cell:<br>bjunk=find(lon==max(lon(:)) & lat > min(lat(:)) & lat<max(lat(:)));<br>Fluxe(bjunk,:) = 0;<br>Fluxe = Fluxe + sparse(bjunk,bjunk,       -Ce(bjunk), Ngrid,Ngrid);<br>Fluxe = Fluxe + sparse(bjunk,bjunk+1-Nlon, Ce(bjunk),Ngrid,Ngrid);<br></div><div>integHcoef = spdiags(Hcoef(:).*vol(:), 0, Ngrid,Ngrid);<br></div><div>metrik.Lfluxes =  Fluxw + Fluxe + Fluxs + Fluxn ;<br>metrik.L       =  metrik.Lfluxes + integHcoef;<br></div><div><br></div><div>into Fortran.  Nevermind what the variables mean; all that's important is that the variable metrik.L is a pentadiagonal matrix that I save in Fortran as two off-diagonal arrays that are Ngrid-Nlon in length, two off-diagonal arrays that are Ngrid-1 in length, and a diagonal array of length Ngrid.  I've written a pent-diagonal matrix solver for this type of situation as follows:</div><div><br></div><div><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">SUBROUTINE</span><span style="font-variant-ligatures:no-common-ligatures"> PENTA(myThid,Ngrid,Nlon,E0,A0,D0,C0,F0,B0,X0)</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">  </span>RESULTS:<span class="gmail-Apple-converted-space">  </span>matrix has 5 bands, EADCF, with D being the main diagonal,</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">  </span>E and A are the lower diagonals, and C and F are the upper diagonals.</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">    </span>E is defined for rows i = n1:Ngrid, but is defined as E(1) to E(Ngrid-Nlon)</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">    </span>A is defined for rows i = 2:Ngrid, but is defined as A(1) to A(Ngrid-1)</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">    </span>D is defined for rows i = 1:Ngrid</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">    </span>C is defined for rows i = 1:Ngrid-1, but the last element isn't used</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">    </span>F is defined for rows i = 1:(Ngrid-Nlon), but the last Nlon-1 elements aren't used</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">  </span>B is the right-hand side</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(86,32,244)"><span style="font-variant-ligatures:no-common-ligatures">c <span class="gmail-Apple-converted-space">  </span>X is the solution vector</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(57,192,38)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures">IMPLICIT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures">NONE</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(219,39,218)"><span style="font-variant-ligatures:no-common-ligatures">#include </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">"SIZE.h"</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(202,51,35)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">#include </span><span style="font-variant-ligatures:no-common-ligatures">"EEPARAMS.h"</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(219,39,218)"><span style="font-variant-ligatures:no-common-ligatures">#include </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">"GRID.h"</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(202,51,35)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">#include </span><span style="font-variant-ligatures:no-common-ligatures">"SURFACE.h"</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(202,51,35)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">INTEGER</span><span style="font-variant-ligatures:no-common-ligatures">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">in</span><span style="font-variant-ligatures:no-common-ligatures">) :: myThid</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">INTEGER</span><span style="font-variant-ligatures:no-common-ligatures">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">in</span><span style="font-variant-ligatures:no-common-ligatures">) :: Ngrid</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">INTEGER</span><span style="font-variant-ligatures:no-common-ligatures">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">in</span><span style="font-variant-ligatures:no-common-ligatures">) :: Nlon</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx:sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy:sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSy),</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">     </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">&</span><span style="font-variant-ligatures:no-common-ligatures"> <span class="gmail-Apple-converted-space">    </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">in</span><span style="font-variant-ligatures:no-common-ligatures">) :: E0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx:sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy:sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSy),</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">     </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">&</span><span style="font-variant-ligatures:no-common-ligatures"> <span class="gmail-Apple-converted-space">    </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">in</span><span style="font-variant-ligatures:no-common-ligatures">) :: A0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx:sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy:sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSy),</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">     </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">&</span><span style="font-variant-ligatures:no-common-ligatures"> <span class="gmail-Apple-converted-space">    </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">in</span><span style="font-variant-ligatures:no-common-ligatures">) :: D0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx:sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy:sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSy),</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">     </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">&</span><span style="font-variant-ligatures:no-common-ligatures"> <span class="gmail-Apple-converted-space">    </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">in</span><span style="font-variant-ligatures:no-common-ligatures">) :: C0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx:sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy:sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSy),</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">     </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">&</span><span style="font-variant-ligatures:no-common-ligatures"> <span class="gmail-Apple-converted-space">    </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">in</span><span style="font-variant-ligatures:no-common-ligatures">) :: F0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx:sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy:sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSy),</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">     </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">&</span><span style="font-variant-ligatures:no-common-ligatures"> <span class="gmail-Apple-converted-space">    </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">out</span><span style="font-variant-ligatures:no-common-ligatures">) :: B0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx:sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy:sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSx,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:nSy),</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">     </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">&</span><span style="font-variant-ligatures:no-common-ligatures"> <span class="gmail-Apple-converted-space">    </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">intent</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">out</span><span style="font-variant-ligatures:no-common-ligatures">) :: X0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">INTEGER</span><span style="font-variant-ligatures:no-common-ligatures"> bi,bj</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">INTEGER</span><span style="font-variant-ligatures:no-common-ligatures"> I,J,IJ</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">INTEGER</span><span style="font-variant-ligatures:no-common-ligatures"> Nn</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL XMULT</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:Ngrid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSy) :: E</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:Ngrid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSy) :: A</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:Ngrid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSy) :: D</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:Ngrid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSy) :: C</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:Ngrid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSy) :: F</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:Ngrid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSy) :: B</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>_RL, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(57,192,38)">dimension</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">:Ngrid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSy) :: X</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>Nn</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">Ngrid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">nSy</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> bj</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">,nSy</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">       </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> bi</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">,nSx</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures">I <span style="color:rgb(209,113,37)">=</span> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx,sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> J </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy,sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>E(IJ)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">E0(I,J,bi,bj)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>A(IJ)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">A0(I,J,bi,bj)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>D(IJ)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">D0(I,J,bi,bj)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>C(IJ)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">C0(I,J,bi,bj)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>F(IJ)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">F0(I,J,bi,bj)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">       </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> IJ </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">2</span><span style="font-variant-ligatures:no-common-ligatures">,Nn</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>XMULT </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> A(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">/</span><span style="font-variant-ligatures:no-common-ligatures">D(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>D(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> D(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> XMULT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">C(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>C(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> C(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> XMULT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">F(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>B(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> B(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> XMULT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">B(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>XMULT </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> E(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">/</span><span style="font-variant-ligatures:no-common-ligatures">D(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>A(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> A(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> XMULT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">C(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>D(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> D(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> XMULT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">F(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>B(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> B(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> XMULT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">B(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>XMULT </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> A(Nn</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">/</span><span style="font-variant-ligatures:no-common-ligatures">D(Nn</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>D(Nn) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> D(Nn) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> XMULT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">C(Nn</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>X(Nn) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> (B(Nn) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> XMULT</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">B(Nn</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">))</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">/</span><span style="font-variant-ligatures:no-common-ligatures">D(Nn)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="color:rgb(209,113,37);font-variant-ligatures:no-common-ligatures">DO</span><span style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures"> IJ </span><span style="color:rgb(209,113,37);font-variant-ligatures:no-common-ligatures">=</span><span style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures"> Nn</span><span style="color:rgb(209,113,37);font-variant-ligatures:no-common-ligatures">-</span><span style="color:rgb(202,51,35);font-variant-ligatures:no-common-ligatures">1</span><span style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures">,Nn</span><span style="color:rgb(209,113,37);font-variant-ligatures:no-common-ligatures">-</span><span style="font-variant-ligatures:no-common-ligatures"><font color="#000000">Nlon</font></span><span style="color:rgb(209,113,37);font-variant-ligatures:no-common-ligatures">+</span><span style="color:rgb(202,51,35);font-variant-ligatures:no-common-ligatures">1</span><span style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures">,</span><span style="color:rgb(209,113,37);font-variant-ligatures:no-common-ligatures">-</span><span style="color:rgb(202,51,35);font-variant-ligatures:no-common-ligatures">1</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">          </span>X(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> (B(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> C(IJ)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">X(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">))</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">/</span><span style="font-variant-ligatures:no-common-ligatures">D(IJ)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> IJ </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> Nn<span style="color:rgb(209,113,37)">-</span>Nlon</span><span style="font-variant-ligatures:no-common-ligatures">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>X(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> (B(IJ) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures"> F(IJ)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">X(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">n1) </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">     </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">&</span><span style="font-variant-ligatures:no-common-ligatures"> <span class="gmail-Apple-converted-space">                </span>C(IJ)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">*</span><span style="font-variant-ligatures:no-common-ligatures">X(IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">))</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">/</span><span style="font-variant-ligatures:no-common-ligatures">D(IJ)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">0</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> bj</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">,nSy</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">       </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> bi</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures">,nSx</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO </span><span style="font-variant-ligatures:no-common-ligatures">I <span style="color:rgb(209,113,37)">=</span> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLx,sNx</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLx</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">DO</span><span style="font-variant-ligatures:no-common-ligatures"> J </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">-</span><span style="font-variant-ligatures:no-common-ligatures">OLy,sNy</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures">OLy</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">IJ</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">+</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(202,51,35)">1</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>B0(I,J,bi,bj)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">B(IJ)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">





















</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">         </span>X0(I,J,bi,bj)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">=</span><span style="font-variant-ligatures:no-common-ligatures">X(IJ)</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">       </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">ENDDO</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(209,113,37)">RETURN</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">




</span></p><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)">END</span></p><br class="gmail-Apple-interchange-newline"><span class="gmail-Apple-converted-space"><span style="color:rgb(0,0,0);font-family:Menlo;font-size:11px">X0</span> is what I want, but the above code isn't correct.  I get something like the following for the magnetic field:</span></div><div><span class="gmail-Apple-converted-space"><img src="cid:ii_ktk8gar90" alt="image.png" width="479" height="374"><br></span></div><div><span class="gmail-Apple-converted-space">It seems like I'm not considering an ordering for the tiling correctly, or the pent-diagonal matrix solver isn't quite correct in other ways (although, I'm adapting it from an existing code with two off-diagonal arrays of length Ngrid-2, two off-diagonal arrays of length Ngrid-1, and a diagonal array of length Ngrid: </span><a href="http://www.math.uakron.edu/~kreider/anpde/penta.f" target="_blank">http://www.math.uakron.edu/~kreider/anpde/penta.f</a>).  It's also possible that I need to interpolate over the "hole" (of NaNs) over Asia in the MITgcm.  I recognize that you don't know whether my inputs to the subroutine are correct, but just assume they are.</div><div><br></div><div>One possible approach to figuring out what's wrong is to interpolate from the LLC grid to a regularly spaced lat-lon grid, but I'm not sure if this capability exists inline as the model runs.  No, I don't want to do this offline using averaged output because I'm trying to make this calculation adjoint-able (plus, a function of the average of each field is not the same as the average of a function of each field).  I figured that someone on this list would be able to point out what I'm doing incorrectly in the above Fortran code or knows how to do the interpolation to a regular lat-lon grid, but maybe I'm asking for too much...  In any case, thanks for any help.</div><div>-David</div></div>