[mpas-developers] Trunk Commit Check: Bug in core_sw/module_global_diagnostics.F

Mark Petersen mpetersen at lanl.gov
Mon Dec 20 16:33:09 MST 2010


Doug,

Yes, great catch.  I agree with Xylar - in the rest of the code we try to 
avoid if statements by using a dummy of nCells+1, nEdges+1, etc.  We then 
initiate zero values in the relevant variables at the dummy indices so 
there is simply no contribution when calculating with a dummy cell.  See 
if you can do something similar.

Mark



On Mon, 20 Dec 2010, Xylar Asay-Davis wrote:

> Hi Doug,
>
> Great that you found this bug!
>
> In other parts of the code, we're using indices of dummy cells to avoid 
> having to use these kinds of if statements. Is there a way that approach 
> could be applied to cellsOnEdge in general, and would it work in the 
> diagnostics?
>
> -Xylar
>
>
> On 12/20/10 9:19 AM, Doug Jacobsen wrote:
>> Hi Everyone,
>> 
>> So, I found a bug in the shallow waters module_global_diagnostics.F. It's 
>> only apparent for limited area grids. Basically, I was getting cellsOnEdge, 
>> and just using both of them, but on a boundaryEdge one of the two 
>> cellsOnEdge is 0, making it not a valid cell, so the code would segfault. I 
>> changed it to check that both of the two cells were not 0 before doing the 
>> computation, and it appears to work.
>> 
>> I have attached the file, to see if anyone cared to look at it. I'll 
>> probably commit it tomorrow if I don't hear anything back. Thanks!
>> 
>> Doug
>> 
>> 
>> _______________________________________________
>> mpas-developers mailing list
>> mpas-developers at mailman.ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/mpas-developers
>
>
> -- 
>
> ***********************
> Xylar S. Asay-Davis
> E-mail: xylar at lanl.gov
> Phone: (505) 606-0025
> Fax: (505) 665-2659
> CNLS, MS B258
> Los Alamos National Laboratory
> Los Alamos, NM 87545
> ***********************
>
>
>


More information about the mpas-developers mailing list