You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
757 B
Fortran

MODULE SWAPMOD
INTERFACE SWAP
MODULE PROCEDURE SWAP_R, SWAP_I, SWAP_C
END INTERFACE
CONTAINS
SUBROUTINE SWAP_R(A,B)
IMPLICIT NONE
DOUBLE PRECISION, INTENT (INOUT) :: A, B
DOUBLE PRECISION :: TEMP
TEMP = A; A = B; B = TEMP
END SUBROUTINE SWAP_R
SUBROUTINE SWAP_I(A,B)
IMPLICIT NONE
INTEGER, INTENT (INOUT) :: A, B
INTEGER :: TEMP
TEMP = A ; A = B ; B = TEMP
END SUBROUTINE SWAP_I
SUBROUTINE SWAP_C(A,B)
IMPLICIT NONE
CHARACTER, INTENT (INOUT) :: A, B
CHARACTER :: TEMP
TEMP = A ; A = B ; B = TEMP
END SUBROUTINE SWAP_C
END MODULE SWAPMOD