[petsc-dev] Fortran strings

Barry Smith bsmith at mcs.anl.gov
Tue May 31 23:30:45 CDT 2016


  My guess is that the explicit listing of 250 here (how could you possibly know it is a string of len 250 being passed in?) causes the Fortran compiler to drop the length information from the stack. Does the syntax 

> character(*), intent(in) :: value

work and does that make a difference?

  Barry

> On May 31, 2016, at 7:37 AM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> On Tue, May 31, 2016 at 7:34 AM, Mark Adams <mfadams at lbl.gov> wrote:
> Wrapper code like this does is not working for Robert:
> 
> The easiest thing to do is just look at it in the debugger.
> 
>   Matt
>  
> subroutine my_PetscOptionsClearValue(value,ierr)
>   use petscsys
>   implicit none
>   character(len=250), intent(in) :: value
>   PetscErrorCode, intent(inout) :: ierr
> 
> #if PETSC_VERSION_LT(3,7,0)
>   call PetscOptionsClearValue(value,ierr)
> #else
>   call PetscOptionsClearValue(PETSC_NULL_OBJECT,value,ierr)
> #endif
> 
> Direct calls to PetscOptionsClearValue work, but calling through his wrapper does not seem to do anything. Is Fortran doing something funny with strings here?
> 
> Mark
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener




More information about the petsc-dev mailing list