<p><b>dwj07@fsu.edu</b> 2012-05-01 14:14:08 -0600 (Tue, 01 May 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Adding routines to deallocate fields.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/omp_blocks/multiple_blocks/src/framework/mpas_grid_types.F
===================================================================
--- branches/omp_blocks/multiple_blocks/src/framework/mpas_grid_types.F        2012-05-01 19:49:47 UTC (rev 1853)
+++ branches/omp_blocks/multiple_blocks/src/framework/mpas_grid_types.F        2012-05-01 20:14:08 UTC (rev 1854)
@@ -363,7 +363,20 @@
type (dm_info), pointer :: dminfo
end type domain_type
+ interface mpas_deallocate_field
+ module procedure mpas_deallocate_field0d_integer
+ module procedure mpas_deallocate_field1d_integer
+ module procedure mpas_deallocate_field2d_integer
+ module procedure mpas_deallocate_field3d_integer
+ module procedure mpas_deallocate_field0d_real
+ module procedure mpas_deallocate_field1d_real
+ module procedure mpas_deallocate_field2d_real
+ module procedure mpas_deallocate_field3d_real
+ module procedure mpas_deallocate_field0d_char
+ module procedure mpas_deallocate_field1d_char
+ end interface
+
contains
@@ -444,7 +457,203 @@
end subroutine mpas_deallocate_domain
+ subroutine mpas_deallocate_field0d_integer(f)!{{{
+ type (field0dInteger), pointer :: f
+ type (field0dInteger), pointer :: f_cursor
+ f_cursor => f
+
+ do while(associated(f))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor)
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field0d_integer!}}}
+
+ subroutine mpas_deallocate_field1d_integer(f)!{{{
+ type (field1dInteger), pointer :: f
+ type (field1dInteger), pointer :: f_cursor
+
+ f_cursor => f
+ do while(associated(f_cursor))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor % array)
+ deallocate(f_cursor)
+
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field1d_integer!}}}
+
+ subroutine mpas_deallocate_field2d_integer(f)!{{{
+ type (field2dInteger), pointer :: f
+ type (field2dInteger), pointer :: f_cursor
+
+ f_cursor => f
+ do while(associated(f_cursor))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor % array)
+ deallocate(f_cursor)
+
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field2d_integer!}}}
+
+ subroutine mpas_deallocate_field3d_integer(f)!{{{
+ type (field3dInteger), pointer :: f
+ type (field3dInteger), pointer :: f_cursor
+
+ f_cursor => f
+ do while(associated(f_cursor))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor % array)
+ deallocate(f_cursor)
+
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field3d_integer!}}}
+
+ subroutine mpas_deallocate_field0d_real(f)!{{{
+ type (field0dReal), pointer :: f
+ type (field0dReal), pointer :: f_cursor
+
+ f_cursor => f
+
+ do while(associated(f))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor)
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field0d_real!}}}
+
+ subroutine mpas_deallocate_field1d_real(f)!{{{
+ type (field1dReal), pointer :: f
+ type (field1dReal), pointer :: f_cursor
+
+ f_cursor => f
+ do while(associated(f_cursor))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor % array)
+ deallocate(f_cursor)
+
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field1d_real!}}}
+
+ subroutine mpas_deallocate_field2d_real(f)!{{{
+ type (field2dReal), pointer :: f
+ type (field2dReal), pointer :: f_cursor
+
+ f_cursor => f
+ do while(associated(f_cursor))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor % array)
+ deallocate(f_cursor)
+
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field2d_real!}}}
+
+ subroutine mpas_deallocate_field3d_real(f)!{{{
+ type (field3dReal), pointer :: f
+ type (field3dReal), pointer :: f_cursor
+
+ f_cursor => f
+ do while(associated(f_cursor))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor % array)
+ deallocate(f_cursor)
+
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field3d_real!}}}
+
+ subroutine mpas_deallocate_field0d_char(f)!{{{
+ type (field0dChar), pointer :: f
+ type (field0dChar), pointer :: f_cursor
+
+ f_cursor => f
+
+ do while(associated(f))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor)
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field0d_char!}}}
+
+ subroutine mpas_deallocate_field1d_char(f)!{{{
+ type (field1dChar), pointer :: f
+ type (field1dChar), pointer :: f_cursor
+
+ f_cursor => f
+ do while(associated(f_cursor))
+ if(associated(f % next)) then
+ f => f % next
+ else
+ nullify(f)
+ end if
+
+ deallocate(f_cursor % array)
+ deallocate(f_cursor)
+
+ f_cursor => f
+ end do
+
+ end subroutine mpas_deallocate_field1d_char!}}}
+
subroutine mpas_deallocate_block(b)
implicit none
</font>
</pre>