INTEGER FUNCTION TRIMLEN( ASTRING )
CHARACTER*(*), INTENT(IN ) :: ASTRING ! string to find effective length for
Note that this is equivalent to Fortran-90 intrinsic
LEN_TRIM(); furthermore note that Fortran-90 added new
intrinsics TRIM(), ADJUSTL(), and
ADJUSTR() that frequently help in directly doing the tasks
the programmer is really attempting.
Deprecated as Fortran-77-only, since the new
Fortran-90 intrinsic LEN_TRIM() has exactly the same
meaning, and the additional new Fortran-90 intrinsic character
string function TRIM() that trims trailing blanks
can be used to replace expressions like
ASTRING( 1:LEN_TRIM( ASTRING ) )
with the much simpler TRIM( ASTRING ).
See also LBLANK() for trimming leading blanks.
...
CHARACTER*256 ASTRING
INTEGER L
INTEGER TRIMLEN
...
L = TRIMLEN( ASTRING )
WRITE (*,*)
& 'ASTRING-squared is "', ASTRING( 1:L ) , ASTRING( 1:L ), '"'
...
C Better: WRITE (*,*)
C & 'ASTRING-squared is "', TRIM(ASTRING) , TRIM(ASTRING), '"'
To: Models-3/EDSS I/O API: The Help Pages