Changeset 2228 for LMDZ5/trunk
- Timestamp:
- Mar 12, 2015, 2:15:18 PM (10 years ago)
- Location:
- LMDZ5/trunk/libf
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/bibio/arth.F90
r1907 r2228 7 7 INTERFACE arth 8 8 ! Returns an arithmetic progression, given a first term "first", an 9 ! increment and a number of terms "n" .9 ! increment and a number of terms "n" (including "first"). 10 10 11 11 MODULE PROCEDURE arth_r, arth_i 12 ! The difference between the procedures is the type of13 ! arguments "first" and "increment"and of function result.12 ! The difference between the procedures is the kind and type of 13 ! arguments first and increment and of function result. 14 14 END INTERFACE 15 15 … … 22 22 REAL, INTENT(IN) :: first,increment 23 23 INTEGER, INTENT(IN) :: n 24 REAL , DIMENSION(n) :: arth_r24 REAL arth_r(n) 25 25 26 ! Variables local to the procedure: 27 26 ! Local: 28 27 INTEGER :: k,k2 29 28 REAL :: temp … … 50 49 end do 51 50 end if 51 52 52 END FUNCTION arth_r 53 53 … … 57 57 58 58 INTEGER, INTENT(IN) :: first,increment,n 59 INTEGER, DIMENSION(n) :: arth_i 59 INTEGER arth_i(n) 60 61 ! Local: 60 62 INTEGER :: k,k2,temp 63 64 !--------------------------------------- 65 61 66 if (n > 0) arth_i(1)=first 62 67 if (n <= NPAR_ARTH) then … … 78 83 end do 79 84 end if 85 80 86 END FUNCTION arth_i 81 87 -
LMDZ5/trunk/libf/bibio/nrtype.F90
r2218 r2228 3 3 implicit none 4 4 5 integer, parameter:: wp = kind(0.) ! working precision for real type5 integer, parameter:: k8 = selected_real_kind(13) 6 6 7 7 ! Frequently used mathematical constants (with precision to spare): … … 13 13 REAL, PARAMETER :: EULER=0.5772156649015328606065120900824024310422 14 14 15 DOUBLE PRECISION, PARAMETER:: & 16 PI_D = 3.141592653589793238462643383279502884197d0 17 DOUBLE PRECISION, PARAMETER:: & 18 PIO2_D=1.57079632679489661923132169163975144209858d0 19 DOUBLE PRECISION, PARAMETER:: & 20 TWOPI_D=6.283185307179586476925286766559005768394d0 21 22 ! Derived data types for sparse matrices, single and double 23 ! precision (see use in Chapter B2): 24 25 TYPE sprs2_sp 26 INTEGER :: n,len 27 REAL, DIMENSION(:), POINTER :: val 28 INTEGER, DIMENSION(:), POINTER :: irow 29 INTEGER, DIMENSION(:), POINTER :: jcol 30 END TYPE sprs2_sp 31 32 TYPE sprs2_dp 33 INTEGER :: n,len 34 DOUBLE PRECISION, DIMENSION(:), POINTER :: val 35 INTEGER, DIMENSION(:), POINTER :: irow 36 INTEGER, DIMENSION(:), POINTER :: jcol 37 END TYPE sprs2_dp 15 REAL(K8), PARAMETER:: & 16 PI_D = 3.141592653589793238462643383279502884197_k8 17 REAL(K8), PARAMETER:: & 18 PIO2_D=1.57079632679489661923132169163975144209858_k8 19 REAL(K8), PARAMETER:: & 20 TWOPI_D=6.283185307179586476925286766559005768394_k8 38 21 39 22 END MODULE nrtype -
LMDZ5/trunk/libf/dyn3d_common/coefpoly_m.F90
r2218 r2228 25 25 ! a0, a1, a2, a3. 26 26 27 DOUBLE PRECISION, intent(in):: xf1, xf2, xprim1, xprim2, xtild1, xtild2 28 DOUBLE PRECISION, intent(out):: a0, a1, a2, a3 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 29 31 30 32 ! Local: 31 DOUBLE PRECISIONxtil1car, xtil2car, derr, x1x2car33 REAL(K8) xtil1car, xtil2car, derr, x1x2car 32 34 33 35 !------------------------------------------------------------ -
LMDZ5/trunk/libf/dyn3d_common/fxhyp_m.F90
r2218 r2228 20 20 use arth_m, only: arth 21 21 use invert_zoom_x_m, only: invert_zoom_x, nmax 22 use nrtype, only: pi, pi_d, twopi, twopi_d 22 use nrtype, only: pi, pi_d, twopi, twopi_d, k8 23 23 use principal_cshift_m, only: principal_cshift 24 24 … … 36 36 REAL dzoom, step 37 37 real d_rlonv(iim) 38 DOUBLE PRECISIONxtild(0:2 * nmax)39 DOUBLE PRECISIONfhyp(nmax:2 * nmax), ffdx, beta, Xprimt(0:2 * nmax)40 DOUBLE PRECISIONXf(0:2 * nmax), xxpr(2 * nmax)41 DOUBLE PRECISIONfa, fb38 REAL(K8) xtild(0:2 * nmax) 39 REAL(K8) fhyp(nmax:2 * nmax), ffdx, beta, Xprimt(0:2 * nmax) 40 REAL(K8) Xf(0:2 * nmax), xxpr(2 * nmax) 41 REAL(K8) fa, fb 42 42 INTEGER i, is2 43 DOUBLE PRECISIONxmoy, fxm43 REAL(K8) xmoy, fxm 44 44 45 45 !---------------------------------------------------------------------- … … 175 175 176 176 call invert_zoom_x(xf, xtild, Xprimt, rlonm025(:iim), & 177 xprimm025(:iim), xuv = - 0.25 d0)177 xprimm025(:iim), xuv = - 0.25_k8) 178 178 call invert_zoom_x(xf, xtild, Xprimt, rlonv(:iim), xprimv(:iim), & 179 xuv = 0 d0)179 xuv = 0._k8) 180 180 call invert_zoom_x(xf, xtild, Xprimt, rlonu(:iim), xprimu(:iim), & 181 xuv = 0.5 d0)181 xuv = 0.5_k8) 182 182 call invert_zoom_x(xf, xtild, Xprimt, rlonp025(:iim), & 183 xprimp025(:iim), xuv = 0.25 d0)183 xprimp025(:iim), xuv = 0.25_k8) 184 184 end if test_grossismx 185 185 -
LMDZ5/trunk/libf/dyn3d_common/fyhyp_m.F90
r2218 r2228 17 17 18 18 use coefpoly_m, only: coefpoly 19 use nrtype, only: k8 19 20 20 21 include "dimensions.h" … … 30 31 ! Local: 31 32 32 DOUBLE PRECISIONchampmin, champmax33 REAL(K8) champmin, champmax 33 34 INTEGER, PARAMETER:: nmax=30000, nmax2=2*nmax 34 35 REAL dzoom ! distance totale de la zone du zoom (en radians) 35 DOUBLE PRECISIONylat(jjm + 1), yprim(jjm + 1)36 DOUBLE PRECISIONyuv37 DOUBLE PRECISION, save:: yt(0:nmax2)38 DOUBLE PRECISIONfhyp(0:nmax2), beta39 DOUBLE PRECISION, save:: ytprim(0:nmax2)40 DOUBLE PRECISIONfxm(0:nmax2)41 DOUBLE PRECISION, save:: yf(0:nmax2)42 DOUBLE PRECISIONyypr(0:nmax2)43 DOUBLE PRECISIONyvrai(jjm + 1), yprimm(jjm + 1), ylatt(jjm + 1)44 DOUBLE PRECISIONpi, pis2, epsilon, y0, pisjm45 DOUBLE PRECISIONyo1, yi, ylon2, ymoy, yprimin46 DOUBLE PRECISIONyfi, yf1, ffdy47 DOUBLE PRECISIONypn, deply, y0036 REAL(K8) ylat(jjm + 1), yprim(jjm + 1) 37 REAL(K8) yuv 38 REAL(K8), save:: yt(0:nmax2) 39 REAL(K8) fhyp(0:nmax2), beta 40 REAL(K8), save:: ytprim(0:nmax2) 41 REAL(K8) fxm(0:nmax2) 42 REAL(K8), save:: yf(0:nmax2) 43 REAL(K8) yypr(0:nmax2) 44 REAL(K8) yvrai(jjm + 1), yprimm(jjm + 1), ylatt(jjm + 1) 45 REAL(K8) pi, pis2, epsilon, y0, pisjm 46 REAL(K8) yo1, yi, ylon2, ymoy, yprimin 47 REAL(K8) yfi, yf1, ffdy 48 REAL(K8) ypn, deply, y00 48 49 SAVE y00, deply 49 50 … … 51 52 INTEGER jpn, jjpn 52 53 SAVE jpn 53 DOUBLE PRECISIONa0, a1, a2, a3, yi2, heavyy0, heavyy0m54 DOUBLE PRECISIONfa(0:nmax2), fb(0:nmax2)54 REAL(K8) a0, a1, a2, a3, yi2, heavyy0, heavyy0m 55 REAL(K8) fa(0:nmax2), fb(0:nmax2) 55 56 REAL y0min, y0max 56 57 57 DOUBLE PRECISIONheavyside58 REAL(K8) heavyside 58 59 59 60 !------------------------------------------------------------------- -
LMDZ5/trunk/libf/dyn3d_common/invert_zoom_x_m.F90
r2218 r2228 10 10 11 11 use coefpoly_m, only: coefpoly 12 use nrtype, only: pi, pi_d, twopi_d 12 use nrtype, only: pi, pi_d, twopi_d, k8 13 13 14 14 include "dimensions.h" … … 18 18 ! for clon 19 19 20 DOUBLE PRECISION, intent(in):: Xf(0:), xtild(0:), Xprimt(0:) ! (0:2 * nmax)20 REAL(K8), intent(in):: Xf(0:), xtild(0:), Xprimt(0:) ! (0:2 * nmax) 21 21 real, intent(out):: xlon(:), xprimm(:) ! (iim) 22 22 23 DOUBLE PRECISION, intent(in):: xuv23 REAL(K8), intent(in):: xuv 24 24 ! 0. si calcul aux points scalaires 25 25 ! 0.5 si calcul aux points U 26 26 27 27 ! Local: 28 DOUBLE PRECISIONxo1, Xfi, a0, a1, a2, a3, Xf1, Xprimin28 REAL(K8) xo1, Xfi, a0, a1, a2, a3, Xf1, Xprimin 29 29 integer i, it, iter 30 DOUBLE PRECISION, parameter:: my_eps = 1d-630 REAL(K8), parameter:: my_eps = 1e-6_k8 31 31 32 DOUBLE PRECISIONxxprim(iim), xvrai(iim)32 REAL(K8) xxprim(iim), xvrai(iim) 33 33 ! intermediary variables because xlon and xprimm are simple precision 34 34 … … 36 36 37 37 DO i = 1, iim 38 Xfi = - pi_d + (i + xuv - 0.75 d0) * twopi_d / iim38 Xfi = - pi_d + (i + xuv - 0.75_k8) * twopi_d / iim 39 39 40 40 it = 2 * nmax … … 54 54 xtild(it), xtild(it + 1), a0, a1, a2, a3) 55 55 Xf1 = Xf(it) 56 Xprimin = a1 + xvrai(i) * (2 d0 * a2 + xvrai(i) * 3d0* a3)56 Xprimin = a1 + xvrai(i) * (2._k8 * a2 + xvrai(i) * 3._k8 * a3) 57 57 xo1 = xvrai(i) 58 58 iter = 1 … … 63 63 xo1 = xvrai(i) 64 64 Xf1 = a0 + xvrai(i) * (a1 + xvrai(i) * (a2 + xvrai(i) * a3)) 65 Xprimin = a1 + xvrai(i) * (2 d0 * a2 + xvrai(i) * 3d0* a3)65 Xprimin = a1 + xvrai(i) * (2._k8 * a2 + xvrai(i) * 3._k8 * a3) 66 66 end DO 67 67
Note: See TracChangeset
for help on using the changeset viewer.