<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 28, 2014 at 7:34 AM, Paulo van Breugel <span dir="ltr"><<a href="mailto:p.vanbreugel@gmail.com" target="_blank">p.vanbreugel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Wed, Aug 27, 2014 at 8:20 PM, Markus Neteler <span dir="ltr"><<a href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Aug 27, 2014 at 3:25 PM, Paulo van Breugel<br>
<div><<a href="mailto:p.vanbreugel@gmail.com" target="_blank">p.vanbreugel@gmail.com</a>> wrote:<br>
> I forgot to mention that I am using GRASS 7.1 (rev 61757, had it before with<br>
> rev 61413, but I think I had a similar problem about a year ago).<br>
><br>
> On Wed, Aug 27, 2014 at 10:13 AM, Paulo van Breugel <<a href="mailto:p.vanbreugel@gmail.com" target="_blank">p.vanbreugel@gmail.com</a>><br>
> wrote:<br>
>><br>
>> When running several r.mapcalc in a loop (via R) the function stops with<br>
>> an error:<br>
>><br>
>> ERROR: Error reading null row 2725 for <MASK><br>
<br>
</div>The error comes from read_null_bits() in<br>
lib/raster/get_row.c<br>
<br>
around<br>
<a href="http://trac.osgeo.org/grass/browser/grass/trunk/lib/raster/get_row.c#L827" target="_blank">http://trac.osgeo.org/grass/browser/grass/trunk/lib/raster/get_row.c#L827</a><br>
<br>
Maybe some off_t definition is missing?<br></blockquote><div><br></div></div><div>I don't know what that means; indication of something being wrong with the data, or in the code?<br></div><div class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><br>
>> The row number varies. This seems to happen at random, and when I repeat<br>
>> the same r.mapcalc calculation that stopped with the error before, things<br>
>> run without problem.<br>
<br>
<br>
</div>Please tell us also<br>
- how many raster cells are involved<br>
- how many files are opened in the loop?<br></blockquote><div><br><br></div></div><div>Last time the error occured in the r.mapcalc below:<br><br><span style="font-family:courier new,monospace"> The command:<br>r.mapcalc --overwrite expression="OUTPUT = if(MESSC==0, 100000* 100.0 * (MESSB-12300000)/(382900000-12300000), if(MESSC<=5000000, 2*MESSC, if(MESSC<=10000000, 2*(10000000-MESSC),100000 * 100.0 * (382900000- MESSB)/(382900000-12300000))))"<br>
produced an error (1) during execution:<div class=""><br>ERROR: Error reading null row 2725 for <MASK></div></span><br></div><div> <br></div><div>These layers have 6515140 raster cells, with 3366825 total null cells. The command is part of a sequence of commands that is run in a loop, but these are run in sequence so at the time of the error I guess two layers were open. As I mentioned, running the command again and it will normally run without problems with the given input layers, and it may go wrong with other input layers again, without any discernible logic to me. <br>
</div><div class=""><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><br>
>> I tried after removing the mask, and this time no problem so it may have<br>
>> to do something with the MASK? (as these error messages only occur once in a<br>
>> while, I can't be completely sure it only happens when a MASK is defined).<br>
>><br>
>> I ran it through R, using the execGRASS() function of the spgrass6<br>
>> package. I ran the same, but using the system call instead of execGRASS.<br>
>> Still got the same error messages. I therefore guess this has nothing to do<br>
>> with R?<br>
<br>
</div>Could you "simulate" the loops in a GRASS script outside of R to see<br>
if it the same?<br></blockquote><div><br></div></div><div>I'll have to figure out how to do that. Perhaps running the r.mapcalc above several times will do the trick. <br></div></div></div></div></blockquote><div><br>
</div><div>I ran the same calculations, but this time as a list of grass commands in a text file, which I subsequently ran from the command line (./runMyscript.txt). Same error, so this does not seem to be related to R.<br>
<br></div><div>Perhaps totally coincidence, but in all cases I remember I encountered this problem, I was running r.mapcalc expressions with an 'if' function<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span><font color="#888888"><br>
Markus<br>
</font></span></blockquote></div><br></div></div>
</blockquote></div><br></div></div>