Hi All,<div><br></div><div>I figured I would check again to see if anyone had any questions/comment on this. Otherwise I&#39;ll commit it tomorrow.</div><div><br></div><div>Thanks,</div><div>Doug</div><div><br><div class="gmail_quote">

On Thu, Oct 11, 2012 at 3:05 PM, Doug Jacobsen <span dir="ltr">&lt;<a href="mailto:jacobsen.douglas@gmail.com" target="_blank">jacobsen.douglas@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi All,<div><br></div><div>This is a commit check for two files which allow the addition of scratch variables in mpas registry files. Just to explain how to use them a bit, typical registry variable definitions look like this:</div>


<div>var persistent real    dvEdge ( nEdges ) 0 iro dvEdge mesh - -</div><div><br></div><div>where persistent means that the variable is allocated once on initialize, persists throughout the run, and then is deallocated on finalize. The proposed changes allow you to change persistent to scratch, in which case the field is allocated on initialize but the % array pointer is not. Then if you want to allocate/deallocate space for the scratch variable in the middle of the run routines are provided from mpas_grid_types.F. These routines are named</div>


<div><br></div><div>mpas_allocate_scratch_field</div><div>and</div><div>mpas_deallocate_scratch_field</div><div><br></div><div>As a template for these routines, both look like the following.</div><div>mpas_allocate_scratch_field1d_integer(f, single_block_in)</div>


<div><br></div><div>where f is a pointer for a field, and single_block_in is an optional logical that allows the allocation of a single block or the entire block list. If single_block_in is omitted or set to be false f is assumed to be the field in the header block as opposed to a field pointer to any other block. The same is true for the deallocate routine. The allocate and deallocate routines only work on scratch variables with at least 1d (no 0d integers or reals).</div>


<div><br></div><div>Some restrictions apply to scratch variables.</div><div>1) Scratch variables cannot exists within a super array. IE. No scratch tracers/scalars.</div><div>2) Currently, registry doesn&#39;t allow single variable types. IE. if you create a new type called scratch (domain % blocklist % scratch) it has to have more than one variable.</div>


<div><br></div><div>This change is needed to explore some of the OpenMP, and hopefully at a later time 2) in the restrictions list will get fixed.</div><div><br></div><div>Please let me know if anyone has questions or comments. If not I&#39;ll probably commit it next wednesday.</div>


<div><br></div><div>Thanks,</div><div>Doug</div>
</blockquote></div><br></div>