Crash if trying to write a parameter or a constant in a Fortran application

Philippe Wautelet Philippe.Wautelet at idris.fr
Thu Jul 11 03:25:42 CDT 2013


Hello,

It is OK for me to declare the variable intent(inout). It will detect the 
problem at compilation. That's better than to look for the origin of a crash!

Regards,

Philippe


Le mardi 9 juillet 2013 23:54:02, Rob Latham a écrit :
> On Tue, Jul 09, 2013 at 04:23:37PM -0500, Wei-keng Liao wrote:
> > One problem is Fortran allows ones to define a parameter array.
> > Such as
> > 
> >       integer, dimension(8192), parameter :: varp=0
> > 
> > I am not aware of a way to tell a subroutine argument is
> > parameter or not in Fortran or C. In the above case, segmentation
> > fault will still occur if writing the entire 8192 elements, though
> > I wonder if it is rare to see one using large parameter variables
> > in Fortran.
> > 
> > If we want to document this, we might want to generate an error
> > code corresponding to it.
> > 
> > One possible solution to forbidding parameter buffers is to declare
> > the intent of I/O buffer as inout
> > 
> >           <type>, intent(inout) :: buf
> > 
> > but it works only for F90.
> 
> I think that's a great solution.  I hope Philippe Wautelet can let us
> know if that is OK for him.
> 
> ==rob

--------------------------------------------------------------------
Philippe Wautelet (Research Engineer)   wautelet at idris.fr
Tel. : 01 69 35 85 76                   Fax : 01 69 85 37 75
IDRIS, Batiment 506, BP 167, 91403 ORSAY Cedex, France
Prof. website   : http://www.idris.fr
--------------------------------------------------------------------


More information about the parallel-netcdf mailing list