/[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 49 by guez, Wed Aug 24 11:43:14 2011 UTC revision 50 by guez, Wed Aug 24 13:33:28 2011 UTC
# Line 18  contains Line 18  contains
18    
19      ! From phylmd/phyetat0.F, version 1.4 2005/06/03 10:03:07      ! From phylmd/phyetat0.F, version 1.4 2005/06/03 10:03:07
20      ! Author: Z.X. Li (LMD/CNRS)      ! Author: Z.X. Li (LMD/CNRS)
21      ! Date: 19930818      ! Date: 1993/08/18
22      ! Objet : Lecture de l'état initial pour la physique      ! Objet : Lecture de l'état initial pour la physique
23    
24      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
25      USE dimsoil, ONLY : nsoilmx      USE dimsoil, ONLY : nsoilmx
26      USE temps, ONLY : itau_phy      USE temps, ONLY : itau_phy
27      use netcdf, only: nf90_get_att, nf90_global, nf90_inq_varid, NF90_NOERR, &      use netcdf, only: nf90_get_att, nf90_global, nf90_inq_varid, NF90_NOERR, &
28           nf90_get_var, NF90_NOWRITE           NF90_NOWRITE
29      use netcdf95, only: handle_err, nf95_get_var, nf95_close, NF95_OPEN      use netcdf95, only: handle_err, nf95_get_var, nf95_close, NF95_OPEN, &
30             nf95_inq_varid
31      use dimphy, only: zmasq, klev      use dimphy, only: zmasq, klev
32    
33      CHARACTER(len=*), intent(in):: fichnom      CHARACTER(len=*), intent(in):: fichnom
# Line 84  contains Line 85  contains
85    
86      ! Lecture des latitudes (coordonnees):      ! Lecture des latitudes (coordonnees):
87    
88      ierr = NF90_INQ_VARID(ncid, "latitude", varid)      call NF95_INQ_VARID(ncid, "latitude", varid)
89      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, rlat)
        PRINT *, 'phyetat0: Le champ <latitude> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, rlat)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <latitude>'  
        stop 1  
     ENDIF  
90    
91      ! Lecture des longitudes (coordonnees):      ! Lecture des longitudes (coordonnees):
92    
93      ierr = NF90_INQ_VARID(ncid, "longitude", varid)      call NF95_INQ_VARID(ncid, "longitude", varid)
94      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, rlon)
        PRINT *, 'phyetat0: Le champ <longitude> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, rlon)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <latitude>'  
        stop 1  
     ENDIF  
95    
96      ! Lecture du masque terre mer      ! Lecture du masque terre mer
97    
98      ierr = NF90_INQ_VARID(ncid, "masque", varid)      ierr = NF90_INQ_VARID(ncid, "masque", varid)
99      IF (ierr ==  NF90_NOERR) THEN      IF (ierr == NF90_NOERR) THEN
100         call nf95_get_var(ncid, varid, zmasq)         call nf95_get_var(ncid, varid, zmasq)
101      else      else
102         PRINT *, 'phyetat0: Le champ <masque> est absent'         PRINT *, 'phyetat0: Le champ <masque> est absent'
103         PRINT *, 'fichier startphy non compatible avec phyetat0'         PRINT *, 'fichier startphy non compatible avec phyetat0'
        !      stop 1  
104      ENDIF      ENDIF
105      ! Lecture des fractions pour chaque sous-surface      ! Lecture des fractions pour chaque sous-surface
106    
# Line 127  contains Line 111  contains
111      ! fraction de terre      ! fraction de terre
112    
113      ierr = NF90_INQ_VARID(ncid, "FTER", varid)      ierr = NF90_INQ_VARID(ncid, "FTER", varid)
114      IF (ierr ==  NF90_NOERR) THEN      IF (ierr == NF90_NOERR) THEN
115         call nf95_get_var(ncid, varid, pctsrf(1 : klon, is_ter))         call nf95_get_var(ncid, varid, pctsrf(:, is_ter))
116      else      else
117         PRINT *, 'phyetat0: Le champ <FTER> est absent'         PRINT *, 'phyetat0: Le champ <FTER> est absent'
        !$$$         stop 1  
118      ENDIF      ENDIF
119    
120      ! fraction de glace de terre      ! fraction de glace de terre
121    
122      ierr = NF90_INQ_VARID(ncid, "FLIC", varid)      ierr = NF90_INQ_VARID(ncid, "FLIC", varid)
123      IF (ierr ==  NF90_NOERR) THEN      IF (ierr == NF90_NOERR) THEN
124         call nf95_get_var(ncid, varid, pctsrf(1 : klon, is_lic))         call nf95_get_var(ncid, varid, pctsrf(:, is_lic))
125      else      else
126         PRINT *, 'phyetat0: Le champ <FLIC> est absent'         PRINT *, 'phyetat0: Le champ <FLIC> est absent'
        !$$$         stop 1  
