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

Diff of /trunk/dyn3d/invert_zoom_x.f

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

trunk/dyn3d/fxhyp_loop_ik.f revision 126 by guez, Fri Feb 6 18:33:15 2015 UTC trunk/Sources/dyn3d/invert_zoom_x.f revision 145 by guez, Tue Jun 16 15:23:29 2015 UTC
# Line 1  Line 1 
1  module fxhyp_loop_ik_m  module invert_zoom_x_m
2    
3    implicit none    implicit none
4    
# Line 6  module fxhyp_loop_ik_m Line 6  module fxhyp_loop_ik_m
6    
7  contains  contains
8    
9    subroutine fxhyp_loop_ik(xf, xtild, Xprimt, xzoom, xlon, xprimm, xuv)    subroutine invert_zoom_x(xf, xtild, Xprimt, xlon, xprimm, xuv)
10    
11      use coefpoly_m, only: coefpoly      use coefpoly_m, only: coefpoly
12      USE dimens_m, ONLY: iim      USE dimens_m, ONLY: iim
13        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)
     DOUBLE PRECISION, intent(in):: xzoom  
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) THEN  
           it = 2 * nmax -1  
        END IF  
   
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)
# Line 78  contains Line 78  contains
78         END IF         END IF
79      END DO      END DO
80    
81      xlon = xvrai + xzoom      xlon = xvrai + clon
82      xprimm = xxprim      xprimm = xxprim
83    
84    end subroutine fxhyp_loop_ik    end subroutine invert_zoom_x
85    
86  end module fxhyp_loop_ik_m  end module invert_zoom_x_m

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

  ViewVC Help
Powered by ViewVC 1.1.21