/[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.1 - (show annotations) (download)
Thu Sep 13 17:43:55 2001 UTC (22 years, 7 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint51k_post, checkpoint47e_post, ecco_c44_e19, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, release1_p13_pre, checkpoint50c_post, checkpoint46f_post, checkpoint48e_post, checkpoint50g_post, checkpoint46b_post, checkpoint43a-release1mods, checkpoint51o_pre, checkpoint44g_post, checkpoint48c_post, ecco_c50_e32, ecco_c50_e33, ecco_c50_e30, ecco_c50_e31, release1_p13, checkpoint51l_post, checkpoint48i_post, checkpoint46l_pre, checkpoint50d_pre, chkpt44d_post, checkpoint51, release1_p8, release1_p9, checkpoint50d_post, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint50b_pre, checkpoint44e_pre, checkpoint51f_post, release1_b1, checkpoint48b_post, ecco_c51_e34d, ecco_c51_e34e, ecco_c51_e34f, ecco_c51_e34g, ecco_c51_e34a, ecco_c51_e34b, ecco_c51_e34c, checkpoint43, checkpoint51d_post, checkpoint48c_pre, checkpoint51n_post, release1_chkpt44d_post, chkpt44c_pre, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint51n_pre, checkpoint47d_post, icebear5, icebear4, icebear3, icebear2, checkpoint46d_pre, checkpoint48d_post, release1-branch_tutorials, checkpoint48f_post, checkpoint45d_post, checkpoint46j_pre, ecco_c50_e28, checkpoint51l_pre, checkpoint47d_pre, checkpoint44h_pre, checkpoint48h_post, ecco_c50_e29, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, chkpt44c_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint46b_pre, checkpoint45a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint51m_post, checkpoint44e_post, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint47a_post, ecco_c50_e33a, branchpoint-genmake2, checkpoint46e_pre, checkpoint45b_post, checkpoint51i_post, release1-branch-end, release1_final_v1, checkpoint51b_post, release1_p12_pre, checkpoint46c_pre, checkpoint44f_post, checkpoint47b_post, checkpoint44b_post, ecco_c51_e34, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint50c_pre, checkpoint45c_post, ecco_ice2, ecco_ice1, checkpoint44h_post, checkpoint46g_post, checkpoint51c_post, checkpoint46i_post, checkpoint50h_post, checkpoint50e_pre, checkpoint50i_post, ecco_c44_e25, checkpoint51i_pre, checkpoint48a_post, checkpoint47j_post, branch-exfmods-tag, checkpoint47f_post, checkpoint50e_post, chkpt44a_pre, ecco_c44_e22, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, checkpoint46c_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, checkpoint46e_post, release1_beta1, checkpoint51e_post, checkpoint44b_pre, checkpoint42, checkpoint40, checkpoint41, checkpoint46, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51o_post, checkpoint50, checkpoint51f_pre, chkpt44a_post, checkpoint47h_post, checkpoint44f_pre, checkpoint51g_post, checkpoint46d_post, checkpoint50b_post, release1-branch_branchpoint, checkpoint51a_post, checkpoint48g_post
Branch point for: c24_e25_ice, branch-exfmods-curt, release1_coupled, release1_final, release1-branch, branch-genmake2, release1, tg2-branch, ecco-branch, release1_50yr, icebear, checkpoint51n_branch
Added package "flt".
 o pkg/flt
 o verification/flt_example
 o visualization of trajectories supplied
 o works but output not available to testscript

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

  ViewVC Help
Powered by ViewVC 1.1.22