/[lmdze]/trunk/Sources/dyn3d/invert_zoom_x.f
ViewVC logotype

Diff of /trunk/Sources/dyn3d/invert_zoom_x.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 144 by guez, Wed Jun 10 16:46:46 2015 UTC revision 145 by guez, Tue Jun 16 15:23:29 2015 UTC
# Line 12  contains Line 12  contains
12      USE dimens_m, ONLY: iim      USE dimens_m, ONLY: iim
13      use dynetat0_m, only: clon      use dynetat0_m, only: clon
14      use nr_util, only: pi_d, twopi_d      use nr_util, only: pi_d, twopi_d
15        use numer_rec_95, only: hunt
16    
17      DOUBLE PRECISION, intent(in):: Xf(0:), xtild(0:), Xprimt(0:) ! (0:2 * nmax)      DOUBLE PRECISION, intent(in):: Xf(0:), xtild(0:), Xprimt(0:) ! (0:2 * nmax)
18      real, intent(out):: xlon(:), xprimm(:) ! (iim)      real, intent(out):: xlon(:), xprimm(:) ! (iim)
19    
20      DOUBLE PRECISION, intent(in):: xuv      DOUBLE PRECISION, intent(in):: xuv
21        ! between - 0.25 and 0.5
22      ! 0. si calcul aux points scalaires      ! 0. si calcul aux points scalaires
23      ! 0.5 si calcul aux points U      ! 0.5 si calcul aux points U
24    
25      ! Local:      ! Local:
26      DOUBLE PRECISION xo1, Xfi, a0, a1, a2, a3, Xf1, Xprimin      DOUBLE PRECISION xo1, Xfi, a0, a1, a2, a3, Xf1, Xprimin
# Line 30  contains Line 32  contains
32    
33      !------------------------------------------------------------------      !------------------------------------------------------------------
34    
35        it = 0 ! initial guess
36    
37      DO i = 1, iim      DO i = 1, iim
38         Xfi = - pi_d + (i + xuv - 0.75d0) * twopi_d / iim         Xfi = - pi_d + (i + xuv - 0.75d0) * twopi_d / iim
39           ! - pi <= xfi < pi
40    
41         it = 2 * nmax         call hunt(xf, xfi, it, my_lbound = 0)
42         do while (xfi < xf(it) .and. it >= 1)         it = max(0, it)
43            it = it - 1         ! In principle, xfi >= xf(0), max with 0 just in case of
44         end do         ! roundoff error. {0 <= it <= 2 * nmax - 1}
45    
46         ! Calcul de Xf(xvrai(i))         ! Calcul de Xf(xvrai(i))
47    
        xvrai(i) = xtild(it)  
        IF (it == 2 * nmax) it = 2 * nmax -1  
48         CALL coefpoly(Xf(it), Xf(it + 1), Xprimt(it), Xprimt(it + 1), &         CALL coefpoly(Xf(it), Xf(it + 1), Xprimt(it), Xprimt(it + 1), &
49              xtild(it), xtild(it + 1), a0, a1, a2, a3)              xtild(it), xtild(it + 1), a0, a1, a2, a3)
50           xvrai(i) = xtild(it)
51         Xf1 = Xf(it)         Xf1 = Xf(it)
52         Xprimin = a1 + xvrai(i) * (2d0 * a2 + xvrai(i) * 3d0 * a3)         Xprimin = a1 + xvrai(i) * (2d0 * a2 + xvrai(i) * 3d0 * a3)
53         xo1 = xvrai(i)         xo1 = xvrai(i)

Legend:
Removed from v.144  
changed lines
  Added in v.145

  ViewVC Help
Powered by ViewVC 1.1.21