1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "FLT_CPPOPTIONS.h" |
5 |
|
6 |
_RL function global2local_i( |
7 |
I rG, |
8 |
I bi, |
9 |
I bj, |
10 |
I mythid |
11 |
& ) |
12 |
|
13 |
c ================================================================== |
14 |
c FUNCTION global2local_i |
15 |
c ================================================================== |
16 |
c |
17 |
c o Converts global x-coordinates (grid) to local index for specific |
18 |
c tile |
19 |
c |
20 |
c ================================================================== |
21 |
c FUNCTION global2local_i |
22 |
c ================================================================== |
23 |
|
24 |
c == global variables == |
25 |
|
26 |
#include "EEPARAMS.h" |
27 |
#include "SIZE.h" |
28 |
#include "GRID.h" |
29 |
#include "PARAMS.h" |
30 |
|
31 |
c == routine arguments == |
32 |
|
33 |
integer mythid, bi, bj |
34 |
_RL rG, fp, fm, dist, xlo, xhi |
35 |
INTEGER i, iG |
36 |
|
37 |
c == local variables == |
38 |
|
39 |
|
40 |
c == end of interface == |
41 |
do i=0,sNx |
42 |
|
43 |
iG = myXGlobalLo + (bi-1)*sNx |
44 |
xlo = xc(i, 1,bi,bj) |
45 |
if (i.eq.0) xlo = xc(i,1,bi,bj)-delX(iG) |
46 |
xhi = xc(i+1,1,bi,bj) |
47 |
if (i.eq.sNx) xhi = xc(i,1,bi,bj)+delX(iG+i-1) |
48 |
|
49 |
if (xlo .le. rG .and. xhi .gt. rG) then |
50 |
dist = xhi - xlo |
51 |
fp = (xhi - rG) / dist |
52 |
fm = (rG - xlo) / dist |
53 |
global2local_i = fp*i + fm*(i+1) |
54 |
goto 100 |
55 |
endif |
56 |
enddo |
57 |
|
58 |
100 continue |
59 |
|
60 |
return |
61 |
end |
62 |
|
63 |
|
64 |
_RL function global2local_j( |
65 |
I rG, |
66 |
I bi, |
67 |
I bj, |
68 |
I mythid |
69 |
& ) |
70 |
|
71 |
c ================================================================== |
72 |
c FUNCTION global2local_j |
73 |
c ================================================================== |
74 |
c |
75 |
c o Converts global y-coordinates (grid) to local index for specific |
76 |
c tile |
77 |
c |
78 |
c |
79 |
c started: Arne Biastoch abiastoch@ucsd.edu 07-AUG-2000 |
80 |
c |
81 |
c |
82 |
c ================================================================== |
83 |
c FUNCTION global2local_j |
84 |
c ================================================================== |
85 |
|
86 |
c == global variables == |
87 |
|
88 |
#include "EEPARAMS.h" |
89 |
#include "SIZE.h" |
90 |
#include "GRID.h" |
91 |
#include "PARAMS.h" |
92 |
|
93 |
c == routine arguments == |
94 |
|
95 |
integer mythid, bi, bj |
96 |
_RL rG, fp, fm, dist, ylo, yhi |
97 |
INTEGER j, jG |
98 |
|
99 |
c == local variables == |
100 |
|
101 |
|
102 |
c == end of interface == |
103 |
|
104 |
do j=0,sNy |
105 |
|
106 |
jG = myYGlobalLo + (bj-1)*sNy |
107 |
ylo = yc(1,j, bi,bj) |
108 |
if (j.eq.0) ylo = yc(1,j,bi,bj)-delY(jG) |
109 |
yhi = yc(1,j+1,bi,bj) |
110 |
if (j.eq.sNy) yhi = yc(1,j,bi,bj)+delY(jG+j-1) |
111 |
|
112 |
if (ylo .le. rG .and. yhi .gt. rG) then |
113 |
dist = yhi - ylo |
114 |
fp = (yhi - rG) / dist |
115 |
fm = (rG - ylo) / dist |
116 |
global2local_j = fp*j + fm*(j+1) |
117 |
goto 100 |
118 |
endif |
119 |
enddo |
120 |
|
121 |
100 continue |
122 |
|
123 |
return |
124 |
end |
125 |
|
126 |
_RL function global2local_k( |
127 |
I rG, |
128 |
I bi, |
129 |
I bj, |
130 |
I mythid |
131 |
& ) |
132 |
|
133 |
c ================================================================== |
134 |
c FUNCTION global2local_k |
135 |
c ================================================================== |
136 |
c |
137 |
c o Converts global z-coordinates (grid) to local index for specific |
138 |
c tile |
139 |
c |
140 |
c |
141 |
c started: Arne Biastoch abiastoch@ucsd.edu 07-AUG-2000 |
142 |
c |
143 |
c |
144 |
c ================================================================== |
145 |
c FUNCTION global2local_k |
146 |
c ================================================================== |
147 |
|
148 |
c == global variables == |
149 |
|
150 |
#include "EEPARAMS.h" |
151 |
#include "SIZE.h" |
152 |
#include "GRID.h" |
153 |
#include "PARAMS.h" |
154 |
|
155 |
c == routine arguments == |
156 |
|
157 |
integer mythid, bi, bj |
158 |
_RL rG, fp, fm, dist, zlo, zhi |
159 |
INTEGER k |
160 |
|
161 |
c == local variables == |
162 |
|
163 |
|
164 |
c == end of interface == |
165 |
do k=0,Nr |
166 |
|
167 |
zlo = rC(k) |
168 |
if (k.eq.0) zlo = rC(k)-delZ(1)*0.5 |
169 |
zhi = rC(k+1) |
170 |
if (k.eq.Nr) zhi = rC(k)+delZ(Nr)*0.5 |
171 |
|
172 |
if (zlo .le. rG .and. zhi .gt. rG) then |
173 |
dist = zhi - zlo |
174 |
fp = (zhi - rG) / dist |
175 |
fm = (rG - zlo) / dist |
176 |
global2local_k = fp*k + fm*(k+1) |
177 |
goto 100 |
178 |
endif |
179 |
enddo |
180 |
|
181 |
100 continue |
182 |
|
183 |
return |
184 |
end |
185 |
|