Skip to content

Instantly share code, notes, and snippets.

@foxtran
Last active September 2, 2022 17:34
Show Gist options
  • Save foxtran/6984e5e3bf30433dddc4b2ac6def8f79 to your computer and use it in GitHub Desktop.
Save foxtran/6984e5e3bf30433dddc4b2ac6def8f79 to your computer and use it in GitHub Desktop.
PROGRAM test_div
IMPLICIT NONE
INTEGER :: count1, count_rate1, count_max1
INTEGER :: count2, count_rate2, count_max2
INTEGER :: N
REAL(8), allocatable :: a(:), b(:), c(:)
read(*,*) N
allocate(a(N), b(N), c(N))
CALL RANDOM_NUMBER(a)
CALL RANDOM_NUMBER(b)
CALL SYSTEM_CLOCK(count1, count_rate1, count_max1)
WRITE(*,*) count1, count_rate1, count_max1
CALL div(a, b, c)
CALL SYSTEM_CLOCK(count2, count_rate2, count_max2)
WRITE(*,*) count2, count_rate2, count_max2
WRITE(*,*) count2-count1
WRITE(7,*) c(1:3)
CONTAINS
SUBROUTINE div(a, b, c)
REAL(8), INTENT(IN) :: a(:), b(:)
REAL(8), INTENT(OUT) :: c(:)
c = a / b
END SUBROUTINE div
END PROGRAM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment