/[lmdze]/trunk/Sources/phylmd/phyetat0.f
ViewVC logotype

Diff of /trunk/Sources/phylmd/phyetat0.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 22 by guez, Fri Jul 31 15:18:47 2009 UTC revision 43 by guez, Fri Apr 8 12:43:31 2011 UTC
# Line 25  contains Line 25  contains
25      USE indicesol, ONLY : epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf      USE indicesol, ONLY : epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf
26      USE dimsoil, ONLY : nsoilmx      USE dimsoil, ONLY : nsoilmx
27      USE temps, ONLY : itau_phy      USE temps, ONLY : itau_phy
28      use netcdf, only: nf90_get_att, nf90_global      use netcdf, only: nf90_get_att, nf90_global, nf90_inq_varid, NF90_NOERR
29      use netcdf95, only: handle_err      use netcdf95, only: handle_err, nf95_get_var
30      use dimphy, only: zmasq, klev      use dimphy, only: zmasq, klev
31    
32      include "netcdf.inc"      include "netcdf.inc"
# Line 82  contains Line 82  contains
82    
83      print *, 'fichnom = ', fichnom      print *, 'fichnom = ', fichnom
84      ierr = NF_OPEN (fichnom, NF_NOWRITE,nid)      ierr = NF_OPEN (fichnom, NF_NOWRITE,nid)
85      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
86         write(6,*)' Pb d''ouverture du fichier '//fichnom         write(6,*)' Pb d''ouverture du fichier '//fichnom
87         write(6,*)' ierr = ', ierr         write(6,*)' ierr = ', ierr
88         STOP 1         STOP 1
# Line 93  contains Line 93  contains
93    
94      ! Lecture des latitudes (coordonnees):      ! Lecture des latitudes (coordonnees):
95    
96      ierr = NF_INQ_VARID (nid, "latitude", nvarid)      ierr = NF90_INQ_VARID (nid, "latitude", nvarid)
97      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
98         PRINT*, 'phyetat0: Le champ <latitude> est absent'         PRINT *, 'phyetat0: Le champ <latitude> est absent'
99         stop 1         stop 1
100      ENDIF      ENDIF
101      ierr = NF_GET_VAR_REAL(nid, nvarid, rlat)      ierr = NF_GET_VAR_REAL(nid, nvarid, rlat)
102      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
103         PRINT*, 'phyetat0: Lecture echouee pour <latitude>'         PRINT *, 'phyetat0: Lecture echouee pour <latitude>'
104         stop 1         stop 1
105      ENDIF      ENDIF
106    
107      ! Lecture des longitudes (coordonnees):      ! Lecture des longitudes (coordonnees):
108    
109      ierr = NF_INQ_VARID (nid, "longitude", nvarid)      ierr = NF90_INQ_VARID (nid, "longitude", nvarid)
110      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
111         PRINT*, 'phyetat0: Le champ <longitude> est absent'         PRINT *, 'phyetat0: Le champ <longitude> est absent'
112         stop 1         stop 1
113      ENDIF      ENDIF
114      ierr = NF_GET_VAR_REAL(nid, nvarid, rlon)      ierr = NF_GET_VAR_REAL(nid, nvarid, rlon)
115      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
116         PRINT*, 'phyetat0: Lecture echouee pour <latitude>'         PRINT *, 'phyetat0: Lecture echouee pour <latitude>'
117         stop 1         stop 1
118      ENDIF      ENDIF
119    
120    
121      ! Lecture du masque terre mer      ! Lecture du masque terre mer
122    
123      ierr = NF_INQ_VARID (nid, "masque", nvarid)      ierr = NF90_INQ_VARID (nid, "masque", nvarid)
124      IF (ierr .EQ.  NF_NOERR) THEN      IF (ierr ==  NF90_NOERR) THEN
125         ierr = NF_GET_VAR_REAL(nid, nvarid, zmasq)         call nf95_get_var(nid, nvarid, zmasq)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <masque>'  
           stop 1  
        ENDIF  
126      else      else
127         PRINT*, 'phyetat0: Le champ <masque> est absent'         PRINT *, 'phyetat0: Le champ <masque> est absent'
128         PRINT*, 'fichier startphy non compatible avec phyetat0'         PRINT *, 'fichier startphy non compatible avec phyetat0'
129         !      stop 1         !      stop 1
130      ENDIF      ENDIF
131      ! Lecture des fractions pour chaque sous-surface      ! Lecture des fractions pour chaque sous-surface
# Line 140  contains Line 136  contains
136    
137      ! fraction de terre      ! fraction de terre
138    
139      ierr = NF_INQ_VARID (nid, "FTER", nvarid)      ierr = NF90_INQ_VARID (nid, "FTER", nvarid)
140      IF (ierr .EQ.  NF_NOERR) THEN      IF (ierr ==  NF90_NOERR) THEN
141         ierr = NF_GET_VAR_REAL(nid, nvarid, pctsrf(1 : klon,is_ter))         call nf95_get_var(nid, nvarid, pctsrf(1 : klon,is_ter))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <FTER>'  
           stop 1  
        ENDIF  
142      else      else
143         PRINT*, 'phyetat0: Le champ <FTER> est absent'         PRINT *, 'phyetat0: Le champ <FTER> est absent'
144         !$$$         stop 1         !$$$         stop 1
145      ENDIF      ENDIF
146    
147      ! fraction de glace de terre      ! fraction de glace de terre
148    
149      ierr = NF_INQ_VARID (nid, "FLIC", nvarid)      ierr = NF90_INQ_VARID (nid, "FLIC", nvarid)
150      IF (ierr .EQ.  NF_NOERR) THEN      IF (ierr ==  NF90_NOERR) THEN
151         ierr = NF_GET_VAR_REAL(nid, nvarid, pctsrf(1 : klon,is_lic))         call nf95_get_var(nid, nvarid, pctsrf(1 : klon,is_lic))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <FLIC>'  
           stop 1  
        ENDIF  
152      else      else
153         PRINT*, 'phyetat0: Le champ <FLIC> est absent'         PRINT *, 'phyetat0: Le champ <FLIC> est absent'
154         !$$$         stop 1         !$$$         stop 1
155      ENDIF      ENDIF
156    
157      ! fraction d'ocean      ! fraction d'ocean
158    
159      ierr = NF_INQ_VARID (nid, "FOCE", nvarid)      ierr = NF90_INQ_VARID (nid, "FOCE", nvarid)
160      IF (ierr .EQ.  NF_NOERR) THEN      IF (ierr ==  NF90_NOERR) THEN
161         ierr = NF_GET_VAR_REAL(nid, nvarid, pctsrf(1 : klon,is_oce))         call nf95_get_var(nid, nvarid, pctsrf(1 : klon,is_oce))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <FOCE>'  
           stop 1  
        ENDIF  
162      else      else
163         PRINT*, 'phyetat0: Le champ <FOCE> est absent'         PRINT *, 'phyetat0: Le champ <FOCE> est absent'
164         !$$$         stop 1         !$$$         stop 1
165      ENDIF      ENDIF
166    
167      ! fraction glace de mer      ! fraction glace de mer
168    
169      ierr = NF_INQ_VARID (nid, "FSIC", nvarid)      ierr = NF90_INQ_VARID (nid, "FSIC", nvarid)
170      IF (ierr .EQ.  NF_NOERR) THEN      IF (ierr ==  NF90_NOERR) THEN
171         ierr = NF_GET_VAR_REAL(nid, nvarid, pctsrf(1 : klon, is_sic))         call nf95_get_var(nid, nvarid, pctsrf(1 : klon, is_sic))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <FSIC>'  
           stop 1  
        ENDIF  
