-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdistance.f90
More file actions
38 lines (30 loc) · 824 Bytes
/
distance.f90
File metadata and controls
38 lines (30 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
!
! File: distance.f90
! Author: peter
!
! Created on May 6, 2020, 12:49 PM
!
module distance
implicit none
private
public::error
interface error
procedure error
end interface error
contains
function error(array, array2) result(diff)
real, Dimension(:,:), intent(in)::array, array2
real:: diff
integer:: n,m
diff =0
if(size(array,1)/=size(array2,1) .or. size(array,2)/=size(array2,2) )then
print *,"Incompatable shapes for error calculation"
else
do n = 1, size(array,1)
do m = 1, size(array,2)
diff= diff+ array(n,m)-array2(n,m)
end do
end do
end if
end function error
end module distance