IF s #
NIL
THEN {
ReadLocations:
PROC [keyWord:
ROPE]
RETURNS [reals: RealSequence ¬
NIL] ~ {
line ¬ G3dIO.FindKeyWord[s, keyWord, FALSE, 20, line];
line ¬ G3dIO.GetLine[s, line];
reals ¬ NEW[RealSequenceRep[G3dIO.NWordsInRope[line.rope]]];
FOR n:
NAT
IN [0..reals.length ¬ reals.maxLength)
DO
reals[n] ¬ G3dIO.GetReal[line];
ENDLOOP;
};
line: G3dIO.Line ¬ G3dIO.FindKeyWord[s, "NumberOfIndices",, 20, G3dIO.ObtainLine[]];
resi: NAT ¬ IO.GetCard[s];
resj: NAT ¬ IO.GetCard[s];
resk: NAT ¬ IO.GetCard[s];
x: RealSequence ¬ ReadLocations["XLocations" ! G3dIO.Error => GOTO BadLocation];
y: RealSequence ¬ ReadLocations["YLocations" ! G3dIO.Error => GOTO BadLocation];
z: RealSequence ¬ ReadLocations["ZLocations" ! G3dIO.Error => GOTO BadLocation];
values: Reals3d ¬ AllocateGridValues[[resi, resj, resk]];
line ¬ G3dIO.FindKeyWord[s, "Values", FALSE, 20, line];
G3dIO.ReleaseLine[line];
FOR i:
NAT
IN [0..resi)
DO
reals2d: Reals2d ¬ values[i];
FOR j:
NAT
IN [0..resj)
DO
reals: RealSequence ¬ reals2d[j];
CedarProcess.CheckAbort[];
FOR k:
NAT
IN [0..resk)
DO
reals[k] ¬ IO.GetReal[s];
ENDLOOP;
ENDLOOP;
ENDLOOP;
IO.Close[s];
g ¬ CreateGrid[values, [], x, y, z];
};