source: CPL/oasis3-mct/branches/OASIS3-MCT_2.0_branch/doc/anaisga.tex @ 4775

Last change on this file since 4775 was 4775, checked in by aclsce, 4 years ago
  • Imported oasis3-mct from Cerfacs svn server (not suppotred anymore).

The version has been extracted from https://oasis3mct.cerfacs.fr/svn/branches/OASIS3-MCT_2.0_branch/oasis3-mct@1818

  • Property svn:executable set to *
File size: 29.9 KB
Line 
1 \magnification =\magstep1
2\count0=77
3%definitions
4
5%end of definitions
6
7
8\centerline{ Olivier Thual, March 15$^{\rm th}$ 1992}
9\centerline{ Revised version  June 30$^{\rm th}$ 1992}
10 \bigskip
11
12\centerline{\bf SIMPLE OCEAN-ATMOSPHERE INTERPOLATION.} 
13\centerline{\bf PART A: THE METHOD}
14
15\bigskip
16 epi920629-naiva-ot6.tex
17A simple and naive method to interpolate fields between an atmospheric
18and an oceanic grid is presented. This crude method is coded into a set of
19FORTRAN programs, in the expectation  of a more elaborated method which
20takes into account the particular physic of the ocean-atmosphere coupling.
21
22
23
24\beginsection 1. INTRODUCTION
25
26The coupling of an atmosphere General Circulation Model (GCM) and an
27oceanic GCM involves both a temporal coupling,  which  deals  with
28the synchronization and the communication between  the two codes at
29suitable time steps, and a spatial coupling which  deals with the
30interpolations of suitable fields from one GCM grid to another, namely the
31fluxes from the atmospheric to the ocean grid, and the sea surface
32temperature (SST) in the reverse direction. 
33
34
35
36These two aspects of the coupling are presently attacked in parallel in the
37CERFACS Climate Modelling \& Global Change team.  They have started
38with a gathering of all the state of art informations that we have been
39able to record in the Climatic community and that have been summarized
40in [1]. Today, progress has been made  in the two directions.
41
42 In [2], a method based on the communication and synchronization of  UNIX
43processes is developed for the GCMs temporal coupling task. The skeleton
44of a universal ``coupler'' has been written in FORTRAN.
45This software
46controls all  the exchanges between an oceanic and an atmospheric codes.
47Its present conception allows a simple
48implementation in an already written and tested GCM, with   minimum
49coding changes in it.
50
51
52
53This coupler skeleton includes a black box which will  perform the spatial
54interpolations between the atmospheric and  oceanic grids. Different
55interpolation schemes can be plugged in this black box, which further
56increases the universality of the coupler.  The fundamental basis for the
57design of an advanced interpolation scheme is presented in [3]. In this
58scheme a particular focus is made on the ``local conservation'' of the
59fluxes when the interpolation from the atmospheric to the oceanic grid is
60performed. It is thought ([3]) than the non-conservation of the fluxes
61might be one of the causes of  the drift problem encountered when two  GCMs,
62individually well tuned, are coupled together.
63
64
65
66In the expectation of the achievement and coding of this advanced
67interpolation scheme, it has appeared necessary to plug into the coupler
68spatial interpolation black box a simple and quickly written package of
69FORTRAN subroutines  in order to start real size tests of the coupler with
70 GCMs.  The purpose of this letter is to expose the
71``naive'' and crude interpolation method that we have chosen in this spirit.
72It is based on the informations that we have collected in our inquiry on the
73state of the art spread among the climatic community (see [4]) and
74summarized in [1].
75
76A basic introduction to the interpolation of data grid points is presented
77in Section 1, and the specific problem of the grid-to-grid interpolation is
78discussed in Section 2. These two sections are finalized by the description
79of the ``naive interpolation method'' that will be plugged into the coupler
80black box. This method have been coded in FORTRAN and is now under a
81testing stage.  The results of the tests will be exposed in Part B of this
82letter. In Section 3, some steps towards the design of a less naive
83grid-to-grid interpolation method are indicated, and could be easily
84implemented in the ``naive method'' FORTRAN software, if they are
85retained as pertinent developments worth the effort.
86
87
88A lot of materials exposed here, at a pedagogical and
89simple level, are presented in a more complete and detailled manner in [3].
90This is the case, for instance, for  the gaussian basis and overlapping of
91Sections 2 and 3, and of the Lagrangian formalism. For furthers details, and
92in particular numerical tests of various interpolation methods in the 1D
93case, the reader is referred to [3].
94
95
96
97
98 
99
100\beginsection  2.  BASIC FACTS ABOUT INTERPOLATION
101
102Interpolation is a problem that often occurs in physics, and we all have
103had some experience in it, in a way or another.  Due to the numerous
104approachs that can be found in the literature, I  have chosen to build a
105pedagogical presentation from scratch, restricted to the materials
106necessary to expose the ``naive method''  that I have coded.  Simple
107notations for the indexing of masked grids are given, in order to be used
108in  this presentation. The family  of the linear  interpolations associated to a
109grid is presented in a formalism focusing  their  functions basis set.
110Several illustrative examples are presented, ending with exposition of the
111``$L$-neighbor naive method''.
112
113
114
115\beginsection 2.1 Grids and masks
116
117Let $r_{lm}= (x _{lm}, y _{lm})$, $ \; l=1,N_1$, $ \; m=1,N_2$ the
118coordinates of a rectangular 2D grid.  In order to define the sea and the
119land, let $M _{lm}$ a $N_1 \times N_2$ matrix called ``mask'' such that,
120for instance,  $M _{lm}=1$ means that  $r_{lm}$ is a ``sea'' grid and  $M
121_{lm}=0$ means that  $r_{lm}$ is a ``land'' grid. In all the present
122discussion, we will only consider the sea points of the grid and discard the
123land points.  If  $N$ is the number of sea grid points  we will denote them
124by $r_i=(x_i, y_i),\; i=1,N$ and no mask  needs to  be mentioned anymore in
125the presentation  of the sea grid. The notion of mask is still useful
126however in the numerical implementation of  algorithms dealing  with
127thoses grids. Another advantage  is the convenient generalization of the
128notations to 1D or 3D grids.
129
130
131
132
133
134\beginsection 2.2 The linear interpolation family of a grid
135
136The most common meaning of the word interpolation when dealing with a
137grid $(r_i),\;  i=1,N$ with a real  value $(a_i),\; i=1,N$
138 at each point is the
139determination of a function $f(r)$ on the whole space (1D, 2D or 3D
140depending on the case), which allows to extrapolate the values $a_i$'s in
141any point $r$ located on or outside the grid. 
142Note that an interpolation does not necessarily requires $f(r_i)=a_i$.
143
144
145
146 Any  linear interpolation method can be expressed as
147$$
148f(r)= \sum_{i=1}^{N} a_i \varphi_i(r)
149\eqno(2.1)
150$$
151where the $ \varphi_i(r)$'s are  functions localized around $r_i$ such that,
152for all $r$:
153$$
154 \sum_{i=1}^{N}\varphi_i(r) dr = 1
155\eqno(2.2)
156$$
157for all $i$.
158Let us call call these functions ``the basis'' of the interpolation.
159 
160
161
162For a given grid, the family of all the possible interpolations of the form
163(2.1) is as big as all the possible  choices of the basis functions.
164The choice of a particular interpolation depends on physical
165considerations, which  depend on  the use that one intends to make
166of the function $f(r)$.
167
168
169
170\medskip
171
172Let us  assume that the
173 general shape of the $ \varphi_i(r)$'s is more or less the same on all
174the grid. This is the case,  for instance, when
175 a given  $ \varphi_i(r)$ ``covers''
176 roughly the same number of
177neighbors for most of the points of the grid.
178It  is then  possible to define the ``overlap order'' of an interpolation
179by looking at
180how much  the support of the $ \varphi_i(r)$'s overlap, taking into account
181how fast   the absolute  value of $ \varphi_i(r)$.
182
183 There is no need here to
184give a more precise definition that this intuitive concept of ``overlap
185order''.
186
187\vfill\eject
188
189
190\beginsection 2.3  The ``closest neighbor'' interpolation
191
192Given a distance in the space where stands the grid, for instance
193 on  a plane or on a
194sphere),  the ``closest neighbor'' interpolation is such that
195 $f(r)=a_{i(r)}$, where
196  $a_{i(r)}$  is the  value data at the closest neighbor
197 $r_{i(r)}$, i.e. the grid point which minimizes the
198distances $(|r-r_i|), \; i=1,N$
199
200
201
202This  interpolation can be expressed under the form (2.1) with
203$\varphi_i(r)$ being 1 on the open domain $S_i$ of all the points
204$r$ which admit $r_i$ as their closest neighbor and  $|S_i|$  its area.  It
205is  1/2 on the boundary  of this domain for the  points at equal distance
206from 2 grid points,
2071/4 at the ``corners'' at equal distance of 4 grid points, and so on.
208  It is zero outside of the domain $S_i$.
209
210
211
212The overlap order of this interpolation is zero, because the support domains
213$S_i$ of the basis functions do not intersect.  The function $f(r)$  of this
214interpolation is discontinuous.
215
216\vfill\eject
217
218\beginsection 2.4 Familiar Interpolations
219
220The linear interpolation is simple to understand on a 1D grid. Given $N$
221values  $(a_i) i=1,N$ at the  real  points $(x_i),\; i=1,N$ the linear
222interpolation reads:
223$$
224f(x)=(a_{i+1}-a_i) { x-x_i \over x_{i+1} - x_i }  + a_i
225\qquad \hbox{if} \quad x\in [x_i, x_{i+1}] \;,
226\eqno(2.3)
227$$
228i.e.  a piece linear function such that $f(x_i)=a_i$ for all points.
229
230
231
232Simple algebraic manipulations show that  this interpolation  can be put
233under the form (2.1) with
234$$
235\varphi_i(x)=\left\{\matrix{
236{x-x_{i-1}\over  x_{i}-x_{i-1} }
237\qquad \hbox{if} \quad x\in [x_{i-1}, x_{i}]  \cr
238{x-x_{i+1}\over  x_{i}-x_{i+1} }
239\qquad \hbox{if} \quad x\in [x_{i}, x_{i+1}]  \cr
2400
241\qquad \hbox{elsewhere}}  \right.
242\eqno(2.4)
243$$
244This function is equal to one at $x_i$, zero at the point $x_{i-1}$ and
245$x_{i+1}$ and outside $ [x_{i-1}, x_{i+1}]$, and is piecewise linear on two
246intervals.
247 
248
249
250
251\bigskip
252
253The linear interpolation on a 2D grid $r_{lm}=(x_{lm},y_{lm})$ can also be
254put under the form
255$$
256f(r)= \sum_{l,m} a_{lm} \varphi_{lm}(r)
257\eqno(2.5)\;,
258$$
259with $\varphi_{lm}(r)$ equal to one at $r_{lm}$, zero at  the four points
260$r_{l-1,m-1}$$r_{l+1,m-1}$$r_{l+1,m+1}$$r_{l-1,m+1}$ and outside
261the  polygon that they form, and piecewise linear on four triangles that
262they make with $r_{lm}$.
263
264
265
266\bigskip
267
268It can be said that the overlap order of the linear interpolation is one,
269as two basis functions can overlap on one grid mesh.  It is intuitive to say
270that the higher the overlap, the smoother the interpolation. 
271I will not try  to consider  here interpolations like quadratic interpolations
272or splines, which certainly enter into the form (2.1).
273
274 
275
276\beginsection 2.5 ``Unique weight function'' interpolation
277
278Instead I will study a very natural interpolation base on the choice  of a
279``weight function''  $\phi(u)$, which can be, as an example, a gaussian:
280$$
281\phi(u)= e^{-{u^2 \over 2\sigma^2}} \;.
282\eqno(2.6)
283$$
284The normalization constant in front of the  exponential can be anything as
285will be seen below. 
286
287
288
289With the choice of a ``weight function''  one  can define the  interpolation
290$$
291f(r)= {1\over Z(r)} \sum_{i=1}^{N} a_i\;  \phi(r-r_i)\;,
292\eqno(2.7)
293$$
294where
295$$
296Z (r)=  \sum_{i=1}^{N}  \phi(r-r_i)\;,
297\eqno(2.8)
298$$
299to ensure (2.2).
300This function $Z(r)$ depends on the geometry of the grid and on the weight
301function $\phi$, and its graphic visualization might give some valuable
302information about the  chosen method.  The same remark holds for the
303individual $ \varphi_i(r) =  \phi(r-r_i) /Z(r)$.
304
305
306\vfill\eject
307
308
309\beginsection 2.6 The ``$L$ neighbors naive interpolation''
310
311The numerical  implementation of the above ``unique weight''  interpolation
312is simple to code, but it costs of order $N$ operation for each   point $r$
313where the value of $f(r)$ is  calculated.  In order to save computing time
314this interpolation can be approximated  or mimiced by what I call the
315``naive method of order $L$'':
316$$
317f(r)={1\over Z(r)}   \sum_{m\in I(r)}  a_i \; \phi(r-r_m)
318\eqno(2.9)
319$$
320where $I(r)=\{ i_1(r), i_2(r), ..., i_L(r) \}  $ is the set containing the
321indices of the  $L$ closest neighbors of $r$. The function $Z(r)$ ensures,
322as usual, that the sum of the weights is one, and is here:
323 $$
324Z(r)=  \sum_{m\in I(r)}   \phi(r-r_m)
325\eqno(2.10)
326$$
327This function should also be worth graphic plots for various choices of the 
328integer $L$ and the  variance of $\phi$ ($\sigma$ for the gaussian).
329
330
331
332\medskip
333
334This  ``naive interpolation'' can also be expressed  under the form (2.1),
335with
336$$
337\varphi_i(r) =\left\{\matrix{   \phi(r-r_m)/Z(r) \qquad \hbox{if} \quad
338r \in  S^L_j  \cr
3390  \qquad \qquad \hbox{elsewhere}} \right.   
340\eqno(2.11)
341$$
342where $S_j^L$   is the   domain of all the points $r$ which admit the grid
343point $r_j$ in the list  of the $L$ closest neighbors.  The values at the
344boundary has to be adjusted as for the ``closest neighbor'' interpolation,
345which   is the particular case $L=1$ and $\phi=1$.
346
347
348
349
350
351
352
353\beginsection 3. GRID-TO-GRID INTERPOLATION
354
355There is a big difference between the interpolation from a set of data on a
356grid to a function $f(r)$ defined everywhere, and a grid-to-grid
357interpolation. In a grid-to-grid interpolation, a set of data is given on a
358first grid, the ``source grid'', and the interpolation must generate from
359these a set of data on a new grid, the ``target grid''. This  problems occurs
360in the ocean-atmosphere coupling problem where fluxes must be transmitted
361from the atmospheric grid to the oceanic grid, and sea surface temperature
362(SST)
363from the oceanic grid to  the atmospheric grid.
364 Of course, given an interpolation  on the source grid, one can apply the
365interpolated function $f(r)$ at each point of the target grid to define a
366grid-to-grid interpolation. But this choice can be extended through a
367Lagrangian formalism where the grid-to-grid interpolation depends on an
368interpolation on the source grid and also an interpolation of the target
369grid. Indeed the grid-to-grid interpolation depends on what the physicist
370intends to do with the interpolated values, and this can generally be
371expressed through the definition of an interpolation on the target grid.
372These considerations will guide the choices of the parameters of our ``naive''
373grid-to-grid interpolation (number of neighbors and variance). 
374
375\vfill\eject
376
377
378\beginsection 3.1 Sea domains and Ocean-Atmosphere coupling
379
380The grid of an Atmospheric General Circulation Model (AGCM)  is made  of
381``land points'' and ``sea points''. The grid of an Oceanic General Circulation
382Model (OGCM)  is, by definition, only made of ``oceanic points''.  The AGCM
383``sea points''  and the OGCM ``oceanic points''  generally do not coincide,
384except  when the same grids  has been chosen.
385
386
387
388The fluxes of the AGCM are known at all  the points, land or sea, and one of
389 the
390task of the coupler is to interpolate them for  the OGCM grid.
391This can be done
392either by using all the  grid,  with no distinction between land and sea
393points, or only taking into account the sea points. This last point is still
394under debate.  There is no such a choice
395however when passing the sea surface temperature (SST) of the OGCM  grid
396to the AGCM ``sea points''.
397
398
399
400In all these cases, it is possible to denote by  by $(r^a_i),\; i=1,N^a$ the
401``source grid'' on which are known the data and $(r^b_i),\; i=1,N^b$ the
402``target grid'' on which the interpolated values must be calculated.  The
403two domains of the two grids are likely to  have  a large intersection and
404sometimes a not so small differences (the complementary of  the
405intersection in the reunion of the the two domains).  The influence of the
406difference set of the two grids in a grid-to-grid interpolation  will be
407investigated in Part B of this letter,  through numerical tests.
408
409
410
411\beginsection 3.2  Lagrangian formalism
412
413A grid-to-grid interpolation always assumes, even  if  not said, the
414choice of an interpolation  on the  source  grid as well as on the target
415grid. 
416
417
418
419Let
420$$
421f(r)=\sum_{i=1}^{N^a} a_i \varphi_i(r) 
422\eqno(3.1)
423$$
424a chosen interpolation on the source grid A defined by the points $(r^a_i),\;
425i=1,N^a$,  at which the values $a_i$ are known.
426
427
428
429Let
430$$
431g(r)=\sum_{j=1}^{N^b} b_i \psi_j(r) 
432\eqno(3.2)
433$$
434a chosen interpolation on the target grid B defined by the points $(r^b_i),\;
435j=1,N^b$,  at which the values $b_i$ are unknown an to be calculated
436through a grid-to-grid interpolation. 
437
438
439
440Such a grid-to-grid interpolation can be defined by the minimization of
441the Lagrangian:
442$$
443L(b_1, b_2, ..., b_{N^b}) =  \int [f(r)-g(r)]^2  dr \;.
444\eqno(3.3)
445$$
446The integral is on all the domain, owing the fact that the $
447\varphi_i(r)$'s can be zero outside their support.
448It is natural to minimize this Lagrangian  in order to  have $f(r)$ as close
449as possible of $g(r)$.
450The set of coefficients $(b_j),\; j=1,N^b$ which  realizes this minimization
451is found by saying that all the partial derivatives $\partial L / \partial
452b_j$ vanish. Some straightforward algebraic manipulations show that this
453lead the  $N^b$ linear equations:
454$$
4552 \sum_{j=1}^{N^b}  < \psi_m | \psi_j > b_j
456=2 \sum_{i=1}^{N^a}  < \psi_m | \varphi_i> a_i
457\qquad \hbox{for} \quad m=1,N^b
458\eqno(3.4)
459$$
460where
461$$
462  < \psi_m  |\psi_j > = \int    \psi_m (r)\psi_j(r) dr  =:  V_{mj}
463\eqno(3.5) 
464$$
465and
466$$
467  < \psi_m |  \varphi_i > = \int    \psi_m (r)\varphi_i(r) P(r) dr  =:  U_{mi}
468\;.
469\eqno(3.6) 
470$$
471
472
473
474In order to find the $N^b$ values $b_j$'s, one has to invert the linear
475system $VB =  UA$:
476$$
477\sum_{j=1}^{N_b} V_{ml}\;  b_j =   \sum_{i=1}^{N_a}  U_{mi}\;  a_i
478\qquad\hbox{for}\quad m=1,N^b
479\eqno(3.7)
480$$
481
482
483
484The inversion of the $N_b$ x $N_b$  matrix $V$ is  possible if  the
485$\psi_j$'s are a good basis, and the grid-to-grid interpolation finally
486reads: $B=V^{-1}U    A$.
487
488
489
490
491
492\beginsection 3.3 The choice of the two grid interpolations
493
494
495
496Choosing the ``closest neighbor'' interpolation for the target grid, in the
497above formalism,  lead to a very easy implementation of the method because
498the matrix $V$ is equal to  unity.  The interpolation chosen on the source
499grid (grid A) is  then the  only one  which determines the grid-to-grid
500interpolation and reads:
501$$
502b_j= \sum _{i=1}^{N^a}  a_i  \overline{\varphi_i}^{S_j}(r_j^b)
503\eqno(3.8)
504$$
505where
506$$
507\overline{\varphi_i}^{S_j}(r_j^b)=  \int_{S_j} \varphi_i(r)
508\eqno(3.9)
509$$
510is the  average of   $\varphi$ on the  ``closest neighbor'' cell surrounding
511$r_j$.  When the variance of $\varphi_i$ is large compared to the size of
512this  domain,  this average is close to its value at $r_j$ and we have
513approximatively $b_j\sim f(r_j)$.  On the contrary, if  this variance is
514small compared  to the size of the ``closest neighbor''  cells of the  target
515grid (grid B),  the grid-to-grid interpolation is approximatively the trivial
516interpolation for which all the $b_j$'s are equal to the mean value
517$\sum_i a_i$.
518
519
520
521
522\bigskip
523
524
525Having this in  mind, I want to express here some  intuitive  ideas  about
526the choice of the source and target grid interpolation, when building a
527grid-to-grid interpolation with the above Lagrangian formalism. Let us
528consider three situations.
529
530\medskip
531
532
533
534\item{*} {\bf  Coarse to thin grid}. If the source grid A is coarser that the
535target grid B, it seems natural  to choose the ``closest neighbor''
536interpolation on grid B. On grid A, one feels that  an smooth interpolation
537with an ``overlap order'' which is be 2 or 5 times
538 to the thinest ratio of the
539two grids, i.e., the ratio of the average mesh size  of the coarse grid A over
540the average mesh size  of the thin grid B.
541
542\medskip
543
544 \item{*} {\bf Thin to coarse grid}. It the source grid A is thiner that the
545target grid B. One can still try to choose the ``closest neighbor''
546interpolation on grid B.
547On grid A, one feels that  an smooth interpolation  with an ``overlap order''
548which is roughly equal to the coarsest ration of the two grid, i.e., the ratio
549of the average mesh size  of the thin grid A over the average mesh size  of
550the coarse grid B.
551
552
553
554
555
556\beginsection 3.4 The grid-to-grid  ``naive'' method
557
558All the above considerations have been addressed in order to explain the
559grid-to-grid  ``naive'' method that is  being build as a temporary  modulus,
560waiting for a  less naive  method  to be coded.
561
562
563
564In this naive method the fluxes $b_j$ on the ocean grid B $(r^b_j),\;  j=1,N^b$ 
565are  obtained  from the fluxes $a_i$ of the atmospheric grid A $(r^a_i),\;
566i=1,N^a$  simply by applying the $L^a$ neighbors $\sigma_a$-gaussian
567interpolation with :
568 $$
569b_j={1\over Z^a(r^b_j)}   \sum_{m\in I(r^b_j)}  a_i  e^{-{(r^b_j-r^a_m)^2
570\over 2 \sigma_a^2} }
571\eqno(3.10)
572$$
573where $I(r^b_j)=\{ i_1(r^b_j), i_2(r^b_j), ..., i_{L^a}(r^b_j) \}  $ is the set
574containing the  indices of $L^a$ closest neighbors A-grid points $r^a_m$
575of the B-grid point $r^b_j$, and   
576$$
577Z^a(r^b_j) =  \sum_{m\in I(r^b_j)}   e^{-{(r^b_j-r^a_m)^2 \over 2
578\sigma_a^2} }\;.
579\eqno(3.11)
580$$
581
582
583
584\medskip
585
586When interpolating the SST (sea surface  temperature) for the oceanic grid
587B to the atmospheric grid, the same principle is applied with
588the $L^b$ neighbors $\sigma_b$-gaussian interpolation:
589 $$
590a_i={1\over Z^b(r^a_i)}   \sum_{m\in J(r^a_i)}  b_i  e^{-{(r^a_i-r^b_m)^2
591\over 2 \sigma_b^2} }
592\eqno(3.12)
593$$
594where $J(r^a_i)=\{ j_1(r^a_i), j_2(r^a_i), ..., i_{L^b}(r^a_i) \}  $ is the set
595containing the  indices of $L^b$ closest neighbors B-grid points $r^b_m$
596of the A-grid point $r^a_i$, and
597$$   
598Z^b(r^a_i) =  \sum_{m\in J(r^a_i)}   e^{-{(r^a_i-r^b_m)^2 \over 2
599\sigma_b^2} }
600\eqno(3.13)
601$$
602
603\vfill\eject
604
605
606\bigskip 
607
608The adjustable parameters of this ``naive method'' are the two integers
609$L^a$ and $L^b$ and the two variances $\sigma_a$ and $\sigma_b$.  For a
610given couple of grids A and B, their choice can be guided by the above
611analysis base on the Lagrangian formalism.
612
613
614
615If Grid B is thiner than Grid A, which is the case for the
616Ocean-Atmosphere coupling, it is reasonable to choose $L^a$ or order 10
617and $\sigma_a$ of the order of the average mesh of grid A. In the  above
618formalism of the Lagrangian interpolation, this choice corresponds to
619the $L^a$ neighbors $\sigma_a$-gaussian interpolation on Grid A,  i.e.,
620and the ``delta-comb'' interpolation on Grid B, i.e., the choice of delta
621function for the $\psi_j$'s.  The inverse Grid B to Grid A interpolation can
622be expressed the same way, but with a different choice of $L^b$. Indeed, it
623seems natural to choose $L^b$ such that $L^b/L^a$ is of the order of the
624ratio between the A-grid and B-grid average mesh size, and $\sigma_b$ of
625the order of $\sigma_a$. With this choice a composition between a A to B
626and B to A grid interpolation is close to the Identity, which is a reasonable
627criteria to impose when no other information is assumed on the nature of
628the fields to be interpolated.
629
630
631
632
633
634
635
636\beginsection 4. TOWARD A LESS NAIVE METHOD
637
638For the case of Ocean-Atmosphere coupling, information is known about
639the structure of the flux or SST fields to interpolated, and about the
640geometry of the   grid. The naive method should be thus replaced by
641grid-to-grid interpolations adapted to the specific physical problem of the
642Ocean-Atmosphere coupling. These interpolation have to be  tuned in order
643to answer specific quality criteria, imposed by physical arguments.  This
644tuning can be achieved through the choice of the basis functions  the
645source grid interpolation (the Atmospheric grid when passing fluxes, and
646the Oceanic one when passing the SST).  Constraints like the conservation
647of the global integral of fluxes can be satisfied by adding Lagrange
648multipliers in the Lagrangian  formalism. At last, a choice of the target
649grid  interpolation, different from the ``Dirac comb'' interpolation can be
650necessary. In this last case the inversion of the matrix $V$ of Equation
651(3.6) has to be done once for all, and the multiplication by $V^{-1}$, which
652is generally not sparse, has to  be performed for each new field to be
653interpolated.  The numerical computation of the elements of $U$ by
654Monte-Carlo techniques is briefly discussed. 
655
656
657
658\beginsection 4.2 Inhomogeneous and anisotropic interpolation
659
660The choice of the interpolation basis $\varphi^a_i(r)$ and $\varphi^b_j(r)$
661of the grid A and B considered as source grids (i.e. when interpolating
662fluxes or SST respectively), can be tuned in function of the geometry of
663the two grids, and the knowledge of the  physical structure of the fields to
664interpolate. For instance, some anisotropy could be given to these
665functions if the fields have a higher correlation in a particular direction
666(e.g. in latitudinal direction  on  the sphere).  Near the edges of the two
667grids, i.e. the costs, a special choice of the basis function, adapted to the
668geometry or the physical processes should be performed. 
669
670
671
672\beginsection 4.3 Lagrangian formalism with constraints
673
674When passing the flux of a quantity, like heat for instance, from the
675atmospheric grid to the oceanic grid it might be important to ensure that
676the amount of  the heat lost by the AGCM is  equal to the heat received by
677the OGCM.  This conservation can be implemented by imposed one  or
678several constraints in the definition of the interpolation.
679
680
681
682Taking the notation of the Langragian formalism of Section 3, the
683constraints
684$$
685\int f(r) dr = \int g(r) dr
686\eqno(4.1)
687$$
688defines a new grid-to-grid  interpolation  obtained by minimizing
689$$
690L(b_1, b_2, ..., b_{N^b})
691 =  \int [f(r)-g(r)]^2  dr + \lambda \int [f(r)-g(r)]  dr
692\eqno(4.2)
693$$
694where $\lambda$ is a Lagrangian multiplier.
695
696
697
698With this constraint, Equation (3.4) is now replaced by the system
699$$
700\left\{
701\eqalign{
702 2 \sum_{j=1}^{N^b}  < \psi_m | \psi_j > b_j
703=&2 \sum_{i=1}^{N^a}  < \psi_m | \varphi_i> a_i - \lambda < \psi_m | 1 >
704 \qquad \hbox{ for all } \quad m=1,N^b \cr
705 \sum_{j=1}^{N^b}
706  < \psi_j | 1 > b_j  =\sum_{i=1}^{N^a}  < \varphi_i | 1 >
707a_i
708} \right.
709\eqno(4.3)
710$$
711where
712$$
713< \psi_j | 1 > = \int \psi_j dr = : H_j
714\eqno(4.4) 
715$$
716and
717$$
718< \varphi_i | 1 > = \int \varphi_i dr = : G_j
719\eqno(4.4) 
720$$
721
722Equation (3.7) is now replaced by a system $VB=UA-\lambda H$ with $HB=
723GA$:
724$$
725\left\{
726\eqalign{
727\sum_{j=1}^{N_b} V_{ml}\;  b_j =&   \sum_{i=1}^{N_a}  U_{mi} \; a_i - \lambda 
728G_m
729\qquad\hbox{for}\quad m=1,N^b  \cr
730\sum_{j=1}^{N^b}  H_j \; b_j  =\sum_{i=1}^{N^a}  G_i\; a_i
731}\right.
732\eqno(4.5)
733$$
734
735
736
737This system is solved by first inverting the matrix $V$, which leads to the
738system $B=V^{-1}UA-\lambda V^{-1}H$ with $HB= GA$, and by
739eliminating $\lambda$. Let us denote $B^*= V^{-1}UA$, which is  the value
740of the coefficients that would be obtained without the constraint, and plug
741$B=B^*- \lambda V^{-1}H$ in the second equation. This gives the value of
742the Lagrange multiplier
743$$
744\lambda= { H B^* - G A \over G V^{-1}H} \;
745\eqno(4.6)
746$$
747which gives a measure of how strongly the constraint is violated by the first
748guess $B^*$. This violation error is redistributed in the solution of the
749problem:
750$$
751\eqalign{
752B=& B^* - {H B^* - G A \over H V^{-1}H} V^{-1}H  \cr
753=& V^{-1}UA - {H V^{-1}UA - G A \over H V^{-1}H} V^{-1} H   \;.}
754\eqno(4.7)
755$$
756
757
758
759
760
761\beginsection 4.3 Practical considerations
762
763For the practical implementation of the interpolation methods which are
764derived from a Lagrangian formalism, one needs to know the numerical
765values of the quantities $V_{mj}=~~~<\psi_m | \psi_j> $$U_{mi}=  <\psi_m |
766\phi_i> $,   $H_m= <\psi_m | 1> $ and $G_i= <\varphi_i | 1> $. Even for the
767next neighbor interpolation basis, the numerical evaluation of these
768numbers is not straightforward. The complexity of this problem, however,
769do not exceed the one of the determination of the double integral  of an
770arbitrary function, which is an often encountered problem in physics.
771Various methods can be found depending of the particular situation.
772
773
774One of them is the evaluation of these integrals through Monte-Carlo
775techniques. For instance, if the functions $\psi_m$'s are the next neighbor
776interpolation basis, the $H_m$'s are the surfaces of the non-intersecting
777domains $S_m$'s (see Section 2.3). If the surfaces of the grid meshes are
778known,  and if the grid is not too distorted (in a sense to be defined later),
779it is possible to reduce the number of random shootings. Inside each  grid
780mesh formed by the four grid points $r_1$, $r_2$, $r_3$ and $r_4$, one
781can choose at random, with  a uniform probability, a big number of points.
782For each of these  points $r$, it is only necessary to calculate the four
783values $\psi_1(r)$, $\psi_2(r)$, $\psi_3(r)$ and $\psi_4(r)$, associated to
784the four grid points at the corners of the mesh,   provided that  the grid is
785not too much distorted (by definition).  If so, the random point has to be
786chosen uniformly on a surface larger than the considered mesh. The same
787algorithm can be apply for the calculation the the $U_{mi}$'s. If the
788$\varphi_i$'s are the basis function of the $L$-closest neighbors
789interpolation,  this algorithm can be generalized.
790
791\vfill\eject 
792
793\beginsection 5. CONCLUSION
794
795The goal of this letter was to expose the ``naive'' grid-to-grid
796interpolation  method that I have coded for the interpolation black box of
797the coupler.  For each point of the target grid, the algorithm search for its
798$L$-closest neighbor and calculates weight coefficients through the
799evaluation of a
800gaussian function. This has to be done once for all, given a couple of grid,
801the addressed and the weight coefficients being the only information to be
802stored.  If $L$ is not big, this storage is not huge, and  the number of
803operation is also reasonable.  Test of this methods with several type of
804grids will be presented in Part B.
805
806In fact, the rough exposition  of the method could have been done quite
807more shortly if this  had been the only  considered goal.  But  the different
808formalisms presented in this letter are candidate to provide a framework
809to the intuitive ideas that one often   generates when dealing with this
810interpolation problem.  It can also be useful to try to translate into these
811formalisms more complicated interpolation methods, and, if not possible,
812to see which  of their features do not enter in this framework.
813
814
815
816\bigskip
817
818\noindent {\bf Acknowledgments:}  I thank all the participants of the ``Adm
819\& Science Team Meeting'' of March 11th, for their  remarks which have
820useful for the drafting of  this letter.
821
822
823
824\beginsection REFERENCES
825
826\def\ref{\parskip 12pt \leftskip 20pt \parindent -20pt} 
827\def\endref{\parskip 0pt \leftskip 0pt \parindent 20pt}
828
829
830
831\ref
832[1]
833O. THUAL, Gathering information for a coupler,
834 {\it Epicoa \ } {\bf 1009} (1991).
835
836
837
838[2]
839 L. TERRAY, A simple communication scheme between coupler and GCM's,
840 {\it Epicoa \ } {\bf 0203}  (1992).
841
842
843
844[3]
845N. H. BARTH,  A Conservative Scheme for Passing Variables Between
846Coupled Models of the Ocean an Atmosphere,
847 {\it Technical Report\ }, CERFACS (1992).
848
849
850
851[4] ``Appel d'id\'ees pour la cr\'eation du coupleur du mod\`ele
852 communautaire'', written by  L. Terray,  October 10th 1991.
853
854
855
856\endref
857
858
859
860\end
861
862
863
864
865
Note: See TracBrowser for help on using the repository browser.