127      ENDIF      ENDIF
128    
129      ! fraction d'ocean      ! fraction d'ocean
130    
131      ierr = NF90_INQ_VARID(ncid, "FOCE", varid)      ierr = NF90_INQ_VARID(ncid, "FOCE", varid)
132      IF (ierr ==  NF90_NOERR) THEN      IF (ierr == NF90_NOERR) THEN
133         call nf95_get_var(ncid, varid, pctsrf(1 : klon, is_oce))         call nf95_get_var(ncid, varid, pctsrf(:, is_oce))
134      else      else
135         PRINT *, 'phyetat0: Le champ <FOCE> est absent'         PRINT *, 'phyetat0: Le champ <FOCE> est absent'
        !$$$         stop 1  
136      ENDIF      ENDIF
137    
138      ! fraction glace de mer      ! fraction glace de mer
139    
140      ierr = NF90_INQ_VARID(ncid, "FSIC", varid)      ierr = NF90_INQ_VARID(ncid, "FSIC", varid)
141      IF (ierr ==  NF90_NOERR) THEN      IF (ierr == NF90_NOERR) THEN
142         call nf95_get_var(ncid, varid, pctsrf(1 : klon, is_sic))         call nf95_get_var(ncid, varid, pctsrf(:, is_sic))
143      else      else
144         PRINT *, 'phyetat0: Le champ <FSIC> est absent'         PRINT *, 'phyetat0: Le champ <FSIC> est absent'
        !$$$         stop 1  
145      ENDIF      ENDIF
146    
147      !  Verification de l'adequation entre le masque et les sous-surfaces      ! Verification de l'adequation entre le masque et les sous-surfaces
148    
149      fractint( 1 : klon) = pctsrf(1 : klon, is_ter)  &      fractint = pctsrf(:, is_ter) + pctsrf(:, is_lic)
          + pctsrf(1 : klon, is_lic)  
150      DO i = 1 , klon      DO i = 1 , klon
151         IF ( abs(fractint(i) - zmasq(i) ) .GT. EPSFRA ) THEN         IF ( abs(fractint(i) - zmasq(i) ) > EPSFRA ) THEN
152            WRITE(*, *) 'phyetat0: attention fraction terre pas ',  &            WRITE(*, *) 'phyetat0: attention fraction terre pas ', &
153                 'coherente ', i, zmasq(i), pctsrf(i, is_ter) &                 'coherente ', i, zmasq(i), pctsrf(i, is_ter) &
154                 , pctsrf(i, is_lic)                 , pctsrf(i, is_lic)
155         ENDIF         ENDIF
156      END DO      END DO
157      fractint(1 : klon) =  pctsrf(1 : klon, is_oce)  &      fractint = pctsrf(:, is_oce) + pctsrf(:, is_sic)
          + pctsrf(1 : klon, is_sic)  
