--- trunk/Sources/dyn3d/fxhyp.f 2015/06/17 14:20:14 147 +++ trunk/Sources/dyn3d/fxhyp.f 2015/07/16 17:39:10 156 @@ -10,12 +10,12 @@ ! Author: P. Le Van, from formulas by R. Sadourny ! Calcule les longitudes et dérivées dans la grille du GCM pour - ! une fonction f(x) à dérivée tangente hyperbolique. + ! une fonction x_f(\tilde x) à dérivée tangente hyperbolique. - ! Il vaut mieux avoir : grossismx \times dzoom < pi + ! Il vaut mieux avoir : grossismx \times delta < pi ! Le premier point scalaire pour une grille regulière (grossismx = - ! 1., taux = 0., clon = 0.) est à - 180 degrés. + ! 1) avec clon = 0 est à - 180 degrés. USE dimens_m, ONLY: iim use dynetat0_m, only: clon, grossismx, dzoomx, taux @@ -24,12 +24,25 @@ use principal_cshift_m, only: principal_cshift use tanh_cautious_m, only: tanh_cautious - REAL, intent(out):: xprimm025(:), rlonv(:), xprimv(:) ! (iim + 1) - real, intent(out):: rlonu(:), xprimu(:), xprimp025(:) ! (iim + 1) + REAL, intent(out):: xprimm025(:) ! (iim + 1) + + REAL, intent(out):: rlonv(:) ! (iim + 1) + ! longitudes of points of the "scalar" and "v" grid, in rad + + REAL, intent(out):: xprimv(:) ! (iim + 1) + ! 2 pi / iim * (derivative of the longitudinal zoom function)(rlonv) + + real, intent(out):: rlonu(:) ! (iim + 1) + ! longitudes of points of the "u" grid, in rad + + real, intent(out):: xprimu(:) ! (iim + 1) + ! 2 pi / iim * (derivative of the longitudinal zoom function)(rlonu) + + real, intent(out):: xprimp025(:) ! (iim + 1) ! Local: real rlonm025(iim + 1), rlonp025(iim + 1), d_rlonv(iim) - REAL dzoom, step + REAL delta, h DOUBLE PRECISION, dimension(0:nmax):: xtild, fhyp, G, Xf, ffdx DOUBLE PRECISION beta INTEGER i, is2 @@ -39,31 +52,31 @@ print *, "Call sequence information: fxhyp" - test_grossismx: if (grossismx == 1.) then - step = twopi / iim + if (grossismx == 1.) then + h = twopi / iim - xprimm025(:iim) = step - xprimp025(:iim) = step - xprimv(:iim) = step - xprimu(:iim) = step - - rlonv(:iim) = arth(- pi + clon, step, iim) - rlonm025(:iim) = rlonv(:iim) - 0.25 * step - rlonp025(:iim) = rlonv(:iim) + 0.25 * step - rlonu(:iim) = rlonv(:iim) + 0.5 * step - else test_grossismx - dzoom = dzoomx * twopi_d + xprimm025(:iim) = h + xprimp025(:iim) = h + xprimv(:iim) = h + xprimu(:iim) = h + + rlonv(:iim) = arth(- pi + clon, h, iim) + rlonm025(:iim) = rlonv(:iim) - 0.25 * h + rlonp025(:iim) = rlonv(:iim) + 0.25 * h + rlonu(:iim) = rlonv(:iim) + 0.5 * h + else + delta = dzoomx * twopi_d xtild = arth(0d0, pi_d / nmax, nmax + 1) forall (i = 1:nmax) xmoy(i) = 0.5d0 * (xtild(i-1) + xtild(i)) ! Compute fhyp: - fhyp(1:nmax - 1) = tanh_cautious(taux * (dzoom / 2d0 & + fhyp(1:nmax - 1) = tanh_cautious(taux * (delta / 2d0 & - xtild(1:nmax - 1)), xtild(1:nmax - 1) & * (pi_d - xtild(1:nmax - 1))) fhyp(0) = 1d0 fhyp(nmax) = -1d0 - fxm = tanh_cautious(taux * (dzoom / 2d0 - xmoy), xmoy * (pi_d - xmoy)) + fxm = tanh_cautious(taux * (delta / 2d0 - xmoy), xmoy * (pi_d - xmoy)) ! Compute \int_0 ^{\tilde x} F: @@ -95,7 +108,7 @@ call invert_zoom_x(xf, xtild, G, rlonu(:iim), xprimu(:iim), xuv = 0.5d0) call invert_zoom_x(xf, xtild, G, rlonp025(:iim), xprimp025(:iim), & xuv = 0.25d0) - end if test_grossismx + end if is2 = 0