Index: /LMDZ6/trunk/libf/dyn3d/guide_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3d/guide_mod.F90	(revision 4254)
+++ /LMDZ6/trunk/libf/dyn3d/guide_mod.F90	(revision 4255)
@@ -69,4 +69,5 @@
   SUBROUTINE guide_init
 
+    use netcdf, only: nf90_noerr
     USE control_mod, ONLY: day_step
     USE serre_mod, ONLY: grossismx
@@ -173,5 +174,5 @@
        if (ncidpl.eq.-99) then
           rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
-          if (rcod.NE.NF_NOERR) THEN
+          if (rcod.NE.NF90_NOERR) THEN
              abort_message=' Nudging error -> no file apbp.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -181,5 +182,5 @@
        if (ncidpl.EQ.-99) then
           rcod=nf90_open('P.nc',Nf90_NOWRITe,ncidpl)
-          if (rcod.NE.NF_NOERR) THEN
+          if (rcod.NE.NF90_NOERR) THEN
              abort_message=' Nudging error -> no file P.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -190,5 +191,5 @@
            if (ncidpl.eq.-99) then
                rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
-               if (rcod.NE.NF_NOERR) THEN
+               if (rcod.NE.NF90_NOERR) THEN
                   CALL abort_gcm(modname, &
                        ' Nudging error -> no file u.nc',1)
@@ -199,5 +200,5 @@
            if (ncidpl.eq.-99) then
                rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
-               if (rcod.NE.NF_NOERR) THEN
+               if (rcod.NE.NF90_NOERR) THEN
                   CALL abort_gcm(modname, &
                        ' Nudging error -> no file v.nc',1)
@@ -207,5 +208,5 @@
            if (ncidpl.eq.-99) then
                rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
-               if (rcod.NE.NF_NOERR) THEN
+               if (rcod.NE.NF90_NOERR) THEN
                   CALL abort_gcm(modname, &
                        ' Nudging error -> no file T.nc',1)
@@ -215,5 +216,5 @@
            if (ncidpl.eq.-99) then
                rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
-               if (rcod.NE.NF_NOERR) THEN
+               if (rcod.NE.NF90_NOERR) THEN
                   CALL abort_gcm(modname, &
                        ' Nudging error -> no file hur.nc',1)
@@ -224,6 +225,6 @@
     endif 
     error=NF_INQ_DIMID(ncidpl,'LEVEL',rid)
-    IF (error.NE.NF_NOERR) error=NF_INQ_DIMID(ncidpl,'PRESSURE',rid)
-    IF (error.NE.NF_NOERR) THEN
+    IF (error.NE.NF90_NOERR) error=NF_INQ_DIMID(ncidpl,'PRESSURE',rid)
+    IF (error.NE.NF90_NOERR) THEN
         CALL abort_gcm(modname,'Nudging: error reading pressure levels',1)
     ENDIF
@@ -1082,5 +1083,5 @@
   SUBROUTINE guide_read(timestep)
 
-    use netcdf, only: NF90_GET_VAR
+    use netcdf, only: NF90_GET_VAR, nf90_noerr
 
     IMPLICIT NONE
@@ -1114,15 +1115,15 @@
              write(*,*) trim(modname)//' Reading nudging on model levels'
              rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no file apbp.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no AP variable in file apbp.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no BP variable in file apbp.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1134,10 +1135,10 @@
          if (guide_plevs.EQ.2) then
              rcode = nf90_open('P.nc', nf90_nowrite, ncidp)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no file P.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidp, 'PRES', varidp)
-             IF (rcode.NE.NF_NOERR) THEN 
+             IF (rcode.NE.NF90_NOERR) THEN 
               abort_message='Nudging: error -> no PRES variable in file P.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1150,10 +1151,10 @@
          if (guide_u) then
              rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no file u.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no UWND variable in file u.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1181,10 +1182,10 @@
          if (guide_v) then
              rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no file v.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no VWND variable in file v.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1214,10 +1215,10 @@
          if (guide_T) then
              rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no file T.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no AIR variable in file T.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1245,10 +1246,10 @@
          if (guide_Q) then
              rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no file hur.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no RH variable in file hur.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1276,10 +1277,10 @@
          if ((guide_P).OR.(guide_modele)) then
              rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no file ps.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidps, 'SP', varidps)
-             IF (rcode.NE.NF_NOERR) THEN
+             IF (rcode.NE.NF90_NOERR) THEN
               abort_message='Nudging: error -> no SP variable in file ps.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1383,5 +1384,5 @@
   SUBROUTINE guide_read2D(timestep)
 
-    use netcdf, only: nf90_get_var
+    use netcdf, only: nf90_get_var, nf90_noerr
 
     IMPLICIT NONE
@@ -1418,15 +1419,15 @@
            write(*,*)trim(modname)//' Reading nudging on model levels'
            rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no file apbp.nc'
            CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no AP variable in file apbp.nc'
            CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no BP variable in file apbp.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1437,10 +1438,10 @@
          if (guide_plevs.EQ.2) then
            rcode = nf90_open('P.nc', nf90_nowrite, ncidp)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no file P.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidp, 'PRES', varidp)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no PRES variable in file P.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1452,10 +1453,10 @@
          if (guide_u) then
            rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no file u.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no UWND variable in file u.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1467,10 +1468,10 @@
          if (guide_v) then
            rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no file v.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no VWND variable in file v.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1482,10 +1483,10 @@
          if (guide_T) then
            rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no file T.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no AIR variable in file T.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1497,10 +1498,10 @@
          if (guide_Q) then
            rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no file hur.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no RH,variable in file hur.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1512,10 +1513,10 @@
          if ((guide_P).OR.(guide_modele)) then
            rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no file ps.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidps, 'SP', varidps)
-           IF (rcode.NE.NF_NOERR) THEN
+           IF (rcode.NE.NF90_NOERR) THEN
              abort_message='Nudging: error -> no SP variable in file ps.nc'
              CALL abort_gcm(modname,abort_message,1)
