subroutine ip2ij (ip,imx,i,j) c c======================================================================= c === c This routine decodes an index of the type: === c === c ip = i + (j-1)*imx === c === c======================================================================= c c----------------------------------------------------------------------- c Define local data c----------------------------------------------------------------------- c integer i,imx,ip,j c c======================================================================= c Begin executable code c======================================================================= c i = mod(ip,imx) c if (i.eq.0) i = imx c j = (ip-i)/imx + 1 c return end