Dear Fortran experts,
I have the following question about the F 95 (F 2003)
standard: Is it standard conforming to apply the LEN
intrinsic function to a disassociated pointer to a
character array? A corresponding code fragment would be:
character(32), pointer :: car(:)=>null()
l=len(car) ! the simplest example
! or, more realistic:
car=alloc_ca(car)
Contains
Function alloc_ca(p)
character(*), pointer :: p(:)
character(len(p)),pointer :: alloc_ca(:) ! this is the statement
! ...in question
allocate(alloc_ca(4))
return
End Function alloc_ca
end
If this would not be allowed I don't know how to allocate
'car' by means of a function as in the above example, unless
one also transfers the character length via the argument list
of the function.
Many thanks in advance for any help,
Roland
+----------------------------------------------------------------------+
| Roland Schilling Home-Office: +49(89)32929-670 |
| Max-Planck-Institut für Gravitationsphysik |
| -- Albert-Einstein-Institut -- |
| D-85748 Garching E-mail: [log in to unmask] |
| Germany http://www.geo600.uni-hannover.de |
+----------------------------------------------------------------------+
|