Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Deallocate Brea...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 8202 of 8551
Post > Topic >>

Deallocate Breakpoint in Library Code

by Michael <mwpowellnm@[EMAIL PROTECTED] > May 1, 2008 at 02:57 PM

After having posted regarding access violation, then employing
gflags.exe to further pinpoint the location and nature of the issue, I
think we located where it is.

Here's the function in question. We're breaking on the last line in
the function, deallocate(). Anywhere else we deallocate, we also
return. I don't know why that should be an issue? Should we also
return?

We're using the Intel Fortran compiler for Microsoft Visual Studio
2005. Intel(R) Fortran Compiler Integration for Microsoft Visual
Studio 2005, 10.1.3885.2005, Copyright (C) 2002-2007 Intel
Cor****ation.

   integer function read_variables_projparams()

      implicit none

      character (len=len_attr_str),     allocatable, dimension(:) ::
names
      character (len=len_longattr_str), allocatable, dimension(:) ::
values

      integer :: np, error_code

      read_variables_projparams = 0

      if ( num_namevalues <= 0 ) return

      if ( not( has_a( p_currgrid, netcdf_projparam_names ) ) ) return

      if ( allocate_namevalues_ptr( p_projdesc_curr, num_namevalues ) /
= 0 ) then
         call variable_read_error( netcdf_zagl )
         read_variables_projparams = error_code
         return
      endif

      allocate( names(num_namevalues),  stat = error_code )
      allocate( values(num_namevalues), stat = error_code )

      error_code = read_var( netcdf_projparam_names, names )
      if ( error_code /= 0 ) then
         if ( vars(netcdf_zagl)%abort_if_missing ) then
            call variable_read_error( netcdf_projparam_names )
            read_variables_projparams = error_code
            deallocate( names, values )
            return
         endif
      endif

      error_code = read_var( netcdf_projparam_values, values )
      if ( error_code /= 0 ) then
         if ( vars(netcdf_zagl)%abort_if_missing ) then
            call variable_read_error( netcdf_projparam_values )
            read_variables_projparams = error_code
            deallocate( names, values )
            return
         endif
      endif

      do np = 1,num_namevalues

         error_code = set_name_value_ptr( np, p_projdesc_curr, &
                                          names(np), values(np) )

         if ( error_code /= 0 ) then
            call variable_read_error( netcdf_projparam_values )
            read_variables_projparams = error_code
            deallocate( names, values )
            return
         endif
      enddo

      deallocate( names, values )

   end function read_variables_projparams
 




 7 Posts in Topic:
Deallocate Breakpoint in Library Code
Michael <mwpowellnm@[E  2008-05-01 14:57:53 
Re: Deallocate Breakpoint in Library Code
nospam@[EMAIL PROTECTED]   2008-05-01 15:31:32 
Re: Deallocate Breakpoint in Library Code
Michael <mwpowellnm@[E  2008-05-01 15:34:47 
Re: Deallocate Breakpoint in Library Code
lindahl@[EMAIL PROTECTED]  2008-05-01 15:53:22 
Re: Deallocate Breakpoint in Library Code
glen herrmannsfeldt <g  2008-05-01 16:00:42 
Re: Deallocate Breakpoint in Library Code
lindahl@[EMAIL PROTECTED]  2008-05-01 15:50:57 
Re: Deallocate Breakpoint in Library Code
"Michael Metcalf&quo  2008-05-02 01:26:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 22:41:01 CDT 2008.