I am trying to upgrade old code to F95 standards. I don't understand how the character string afpn
is being assigned a value using the write statement in the below function. I've encountered this in several places. How does this work?
CHARACTER(LEN=15) FUNCTION XFPN2AL( FPN )
IMPLICIT NONE
! external variables
REAL(KIND=4)INTENT(IN):: FPN
! internal variables
CHARACTER(LEN=15):: AFPN
! initialize variables
AFPN = ' '
XFPN2AL = ' '
WRITE(AFPN,'(G15.7)') FPN
XFPN2AL = ADJUSTL(AFPN)
END FUNCTION XFPN2AL