source: trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/ye @ 1766

Last change on this file since 1766 was 17, checked in by aslmd, 14 years ago

spiga:mineur

File size: 5.6 KB
Line 
1189a190,195
2> !!!!!!!!!!!!!! TEST NaN: ne fonction qu'avec r4 i4
3> integer :: mask_nan = 2139095040
4> integer :: chuck_norris
5> !!!!!!!!!!!!!! TEST NaN: ne fonction qu'avec r4 i4
6>
7>
8207a214,222
9>                          !!!!$OMP PARALLEL DO   &
10>                          !!!!$OMP PRIVATE ( ij ,i,j,k,its,ite,jts,jte)
11>                          !!!DO ij = 1 , num_tiles
12>                          !!!   its = i_start(ij)
13>                          !!!   ite = i_end(ij)
14>                          !!!   jts = j_start(ij)
15>                          !!!   jte = j_end(ij)
16>                          !!!ENDDO
17>                          !!!!$OMP END PARALLEL DO
18249,253d263
19< PRINT *, ips, ipe, jps, jpe
20< PRINT *, ngrid
21<
22<
23<
24333,372c343,360
25< !IF ((MAXVAL(t) > 500).OR.(MINVAL(t,MASK = t > 0) <= 50)) THEN
26< !        PRINT *,'******************   CRASH   *******************'
27< !        PRINT *,'Irrealistic temperature...', MAXLOC(t), MINLOC(t)
28< !PRINT *, t
29< !        PRINT *,'************************************************'
30< !        STOP
31< !ENDIF   
32< !
33< !!! PB SAUF SI debug = 200 ?!!?
34< !IF (float(itimestep) > 200.) THEN        ! to allow initialisation with zero-wind or constant
35< !                                         ! and allow some outputs to locate the NaNs :)
36< !IF (         (abs(MAXVAL(u)) == 0.) &
37< !        .OR. (MINVAL(u) > MAXVAL(u)) &
38< !        .OR. (abs(MAXVAL(v)) == 0.) &
39< !        .OR. (MINVAL(v) > MAXVAL(v)) ) THEN
40< !!IF (          (ANY(isNaN(u)) .EQV. .true.) &
41< !!         .OR. (ANY(isNaN(v)) .EQV. .true.) & 
42< !!         .OR. (ANY(isNaN(t)) .EQV. .true.) ) THEN
43< !IF (         ANY(u*0. /= 0.) &
44< !        .OR. ANY(v*0. /= 0.)        ) THEN
45< !        PRINT *,'******************   CRASH   *******************'
46< !        PRINT *,'************************************************'
47< !        PRINT *,'NaN appeared in the simulation ...'
48< !        PRINT *,'...this may be due to numerical or dynamical instability'
49< !        PRINT *,'************************************************'
50< !        PRINT *,'POSSIBLE SOLUTIONS:'
51< !        PRINT *,'>> IF nonhydrostatic mode,'
52< !        PRINT *,'   --> check that smdiv, emdiv and epssm are not 0.'
53< !        PRINT *,'>> IF cfl is violated, '
54< !        PRINT *,'   --> try to lower the dynamical timestep'
55< !        PRINT *,'>> IF topographical gradients are high near specified bdy,'
56< !        PRINT *,'   --> try to redefine the domain'
57< !        PRINT *,'************************************************'
58< !        STOP
59< !ENDIF
60< !ENDIF
61<         !IF (          ANY(isNaN(u)) &
62<         !         .OR. ANY(isNaN(v)) &
63<         !         .OR. ANY(isNaN(t)) ) THEN
64<         ! >>> ne marche qu'avec g95
65---
66> chuck_norris = transfer( u(1,1,1),chuck_norris )        !! astuce J. Lefrere - test NaN or Inf
67> IF ( iand( chuck_norris,mask_nan ) == mask_nan ) THEN   !! astuce J. Lefrere - test NaN or Inf
68>         PRINT *, u(1,1,1)
69>         PRINT *,'******************   CRASH   *******************'
70>         PRINT *,'************************************************'
71>         PRINT *,'NaN or Inf appeared in the simulation ...'
72>         PRINT *,'...this may be due to numerical or dynamical instability'
73>         PRINT *,'************************************************'
74>         PRINT *,'POSSIBLE SOLUTIONS:'
75>         PRINT *,'>> IF nonhydrostatic mode,'
76>         PRINT *,'   --> check that smdiv, emdiv and epssm are not 0.'
77>         PRINT *,'>> IF cfl is violated, '
78>         PRINT *,'   --> try to lower the dynamical timestep'
79>         PRINT *,'>> IF topographical gradients are high near specified bdy,'
80>         PRINT *,'   --> try to redefine the domain'
81>         PRINT *,'************************************************'
82>         STOP
83> ENDIF
84379d366
85<
8659a60,61
87>    !INTEGER :: grandn !!MARS
88>
893238a3241,3277
90> !! pour gagner encore plus de place, puisqu'en LES p et ph varient peu selon le domaine
91> !! on prend la valeur au point 1,1 car la moyenne impose du jonglage avec calc. parall.
92>      IF ( (ips .eq. 1) .and. (jps .eq. 1) ) THEN
93>        PRINT *, 'save profile'
94>        DO kk = kps, MIN(kpe,kde-1)
95>           grid%pprof(kk) = grid%ptot(ips,kk,jps)
96>           grid%phprof(kk) = grid%phtot(ips,kk,jps)
97>        ENDDO
98>      ENDIF
99>   
100>      !! attention, fonctionne seulement en cas de vent nul !!
101>      grid%tketot  = 0.5 * (grid%u_2*grid%u_2 + grid%v_2*grid%v_2 + grid%w_2*grid%w_2) + grid%tke_2
102>      !! attention, fonctionne seulement en cas de vent nul !!
103>
104>      !grandn = FLOAT(ide-ids-2+1)*FLOAT(jde-jds-2+1)
105>      !DO kk = kps, MIN(kpe,kde-1)
106>      ! grid%thprof(kk) = grid%t_2(ids+1,kk,jds+1) / grandn
107>      ! DO jj = jds+2, jde-1
108>      ! DO ii = ids+2, ide-1
109>      !  grid%thprof(kk) = grid%thprof(kk) + grid%t_2(ii,kk,jj) / grandn
110>      !  IF (grid%t_2(ii,kk,jj) .eq. 0.) print *,'zero t',ii,kk,jj
111>      ! ENDDO
112>      ! ENDDO
113>      !ENDDO
114>
115> !     DO kk = kps, MIN(kpe,kde-1)
116> !      grid%pprof(kk) = grid%ptot(ips,kk,jps) / FLOAT(MIN(ipe,ide-1) - ips + 1) / FLOAT(MIN(jpe,jde-1) - jps + 1)
117> !      grid%phprof(kk) = grid%phtot(ips,kk,jps) / FLOAT(MIN(ipe,ide-1) - ips + 1) / FLOAT(MIN(jpe,jde-1) - jps + 1)
118> !     DO jj = jps+1, MIN(jpe,jde-1)
119> !     DO ii = ips+1, MIN(ipe,ide-1)
120> !         grid%pprof(kk) = grid%pprof(kk) + grid%ptot(ii,kk,jj) / FLOAT(MIN(ipe,ide-1) - ips + 1) / FLOAT(MIN(jpe,jde-1) - jps + 1)
121> !         grid%phprof(kk) = grid%phprof(kk) + grid%phtot(ii,kk,jj) / FLOAT(MIN(ipe,ide-1) - ips + 1) / FLOAT(MIN(jpe,jde-1) - jps + 1)
122> !         IF (grid%phtot(ii,kk,jj) .eq. 0.) print *,'zero ph',ii,kk,jj
123> !         IF (grid%ptot(ii,kk,jj) .eq. 0.) print *,'zero p',ii,kk,jj
124> !     ENDDO
125> !     ENDDO
126> !     ENDDO
Note: See TracBrowser for help on using the repository browser.