[mpas-developers] COMMIT CHECK: Scratch Variables

Doug Jacobsen jacobsen.douglas at gmail.com
Tue Oct 23 10:46:56 MDT 2012


Hi All,

Here is an updated version of the gen_inc.c file. Last week Michael pointed
out some issues with it, so this new version fixes those.

I've tested it and from my tests it seems to work well. The issues I
mentioned previously still exist though (can't have a single variable in a
group ie. state, mesh, etc). So those will have to be tackled at some point
in time.

If no one has any issues I'll commit these tomorrow.

Thanks!
Doug

On Tue, Oct 16, 2012 at 3:55 PM, Mark Petersen <mpetersen at lanl.gov> wrote:

>  Doug took a few minutes to explain this to me in person, and it sounds
> like a great addition.  It allows us to add allocatable scratch variables
> in the Registry.  This all looks good to me.
>
> Mark
>
>
> On 10/16/12 15:20, Doug Jacobsen wrote:
>
> Hi All,
>
>  I figured I would check again to see if anyone had any questions/comment
> on this. Otherwise I'll commit it tomorrow.
>
>  Thanks,
> Doug
>
>  On Thu, Oct 11, 2012 at 3:05 PM, Doug Jacobsen <
> jacobsen.douglas at gmail.com> wrote:
>
>> Hi All,
>>
>>  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:
>> var persistent real    dvEdge ( nEdges ) 0 iro dvEdge mesh - -
>>
>>  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
>>
>>  mpas_allocate_scratch_field
>> and
>> mpas_deallocate_scratch_field
>>
>>  As a template for these routines, both look like the following.
>> mpas_allocate_scratch_field1d_integer(f, single_block_in)
>>
>>  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).
>>
>>  Some restrictions apply to scratch variables.
>> 1) Scratch variables cannot exists within a super array. IE. No scratch
>> tracers/scalars.
>> 2) Currently, registry doesn'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.
>>
>>  This change is needed to explore some of the OpenMP, and hopefully at a
>> later time 2) in the restrictions list will get fixed.
>>
>>  Please let me know if anyone has questions or comments. If not I'll
>> probably commit it next wednesday.
>>
>>  Thanks,
>> Doug
>>
>
>
>
> _______________________________________________
> mpas-developers mailing listmpas-developers at mailman.ucar.eduhttp://mailman.ucar.edu/mailman/listinfo/mpas-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/mpas-developers/attachments/20121023/d3b4ce01/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gen_inc.c
Type: text/x-csrc
Size: 156610 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/mpas-developers/attachments/20121023/d3b4ce01/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpas_grid_types.F
Type: application/octet-stream
Size: 35922 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/mpas-developers/attachments/20121023/d3b4ce01/attachment-0001.obj 


More information about the mpas-developers mailing list