source: LMDZ5/trunk/libf/dyn3d_common/coefpoly_m.F90 @ 2225

Last change on this file since 2225 was 2218, checked in by lguez, 10 years ago

Bug fix in fxhyp. There was some bad logic for the shifting of
longitude grids rlonuv, rlonv, rlonm025 and rlonp025 toward [- pi,
pi]. In some cases, one of the four grids was not shifted and the
others were. For example, you could see the bug with: iim = 48, clon =
20, grossismx = 3, dzoomx = 0.15. The bad logic involved the variable
is2 in the loop on ik = 1, 4. The loop included some tests depending
on ik. The whole thing was quite convoluted. Rewrote fxhyp. In
particular, replaced the loop on ik by a call to a new procedure,
invert_zoom_x. fxhyp.F was in dyn3d, it is replaced by fxhyp_m.F90
which is in dyn3d_common. Removed several arguments of fxhyp: zoom
parameters are accessed through serre.h; rlonm025 and rlonp025 were
not used in inigeom; min and max of longitude steps are written inside
fxhyp.

Some simplifications and modernizations in fyhyp. In particular,
several arguments are removed: zoom parameters are accessed through
serre.h; yprimv was not used in inigeom; min and max of latitude steps
are written inside fyhyp.

Removed now useless intermediary procedure fxyhyper.

Changed default value of dzoomx and dzoomy from 0 to 0.2. dzoom[xy] is
only needed when grossism[xy] > 1 and then it should be > 0.

dzoom[xy] can no longer be the extent of the zoom in degrees: it must
be expressed as the fraction of the total domain.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1module coefpoly_m
2
3  IMPLICIT NONE
4
5contains
6
7  SUBROUTINE coefpoly(xf1, xf2, xprim1, xprim2, xtild1, xtild2, a0, a1, a2, a3)
8
9    ! From LMDZ4/libf/dyn3d/coefpoly.F, version 1.1.1.1 2004/05/19 12:53:05
10
11    ! Author: P. Le Van
12
13    ! Calcul des coefficients a0, a1, a2, a3 du polynôme de degré 3 qui
14    ! satisfait aux 4 équations suivantes :
15
16    ! a0 + a1 * xtild1 + a2 * xtild1**2 + a3 * xtild1**3 = Xf1
17    ! a0 + a1 * xtild2 + a2 * xtild2**2 + a3 * xtild2**3 = Xf2
18    ! a1 + 2. * a2 * xtild1 + 3. * a3 * xtild1**2 = Xprim1
19    ! a1 + 2. * a2 * xtild2 + 3. * a3 * xtild2**2 = Xprim2
20
21    ! (passe par les points (Xf(it), xtild(it)) et (Xf(it + 1),
22    ! xtild(it + 1))
23
24    ! On en revient à resoudre un système de 4 équations à 4 inconnues
25    ! a0, a1, a2, a3.
26
27    DOUBLE PRECISION, intent(in):: xf1, xf2, xprim1, xprim2, xtild1, xtild2
28    DOUBLE PRECISION, intent(out):: a0, a1, a2, a3
29
30    ! Local:
31    DOUBLE PRECISION xtil1car, xtil2car, derr, x1x2car
32
33    !------------------------------------------------------------
34
35    xtil1car = xtild1 * xtild1
36    xtil2car = xtild2 * xtild2
37
38    derr = 2. * (xf2-xf1)/(xtild1-xtild2)
39
40    x1x2car = (xtild1-xtild2) * (xtild1-xtild2)
41
42    a3 = (derr+xprim1+xprim2)/x1x2car
43    a2 = (xprim1-xprim2+3. * a3 * (xtil2car-xtil1car))/(2. * (xtild1-xtild2))
44
45    a1 = xprim1 - 3. * a3 * xtil1car - 2. * a2 * xtild1
46    a0 = xf1 - a3 * xtild1 * xtil1car - a2 * xtil1car - a1 * xtild1
47
48  END SUBROUTINE coefpoly
49
50end module coefpoly_m
Note: See TracBrowser for help on using the repository browser.