158      DO i = 1 , klon      DO i = 1 , klon
159         IF ( abs( fractint(i) - (1. - zmasq(i))) .GT. EPSFRA ) THEN         IF ( abs( fractint(i) - (1. - zmasq(i))) > EPSFRA ) THEN
160            WRITE(*, *) 'phyetat0 attention fraction ocean pas ',  &            WRITE(*, *) 'phyetat0 attention fraction ocean pas ', &
161                 'coherente ', i, zmasq(i) , pctsrf(i, is_oce) &                 'coherente ', i, zmasq(i) , pctsrf(i, is_oce) &
162                 , pctsrf(i, is_sic)                 , pctsrf(i, is_sic)
163         ENDIF         ENDIF
# Line 190  contains Line 168  contains
168      ierr = NF90_INQ_VARID(ncid, "TS", varid)      ierr = NF90_INQ_VARID(ncid, "TS", varid)
169      IF (ierr /= NF90_NOERR) THEN      IF (ierr /= NF90_NOERR) THEN
170         PRINT *, 'phyetat0 : Le champ <TS> est absent'         PRINT *, 'phyetat0 : Le champ <TS> est absent'
171         PRINT *, '          Mais je vais essayer de lire TS**'         PRINT *, ' Mais je vais essayer de lire TS**'
172         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
173            IF (nsrf.GT.99) THEN            IF (nsrf > 99) THEN
174               PRINT *, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
175               stop 1               stop 1
176            ENDIF            ENDIF
177            WRITE(str2, '(i2.2)') nsrf            WRITE(str2, '(i2.2)') nsrf
178            ierr = NF90_INQ_VARID(ncid, "TS"//str2, varid)            call NF95_INQ_VARID(ncid, "TS"//str2, varid)
179            IF (ierr /= NF90_NOERR) THEN            call NF95_GET_VAR(ncid, varid, tsol(:, nsrf))
              PRINT *, "phyetat0: Le champ <TS"//str2//"> est absent"  
              stop 1  
           ENDIF  
           ierr = NF90_GET_VAR(ncid, varid, tsol(1, nsrf))  
           IF (ierr /= NF90_NOERR) THEN  
              PRINT *, "phyetat0: Lecture echouee pour <TS"//str2//">"  
              stop 1  
           ENDIF  
180            xmin = 1.0E+20            xmin = 1.0E+20
181            xmax = -1.0E+20            xmax = -1.0E+20
182            DO i = 1, klon            DO i = 1, klon
# Line 217  contains Line 187  contains
187         ENDDO         ENDDO
188      ELSE      ELSE
189         PRINT *, 'phyetat0: Le champ <TS> est present'         PRINT *, 'phyetat0: Le champ <TS> est present'
190         PRINT *, '          J ignore donc les autres temperatures TS**'         PRINT *, ' J ignore donc les autres temperatures TS**'
191         call nf95_get_var(ncid, varid, tsol(:, 1))         call nf95_get_var(ncid, varid, tsol(:, 1))
192         xmin = 1.0E+20         xmin = 1.0E+20
193         xmax = -1.0E+20         xmax = -1.0E+20
# Line 237  contains Line 207  contains
207    
208      DO nsrf = 1, nbsrf      DO nsrf = 1, nbsrf
209         DO isoil=1, nsoilmx         DO isoil=1, nsoilmx
210            IF (isoil.GT.99 .AND. nsrf.GT.99) THEN            IF (isoil > 99 .AND. nsrf > 99) THEN
211               PRINT *, "Trop de couches ou sous-mailles"               PRINT *, "Trop de couches ou sous-mailles"
212               stop 1               stop 1
213            ENDIF            ENDIF
# Line 245  contains Line 215  contains
215            ierr = NF90_INQ_VARID(ncid, 'Tsoil'//str7, varid)            ierr = NF90_INQ_VARID(ncid, 'Tsoil'//str7, varid)
216            IF (ierr /= NF90_NOERR) THEN            IF (ierr /= NF90_NOERR) THEN
217               PRINT *, "phyetat0: Le champ <Tsoil"//str7//"> est absent"               PRINT *, "phyetat0: Le champ <Tsoil"//str7//"> est absent"
218               PRINT *, "          Il prend donc la valeur de surface"               PRINT *, " Il prend donc la valeur de surface"
219               DO i=1, klon               DO i=1, klon
220                  tsoil(i, isoil, nsrf)=tsol(i, nsrf)                  tsoil(i, isoil, nsrf)=tsol(i, nsrf)
221               ENDDO               ENDDO
222            ELSE            ELSE
223               ierr = NF90_GET_VAR(ncid, varid, tsoil(1, isoil, nsrf))               call NF95_GET_VAR(ncid, varid, tsoil(:, isoil, nsrf))
              IF (ierr /= NF90_NOERR) THEN  
                 PRINT *, "Lecture echouee pour <Tsoil"//str7//">"  
                 stop 1  
              ENDIF  
224            ENDIF            ENDIF
225         ENDDO         ENDDO
226      ENDDO      ENDDO
227    
228      !IM "slab" ocean      !IM "slab" ocean
229    
230      ! Lecture de tslab (pour slab ocean seulement):            ! Lecture de tslab (pour slab ocean seulement):
231    
232      IF (ocean .eq. 'slab  ') then      IF (ocean .eq. 'slab ') then
233         ierr = NF90_INQ_VARID(ncid, "TSLAB", varid)         call NF95_INQ_VARID(ncid, "TSLAB", varid)
        IF (ierr /= NF90_NOERR) THEN  
           PRINT *, "phyetat0: Le champ <TSLAB> est absent"  
           stop 1  
        ENDIF  
234         call nf95_get_var(ncid, varid, tslab)         call nf95_get_var(ncid, varid, tslab)
235         xmin = 1.0E+20         xmin = 1.0E+20
236         xmax = -1.0E+20         xmax = -1.0E+20
# Line 280  contains Line 242  contains
242    
243         ! Lecture de seaice (pour slab ocean seulement):         ! Lecture de seaice (pour slab ocean seulement):
244    
245         ierr = NF90_INQ_VARID(ncid, "SEAICE", varid)         call NF95_INQ_VARID(ncid, "SEAICE", varid)
        IF (ierr /= NF90_NOERR) THEN  
           PRINT *, "phyetat0: Le champ <SEAICE> est absent"  
           stop 1  
        ENDIF  
246         call nf95_get_var(ncid, varid, seaice)         call nf95_get_var(ncid, varid, seaice)
247         xmin = 1.0E+20         xmin = 1.0E+20
248         xmax = -1.0E+20         xmax = -1.0E+20
# Line 303  contains Line 261  contains
261      ierr = NF90_INQ_VARID(ncid, "QS", varid)      ierr = NF90_INQ_VARID(ncid, "QS", varid)
262      IF (ierr /= NF90_NOERR) THEN      IF (ierr /= NF90_NOERR) THEN
263         PRINT *, 'phyetat0: Le champ <QS> est absent'         PRINT *, 'phyetat0: Le champ <QS> est absent'
264         PRINT *, '          Mais je vais essayer de lire QS**'         PRINT *, ' Mais je vais essayer de lire QS**'
265         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
266            IF (nsrf.GT.99) THEN            IF (nsrf > 99) THEN
267               PRINT *, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
268               stop 1               stop 1
269            ENDIF            ENDIF
270            WRITE(str2, '(i2.2)') nsrf            WRITE(str2, '(i2.2)') nsrf
271            ierr = NF90_INQ_VARID(ncid, "QS"//str2, varid)            call NF95_INQ_VARID(ncid, "QS"//str2, varid)
272            IF (ierr /= NF90_NOERR) THEN            call NF95_GET_VAR(ncid, varid, qsurf(:, nsrf))
              PRINT *, "phyetat0: Le champ <QS"//str2//"> est absent"  
              stop 1  
           ENDIF  
           ierr = NF90_GET_VAR(ncid, varid, qsurf(1, nsrf))  
           IF (ierr /= NF90_NOERR) THEN  
              PRINT *, "phyetat0: Lecture echouee pour <QS"//str2//">"  
              stop 1  
           ENDIF  
273            xmin = 1.0E+20            xmin = 1.0E+20
274            xmax = -1.0E+20            xmax = -1.0E+20
275            DO i = 1, klon            DO i = 1, klon
# Line 330  contains Line 280  contains
280         ENDDO         ENDDO
281      ELSE      ELSE
282         PRINT *, 'phyetat0: Le champ <QS> est present'         PRINT *, 'phyetat0: Le champ <QS> est present'
283         PRINT *, '          J ignore donc les autres humidites QS**'         PRINT *, ' J ignore donc les autres humidites QS**'
284         call nf95_get_var(ncid, varid, qsurf(:, 1))         call nf95_get_var(ncid, varid, qsurf(:, 1))
285         xmin = 1.0E+20         xmin = 1.0E+20
286         xmax = -1.0E+20         xmax = -1.0E+20
# Line 349  contains Line 299  contains
299      ! Eau dans le sol (pour le modele de sol "bucket")      ! Eau dans le sol (pour le modele de sol "bucket")
300    
301      ierr = NF90_INQ_VARID(ncid, "QSOL", varid)      ierr = NF90_INQ_VARID(ncid, "QSOL", varid)
302      IF (ierr ==  NF90_NOERR) THEN      IF (ierr == NF90_NOERR) THEN
303         call nf95_get_var(ncid, varid, qsol)         call nf95_get_var(ncid, varid, qsol)
304      else      else
305         PRINT *, 'phyetat0: Le champ <QSOL> est absent'         PRINT *, 'phyetat0: Le champ <QSOL> est absent'
306         PRINT *, '          Valeur par defaut nulle'         PRINT *, ' Valeur par defaut nulle'
307         qsol = 0.         qsol = 0.
308      ENDIF      ENDIF
309      xmin = 1.0E+20      xmin = 1.0E+20
# Line 369  contains Line 319  contains
319      ierr = NF90_INQ_VARID(ncid, "SNOW", varid)      ierr = NF90_INQ_VARID(ncid, "SNOW", varid)
320      IF (ierr /= NF90_NOERR) THEN      IF (ierr /= NF90_NOERR) THEN
321         PRINT *, 'phyetat0: Le champ <SNOW> est absent'         PRINT *, 'phyetat0: Le champ <SNOW> est absent'
322         PRINT *, '          Mais je vais essayer de lire SNOW**'         PRINT *, ' Mais je vais essayer de lire SNOW**'
323         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
324            IF (nsrf.GT.99) THEN            IF (nsrf > 99) THEN
325               PRINT *, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
326               stop 1               stop 1
327            ENDIF            ENDIF
328            WRITE(str2, '(i2.2)') nsrf            WRITE(str2, '(i2.2)') nsrf
329            ierr = NF90_INQ_VARID(ncid, "SNOW"//str2, varid)            call NF95_INQ_VARID(ncid, "SNOW"//str2, varid)
330            IF (ierr /= NF90_NOERR) THEN            call NF95_GET_VAR(ncid, varid, snow(:, nsrf))
              PRINT *, "phyetat0: Le champ <SNOW"//str2//"> est absent"  
              stop 1  
           ENDIF  
           ierr = NF90_GET_VAR(ncid, varid, snow(1, nsrf))  
           IF (ierr /= NF90_NOERR) THEN  
              PRINT *, "phyetat0: Lecture echouee pour <SNOW"//str2//">"  
              stop 1  
           ENDIF  
331            xmin = 1.0E+20            xmin = 1.0E+20
332            xmax = -1.0E+20            xmax = -1.0E+20
333            DO i = 1, klon            DO i = 1, klon
# Line 396  contains Line 338  contains
338         ENDDO         ENDDO
339      ELSE      ELSE
340         PRINT *, 'phyetat0: Le champ <SNOW> est present'         PRINT *, 'phyetat0: Le champ <SNOW> est present'
341         PRINT *, '          J ignore donc les autres neiges SNOW**'         PRINT *, ' J ignore donc les autres neiges SNOW**'
342         call nf95_get_var(ncid, varid, snow(:, 1))         call nf95_get_var(ncid, varid, snow(:, 1))
343         xmin = 1.0E+20         xmin = 1.0E+20
344         xmax = -1.0E+20         xmax = -1.0E+20
# Line 417  contains Line 359  contains
359      ierr = NF90_INQ_VARID(ncid, "ALBE", varid)      ierr = NF90_INQ_VARID(ncid, "ALBE", varid)
360      IF (ierr /= NF90_NOERR) THEN      IF (ierr /= NF90_NOERR) THEN
361         PRINT *, 'phyetat0: Le champ <ALBE> est absent'         PRINT *, 'phyetat0: Le champ <ALBE> est absent'
362         PRINT *, '          Mais je vais essayer de lire ALBE**'         PRINT *, ' Mais je vais essayer de lire ALBE**'
363         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
364            IF (nsrf.GT.99) THEN            IF (nsrf > 99) THEN
365               PRINT *, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
366               stop 1               stop 1
367            ENDIF            ENDIF
368            WRITE(str2, '(i2.2)') nsrf            WRITE(str2, '(i2.2)') nsrf
369            ierr = NF90_INQ_VARID(ncid, "ALBE"//str2, varid)            call NF95_INQ_VARID(ncid, "ALBE"//str2, varid)
370            IF (ierr /= NF90_NOERR) THEN            call NF95_GET_VAR(ncid, varid, albe(:, nsrf))
              PRINT *, "phyetat0: Le champ <ALBE"//str2//"> est absent"  
              stop 1  
           ENDIF  
           ierr = NF90_GET_VAR(ncid, varid, albe(1, nsrf))  
           IF (ierr /= NF90_NOERR) THEN  
              PRINT *, "phyetat0: Lecture echouee pour <ALBE"//str2//">"  
              stop 1  
           ENDIF  
371            xmin = 1.0E+20            xmin = 1.0E+20
372            xmax = -1.0E+20            xmax = -1.0E+20
373            DO i = 1, klon            DO i = 1, klon
# Line 444  contains Line 378  contains
378         ENDDO         ENDDO
379      ELSE      ELSE
380         PRINT *, 'phyetat0: Le champ <ALBE> est present'         PRINT *, 'phyetat0: Le champ <ALBE> est present'
381         PRINT *, '          J ignore donc les autres ALBE**'         PRINT *, ' J ignore donc les autres ALBE**'
382         call nf95_get_var(ncid, varid, albe(:, 1))         call nf95_get_var(ncid, varid, albe(:, 1))
383         xmin = 1.0E+20         xmin = 1.0E+20
384         xmax = -1.0E+20         xmax = -1.0E+20
# Line 465  contains Line 399  contains
399      ierr = NF90_INQ_VARID(ncid, "ALBLW", varid)      ierr = NF90_INQ_VARID(ncid, "ALBLW", varid)
400      IF (ierr /= NF90_NOERR) THEN      IF (ierr /= NF90_NOERR) THEN
401         PRINT *, 'phyetat0: Le champ <ALBLW> est absent'         PRINT *, 'phyetat0: Le champ <ALBLW> est absent'
402         !        PRINT *, '          Mais je vais essayer de lire ALBLW**'         ! PRINT *, ' Mais je vais essayer de lire ALBLW**'
403         PRINT *, '          Mais je vais prendre ALBE**'         PRINT *, ' Mais je vais prendre ALBE**'
404         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
405            DO i = 1, klon            DO i = 1, klon
406               alblw(i, nsrf) = albe(i, nsrf)               alblw(i, nsrf) = albe(i, nsrf)
# Line 474  contains Line 408  contains
408         ENDDO         ENDDO
409      ELSE      ELSE
410         PRINT *, 'phyetat0: Le champ <ALBLW> est present'         PRINT *, 'phyetat0: Le champ <ALBLW> est present'
411         PRINT *, '          J ignore donc les autres ALBLW**'         PRINT *, ' J ignore donc les autres ALBLW**'
412         call nf95_get_var(ncid, varid, alblw(:, 1))         call nf95_get_var(ncid, varid, alblw(:, 1))
413         xmin = 1.0E+20         xmin = 1.0E+20
414         xmax = -1.0E+20         xmax = -1.0E+20
# Line 490  contains Line 424  contains
424         ENDDO         ENDDO
425      ENDIF      ENDIF
426    
427      ! Lecture de evaporation:        ! Lecture de evaporation:
428    
429      ierr = NF90_INQ_VARID(ncid, "EVAP", varid)      ierr = NF90_INQ_VARID(ncid, "EVAP", varid)
430      IF (ierr /= NF90_NOERR) THEN      IF (ierr /= NF90_NOERR) THEN
431         PRINT *, 'phyetat0: Le champ <EVAP> est absent'         PRINT *, 'phyetat0: Le champ <EVAP> est absent'
432         PRINT *, '          Mais je vais essayer de lire EVAP**'         PRINT *, ' Mais je vais essayer de lire EVAP**'
433         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
434            IF (nsrf.GT.99) THEN            IF (nsrf > 99) THEN
435               PRINT *, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
436               stop 1               stop 1
437            ENDIF            ENDIF
438            WRITE(str2, '(i2.2)') nsrf            WRITE(str2, '(i2.2)') nsrf
439            ierr = NF90_INQ_VARID(ncid, "EVAP"//str2, varid)            call NF95_INQ_VARID(ncid, "EVAP"//str2, varid)
440            IF (ierr /= NF90_NOERR) THEN            call NF95_GET_VAR(ncid, varid, evap(:, nsrf))
              PRINT *, "phyetat0: Le champ <EVAP"//str2//"> est absent"  
              stop 1  
           ENDIF  
           ierr = NF90_GET_VAR(ncid, varid, evap(1, nsrf))  
           IF (ierr /= NF90_NOERR) THEN  
              PRINT *, "phyetat0: Lecture echouee pour <EVAP"//str2//">"  
              stop 1  
           ENDIF  
441            xmin = 1.0E+20            xmin = 1.0E+20
442            xmax = -1.0E+20            xmax = -1.0E+20
443            DO i = 1, klon            DO i = 1, klon
# Line 522  contains Line 448  contains
448         ENDDO         ENDDO
449      ELSE      ELSE
450         PRINT *, 'phyetat0: Le champ <EVAP> est present'         PRINT *, 'phyetat0: Le champ <EVAP> est present'
451         PRINT *, '          J ignore donc les autres EVAP**'         PRINT *, ' J ignore donc les autres EVAP**'
452         call nf95_get_var(ncid, varid, evap(:, 1))         call nf95_get_var(ncid, varid, evap(:, 1))
453         xmin = 1.0E+20         xmin = 1.0E+20
454         xmax = -1.0E+20         xmax = -1.0E+20
# Line 540  contains Line 466  contains
466    
467      ! Lecture precipitation liquide:      ! Lecture precipitation liquide:
468    
469      ierr = NF90_INQ_VARID(ncid, "rain_f", varid)      call NF95_INQ_VARID(ncid, "rain_f", varid)
470      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, rain_fall)
        PRINT *, 'phyetat0: Le champ <rain_f> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, rain_fall)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <rain_f>'  
        stop 1  
     ENDIF  
471      xmin = 1.0E+20      xmin = 1.0E+20
472      xmax = -1.0E+20      xmax = -1.0E+20
473      DO i = 1, klon      DO i = 1, klon
# Line 560  contains Line 478  contains
478    
479      ! Lecture precipitation solide:      ! Lecture precipitation solide:
480    
481      ierr = NF90_INQ_VARID(ncid, "snow_f", varid)      call NF95_INQ_VARID(ncid, "snow_f", varid)
482      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, snow_fall)
        PRINT *, 'phyetat0: Le champ <snow_f> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, snow_fall)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <snow_f>'  
        stop 1  
     ENDIF  
483      xmin = 1.0E+20      xmin = 1.0E+20
484      xmax = -1.0E+20      xmax = -1.0E+20
485      DO i = 1, klon      DO i = 1, klon
# Line 634  contains Line 544  contains
544    
545      ! Lecture du rayonnement net au sol:      ! Lecture du rayonnement net au sol:
546    
547      ierr = NF90_INQ_VARID(ncid, "RADS", varid)      call NF95_INQ_VARID(ncid, "RADS", varid)
548      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, radsol)
        PRINT *, 'phyetat0: Le champ <RADS> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, radsol)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <RADS>'  
        stop 1  
     ENDIF  
549      xmin = 1.0E+20      xmin = 1.0E+20
550      xmax = -1.0E+20      xmax = -1.0E+20
551      DO i = 1, klon      DO i = 1, klon
# Line 657  contains Line 559  contains
559      ierr = NF90_INQ_VARID(ncid, "RUG", varid)      ierr = NF90_INQ_VARID(ncid, "RUG", varid)
560      IF (ierr /= NF90_NOERR) THEN      IF (ierr /= NF90_NOERR) THEN
561         PRINT *, 'phyetat0: Le champ <RUG> est absent'         PRINT *, 'phyetat0: Le champ <RUG> est absent'
562         PRINT *, '          Mais je vais essayer de lire RUG**'         PRINT *, ' Mais je vais essayer de lire RUG**'
563         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
564            IF (nsrf.GT.99) THEN            IF (nsrf > 99) THEN
565               PRINT *, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
566               stop 1               stop 1
567            ENDIF            ENDIF
568            WRITE(str2, '(i2.2)') nsrf            WRITE(str2, '(i2.2)') nsrf
569            ierr = NF90_INQ_VARID(ncid, "RUG"//str2, varid)            call NF95_INQ_VARID(ncid, "RUG"//str2, varid)
570            IF (ierr /= NF90_NOERR) THEN            call NF95_GET_VAR(ncid, varid, frugs(:, nsrf))
              PRINT *, "phyetat0: Le champ <RUG"//str2//"> est absent"  
              stop 1  
           ENDIF  
           ierr = NF90_GET_VAR(ncid, varid, frugs(1, nsrf))  
           IF (ierr /= NF90_NOERR) THEN  
              PRINT *, "phyetat0: Lecture echouee pour <RUG"//str2//">"  
              stop 1  
           ENDIF  
571            xmin = 1.0E+20            xmin = 1.0E+20
572            xmax = -1.0E+20            xmax = -1.0E+20
573            DO i = 1, klon            DO i = 1, klon
# Line 684  contains Line 578  contains
578         ENDDO         ENDDO
579      ELSE      ELSE
580         PRINT *, 'phyetat0: Le champ <RUG> est present'         PRINT *, 'phyetat0: Le champ <RUG> est present'
581         PRINT *, '          J ignore donc les autres RUG**'         PRINT *, ' J ignore donc les autres RUG**'
582         call nf95_get_var(ncid, varid, frugs(:, 1))         call nf95_get_var(ncid, varid, frugs(:, 1))
583         xmin = 1.0E+20         xmin = 1.0E+20
584         xmax = -1.0E+20         xmax = -1.0E+20
# Line 705  contains Line 599  contains
599      ierr = NF90_INQ_VARID(ncid, "AGESNO", varid)      ierr = NF90_INQ_VARID(ncid, "AGESNO", varid)
600      IF (ierr /= NF90_NOERR) THEN      IF (ierr /= NF90_NOERR) THEN
601         PRINT *, 'phyetat0: Le champ <AGESNO> est absent'         PRINT *, 'phyetat0: Le champ <AGESNO> est absent'
602         PRINT *, '          Mais je vais essayer de lire AGESNO**'         PRINT *, ' Mais je vais essayer de lire AGESNO**'
603         DO nsrf = 1, nbsrf         DO nsrf = 1, nbsrf
604            IF (nsrf.GT.99) THEN            IF (nsrf > 99) THEN
605               PRINT *, "Trop de sous-mailles"               PRINT *, "Trop de sous-mailles"
606               stop 1               stop 1
607            ENDIF            ENDIF
# Line 717  contains Line 611  contains
611               PRINT *, "phyetat0: Le champ <AGESNO"//str2//"> est absent"               PRINT *, "phyetat0: Le champ <AGESNO"//str2//"> est absent"
612               agesno = 50.0               agesno = 50.0
613            ENDIF            ENDIF
614            ierr = NF90_GET_VAR(ncid, varid, agesno(1, nsrf))            call NF95_GET_VAR(ncid, varid, agesno(:, nsrf))
           IF (ierr /= NF90_NOERR) THEN  
              PRINT *, "phyetat0: Lecture echouee pour <AGESNO"//str2//">"  
              stop 1  
           ENDIF  
615            xmin = 1.0E+20            xmin = 1.0E+20
616            xmax = -1.0E+20            xmax = -1.0E+20
617            DO i = 1, klon            DO i = 1, klon
# Line 732  contains Line 622  contains
622         ENDDO         ENDDO
623      ELSE      ELSE
624         PRINT *, 'phyetat0: Le champ <AGESNO> est present'         PRINT *, 'phyetat0: Le champ <AGESNO> est present'
625         PRINT *, '          J ignore donc les autres AGESNO**'         PRINT *, ' J ignore donc les autres AGESNO**'
626         call nf95_get_var(ncid, varid, agesno(:, 1))         call nf95_get_var(ncid, varid, agesno(:, 1))
627         xmin = 1.0E+20         xmin = 1.0E+20
628         xmax = -1.0E+20         xmax = -1.0E+20
# Line 748  contains Line 638  contains
638         ENDDO         ENDDO
639      ENDIF      ENDIF
640    
641      ierr = NF90_INQ_VARID(ncid, "ZMEA", varid)      call NF95_INQ_VARID(ncid, "ZMEA", varid)
642      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, zmea)
        PRINT *, 'phyetat0: Le champ <ZMEA> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, zmea)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <ZMEA>'  
        stop 1  
     ENDIF  
643      xmin = 1.0E+20      xmin = 1.0E+20
644      xmax = -1.0E+20      xmax = -1.0E+20
645      DO i = 1, klon      DO i = 1, klon
# Line 766  contains Line 648  contains
648      ENDDO      ENDDO
649      PRINT *, 'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax      PRINT *, 'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax
650    
651      ierr = NF90_INQ_VARID(ncid, "ZSTD", varid)      call NF95_INQ_VARID(ncid, "ZSTD", varid)
652      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, zstd)
        PRINT *, 'phyetat0: Le champ <ZSTD> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, zstd)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <ZSTD>'  
        stop 1  
     ENDIF  
653      xmin = 1.0E+20      xmin = 1.0E+20
654      xmax = -1.0E+20      xmax = -1.0E+20
655      DO i = 1, klon      DO i = 1, klon
# Line 784  contains Line 658  contains
658      ENDDO      ENDDO
659      PRINT *, 'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax      PRINT *, 'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax
660    
661      ierr = NF90_INQ_VARID(ncid, "ZSIG", varid)      call NF95_INQ_VARID(ncid, "ZSIG", varid)
662      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, zsig)
        PRINT *, 'phyetat0: Le champ <ZSIG> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, zsig)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <ZSIG>'  
        stop 1  
     ENDIF  
663      xmin = 1.0E+20      xmin = 1.0E+20
664      xmax = -1.0E+20      xmax = -1.0E+20
665      DO i = 1, klon      DO i = 1, klon
# Line 802  contains Line 668  contains
668      ENDDO      ENDDO
669      PRINT *, 'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax      PRINT *, 'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax
670    
671      ierr = NF90_INQ_VARID(ncid, "ZGAM", varid)      call NF95_INQ_VARID(ncid, "ZGAM", varid)
672      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, zgam)
        PRINT *, 'phyetat0: Le champ <ZGAM> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, zgam)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <ZGAM>'  
        stop 1  
     ENDIF  
