forked from bright1998/TCUP_GPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert.f
79 lines (64 loc) · 2.15 KB
/
convert.f
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
c -----------------------------------------
subroutine convertx(da,dam,is,ie,js,je)
c -----------------------------------------
use common
implicit double precision(a-h,o-z)
double precision,dimension(:,:),intent(in) :: da
double precision,dimension(:,:),intent(inout) :: dam
integer :: is,ie,js,je
do j=js,je
do i=is,ie
tx = (xm(i) - x(i))/(x(i+1) - x(i))
dam(i,j) = (1.d0 - tx)*da(i,j) + tx*da(i+1,j)
enddo
enddo
return
end subroutine convertx
c ------------------------------------------
subroutine convertxm(dam,da,is,ie,js,je)
c ------------------------------------------
use common
implicit double precision(a-h,o-z)
double precision,dimension(:,:),intent(in) :: dam
double precision,dimension(:,:),intent(inout) :: da
integer :: is,ie,js,je
do j=js,je
do i=is,ie
tx = (xm(i) - x(i))/(-xm(i-1) + xm(i))
da(i,j) = tx*dam(i-1,j) + (1.d0 - tx)*dam(i,j)
enddo
enddo
return
end subroutine convertxm
c -----------------------------------------
subroutine converty(da,dam,is,ie,js,je)
c -----------------------------------------
use common
implicit double precision(a-h,o-z)
double precision,dimension(:,:),intent(in) :: da
double precision,dimension(:,:),intent(inout) :: dam
integer :: is,ie,js,je
do j=js,je
do i=is,ie
ty = (ym(j) - y(j))/(y(j+1) - y(j))
dam(i,j) = (1.d0 - ty)*da(i,j) + ty*da(i,j+1)
enddo
enddo
return
end subroutine converty
c ------------------------------------------
subroutine convertym(dam,da,is,ie,js,je)
c ------------------------------------------
use common
implicit double precision(a-h,o-z)
double precision,dimension(:,:),intent(in) :: dam
double precision,dimension(:,:),intent(inout) :: da
integer :: is,ie,js,je
do j=js,je
do i=is,ie
ty = (ym(j) - y(j))/(-ym(j-1) + ym(j))
da(i,j) = ty*dam(i,j-1) + (1.d0 - ty)*dam(i,j)
enddo
enddo
return
end subroutine convertym