TRIMLEN()

Fortran version:

    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.

NO C version:

Summary:

Returns the effective length of the Fortran character string argument ASTRING, after trailing blanks have been trimmed.

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.

Preconditions:

none

Fortran Usage:

(See sample programs LATLON, PRESZ, or SFCMET for additional usage examples.)
    ...
    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), '"'

C Usage:

don't


Previous: SYSTEMF

Next: UNGRIDB

Up: Utility Routines

To: Models-3/EDSS I/O API: The Help Pages