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

Diff of /trunk/dyn3d/fxhyp.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 146 by guez, Tue Jun 16 17:27:33 2015 UTC
# Line 15  contains Line 15  contains
15      ! Il vaut mieux avoir : grossismx \times dzoom < pi      ! Il vaut mieux avoir : grossismx \times dzoom < pi
16    
17      ! Le premier point scalaire pour une grille regulière (grossismx =      ! Le premier point scalaire pour une grille regulière (grossismx =
18      ! 1., taux=0., clon=0.) est à - 180 degrés.      ! 1., taux = 0., clon = 0.) est à - 180 degrés.
19    
20      USE dimens_m, ONLY: iim      USE dimens_m, ONLY: iim
21      use dynetat0_m, only: clon, grossismx, dzoomx, taux      use dynetat0_m, only: clon, grossismx, dzoomx, taux
# Line 28  contains Line 28  contains
28      real, intent(out):: rlonu(:), xprimu(:), xprimp025(:) ! (iim + 1)      real, intent(out):: rlonu(:), xprimu(:), xprimp025(:) ! (iim + 1)
29    
30      ! Local:      ! Local:
31      real rlonm025(iim + 1), rlonp025(iim + 1)      real rlonm025(iim + 1), rlonp025(iim + 1), d_rlonv(iim)
32      REAL dzoom, step      REAL dzoom, step
33      real d_rlonv(iim)      DOUBLE PRECISION, dimension(0:nmax):: xtild, fhyp, G, Xf
34      DOUBLE PRECISION xtild(0:2 * nmax)      DOUBLE PRECISION ffdx, beta
     DOUBLE PRECISION fhyp(nmax:2 * nmax), ffdx, beta, Xprimt(0:2 * nmax)  
     DOUBLE PRECISION Xf(0:2 * nmax), xxpr(2 * nmax)  
35      INTEGER i, is2      INTEGER i, is2
36      DOUBLE PRECISION, dimension(nmax + 1:2 * nmax):: xmoy, fxm      DOUBLE PRECISION xxpr(nmax - 1), xmoy(nmax), fxm(nmax)
37    
38      !----------------------------------------------------------------------      !----------------------------------------------------------------------
39    
# Line 55  contains Line 53  contains
53         rlonu(:iim) = rlonv(:iim) + 0.5 * step         rlonu(:iim) = rlonv(:iim) + 0.5 * step
54      else test_grossismx      else test_grossismx
55         dzoom = dzoomx * twopi_d         dzoom = dzoomx * twopi_d
56         xtild = arth(- pi_d, pi_d / nmax, 2 * nmax + 1)         xtild = arth(0d0, pi_d / nmax, nmax + 1)
57         forall (i = nmax + 1:2 * nmax) xmoy(i) = 0.5d0 * (xtild(i-1) + xtild(i))         forall (i = 1:nmax) xmoy(i) = 0.5d0 * (xtild(i-1) + xtild(i))
58    
59         ! Compute fhyp:         ! Compute fhyp:
60         fhyp(nmax + 1:2 * nmax - 1) = tanh_cautious(taux * (dzoom / 2. &         fhyp(1:nmax - 1) = tanh_cautious(taux * (dzoom / 2. &
61              - xtild(nmax + 1:2 * nmax - 1)), xtild(nmax + 1:2 * nmax - 1) &              - xtild(1:nmax - 1)), xtild(1:nmax - 1) &
62              * (pi_d - xtild(nmax + 1:2 * nmax - 1)))              * (pi_d - xtild(1:nmax - 1)))
63         fhyp(nmax) = 1d0         fhyp(0) = 1d0
64         fhyp(2 * nmax) = -1d0         fhyp(nmax) = -1d0
65    
66         fxm = tanh_cautious(taux * (dzoom / 2. - xmoy), xmoy * (pi_d - xmoy))         fxm = tanh_cautious(taux * (dzoom / 2. - xmoy), xmoy * (pi_d - xmoy))
67    
# Line 71  contains Line 69  contains
69    
70         ffdx = 0.         ffdx = 0.
71    
72         DO i = nmax + 1, 2 * nmax         DO i = 1, nmax
73            ffdx = ffdx + fxm(i) * (xtild(i) - xtild(i-1))            ffdx = ffdx + fxm(i) * (xtild(i) - xtild(i-1))
74         END DO         END DO
75    
# Line 85  contains Line 83  contains
83            STOP 1            STOP 1
84         END IF         END IF
85    
86         ! calcul de Xprimt         G = beta + (grossismx - beta) * fhyp
        Xprimt(nmax:2 * nmax) = beta + (grossismx - beta) * fhyp  
        xprimt(:nmax - 1) = xprimt(2 * nmax:nmax + 1:- 1)  
87    
88         ! Calcul de Xf         ! Calcul de Xf
89    
90         xxpr(nmax + 1:2 * nmax) = beta + (grossismx - beta) * fxm         xxpr = beta + (grossismx - beta) * fxm(:nmax - 1)
91         xxpr(:nmax) = xxpr(2 * nmax:nmax + 1:- 1)         Xf(0) = 0d0
92    
93         Xf(0) = - pi_d         DO i = 1, nmax - 1
   
        DO i=1, 2 * nmax - 1  
94            Xf(i) = Xf(i-1) + xxpr(i) * (xtild(i) - xtild(i-1))            Xf(i) = Xf(i-1) + xxpr(i) * (xtild(i) - xtild(i-1))
95         END DO         END DO
96    
97         Xf(2 * nmax) = pi_d         Xf(nmax) = pi_d
98    
99         call invert_zoom_x(xf, xtild, Xprimt, rlonm025(:iim), xprimm025(:iim), &         call invert_zoom_x(xf, xtild, G, rlonm025(:iim), xprimm025(:iim), &
100              xuv = - 0.25d0)              xuv = - 0.25d0)
101         call invert_zoom_x(xf, xtild, Xprimt, rlonv(:iim), xprimv(:iim), &         call invert_zoom_x(xf, xtild, G, rlonv(:iim), xprimv(:iim), xuv = 0d0)
102              xuv = 0d0)         call invert_zoom_x(xf, xtild, G, rlonu(:iim), xprimu(:iim), xuv = 0.5d0)
103         call invert_zoom_x(xf, xtild, Xprimt, rlonu(:iim), xprimu(:iim), &         call invert_zoom_x(xf, xtild, G, rlonp025(:iim), xprimp025(:iim), &
             xuv = 0.5d0)  
        call invert_zoom_x(xf, xtild, Xprimt, rlonp025(:iim), xprimp025(:iim), &  
104              xuv = 0.25d0)              xuv = 0.25d0)
105      end if test_grossismx      end if test_grossismx
106    

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

  ViewVC Help
Powered by ViewVC 1.1.21