WRITECHARS Subroutine

public subroutine WRITECHARS(IUNIT, CHARS, NROT, STR)

Arguments

Type IntentOptional Attributes Name
integer :: IUNIT
complex(kind=dp) :: CHARS(NROT)
integer :: NROT
character(len=6) :: STR

Contents

Source Code


Source Code

    SUBROUTINE WRITECHARS(IUNIT, CHARS, NROT, STR)
        IMPLICIT NONE
        INTEGER IUNIT, NROT
        complex(dp) CHARS(NROT)
        INTEGER J
        CHARACTER(6) STR
        LOGICAL LCOMP, LREAL
!   First do a check for the format
        LCOMP = .FALSE.
        LREAL = .FALSE.
        DO J = 1, NROT
            IF (ABS(REAL(CHARS(J))) > 1.0e-2_dp .AND. ABS(AIMAG(CHARS(J))) > 1.0e-2_dp) LCOMP = .TRUE.
            IF (ABS(REAL(CHARS(J)) - NINT(REAL(CHARS(J)))) > 1.0e-2_dp) LREAL = .TRUE.
            IF (ABS(AIMAG(CHARS(J)) - NINT(AIMAG(CHARS(J)))) > 1.0e-2_dp) LREAL = .TRUE.
        end do
        CALL WRITECHARSF(IUNIT, CHARS, NROT, STR, LCOMP, LREAL)
    END SUBROUTINE WRITECHARS