172      else      else
173         PRINT*, 'phyetat0: Le champ <FSIC> est absent'         PRINT *, 'phyetat0: Le champ <FSIC> est absent'
174         !$$$         stop 1         !$$$         stop 1
175      ENDIF      ENDIF
176    
# Line 217  contains Line 197  contains
197    
198      ! Lecture des temperatures du sol:      ! Lecture des temperatures du sol:
199    
200      ierr = NF_INQ_VARID (nid, "TS", nvarid)      ierr = NF90_INQ_VARID (nid, "TS", nvarid)
201      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
202         PRINT*, 'phyetat0: Le champ <TS> est absent'         PRINT *, 'phyetat0: Le champ <TS> est absent'
203         PRINT*, '          Mais je vais essayer de lire TS**'         PRINT *, '          Mais je vais essayer de lire TS**'
204         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
205            IF (nsrf.GT.99) THEN            IF (nsrf.GT.99) THEN
206               PRINT*, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
207               stop 1               stop 1
208            ENDIF            ENDIF
209            WRITE(str2,'(i2.2)') nsrf            WRITE(str2,'(i2.2)') nsrf
210            ierr = NF_INQ_VARID (nid, "TS"//str2, nvarid)            ierr = NF90_INQ_VARID (nid, "TS"//str2, nvarid)
211            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
212               PRINT*, "phyetat0: Le champ <TS"//str2//"> est absent"               PRINT *, "phyetat0: Le champ <TS"//str2//"> est absent"
213               stop 1               stop 1
214            ENDIF            ENDIF
215            ierr = NF_GET_VAR_REAL(nid, nvarid, tsol(1,nsrf))            ierr = NF_GET_VAR_REAL(nid, nvarid, tsol(1,nsrf))
216            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
217               PRINT*, "phyetat0: Lecture echouee pour <TS"//str2//">"               PRINT *, "phyetat0: Lecture echouee pour <TS"//str2//">"
218               stop 1               stop 1
219            ENDIF            ENDIF
220            xmin = 1.0E+20            xmin = 1.0E+20
# Line 243  contains Line 223  contains
223               xmin = MIN(tsol(i,nsrf),xmin)               xmin = MIN(tsol(i,nsrf),xmin)
224               xmax = MAX(tsol(i,nsrf),xmax)               xmax = MAX(tsol(i,nsrf),xmax)
225            ENDDO            ENDDO
226            PRINT*,'Temperature du sol TS**:', nsrf, xmin, xmax            PRINT *,'Temperature du sol TS**:', nsrf, xmin, xmax
227         ENDDO         ENDDO
228      ELSE      ELSE
229         PRINT*, 'phyetat0: Le champ <TS> est present'         PRINT *, 'phyetat0: Le champ <TS> est present'
230         PRINT*, '          J ignore donc les autres temperatures TS**'         PRINT *, '          J ignore donc les autres temperatures TS**'
231         ierr = NF_GET_VAR_REAL(nid, nvarid, tsol(1,1))         call nf95_get_var(nid, nvarid, tsol(:,1))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <TS>"  
           stop 1  
        ENDIF  
232         xmin = 1.0E+20         xmin = 1.0E+20
233         xmax = -1.0E+20         xmax = -1.0E+20
234         DO i = 1, klon         DO i = 1, klon
235            xmin = MIN(tsol(i,1),xmin)            xmin = MIN(tsol(i,1),xmin)
236            xmax = MAX(tsol(i,1),xmax)            xmax = MAX(tsol(i,1),xmax)
237         ENDDO         ENDDO
238         PRINT*,'Temperature du sol <TS>', xmin, xmax         PRINT *,'Temperature du sol <TS>', xmin, xmax
239         DO nsrf = 2, nbsrf         DO nsrf = 2, nbsrf
240            DO i = 1, klon            DO i = 1, klon
241               tsol(i,nsrf) = tsol(i,1)               tsol(i,nsrf) = tsol(i,1)
# Line 272  contains Line 248  contains
248      DO nsrf = 1, nbsrf      DO nsrf = 1, nbsrf
249         DO isoil=1, nsoilmx         DO isoil=1, nsoilmx
250            IF (isoil.GT.99 .AND. nsrf.GT.99) THEN            IF (isoil.GT.99 .AND. nsrf.GT.99) THEN
251               PRINT*, "Trop de couches ou sous-mailles"               PRINT *, "Trop de couches ou sous-mailles"
252               stop 1               stop 1
253            ENDIF            ENDIF
254            WRITE(str7,'(i2.2,"srf",i2.2)') isoil, nsrf            WRITE(str7,'(i2.2,"srf",i2.2)') isoil, nsrf
255            ierr = NF_INQ_VARID (nid, 'Tsoil'//str7, nvarid)            ierr = NF90_INQ_VARID (nid, 'Tsoil'//str7, nvarid)
256            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
257               PRINT*, "phyetat0: Le champ <Tsoil"//str7//"> est absent"               PRINT *, "phyetat0: Le champ <Tsoil"//str7//"> est absent"
258               PRINT*, "          Il prend donc la valeur de surface"               PRINT *, "          Il prend donc la valeur de surface"
259               DO i=1, klon               DO i=1, klon
260                  tsoil(i,isoil,nsrf)=tsol(i,nsrf)                  tsoil(i,isoil,nsrf)=tsol(i,nsrf)
261               ENDDO               ENDDO
262            ELSE            ELSE
263               ierr = NF_GET_VAR_REAL(nid, nvarid, tsoil(1,isoil,nsrf))               ierr = NF_GET_VAR_REAL(nid, nvarid, tsoil(1,isoil,nsrf))
264               IF (ierr.NE.NF_NOERR) THEN               IF (ierr.NE.NF90_NOERR) THEN
265                  PRINT*, "Lecture echouee pour <Tsoil"//str7//">"                  PRINT *, "Lecture echouee pour <Tsoil"//str7//">"
266                  stop 1                  stop 1
267               ENDIF               ENDIF
268            ENDIF            ENDIF
# Line 298  contains Line 274  contains
274      ! Lecture de tslab (pour slab ocean seulement):            ! Lecture de tslab (pour slab ocean seulement):      
275    
276      IF (ocean .eq. 'slab  ') then      IF (ocean .eq. 'slab  ') then
277         ierr = NF_INQ_VARID (nid, "TSLAB", nvarid)         ierr = NF90_INQ_VARID (nid, "TSLAB", nvarid)
278         IF (ierr.NE.NF_NOERR) THEN         IF (ierr.NE.NF90_NOERR) THEN
279            PRINT*, "phyetat0: Le champ <TSLAB> est absent"            PRINT *, "phyetat0: Le champ <TSLAB> est absent"
           stop 1  
        ENDIF  
        ierr = NF_GET_VAR_REAL(nid, nvarid, tslab)  
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <TSLAB>"  
280            stop 1            stop 1
281         ENDIF         ENDIF
282           call nf95_get_var(nid, nvarid, tslab)
283         xmin = 1.0E+20         xmin = 1.0E+20
284         xmax = -1.0E+20         xmax = -1.0E+20
285         DO i = 1, klon         DO i = 1, klon
286            xmin = MIN(tslab(i),xmin)            xmin = MIN(tslab(i),xmin)
287            xmax = MAX(tslab(i),xmax)            xmax = MAX(tslab(i),xmax)
288         ENDDO         ENDDO
289         PRINT*,'Ecart de la SST tslab:', xmin, xmax         PRINT *,'Ecart de la SST tslab:', xmin, xmax
290    
291         ! Lecture de seaice (pour slab ocean seulement):         ! Lecture de seaice (pour slab ocean seulement):
292    
293         ierr = NF_INQ_VARID (nid, "SEAICE", nvarid)         ierr = NF90_INQ_VARID (nid, "SEAICE", nvarid)
294         IF (ierr.NE.NF_NOERR) THEN         IF (ierr.NE.NF90_NOERR) THEN
295            PRINT*, "phyetat0: Le champ <SEAICE> est absent"            PRINT *, "phyetat0: Le champ <SEAICE> est absent"
           stop 1  
        ENDIF  
        ierr = NF_GET_VAR_REAL(nid, nvarid, seaice)  
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <SEAICE>"  
296            stop 1            stop 1
297         ENDIF         ENDIF
298           call nf95_get_var(nid, nvarid, seaice)
299         xmin = 1.0E+20         xmin = 1.0E+20
300         xmax = -1.0E+20         xmax = -1.0E+20
301         DO i = 1, klon         DO i = 1, klon
302            xmin = MIN(seaice(i),xmin)            xmin = MIN(seaice(i),xmin)
303            xmax = MAX(seaice(i),xmax)            xmax = MAX(seaice(i),xmax)
304         ENDDO         ENDDO
305         PRINT*,'Masse de la glace de mer seaice:', xmin, xmax         PRINT *,'Masse de la glace de mer seaice:', xmin, xmax
306      ELSE      ELSE
307         tslab = 0.         tslab = 0.
308         seaice = 0.         seaice = 0.
# Line 342  contains Line 310  contains
310    
311      ! Lecture de l'humidite de l'air juste au dessus du sol:      ! Lecture de l'humidite de l'air juste au dessus du sol:
312    
313      ierr = NF_INQ_VARID (nid, "QS", nvarid)      ierr = NF90_INQ_VARID (nid, "QS", nvarid)
314      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
315         PRINT*, 'phyetat0: Le champ <QS> est absent'         PRINT *, 'phyetat0: Le champ <QS> est absent'
316         PRINT*, '          Mais je vais essayer de lire QS**'         PRINT *, '          Mais je vais essayer de lire QS**'
317         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
318            IF (nsrf.GT.99) THEN            IF (nsrf.GT.99) THEN
319               PRINT*, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
320               stop 1               stop 1
321            ENDIF            ENDIF
322            WRITE(str2,'(i2.2)') nsrf            WRITE(str2,'(i2.2)') nsrf
323            ierr = NF_INQ_VARID (nid, "QS"//str2, nvarid)            ierr = NF90_INQ_VARID (nid, "QS"//str2, nvarid)
324            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
325               PRINT*, "phyetat0: Le champ <QS"//str2//"> est absent"               PRINT *, "phyetat0: Le champ <QS"//str2//"> est absent"
326               stop 1               stop 1
327            ENDIF            ENDIF
328            ierr = NF_GET_VAR_REAL(nid, nvarid, qsurf(1,nsrf))            ierr = NF_GET_VAR_REAL(nid, nvarid, qsurf(1,nsrf))
329            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
330               PRINT*, "phyetat0: Lecture echouee pour <QS"//str2//">"               PRINT *, "phyetat0: Lecture echouee pour <QS"//str2//">"
331               stop 1               stop 1
332            ENDIF            ENDIF
333            xmin = 1.0E+20            xmin = 1.0E+20
# Line 368  contains Line 336  contains
336               xmin = MIN(qsurf(i,nsrf),xmin)               xmin = MIN(qsurf(i,nsrf),xmin)
337               xmax = MAX(qsurf(i,nsrf),xmax)               xmax = MAX(qsurf(i,nsrf),xmax)
338            ENDDO            ENDDO
339            PRINT*,'Humidite pres du sol QS**:', nsrf, xmin, xmax            PRINT *,'Humidite pres du sol QS**:', nsrf, xmin, xmax
340         ENDDO         ENDDO
341      ELSE      ELSE
342         PRINT*, 'phyetat0: Le champ <QS> est present'         PRINT *, 'phyetat0: Le champ <QS> est present'
343         PRINT*, '          J ignore donc les autres humidites QS**'         PRINT *, '          J ignore donc les autres humidites QS**'
344         ierr = NF_GET_VAR_REAL(nid, nvarid, qsurf(1,1))         call nf95_get_var(nid, nvarid, qsurf(:,1))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <QS>"  
           stop 1  
        ENDIF  
345         xmin = 1.0E+20         xmin = 1.0E+20
346         xmax = -1.0E+20         xmax = -1.0E+20
347         DO i = 1, klon         DO i = 1, klon
348            xmin = MIN(qsurf(i,1),xmin)            xmin = MIN(qsurf(i,1),xmin)
349            xmax = MAX(qsurf(i,1),xmax)            xmax = MAX(qsurf(i,1),xmax)
350         ENDDO         ENDDO
351         PRINT*,'Humidite pres du sol <QS>', xmin, xmax         PRINT *,'Humidite pres du sol <QS>', xmin, xmax
352         DO nsrf = 2, nbsrf         DO nsrf = 2, nbsrf
353            DO i = 1, klon            DO i = 1, klon
354               qsurf(i,nsrf) = qsurf(i,1)               qsurf(i,nsrf) = qsurf(i,1)
# Line 394  contains Line 358  contains
358    
359      ! Eau dans le sol (pour le modele de sol "bucket")      ! Eau dans le sol (pour le modele de sol "bucket")
360    
361      ierr = NF_INQ_VARID (nid, "QSOL", nvarid)      ierr = NF90_INQ_VARID(nid, "QSOL", nvarid)
362      IF (ierr .EQ.  NF_NOERR) THEN      IF (ierr ==  NF90_NOERR) THEN
363         ierr = NF_GET_VAR_REAL(nid, nvarid, qsol)         call nf95_get_var(nid, nvarid, qsol)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <QSOL>'  
           stop 1  
        ENDIF  
364      else      else
365         PRINT*, 'phyetat0: Le champ <QSOL> est absent'         PRINT *, 'phyetat0: Le champ <QSOL> est absent'
366         PRINT*, '          Valeur par defaut nulle'         PRINT *, '          Valeur par defaut nulle'
367         qsol(:)=0.         qsol = 0.
        !$$$         stop 1  
368      ENDIF      ENDIF
369      xmin = 1.0E+20      xmin = 1.0E+20
370      xmax = -1.0E+20      xmax = -1.0E+20
# Line 413  contains Line 372  contains
372         xmin = MIN(qsol(i),xmin)         xmin = MIN(qsol(i),xmin)
373         xmax = MAX(qsol(i),xmax)         xmax = MAX(qsol(i),xmax)
374      ENDDO      ENDDO
375      PRINT*,'Eau dans le sol (mm) <QSOL>', xmin, xmax      PRINT *,'Eau dans le sol (mm) <QSOL>', xmin, xmax
376    
377      ! Lecture de neige au sol:      ! Lecture de neige au sol:
378    
379      ierr = NF_INQ_VARID (nid, "SNOW", nvarid)      ierr = NF90_INQ_VARID (nid, "SNOW", nvarid)
380      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
381         PRINT*, 'phyetat0: Le champ <SNOW> est absent'         PRINT *, 'phyetat0: Le champ <SNOW> est absent'
382         PRINT*, '          Mais je vais essayer de lire SNOW**'         PRINT *, '          Mais je vais essayer de lire SNOW**'
383         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
384            IF (nsrf.GT.99) THEN            IF (nsrf.GT.99) THEN
385               PRINT*, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
386               stop 1               stop 1
387            ENDIF            ENDIF
388            WRITE(str2,'(i2.2)') nsrf            WRITE(str2,'(i2.2)') nsrf
389            ierr = NF_INQ_VARID (nid, "SNOW"//str2, nvarid)            ierr = NF90_INQ_VARID (nid, "SNOW"//str2, nvarid)
390            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
391               PRINT*, "phyetat0: Le champ <SNOW"//str2//"> est absent"               PRINT *, "phyetat0: Le champ <SNOW"//str2//"> est absent"
392               stop 1               stop 1
393            ENDIF            ENDIF
394            ierr = NF_GET_VAR_REAL(nid, nvarid, snow(1,nsrf))            ierr = NF_GET_VAR_REAL(nid, nvarid, snow(1,nsrf))
395            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
396               PRINT*, "phyetat0: Lecture echouee pour <SNOW"//str2//">"               PRINT *, "phyetat0: Lecture echouee pour <SNOW"//str2//">"
397               stop 1               stop 1
398            ENDIF            ENDIF
399            xmin = 1.0E+20            xmin = 1.0E+20
# Line 443  contains Line 402  contains
402               xmin = MIN(snow(i,nsrf),xmin)               xmin = MIN(snow(i,nsrf),xmin)
403               xmax = MAX(snow(i,nsrf),xmax)               xmax = MAX(snow(i,nsrf),xmax)
404            ENDDO            ENDDO
405            PRINT*,'Neige du sol SNOW**:', nsrf, xmin, xmax            PRINT *,'Neige du sol SNOW**:', nsrf, xmin, xmax
406         ENDDO         ENDDO
407      ELSE      ELSE
408         PRINT*, 'phyetat0: Le champ <SNOW> est present'         PRINT *, 'phyetat0: Le champ <SNOW> est present'
409         PRINT*, '          J ignore donc les autres neiges SNOW**'         PRINT *, '          J ignore donc les autres neiges SNOW**'
410         ierr = NF_GET_VAR_REAL(nid, nvarid, snow(1,1))         call nf95_get_var(nid, nvarid, snow(:,1))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <SNOW>"  
           stop 1  
        ENDIF  
411         xmin = 1.0E+20         xmin = 1.0E+20
412         xmax = -1.0E+20         xmax = -1.0E+20
413         DO i = 1, klon         DO i = 1, klon
414            xmin = MIN(snow(i,1),xmin)            xmin = MIN(snow(i,1),xmin)
415            xmax = MAX(snow(i,1),xmax)            xmax = MAX(snow(i,1),xmax)
416         ENDDO         ENDDO
417         PRINT*,'Neige du sol <SNOW>', xmin, xmax         PRINT *,'Neige du sol <SNOW>', xmin, xmax
418         DO nsrf = 2, nbsrf         DO nsrf = 2, nbsrf
419            DO i = 1, klon            DO i = 1, klon
420               snow(i,nsrf) = snow(i,1)               snow(i,nsrf) = snow(i,1)
# Line 469  contains Line 424  contains
424    
425      ! Lecture de albedo au sol:      ! Lecture de albedo au sol:
426    
427      ierr = NF_INQ_VARID (nid, "ALBE", nvarid)      ierr = NF90_INQ_VARID (nid, "ALBE", nvarid)
428      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
429         PRINT*, 'phyetat0: Le champ <ALBE> est absent'         PRINT *, 'phyetat0: Le champ <ALBE> est absent'
430         PRINT*, '          Mais je vais essayer de lire ALBE**'         PRINT *, '          Mais je vais essayer de lire ALBE**'
431         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
432            IF (nsrf.GT.99) THEN            IF (nsrf.GT.99) THEN
433               PRINT*, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
434               stop 1               stop 1
435            ENDIF            ENDIF
436            WRITE(str2,'(i2.2)') nsrf            WRITE(str2,'(i2.2)') nsrf
437            ierr = NF_INQ_VARID (nid, "ALBE"//str2, nvarid)            ierr = NF90_INQ_VARID (nid, "ALBE"//str2, nvarid)
438            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
439               PRINT*, "phyetat0: Le champ <ALBE"//str2//"> est absent"               PRINT *, "phyetat0: Le champ <ALBE"//str2//"> est absent"
440               stop 1               stop 1
441            ENDIF            ENDIF
442            ierr = NF_GET_VAR_REAL(nid, nvarid, albe(1,nsrf))            ierr = NF_GET_VAR_REAL(nid, nvarid, albe(1,nsrf))
443            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
444               PRINT*, "phyetat0: Lecture echouee pour <ALBE"//str2//">"               PRINT *, "phyetat0: Lecture echouee pour <ALBE"//str2//">"
445               stop 1               stop 1
446            ENDIF            ENDIF
447            xmin = 1.0E+20            xmin = 1.0E+20
# Line 495  contains Line 450  contains
450               xmin = MIN(albe(i,nsrf),xmin)               xmin = MIN(albe(i,nsrf),xmin)
451               xmax = MAX(albe(i,nsrf),xmax)               xmax = MAX(albe(i,nsrf),xmax)
452            ENDDO            ENDDO
453            PRINT*,'Albedo du sol ALBE**:', nsrf, xmin, xmax            PRINT *,'Albedo du sol ALBE**:', nsrf, xmin, xmax
454         ENDDO         ENDDO
455      ELSE      ELSE
456         PRINT*, 'phyetat0: Le champ <ALBE> est present'         PRINT *, 'phyetat0: Le champ <ALBE> est present'
457         PRINT*, '          J ignore donc les autres ALBE**'         PRINT *, '          J ignore donc les autres ALBE**'
458         ierr = NF_GET_VAR_REAL(nid, nvarid, albe(1,1))         call nf95_get_var(nid, nvarid, albe(:,1))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <ALBE>"  
           stop 1  
        ENDIF  
459         xmin = 1.0E+20         xmin = 1.0E+20
460         xmax = -1.0E+20         xmax = -1.0E+20
461         DO i = 1, klon         DO i = 1, klon
462            xmin = MIN(albe(i,1),xmin)            xmin = MIN(albe(i,1),xmin)
463            xmax = MAX(albe(i,1),xmax)            xmax = MAX(albe(i,1),xmax)
464         ENDDO         ENDDO
465         PRINT*,'Neige du sol <ALBE>', xmin, xmax         PRINT *,'Neige du sol <ALBE>', xmin, xmax
466         DO nsrf = 2, nbsrf         DO nsrf = 2, nbsrf
467            DO i = 1, klon            DO i = 1, klon
468               albe(i,nsrf) = albe(i,1)               albe(i,nsrf) = albe(i,1)
# Line 522  contains Line 473  contains
473    
474      ! Lecture de albedo au sol LW:      ! Lecture de albedo au sol LW:
475    
476      ierr = NF_INQ_VARID (nid, "ALBLW", nvarid)      ierr = NF90_INQ_VARID (nid, "ALBLW", nvarid)
477      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
478         PRINT*, 'phyetat0: Le champ <ALBLW> est absent'         PRINT *, 'phyetat0: Le champ <ALBLW> est absent'
479         !        PRINT*, '          Mais je vais essayer de lire ALBLW**'         !        PRINT *, '          Mais je vais essayer de lire ALBLW**'
480         PRINT*, '          Mais je vais prendre ALBE**'         PRINT *, '          Mais je vais prendre ALBE**'
481         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
482            DO i = 1, klon            DO i = 1, klon
483               alblw(i,nsrf) = albe(i,nsrf)               alblw(i,nsrf) = albe(i,nsrf)
484            ENDDO            ENDDO
485         ENDDO         ENDDO
486      ELSE      ELSE
487         PRINT*, 'phyetat0: Le champ <ALBLW> est present'         PRINT *, 'phyetat0: Le champ <ALBLW> est present'
488         PRINT*, '          J ignore donc les autres ALBLW**'         PRINT *, '          J ignore donc les autres ALBLW**'
489         ierr = NF_GET_VAR_REAL(nid, nvarid, alblw(1,1))         call nf95_get_var(nid, nvarid, alblw(:,1))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <ALBLW>"  
           stop 1  
        ENDIF  
490         xmin = 1.0E+20         xmin = 1.0E+20
491         xmax = -1.0E+20         xmax = -1.0E+20
492         DO i = 1, klon         DO i = 1, klon
493            xmin = MIN(alblw(i,1),xmin)            xmin = MIN(alblw(i,1),xmin)
494            xmax = MAX(alblw(i,1),xmax)            xmax = MAX(alblw(i,1),xmax)
495         ENDDO         ENDDO
496         PRINT*,'Neige du sol <ALBLW>', xmin, xmax         PRINT *,'Neige du sol <ALBLW>', xmin, xmax
497         DO nsrf = 2, nbsrf         DO nsrf = 2, nbsrf
498            DO i = 1, klon            DO i = 1, klon
499               alblw(i,nsrf) = alblw(i,1)               alblw(i,nsrf) = alblw(i,1)
# Line 556  contains Line 503  contains
503    
504      ! Lecture de evaporation:        ! Lecture de evaporation:  
505    
506      ierr = NF_INQ_VARID (nid, "EVAP", nvarid)      ierr = NF90_INQ_VARID (nid, "EVAP", nvarid)
507      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
508         PRINT*, 'phyetat0: Le champ <EVAP> est absent'         PRINT *, 'phyetat0: Le champ <EVAP> est absent'
509         PRINT*, '          Mais je vais essayer de lire EVAP**'         PRINT *, '          Mais je vais essayer de lire EVAP**'
510         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
511            IF (nsrf.GT.99) THEN            IF (nsrf.GT.99) THEN
512               PRINT*, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
513               stop 1               stop 1
514            ENDIF            ENDIF
515            WRITE(str2,'(i2.2)') nsrf            WRITE(str2,'(i2.2)') nsrf
516            ierr = NF_INQ_VARID (nid, "EVAP"//str2, nvarid)            ierr = NF90_INQ_VARID (nid, "EVAP"//str2, nvarid)
517            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
518               PRINT*, "phyetat0: Le champ <EVAP"//str2//"> est absent"               PRINT *, "phyetat0: Le champ <EVAP"//str2//"> est absent"
519               stop 1               stop 1
520            ENDIF            ENDIF
521            ierr = NF_GET_VAR_REAL(nid, nvarid, evap(1,nsrf))            ierr = NF_GET_VAR_REAL(nid, nvarid, evap(1,nsrf))
522            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
523               PRINT*, "phyetat0: Lecture echouee pour <EVAP"//str2//">"               PRINT *, "phyetat0: Lecture echouee pour <EVAP"//str2//">"
524               stop 1               stop 1
525            ENDIF            ENDIF
526            xmin = 1.0E+20            xmin = 1.0E+20
# Line 582  contains Line 529  contains
529               xmin = MIN(evap(i,nsrf),xmin)               xmin = MIN(evap(i,nsrf),xmin)
530               xmax = MAX(evap(i,nsrf),xmax)               xmax = MAX(evap(i,nsrf),xmax)
531            ENDDO            ENDDO
532            PRINT*,'evap du sol EVAP**:', nsrf, xmin, xmax            PRINT *,'evap du sol EVAP**:', nsrf, xmin, xmax
533         ENDDO         ENDDO
534      ELSE      ELSE
535         PRINT*, 'phyetat0: Le champ <EVAP> est present'         PRINT *, 'phyetat0: Le champ <EVAP> est present'
536         PRINT*, '          J ignore donc les autres EVAP**'         PRINT *, '          J ignore donc les autres EVAP**'
537         ierr = NF_GET_VAR_REAL(nid, nvarid, evap(1,1))         call nf95_get_var(nid, nvarid, evap(:,1))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <EVAP>"  
           stop 1  
        ENDIF  
538         xmin = 1.0E+20         xmin = 1.0E+20
539         xmax = -1.0E+20         xmax = -1.0E+20
540         DO i = 1, klon         DO i = 1, klon
541            xmin = MIN(evap(i,1),xmin)            xmin = MIN(evap(i,1),xmin)
542            xmax = MAX(evap(i,1),xmax)            xmax = MAX(evap(i,1),xmax)
543         ENDDO         ENDDO
544         PRINT*,'Evap du sol <EVAP>', xmin, xmax         PRINT *,'Evap du sol <EVAP>', xmin, xmax
545         DO nsrf = 2, nbsrf         DO nsrf = 2, nbsrf
546            DO i = 1, klon            DO i = 1, klon
547               evap(i,nsrf) = evap(i,1)               evap(i,nsrf) = evap(i,1)
# Line 608  contains Line 551  contains
551    
552      ! Lecture precipitation liquide:      ! Lecture precipitation liquide:
553    
554      ierr = NF_INQ_VARID (nid, "rain_f", nvarid)      ierr = NF90_INQ_VARID (nid, "rain_f", nvarid)
555      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
556         PRINT*, 'phyetat0: Le champ <rain_f> est absent'         PRINT *, 'phyetat0: Le champ <rain_f> est absent'
557         stop 1         stop 1
558      ENDIF      ENDIF
559      ierr = NF_GET_VAR_REAL(nid, nvarid, rain_fall)      ierr = NF_GET_VAR_REAL(nid, nvarid, rain_fall)
560      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
561         PRINT*, 'phyetat0: Lecture echouee pour <rain_f>'         PRINT *, 'phyetat0: Lecture echouee pour <rain_f>'
562         stop 1         stop 1
563      ENDIF      ENDIF
564      xmin = 1.0E+20      xmin = 1.0E+20
# Line 624  contains Line 567  contains
567         xmin = MIN(rain_fall(i),xmin)         xmin = MIN(rain_fall(i),xmin)
568         xmax = MAX(rain_fall(i),xmax)         xmax = MAX(rain_fall(i),xmax)
569      ENDDO      ENDDO
570      PRINT*,'Precipitation liquide rain_f:', xmin, xmax      PRINT *,'Precipitation liquide rain_f:', xmin, xmax
571    
572      ! Lecture precipitation solide:      ! Lecture precipitation solide:
573    
574      ierr = NF_INQ_VARID (nid, "snow_f", nvarid)      ierr = NF90_INQ_VARID (nid, "snow_f", nvarid)
575      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
576         PRINT*, 'phyetat0: Le champ <snow_f> est absent'         PRINT *, 'phyetat0: Le champ <snow_f> est absent'
577         stop 1         stop 1
578      ENDIF      ENDIF
579      ierr = NF_GET_VAR_REAL(nid, nvarid, snow_fall)      ierr = NF_GET_VAR_REAL(nid, nvarid, snow_fall)
580      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
581         PRINT*, 'phyetat0: Lecture echouee pour <snow_f>'         PRINT *, 'phyetat0: Lecture echouee pour <snow_f>'
582         stop 1         stop 1
583      ENDIF      ENDIF
584      xmin = 1.0E+20      xmin = 1.0E+20
# Line 644  contains Line 587  contains
587         xmin = MIN(snow_fall(i),xmin)         xmin = MIN(snow_fall(i),xmin)
588         xmax = MAX(snow_fall(i),xmax)         xmax = MAX(snow_fall(i),xmax)
589      ENDDO      ENDDO
590      PRINT*,'Precipitation solide snow_f:', xmin, xmax      PRINT *,'Precipitation solide snow_f:', xmin, xmax
591    
592      ! Lecture rayonnement solaire au sol:      ! Lecture rayonnement solaire au sol:
593    
594      ierr = NF_INQ_VARID (nid, "solsw", nvarid)      ierr = NF90_INQ_VARID (nid, "solsw", nvarid)
595      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
596         PRINT*, 'phyetat0: Le champ <solsw> est absent'         PRINT *, 'phyetat0: Le champ <solsw> est absent'
597         PRINT*, 'mis a zero'         PRINT *, 'mis a zero'
598         solsw = 0.         solsw = 0.
599      ELSE      ELSE
600         ierr = NF_GET_VAR_REAL(nid, nvarid, solsw)         call nf95_get_var(nid, nvarid, solsw)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <solsw>'  
           stop 1  
        ENDIF  
601      ENDIF      ENDIF
602      xmin = 1.0E+20      xmin = 1.0E+20
603      xmax = -1.0E+20      xmax = -1.0E+20
# Line 666  contains Line 605  contains
605         xmin = MIN(solsw(i),xmin)         xmin = MIN(solsw(i),xmin)
606         xmax = MAX(solsw(i),xmax)         xmax = MAX(solsw(i),xmax)
607      ENDDO      ENDDO
608      PRINT*,'Rayonnement solaire au sol solsw:', xmin, xmax      PRINT *,'Rayonnement solaire au sol solsw:', xmin, xmax
609    
610      ! Lecture rayonnement IF au sol:      ! Lecture rayonnement IF au sol:
611    
612      ierr = NF_INQ_VARID (nid, "sollw", nvarid)      ierr = NF90_INQ_VARID (nid, "sollw", nvarid)
613      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
614         PRINT*, 'phyetat0: Le champ <sollw> est absent'         PRINT *, 'phyetat0: Le champ <sollw> est absent'
615         PRINT*, 'mis a zero'         PRINT *, 'mis a zero'
616         sollw = 0.         sollw = 0.
617      ELSE      ELSE
618         ierr = NF_GET_VAR_REAL(nid, nvarid, sollw)         call nf95_get_var(nid, nvarid, sollw)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <sollw>'  
           stop 1  
        ENDIF  
619      ENDIF      ENDIF
620      xmin = 1.0E+20      xmin = 1.0E+20
621      xmax = -1.0E+20      xmax = -1.0E+20
# Line 688  contains Line 623  contains
623         xmin = MIN(sollw(i),xmin)         xmin = MIN(sollw(i),xmin)
624         xmax = MAX(sollw(i),xmax)         xmax = MAX(sollw(i),xmax)
625      ENDDO      ENDDO
626      PRINT*,'Rayonnement IF au sol sollw:', xmin, xmax      PRINT *,'Rayonnement IF au sol sollw:', xmin, xmax
627    
628    
629      ! Lecture derive des flux:      ! Lecture derive des flux:
630    
631      ierr = NF_INQ_VARID (nid, "fder", nvarid)      ierr = NF90_INQ_VARID (nid, "fder", nvarid)
632      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
633         PRINT*, 'phyetat0: Le champ <fder> est absent'         PRINT *, 'phyetat0: Le champ <fder> est absent'
634         PRINT*, 'mis a zero'         PRINT *, 'mis a zero'
635         fder = 0.         fder = 0.
636      ELSE      ELSE
637         ierr = NF_GET_VAR_REAL(nid, nvarid, fder)         call nf95_get_var(nid, nvarid, fder)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, 'phyetat0: Lecture echouee pour <fder>'  
           stop 1  
        ENDIF  
638      ENDIF      ENDIF
639      xmin = 1.0E+20      xmin = 1.0E+20
640      xmax = -1.0E+20      xmax = -1.0E+20
# Line 711  contains Line 642  contains
642         xmin = MIN(fder(i),xmin)         xmin = MIN(fder(i),xmin)
643         xmax = MAX(fder(i),xmax)         xmax = MAX(fder(i),xmax)
644      ENDDO      ENDDO
645      PRINT*,'Derive des flux fder:', xmin, xmax      PRINT *,'Derive des flux fder:', xmin, xmax
646    
647    
648      ! Lecture du rayonnement net au sol:      ! Lecture du rayonnement net au sol:
649    
650      ierr = NF_INQ_VARID (nid, "RADS", nvarid)      ierr = NF90_INQ_VARID (nid, "RADS", nvarid)
651      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
652         PRINT*, 'phyetat0: Le champ <RADS> est absent'         PRINT *, 'phyetat0: Le champ <RADS> est absent'
653         stop 1         stop 1
654      ENDIF      ENDIF
655      ierr = NF_GET_VAR_REAL(nid, nvarid, radsol)      ierr = NF_GET_VAR_REAL(nid, nvarid, radsol)
656      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
657         PRINT*, 'phyetat0: Lecture echouee pour <RADS>'         PRINT *, 'phyetat0: Lecture echouee pour <RADS>'
658         stop 1         stop 1
659      ENDIF      ENDIF
660      xmin = 1.0E+20      xmin = 1.0E+20
# Line 732  contains Line 663  contains
663         xmin = MIN(radsol(i),xmin)         xmin = MIN(radsol(i),xmin)
664         xmax = MAX(radsol(i),xmax)         xmax = MAX(radsol(i),xmax)
665      ENDDO      ENDDO
666      PRINT*,'Rayonnement net au sol radsol:', xmin, xmax      PRINT *,'Rayonnement net au sol radsol:', xmin, xmax
667    
668      ! Lecture de la longueur de rugosite      ! Lecture de la longueur de rugosite
669    
670    
671      ierr = NF_INQ_VARID (nid, "RUG", nvarid)      ierr = NF90_INQ_VARID (nid, "RUG", nvarid)
672      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
673         PRINT*, 'phyetat0: Le champ <RUG> est absent'         PRINT *, 'phyetat0: Le champ <RUG> est absent'
674         PRINT*, '          Mais je vais essayer de lire RUG**'         PRINT *, '          Mais je vais essayer de lire RUG**'
675         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
676            IF (nsrf.GT.99) THEN            IF (nsrf.GT.99) THEN
677               PRINT*, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
678               stop 1               stop 1
679            ENDIF            ENDIF
680            WRITE(str2,'(i2.2)') nsrf            WRITE(str2,'(i2.2)') nsrf
681            ierr = NF_INQ_VARID (nid, "RUG"//str2, nvarid)            ierr = NF90_INQ_VARID (nid, "RUG"//str2, nvarid)
682            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
683               PRINT*, "phyetat0: Le champ <RUG"//str2//"> est absent"               PRINT *, "phyetat0: Le champ <RUG"//str2//"> est absent"
684               stop 1               stop 1
685            ENDIF            ENDIF
686            ierr = NF_GET_VAR_REAL(nid, nvarid, frugs(1,nsrf))            ierr = NF_GET_VAR_REAL(nid, nvarid, frugs(1,nsrf))
687            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
688               PRINT*, "phyetat0: Lecture echouee pour <RUG"//str2//">"               PRINT *, "phyetat0: Lecture echouee pour <RUG"//str2//">"
689               stop 1               stop 1
690            ENDIF            ENDIF
691            xmin = 1.0E+20            xmin = 1.0E+20
# Line 763  contains Line 694  contains
694               xmin = MIN(frugs(i,nsrf),xmin)               xmin = MIN(frugs(i,nsrf),xmin)
695               xmax = MAX(frugs(i,nsrf),xmax)               xmax = MAX(frugs(i,nsrf),xmax)
696            ENDDO            ENDDO
697            PRINT*,'rugosite du sol RUG**:', nsrf, xmin, xmax            PRINT *,'rugosite du sol RUG**:', nsrf, xmin, xmax
698         ENDDO         ENDDO
699      ELSE      ELSE
700         PRINT*, 'phyetat0: Le champ <RUG> est present'         PRINT *, 'phyetat0: Le champ <RUG> est present'
701         PRINT*, '          J ignore donc les autres RUG**'         PRINT *, '          J ignore donc les autres RUG**'
702         ierr = NF_GET_VAR_REAL(nid, nvarid, frugs(1,1))         call nf95_get_var(nid, nvarid, frugs(:,1))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <RUG>"  
           stop 1  
        ENDIF  
703         xmin = 1.0E+20         xmin = 1.0E+20
704         xmax = -1.0E+20         xmax = -1.0E+20
705         DO i = 1, klon         DO i = 1, klon
706            xmin = MIN(frugs(i,1),xmin)            xmin = MIN(frugs(i,1),xmin)
707            xmax = MAX(frugs(i,1),xmax)            xmax = MAX(frugs(i,1),xmax)
708         ENDDO         ENDDO
709         PRINT*,'rugosite <RUG>', xmin, xmax         PRINT *,'rugosite <RUG>', xmin, xmax
710         DO nsrf = 2, nbsrf         DO nsrf = 2, nbsrf
711            DO i = 1, klon            DO i = 1, klon
712               frugs(i,nsrf) = frugs(i,1)               frugs(i,nsrf) = frugs(i,1)
# Line 790  contains Line 717  contains
717    
718      ! Lecture de l'age de la neige:      ! Lecture de l'age de la neige:
719    
720      ierr = NF_INQ_VARID (nid, "AGESNO", nvarid)      ierr = NF90_INQ_VARID (nid, "AGESNO", nvarid)
721      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
722         PRINT*, 'phyetat0: Le champ <AGESNO> est absent'         PRINT *, 'phyetat0: Le champ <AGESNO> est absent'
723         PRINT*, '          Mais je vais essayer de lire AGESNO**'         PRINT *, '          Mais je vais essayer de lire AGESNO**'
724         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
725            IF (nsrf.GT.99) THEN            IF (nsrf.GT.99) THEN
726               PRINT*, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
727               stop 1               stop 1
728            ENDIF            ENDIF
729            WRITE(str2,'(i2.2)') nsrf            WRITE(str2,'(i2.2)') nsrf
730            ierr = NF_INQ_VARID (nid, "AGESNO"//str2, nvarid)            ierr = NF90_INQ_VARID (nid, "AGESNO"//str2, nvarid)
731            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
732               PRINT*, "phyetat0: Le champ <AGESNO"//str2//"> est absent"               PRINT *, "phyetat0: Le champ <AGESNO"//str2//"> est absent"
733               agesno = 50.0               agesno = 50.0
734            ENDIF            ENDIF
735            ierr = NF_GET_VAR_REAL(nid, nvarid, agesno(1,nsrf))            ierr = NF_GET_VAR_REAL(nid, nvarid, agesno(1,nsrf))
736            IF (ierr.NE.NF_NOERR) THEN            IF (ierr.NE.NF90_NOERR) THEN
737               PRINT*, "phyetat0: Lecture echouee pour <AGESNO"//str2//">"               PRINT *, "phyetat0: Lecture echouee pour <AGESNO"//str2//">"
738               stop 1               stop 1
739            ENDIF            ENDIF
740            xmin = 1.0E+20            xmin = 1.0E+20
# Line 816  contains Line 743  contains
743               xmin = MIN(agesno(i,nsrf),xmin)               xmin = MIN(agesno(i,nsrf),xmin)
744               xmax = MAX(agesno(i,nsrf),xmax)               xmax = MAX(agesno(i,nsrf),xmax)
745            ENDDO            ENDDO
746            PRINT*,'Age de la neige AGESNO**:', nsrf, xmin, xmax            PRINT *,'Age de la neige AGESNO**:', nsrf, xmin, xmax
747         ENDDO         ENDDO
748      ELSE      ELSE
749         PRINT*, 'phyetat0: Le champ <AGESNO> est present'         PRINT *, 'phyetat0: Le champ <AGESNO> est present'
750         PRINT*, '          J ignore donc les autres AGESNO**'         PRINT *, '          J ignore donc les autres AGESNO**'
751         ierr = NF_GET_VAR_REAL(nid, nvarid, agesno(1,1))         call nf95_get_var(nid, nvarid, agesno(:,1))
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <AGESNO>"  
           stop 1  
        ENDIF  
752         xmin = 1.0E+20         xmin = 1.0E+20
753         xmax = -1.0E+20         xmax = -1.0E+20
754         DO i = 1, klon         DO i = 1, klon
755            xmin = MIN(agesno(i,1),xmin)            xmin = MIN(agesno(i,1),xmin)
756            xmax = MAX(agesno(i,1),xmax)            xmax = MAX(agesno(i,1),xmax)
757         ENDDO         ENDDO
758         PRINT*,'Age de la neige <AGESNO>', xmin, xmax         PRINT *,'Age de la neige <AGESNO>', xmin, xmax
759         DO nsrf = 2, nbsrf         DO nsrf = 2, nbsrf
760            DO i = 1, klon            DO i = 1, klon
761               agesno(i,nsrf) = agesno(i,1)               agesno(i,nsrf) = agesno(i,1)
# Line 841  contains Line 764  contains
764      ENDIF      ENDIF
765    
766    
767      ierr = NF_INQ_VARID (nid, "ZMEA", nvarid)      ierr = NF90_INQ_VARID (nid, "ZMEA", nvarid)
768      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
769         PRINT*, 'phyetat0: Le champ <ZMEA> est absent'         PRINT *, 'phyetat0: Le champ <ZMEA> est absent'
770         stop 1         stop 1
771      ENDIF      ENDIF
772      ierr = NF_GET_VAR_REAL(nid, nvarid, zmea)      ierr = NF_GET_VAR_REAL(nid, nvarid, zmea)
773      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
774         PRINT*, 'phyetat0: Lecture echouee pour <ZMEA>'         PRINT *, 'phyetat0: Lecture echouee pour <ZMEA>'
775         stop 1         stop 1
776      ENDIF      ENDIF
777      xmin = 1.0E+20      xmin = 1.0E+20
# Line 857  contains Line 780  contains
780         xmin = MIN(zmea(i),xmin)         xmin = MIN(zmea(i),xmin)
781         xmax = MAX(zmea(i),xmax)         xmax = MAX(zmea(i),xmax)
782      ENDDO      ENDDO
783      PRINT*,'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax      PRINT *,'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax
784    
785    
786      ierr = NF_INQ_VARID (nid, "ZSTD", nvarid)      ierr = NF90_INQ_VARID (nid, "ZSTD", nvarid)
787      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
788         PRINT*, 'phyetat0: Le champ <ZSTD> est absent'         PRINT *, 'phyetat0: Le champ <ZSTD> est absent'
789         stop 1         stop 1
790      ENDIF      ENDIF
791      ierr = NF_GET_VAR_REAL(nid, nvarid, zstd)      ierr = NF_GET_VAR_REAL(nid, nvarid, zstd)
792      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
793         PRINT*, 'phyetat0: Lecture echouee pour <ZSTD>'         PRINT *, 'phyetat0: Lecture echouee pour <ZSTD>'
794         stop 1         stop 1
795      ENDIF      ENDIF
796      xmin = 1.0E+20      xmin = 1.0E+20
# Line 876  contains Line 799  contains
799         xmin = MIN(zstd(i),xmin)         xmin = MIN(zstd(i),xmin)
800         xmax = MAX(zstd(i),xmax)         xmax = MAX(zstd(i),xmax)
801      ENDDO      ENDDO
802      PRINT*,'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax      PRINT *,'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax
803    
804    
805      ierr = NF_INQ_VARID (nid, "ZSIG", nvarid)      ierr = NF90_INQ_VARID (nid, "ZSIG", nvarid)
806      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
807         PRINT*, 'phyetat0: Le champ <ZSIG> est absent'         PRINT *, 'phyetat0: Le champ <ZSIG> est absent'
808         stop 1         stop 1
809      ENDIF      ENDIF
810      ierr = NF_GET_VAR_REAL(nid, nvarid, zsig)      ierr = NF_GET_VAR_REAL(nid, nvarid, zsig)
811      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
812         PRINT*, 'phyetat0: Lecture echouee pour <ZSIG>'         PRINT *, 'phyetat0: Lecture echouee pour <ZSIG>'
813         stop 1         stop 1
814      ENDIF      ENDIF
815      xmin = 1.0E+20      xmin = 1.0E+20
# Line 895  contains Line 818  contains
818         xmin = MIN(zsig(i),xmin)         xmin = MIN(zsig(i),xmin)
819         xmax = MAX(zsig(i),xmax)         xmax = MAX(zsig(i),xmax)
820      ENDDO      ENDDO
821      PRINT*,'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax      PRINT *,'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax
822    
823    
824      ierr = NF_INQ_VARID (nid, "ZGAM", nvarid)      ierr = NF90_INQ_VARID (nid, "ZGAM", nvarid)
825      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
826         PRINT*, 'phyetat0: Le champ <ZGAM> est absent'         PRINT *, 'phyetat0: Le champ <ZGAM> est absent'
827         stop 1         stop 1
828      ENDIF      ENDIF
829      ierr = NF_GET_VAR_REAL(nid, nvarid, zgam)      ierr = NF_GET_VAR_REAL(nid, nvarid, zgam)
830      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
831         PRINT*, 'phyetat0: Lecture echouee pour <ZGAM>'         PRINT *, 'phyetat0: Lecture echouee pour <ZGAM>'
832         stop 1         stop 1
833      ENDIF      ENDIF
834      xmin = 1.0E+20      xmin = 1.0E+20
# Line 914  contains Line 837  contains
837         xmin = MIN(zgam(i),xmin)         xmin = MIN(zgam(i),xmin)
838         xmax = MAX(zgam(i),xmax)         xmax = MAX(zgam(i),xmax)
839      ENDDO      ENDDO
840      PRINT*,'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax      PRINT *,'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax
841    
842    
843      ierr = NF_INQ_VARID (nid, "ZTHE", nvarid)      ierr = NF90_INQ_VARID (nid, "ZTHE", nvarid)
844      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
845         PRINT*, 'phyetat0: Le champ <ZTHE> est absent'         PRINT *, 'phyetat0: Le champ <ZTHE> est absent'
846         stop 1         stop 1
847      ENDIF      ENDIF
848      ierr = NF_GET_VAR_REAL(nid, nvarid, zthe)      ierr = NF_GET_VAR_REAL(nid, nvarid, zthe)
849      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
850         PRINT*, 'phyetat0: Lecture echouee pour <ZTHE>'         PRINT *, 'phyetat0: Lecture echouee pour <ZTHE>'
851         stop 1         stop 1
852      ENDIF      ENDIF
853      xmin = 1.0E+20      xmin = 1.0E+20
# Line 933  contains Line 856  contains
856         xmin = MIN(zthe(i),xmin)         xmin = MIN(zthe(i),xmin)
857         xmax = MAX(zthe(i),xmax)         xmax = MAX(zthe(i),xmax)
858      ENDDO      ENDDO
859      PRINT*,'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax      PRINT *,'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax
860    
861    
862      ierr = NF_INQ_VARID (nid, "ZPIC", nvarid)      ierr = NF90_INQ_VARID (nid, "ZPIC", nvarid)
863      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
864         PRINT*, 'phyetat0: Le champ <ZPIC> est absent'         PRINT *, 'phyetat0: Le champ <ZPIC> est absent'
865         stop 1         stop 1
866      ENDIF      ENDIF
867      ierr = NF_GET_VAR_REAL(nid, nvarid, zpic)      ierr = NF_GET_VAR_REAL(nid, nvarid, zpic)
868      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
869         PRINT*, 'phyetat0: Lecture echouee pour <ZPIC>'         PRINT *, 'phyetat0: Lecture echouee pour <ZPIC>'
870         stop 1         stop 1
871      ENDIF      ENDIF
872      xmin = 1.0E+20      xmin = 1.0E+20
# Line 952  contains Line 875  contains
875         xmin = MIN(zpic(i),xmin)         xmin = MIN(zpic(i),xmin)
876         xmax = MAX(zpic(i),xmax)         xmax = MAX(zpic(i),xmax)
877      ENDDO      ENDDO
878      PRINT*,'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax      PRINT *,'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax
879    
880      ierr = NF_INQ_VARID (nid, "ZVAL", nvarid)      ierr = NF90_INQ_VARID (nid, "ZVAL", nvarid)
881      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
882         PRINT*, 'phyetat0: Le champ <ZVAL> est absent'         PRINT *, 'phyetat0: Le champ <ZVAL> est absent'
883         stop 1         stop 1
884      ENDIF      ENDIF
885      ierr = NF_GET_VAR_REAL(nid, nvarid, zval)      ierr = NF_GET_VAR_REAL(nid, nvarid, zval)
886      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
887         PRINT*, 'phyetat0: Lecture echouee pour <ZVAL>'         PRINT *, 'phyetat0: Lecture echouee pour <ZVAL>'
888         stop 1         stop 1
889      ENDIF      ENDIF
890      xmin = 1.0E+20      xmin = 1.0E+20
# Line 970  contains Line 893  contains
893         xmin = MIN(zval(i),xmin)         xmin = MIN(zval(i),xmin)
894         xmax = MAX(zval(i),xmax)         xmax = MAX(zval(i),xmax)
895      ENDDO      ENDDO
896      PRINT*,'OROGRAPHIE SOUS-MAILLE zval:', xmin, xmax      PRINT *,'OROGRAPHIE SOUS-MAILLE zval:', xmin, xmax
897    
898      ancien_ok = .TRUE.      ancien_ok = .TRUE.
899    
900      ierr = NF_INQ_VARID (nid, "TANCIEN", nvarid)      ierr = NF90_INQ_VARID (nid, "TANCIEN", nvarid)
901      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
902         PRINT*, "phyetat0: Le champ <TANCIEN> est absent"         PRINT *, "phyetat0: Le champ <TANCIEN> est absent"
903         PRINT*, "Depart legerement fausse. Mais je continue"         PRINT *, "Depart legerement fausse. Mais je continue"
904         ancien_ok = .FALSE.         ancien_ok = .FALSE.
905      ELSE      ELSE
906         ierr = NF_GET_VAR_REAL(nid, nvarid, t_ancien)         call nf95_get_var(nid, nvarid, t_ancien)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <TANCIEN>"  
           stop 1  
        ENDIF  
907      ENDIF      ENDIF
908    
909      ierr = NF_INQ_VARID (nid, "QANCIEN", nvarid)      ierr = NF90_INQ_VARID (nid, "QANCIEN", nvarid)
910      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
911         PRINT*, "phyetat0: Le champ <QANCIEN> est absent"         PRINT *, "phyetat0: Le champ <QANCIEN> est absent"
912         PRINT*, "Depart legerement fausse. Mais je continue"         PRINT *, "Depart legerement fausse. Mais je continue"
913         ancien_ok = .FALSE.         ancien_ok = .FALSE.
914      ELSE      ELSE
915         ierr = NF_GET_VAR_REAL(nid, nvarid, q_ancien)         call nf95_get_var(nid, nvarid, q_ancien)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <QANCIEN>"  
           stop 1  
        ENDIF  
916      ENDIF      ENDIF
917    
918      ierr = NF_INQ_VARID (nid, "CLWCON", nvarid)      ierr = NF90_INQ_VARID (nid, "CLWCON", nvarid)
919      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
920         PRINT*, "phyetat0: Le champ CLWCON est absent"         PRINT *, "phyetat0: Le champ CLWCON est absent"
921         PRINT*, "Depart legerement fausse. Mais je continue"         PRINT *, "Depart legerement fausse. Mais je continue"
922         clwcon = 0.         clwcon = 0.
923      ELSE      ELSE
924         ierr = NF_GET_VAR_REAL(nid, nvarid, clwcon)         call nf95_get_var(nid, nvarid, clwcon)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <CLWCON>"  
           stop 1  
        ENDIF  
925      ENDIF      ENDIF
926      xmin = 1.0E+20      xmin = 1.0E+20
927      xmax = -1.0E+20      xmax = -1.0E+20
928      xmin = MINval(clwcon)      xmin = MINval(clwcon)
929      xmax = MAXval(clwcon)      xmax = MAXval(clwcon)
930      PRINT*,'Eau liquide convective (ecart-type) clwcon:', xmin, xmax      PRINT *,'Eau liquide convective (ecart-type) clwcon:', xmin, xmax
931    
932      ierr = NF_INQ_VARID (nid, "RNEBCON", nvarid)      ierr = NF90_INQ_VARID (nid, "RNEBCON", nvarid)
933      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
934         PRINT*, "phyetat0: Le champ RNEBCON est absent"         PRINT *, "phyetat0: Le champ RNEBCON est absent"
935         PRINT*, "Depart legerement fausse. Mais je continue"         PRINT *, "Depart legerement fausse. Mais je continue"
936         rnebcon = 0.         rnebcon = 0.
937      ELSE      ELSE
938         ierr = NF_GET_VAR_REAL(nid, nvarid, rnebcon)         call nf95_get_var(nid, nvarid, rnebcon)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <RNEBCON>"  
           stop 1  
        ENDIF  
939      ENDIF      ENDIF
940      xmin = 1.0E+20      xmin = 1.0E+20
941      xmax = -1.0E+20      xmax = -1.0E+20
942      xmin = MINval(rnebcon)      xmin = MINval(rnebcon)
943      xmax = MAXval(rnebcon)      xmax = MAXval(rnebcon)
944      PRINT*,'Nebulosite convective (ecart-type) rnebcon:', xmin, xmax      PRINT *,'Nebulosite convective (ecart-type) rnebcon:', xmin, xmax
945    
946    
947      ierr = NF_INQ_VARID (nid, "QANCIEN", nvarid)      ierr = NF90_INQ_VARID (nid, "QANCIEN", nvarid)
948      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
949         PRINT*, "phyetat0: Le champ <QANCIEN> est absent"         PRINT *, "phyetat0: Le champ <QANCIEN> est absent"
950         PRINT*, "Depart legerement fausse. Mais je continue"         PRINT *, "Depart legerement fausse. Mais je continue"
951         ancien_ok = .FALSE.         ancien_ok = .FALSE.
952      ELSE      ELSE
953         ierr = NF_GET_VAR_REAL(nid, nvarid, q_ancien)         call nf95_get_var(nid, nvarid, q_ancien)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <QANCIEN>"  
           stop 1  
        ENDIF  
954      ENDIF      ENDIF
955    
956      ! Lecture ratqs      ! Lecture ratqs
957    
958      ierr = NF_INQ_VARID (nid, "RATQS", nvarid)      ierr = NF90_INQ_VARID (nid, "RATQS", nvarid)
959      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
960         PRINT*, "phyetat0: Le champ <RATQS> est absent"         PRINT *, "phyetat0: Le champ <RATQS> est absent"
961         PRINT*, "Depart legerement fausse. Mais je continue"         PRINT *, "Depart legerement fausse. Mais je continue"
962         ratqs = 0.         ratqs = 0.
963      ELSE      ELSE
964         ierr = NF_GET_VAR_REAL(nid, nvarid, ratqs)         call nf95_get_var(nid, nvarid, ratqs)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <RATQS>"  
           stop 1  
        ENDIF  
965      ENDIF      ENDIF
966      xmin = 1.0E+20      xmin = 1.0E+20
967      xmax = -1.0E+20      xmax = -1.0E+20
968      xmin = MINval(ratqs)      xmin = MINval(ratqs)
969      xmax = MAXval(ratqs)      xmax = MAXval(ratqs)
970      PRINT*,'(ecart-type) ratqs:', xmin, xmax      PRINT *,'(ecart-type) ratqs:', xmin, xmax
971    
972      ! Lecture run_off_lic_0      ! Lecture run_off_lic_0
973    
974      ierr = NF_INQ_VARID (nid, "RUNOFFLIC0", nvarid)      ierr = NF90_INQ_VARID (nid, "RUNOFFLIC0", nvarid)
975      IF (ierr.NE.NF_NOERR) THEN      IF (ierr.NE.NF90_NOERR) THEN
976         PRINT*, "phyetat0: Le champ <RUNOFFLIC0> est absent"         PRINT *, "phyetat0: Le champ <RUNOFFLIC0> est absent"
977         PRINT*, "Depart legerement fausse. Mais je continue"         PRINT *, "Depart legerement fausse. Mais je continue"
978         run_off_lic_0 = 0.         run_off_lic_0 = 0.
979      ELSE      ELSE
980         ierr = NF_GET_VAR_REAL(nid, nvarid, run_off_lic_0)         call nf95_get_var(nid, nvarid, run_off_lic_0)
        IF (ierr.NE.NF_NOERR) THEN  
           PRINT*, "phyetat0: Lecture echouee pour <RUNOFFLIC0>"  
           stop 1  
        ENDIF  
981      ENDIF      ENDIF
982      xmin = 1.0E+20      xmin = 1.0E+20
983      xmax = -1.0E+20      xmax = -1.0E+20
984      xmin = MINval(run_off_lic_0)      xmin = MINval(run_off_lic_0)
985      xmax = MAXval(run_off_lic_0)      xmax = MAXval(run_off_lic_0)
986      PRINT*,'(ecart-type) run_off_lic_0:', xmin, xmax      PRINT *,'(ecart-type) run_off_lic_0:', xmin, xmax
987    
988      ! Fermer le fichier:      ! Fermer le fichier:
989    

Legend:
Removed from v.22  
changed lines
  Added in v.43

  ViewVC Help
Powered by ViewVC 1.1.21