- Timestamp:
- Nov 5, 2018, 3:24:59 PM (6 years ago)
- Location:
- LMDZ6/branches/DYNAMICO-conv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/DYNAMICO-conv
- Property svn:mergeinfo changed
/LMDZ6/trunk removed
- Property svn:mergeinfo changed
-
LMDZ6/branches/DYNAMICO-conv/libf/phylmd/flott_gwd_rando_m.F90
r3356 r3411 18 18 use dimphy, only: klon, klev 19 19 use assert_m, only: assert 20 USE ioipsl_getin_p_mod, ONLY : getin_p21 USE vertical_layers_mod, ONLY : presnivs22 23 20 include "YOMCST.h" 24 21 include "clesphys.h" … … 106 103 REAL PH(KLON, KLEV + 1) ! Pressure at 1/2 levels 107 104 REAL PSEC ! Security to avoid division by 0 pressure 105 REAL PHM1(KLON, KLEV + 1) ! 1/Press at 1/2 levels 108 106 REAL BV(KLON, KLEV + 1) ! Brunt Vaisala freq. (BVF) at 1/2 levels 109 107 REAL BVSEC ! Security to avoid negative BVF 110 REAL RAN_NUM_1,RAN_NUM_2,RAN_NUM_3111 112 REAL, DIMENSION(klev+1) ::HREF113 114 LOGICAL, SAVE :: gwd_reproductibilite_mpiomp=.true.115 LOGICAL, SAVE :: firstcall = .TRUE.116 !$OMP THREADPRIVATE(firstcall,gwd_reproductibilite_mpiomp)117 118 CHARACTER (LEN=20) :: modname='flott_gwd_rando'119 CHARACTER (LEN=80) :: abort_message120 121 122 123 IF (firstcall) THEN124 ! Cle introduite pour resoudre un probleme de non reproductibilite125 ! Le but est de pouvoir tester de revenir a la version precedenete126 ! A eliminer rapidement127 CALL getin_p('gwd_reproductibilite_mpiomp',gwd_reproductibilite_mpiomp)128 IF (NW+3*NA>=KLEV) THEN129 abort_message = 'NW+3*NA>=KLEV Probleme pour generation des ondes'130 CALL abort_physic (modname,abort_message,1)131 ENDIF132 firstcall=.false.133 ENDIF134 135 108 136 109 !----------------------------------------------------------------- … … 183 156 ZOISEC = 1.E-6 ! Security FOR 0 INTRINSIC FREQ 184 157 185 IF (1==0) THEN186 158 !ONLINE 187 159 call assert(klon == (/size(pp, 1), size(tt, 1), size(uu, 1), & … … 195 167 "FLOTT_GWD_RANDO klev") 196 168 !END ONLINE 197 ENDIF198 169 199 170 IF(DELTAT < DTIME)THEN … … 212 183 DO LL = 2, KLEV 213 184 PH(:, LL) = EXP((LOG(PP(:, LL)) + LOG(PP(:, LL - 1))) / 2.) 214 end DO 185 PHM1(:, LL) = 1. / PH(:, LL) 186 end DO 187 215 188 PH(:, KLEV + 1) = 0. 189 PHM1(:, KLEV + 1) = 1. / PSEC 216 190 PH(:, 1) = 2. * PP(:, 1) - PH(:, 2) 217 191 218 192 ! Launching altitude 219 220 !Pour revenir a la version non reproductible en changeant le nombre de process221 IF (gwd_reproductibilite_mpiomp) THEN222 ! Reprend la formule qui calcule PH en fonction de PP=play223 DO LL = 2, KLEV224 HREF(LL) = EXP((LOG(presnivs(LL)) + LOG(presnivs(LL - 1))) / 2.)225 end DO226 HREF(KLEV + 1) = 0.227 HREF(1) = 2. * presnivs(1) - HREF(2)228 ELSE229 HREF(1:KLEV)=PH(KLON/2,1:KLEV)230 ENDIF231 193 232 194 LAUNCH=0 233 195 LTROP =0 234 196 DO LL = 1, KLEV 235 IF ( HREF(LL) / HREF(1) > XLAUNCH) LAUNCH = LL197 IF (PH(KLON / 2, LL) / PH(KLON / 2, 1) > XLAUNCH) LAUNCH = LL 236 198 ENDDO 237 199 DO LL = 1, KLEV 238 IF ( HREF(LL) / HREF(1) > XTROP) LTROP = LL200 IF (PH(KLON / 2, LL) / PH(KLON / 2, 1) > XTROP) LTROP = LL 239 201 ENDDO 240 !LAUNCH=22 ; LTROP=33241 ! print*,'LAUNCH=',LAUNCH,'LTROP=',LTROP242 202 243 203 ! Log pressure vert. coordinate … … 285 245 ! waves characteristics in an almost stochastic way 286 246 287 DO JW = 1, NW 247 JW = 0 248 DO JP = 1, NP 249 DO JK = 1, NK 250 DO JO = 1, NO 251 JW = JW + 1 288 252 ! Angle 289 253 DO II = 1, KLON 290 254 ! Angle (0 or PI so far) 291 RAN_NUM_1=MOD(TT(II, JW) * 10., 1.) 292 RAN_NUM_2= MOD(TT(II, JW) * 100., 1.) 293 ZP(JW, II) = (SIGN(1., 0.5 - RAN_NUM_1) + 1.) & 255 ZP(JW, II) = (SIGN(1., 0.5 - MOD(TT(II, JW) * 10., 1.)) + 1.) & 294 256 * RPI / 2. 295 257 ! Horizontal wavenumber amplitude 296 ZK(JW, II) = KMIN + (KMAX - KMIN) * RAN_NUM_2258 ZK(JW, II) = KMIN + (KMAX - KMIN) * MOD(TT(II, JW) * 100., 1.) 297 259 ! Horizontal phase speed 298 260 CPHA = 0. 299 261 DO JJ = 1, NA 300 RAN_NUM_3=MOD(TT(II, JW+3*JJ)**2, 1.)301 262 CPHA = CPHA + & 302 CMAX*2.*(RAN_NUM_3-0.5)*SQRT(3.)/SQRT(NA*1.)263 CMAX*2.*(MOD(TT(II, JW+3*JJ)**2, 1.)-0.5)*SQRT(3.)/SQRT(NA*1.) 303 264 END DO 304 265 IF (CPHA.LT.0.) THEN … … 315 276 RUW0(JW, II) = RUWMAX 316 277 ENDDO 317 ENDDO 278 end DO 279 end DO 280 end DO 318 281 319 282 ! 4. COMPUTE THE FLUXES … … 454 417 ENDDO 455 418 456 457 419 END SUBROUTINE FLOTT_GWD_RANDO 458 420
Note: See TracChangeset
for help on using the changeset viewer.