/[MITgcm]/MITgcm/pkg/flt/flt_functions.F
ViewVC logotype

Contents of /MITgcm/pkg/flt/flt_functions.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Tue Oct 28 22:21:27 2003 UTC (20 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint57g_pre, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint52d_pre, checkpoint57g_post, checkpoint56b_post, checkpoint57y_post, checkpoint52j_pre, checkpoint54d_post, checkpoint54e_post, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint52k_post, checkpoint59, checkpoint58, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint53, checkpoint52, checkpoint58f_post, checkpoint52f_post, checkpoint57n_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint54f_post, checkpoint58y_post, checkpoint55a_post, checkpoint51t_post, checkpoint58t_post, checkpoint55i_post, checkpoint52i_pre, checkpoint57h_post, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint57t_post, checkpoint55c_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57f_post, checkpoint52e_post, checkpoint53d_post, checkpoint60, checkpoint61, checkpoint57a_post, checkpoint57h_pre, checkpoint57x_post, checkpoint52b_pre, checkpoint54b_post, checkpoint58w_post, checkpoint52m_post, checkpoint57y_pre, checkpoint53b_post, checkpoint55g_post, checkpoint51q_post, checkpoint52b_post, checkpoint57l_post, checkpoint58o_post, checkpoint52h_pre, checkpoint57c_post, hrcube_1, checkpoint58p_post, checkpoint58q_post, checkpoint52c_post, checkpoint58e_post, checkpoint58m_post, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint58n_post, checkpoint51r_post, checkpoint57e_post, checkpoint55b_post, checkpoint53a_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint52d_post, checkpoint53g_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, eckpoint57e_pre, checkpoint58k_post, checkpoint52a_pre, checkpoint58v_post, checkpoint52i_post, checkpoint54c_post, checkpoint56a_post, checkpoint58l_post, checkpoint53f_post, checkpoint54a_pre, checkpoint53b_pre, checkpoint57h_done, checkpoint52j_post, checkpoint57j_post, checkpoint57f_pre, checkpoint61f, checkpoint58g_post, branch-netcdf, checkpoint52l_post, checkpoint58x_post, checkpoint52n_post, checkpoint59j, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint57a_pre, checkpoint57o_post, checkpoint57k_post, checkpoint52a_post, checkpoint57w_post, checkpoint58i_post, ecco_c52_e35, checkpoint58c_post, checkpoint58u_post, checkpoint52f_pre, checkpoint53d_pre, checkpoint58s_post, checkpoint55e_post, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint51p_post, checkpoint51u_post, checkpoint55d_post
Branch point for: branch-nonh, netcdf-sm0
Changes since 1.1: +4 -4 lines
use drF instead of delZ

1 C $Header: /u/gcmpack/MITgcm/pkg/flt/flt_functions.F,v 1.1 2001/09/13 17:43:55 adcroft Exp $
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)-drF(1)*0.5
169 zhi = rC(k+1)
170 if (k.eq.Nr) zhi = rC(k)+drF(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

  ViewVC Help
Powered by ViewVC 1.1.22