source: trunk/LMDZ.COMMON/libf/misc/coefpoly_m.F90 @ 3537

Last change on this file since 3537 was 1441, checked in by emillour, 10 years ago

Updates in common dynamics (seq and ) to keep up with updates
in LMDZ5 (up to LMDZ5 trunk, rev 2250):

  • compilation:
  • added test in grid/dimension/makdim to check that # of longitudes is a multiple of 8
  • dyn3d_common:

Bug correction concerning zoom (cf LMDZ5 rev 2218)

  • coefpoly.F becomes coefpoly_m.F90 (in misc)
  • fxhyp.F => fxhyp_m.F90 , fyhyp.F => fyhyp_m.F90
  • new routines for zoom: invert_zoom_x_m.F90 and principal_cshift_m.F90
  • inigeom.F adapted to new zoom definition routines
  • fluxstokenc.F : got rid of calls to initial0()
  • dyn3d:
  • advtrac.F90 : got rid of calls to initial0()
  • conf_gcm.F90 : cosmetic changes and change in default dzoomx,dzoomy values
  • guide_mod.F90 : followed updates from Earth Model
  • gcm.F is now gcm.F90
  • dyn3dpar:
  • advtrac_p.F90, covcont_p.F90, mod_hallo.F90 : cosmetic changes
  • conf_gcm.F90 : cosmetic and changed in default dzoomx,dzoomy values
  • parallel_lmdz.F90 : updates to keep up with Earth model
  • misc:
  • arth.F90 becomes arth_m.F90
  • wxios.F90 updated wrt Earth model changes
  • nrtype.F90 and coefpoly_m.F90 added
  • ran1.F, sort.F, minmax.F, minmax2.F, juldate.F moved over from dyn3d_common

EM

File size: 1.5 KB
RevLine 
[1441]1module coefpoly_m
[1]2
[1441]3  IMPLICIT NONE
[1]4
[1441]5contains
[1]6
[1441]7  SUBROUTINE coefpoly(xf1, xf2, xprim1, xprim2, xtild1, xtild2, a0, a1, a2, a3)
[1]8
[1441]9    ! From LMDZ4/libf/dyn3d/coefpoly.F, version 1.1.1.1 2004/05/19 12:53:05
[1]10
[1441]11    ! Author: P. Le Van
[1]12
[1441]13    ! Calcul des coefficients a0, a1, a2, a3 du polynôme de degré 3 qui
14    ! satisfait aux 4 équations suivantes :
[1]15
[1441]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
[1]20
[1441]21    ! (passe par les points (Xf(it), xtild(it)) et (Xf(it + 1),
22    ! xtild(it + 1))
[1]23
[1441]24    ! On en revient à resoudre un système de 4 équations à 4 inconnues
25    ! a0, a1, a2, a3.
26
27    use nrtype, only: k8
28
29    REAL(K8), intent(in):: xf1, xf2, xprim1, xprim2, xtild1, xtild2
30    REAL(K8), intent(out):: a0, a1, a2, a3
31
32    ! Local:
33    REAL(K8) xtil1car, xtil2car, derr, x1x2car
34
35    !------------------------------------------------------------
36
37    xtil1car = xtild1 * xtild1
38    xtil2car = xtild2 * xtild2
39
40    derr = 2. * (xf2-xf1)/(xtild1-xtild2)
41
42    x1x2car = (xtild1-xtild2) * (xtild1-xtild2)
43
44    a3 = (derr+xprim1+xprim2)/x1x2car
45    a2 = (xprim1-xprim2+3. * a3 * (xtil2car-xtil1car))/(2. * (xtild1-xtild2))
46
47    a1 = xprim1 - 3. * a3 * xtil1car - 2. * a2 * xtild1
48    a0 = xf1 - a3 * xtild1 * xtil1car - a2 * xtil1car - a1 * xtild1
49
50  END SUBROUTINE coefpoly
51
52end module coefpoly_m
Note: See TracBrowser for help on using the repository browser.