G.Delautier 11/2015 correction dor arome files
authorGaelle Tanguy <gaelle.tanguy@meteo.fr>
Thu, 26 Nov 2015 14:51:46 +0000 (14:51 +0000)
committerPhilippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Thu, 19 May 2016 14:44:49 +0000 (16:44 +0200)
src/SURFEX/mode_read_extern.F90

index 7f5fcb5..b5417c8 100644 (file)
@@ -541,6 +541,8 @@ DEALLOCATE(ZSOILGRID)
 ALLOCATE(ZNAT(KNI))
 IF (IVERSION>=7) THEN
   CALL READ_SURF(HFILEPGDTYPE,'FRAC_NATURE',ZNAT,IRESP,HDIR='A')
+ELSE
+  ZNAT=1.0  
 ENDIF
 
 !
@@ -634,7 +636,7 @@ IF (HFIELD=='WG    ' .OR. HFIELD=='WGI   ') THEN
   IF (HFIELD=='WG    ') THEN
     DO JPATCH=1,IPATCH
       DO JLAYER=1,ILAYER
-        WHERE(ZNAT(:)>0.0)
+        WHERE(ZNAT(:)>0.0 .AND. ZVAR(:,JLAYER,JPATCH)/=XUNDEF)
           ZVAR(:,JLAYER,JPATCH) = MAX(MIN(ZVAR(:,JLAYER,JPATCH),ZWSAT(:)),0.)
           !
           ZFIELD(:,JLAYER,JPATCH) = (ZVAR(:,JLAYER,JPATCH) - ZWWILT(:)) / (ZWFC(:) - ZWWILT(:))
@@ -644,7 +646,7 @@ IF (HFIELD=='WG    ' .OR. HFIELD=='WGI   ') THEN
   ELSE IF (HFIELD=='WGI   ') THEN
     DO JPATCH=1,IPATCH
       DO JLAYER=1,ILAYER
-        WHERE(ZNAT(:)>0.0)
+        WHERE(ZNAT(:)>0.0 .AND. ZVAR(:,JLAYER,JPATCH)/=XUNDEF)
           ZFIELD(:,JLAYER,JPATCH) = ZVAR(:,JLAYER,JPATCH) / ZWSAT(:)  
         END WHERE 
       END DO