673      xmin = 1.0E+20      xmin = 1.0E+20
674      xmax = -1.0E+20      xmax = -1.0E+20
675      DO i = 1, klon      DO i = 1, klon
# Line 820  contains Line 678  contains
678      ENDDO      ENDDO
679      PRINT *, 'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax      PRINT *, 'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax
680    
681      ierr = NF90_INQ_VARID(ncid, "ZTHE", varid)      call NF95_INQ_VARID(ncid, "ZTHE", varid)
682      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, zthe)
        PRINT *, 'phyetat0: Le champ <ZTHE> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, zthe)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <ZTHE>'  
        stop 1  
     ENDIF  
683      xmin = 1.0E+20      xmin = 1.0E+20
684      xmax = -1.0E+20      xmax = -1.0E+20
685      DO i = 1, klon      DO i = 1, klon
# Line 838  contains Line 688  contains
688      ENDDO      ENDDO
689      PRINT *, 'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax      PRINT *, 'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax
690    
691      ierr = NF90_INQ_VARID(ncid, "ZPIC", varid)      call NF95_INQ_VARID(ncid, "ZPIC", varid)
692      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, zpic)
        PRINT *, 'phyetat0: Le champ <ZPIC> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, zpic)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <ZPIC>'  
        stop 1  
     ENDIF  
693      xmin = 1.0E+20      xmin = 1.0E+20
694      xmax = -1.0E+20      xmax = -1.0E+20
695      DO i = 1, klon      DO i = 1, klon
# Line 856  contains Line 698  contains
698      ENDDO      ENDDO
699      PRINT *, 'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax      PRINT *, 'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax
700    
701      ierr = NF90_INQ_VARID(ncid, "ZVAL", varid)      call NF95_INQ_VARID(ncid, "ZVAL", varid)
702      IF (ierr /= NF90_NOERR) THEN      call NF95_GET_VAR(ncid, varid, zval)
        PRINT *, 'phyetat0: Le champ <ZVAL> est absent'  
        stop 1  
     ENDIF  
     ierr = NF90_GET_VAR(ncid, varid, zval)  
     IF (ierr /= NF90_NOERR) THEN  
        PRINT *, 'phyetat0: Lecture echouee pour <ZVAL>'  
        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

Legend:
Removed from v.49  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.21