Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.F	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.F	(revision 5088)
@@ -4,5 +4,5 @@
      .                     lmt_omnat)
       USE dimphy
-      USE lmdz_netcdf, ONLY: nf_close,nf_noerr,nf_inq_varid,nf_open,nf_nowrite,nf90_get_var
+      USE netcdf, ONLY: nf90_close,nf90_noerr,nf90_inq_varid,nf90_open,nf90_nowrite,nf90_get_var
       IMPLICIT none
 !
@@ -34,6 +34,6 @@
       ENDIF
 !
-      ierr = NF_OPEN ("limitcarbon.nc", NF_NOWRITE, nid1)
-      if (ierr/=NF_NOERR) then
+      ierr = nf90_open ("limitcarbon.nc", nf90_nowrite, nid1)
+      if (ierr/=nf90_noerr) then
         write(6,*)' Pb d''ouverture du fichier limitbc.nc'
         write(6,*)' ierr = ', ierr
@@ -48,11 +48,11 @@
 !
 !
-      ierr = NF_INQ_VARID (nid1, "BCFF", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCFF", nvarid)
       ierr = nf90_get_var(nid1, nvarid, lmt_bcff, debut, epais)
 !      print *,'IERR = ',ierr
-!      print *,'NF_NOERR = ',NF_NOERR
+!      print *,'nf90_noerr = ',nf90_noerr
 !      print *,'debut = ',debut
 !      print *,'epais = ',epais
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC'
          CALL exit(1)
@@ -60,7 +60,7 @@
 !
 !
-      ierr = NF_INQ_VARID (nid1, "BCBB", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCBB", nvarid)
       ierr = nf90_get_var(nid1, nvarid, lmt_bcbb, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC-biomass'
          CALL exit(1)
@@ -68,7 +68,7 @@
 !
 !
-      ierr = NF_INQ_VARID (nid1, "BCBL", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCBL", nvarid)
       ierr = nf90_get_var(nid1, nvarid, lmt_bcbbl, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC low'
          CALL exit(1)
@@ -76,14 +76,14 @@
 !
 !
-      ierr = NF_INQ_VARID (nid1, "BCBH", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCBH", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_bcbbh, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC high'
          CALL exit(1)
       ENDIF
 !
-      ierr = NF_INQ_VARID (nid1, "TERP", nvarid)
+      ierr = nf90_inq_varid (nid1, "TERP", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_terp, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources Terpene'
          CALL exit(1)
@@ -91,7 +91,7 @@
 !
 !
-      ierr = NF_INQ_VARID (nid1, "BC_penner", nvarid)
+      ierr = nf90_inq_varid (nid1, "BC_penner", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_bc_penner, debut,  epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC Penner'
          CALL exit(1)
@@ -99,7 +99,7 @@
 !
 !
-      ierr = NF_INQ_VARID (nid1, "OMFF", nvarid)
+      ierr = nf90_inq_varid (nid1, "OMFF", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_omff, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources om-ifossil'
          CALL exit(1)
@@ -114,5 +114,5 @@
       ENDDO
 !
-      ierr = NF_CLOSE(nid1)
+      ierr = nf90_close(nid1)
       PRINT*, 'Carbon sources lues pour jour: ', jour
 !
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.F	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.F	(revision 5088)
@@ -6,5 +6,5 @@
       USE mod_phys_lmdz_para
       USE dimphy
-      USE lmdz_netcdf, ONLY:nf90_get_var,nf_close,nf_noerr,nf_inq_varid,nf_open,nf_nowrite
+      USE netcdf, ONLY:nf90_get_var,nf90_close,nf90_noerr,nf90_inq_varid,nf90_open,nf90_nowrite
       IMPLICIT none
 c
@@ -57,6 +57,6 @@
 !=======================================================================
 !
-      ierr = NF_OPEN ("carbon_emissions.nc", NF_NOWRITE, nid1)
-      if (ierr/=NF_NOERR) then
+      ierr = nf90_open ("carbon_emissions.nc", nf90_nowrite, nid1)
+      if (ierr/=nf90_noerr) then
         write(6,*)' Pb d''ouverture du fichier limitbc.nc'
         write(6,*)' ierr = ', ierr
@@ -66,7 +66,7 @@
 ! BC emissions from fossil fuel combustion
 !
-      ierr = NF_INQ_VARID (nid1, "BCFF", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCFF", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_bcff_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC'
          CALL exit(1)
@@ -77,7 +77,7 @@
 ! BC emissions from non fossil fuel combustion
 !
-      ierr = NF_INQ_VARID (nid1, "BCNFF", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCNFF", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_bcnff_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC'
          CALL exit(1)
@@ -86,7 +86,7 @@
 ! Low BC emissions from biomass burning
 !
-      ierr = NF_INQ_VARID (nid1, "BCBBL", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCBBL", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_bcbbl_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC low'
          CALL exit(1)
@@ -95,7 +95,7 @@
 ! High BC emissions from biomass burning
 !
-      ierr = NF_INQ_VARID (nid1, "BCBBH", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCBBH", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_bcbbh_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC high'
          CALL exit(1)
@@ -104,7 +104,7 @@
 ! BC emissions from ship transport
 !
-      ierr = NF_INQ_VARID (nid1, "BCBA", nvarid)
+      ierr = nf90_inq_varid (nid1, "BCBA", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_bcba_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources BC'
          CALL exit(1)
@@ -119,7 +119,7 @@
 ! OM emissions from fossil fuel combustion
 !
-      ierr = NF_INQ_VARID (nid1, "OMFF", nvarid)
+      ierr = nf90_inq_varid (nid1, "OMFF", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_omff_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources OM'
          CALL exit(1)
@@ -128,7 +128,7 @@
 ! OM emissions from non fossil fuel combustion
 !
-      ierr = NF_INQ_VARID (nid1, "OMNFF", nvarid)
+      ierr = nf90_inq_varid (nid1, "OMNFF", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_omnff_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources OM'
          CALL exit(1)
@@ -137,7 +137,7 @@
 ! Low OM emissions from biomass burning - low
 !
-      ierr = NF_INQ_VARID (nid1, "OMBBL", nvarid)
+      ierr = nf90_inq_varid (nid1, "OMBBL", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_ombbl_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources OM low'
          CALL exit(1)
@@ -146,7 +146,7 @@
 ! High OM emissions from biomass burning - high
 !
-      ierr = NF_INQ_VARID (nid1, "OMBBH", nvarid)
+      ierr = nf90_inq_varid (nid1, "OMBBH", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_ombbh_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources OM high'
          CALL exit(1)
@@ -155,7 +155,7 @@
 ! High OM emissions from ship
 !
-      ierr = NF_INQ_VARID (nid1, "OMBA", nvarid)
+      ierr = nf90_inq_varid (nid1, "OMBA", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_omba_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources OM ship'
          CALL exit(1)
@@ -164,7 +164,7 @@
 ! Natural Terpene emissions => Natural OM emissions
 !
-      ierr = NF_INQ_VARID (nid1, "TERP", nvarid)
+      ierr = nf90_inq_varid (nid1, "TERP", nvarid)
       ierr = nf90_get_var (nid1, nvarid, lmt_terp_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources Terpene'
          CALL exit(1)
@@ -175,5 +175,5 @@
       ENDDO
 
-      ierr = NF_CLOSE(nid1)
+      ierr = nf90_close(nid1)
 !
       PRINT*, 'Carbon sources lues pour jour: ', jour
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.F	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.F	(revision 5088)
@@ -4,5 +4,5 @@
      .                     lmt_dmsbio, lmt_h2sbio, lmt_dms, lmt_dmsconc)
        USE dimphy
-       USE lmdz_netcdf, ONLY:nf_close,nf_noerr,nf_inq_varid,nf_open,nf_nowrite,nf90_get_var
+       USE netcdf, ONLY:nf90_close,nf90_noerr,nf90_inq_varid,nf90_open,nf90_nowrite,nf90_get_var
       IMPLICIT none
 c
@@ -34,6 +34,6 @@
       ENDIF
 c
-      ierr = NF_OPEN ("limitsoufre.nc", NF_NOWRITE, nid)
-      if (ierr/=NF_NOERR) then
+      ierr = nf90_open ("limitsoufre.nc", nf90_nowrite, nid)
+      if (ierr/=nf90_noerr) then
         write(6,*)' Pb d''ouverture du fichier limitsoufre.nc'
         write(6,*)' ierr = ', ierr
@@ -47,14 +47,14 @@
       epais(2) = 1
 c
-      ierr = NF_INQ_VARID (nid, "VOLC", nvarid)
+      ierr = nf90_inq_varid (nid, "VOLC", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2volc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 volcan'
          CALL exit(1)
       ENDIF
 c
-      ierr = NF_INQ_VARID (nid, "ALTI", nvarid)
+      ierr = nf90_inq_varid (nid, "ALTI", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_altvolc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les altitudes volcan'
          CALL exit(1)
@@ -63,14 +63,14 @@
       IF (edgar) THEN   !--EDGAR w/o ship and biomass burning
 c
-      ierr = NF_INQ_VARID (nid, "SO2ED95L", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2ED95L", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 edgar low'
          CALL exit(1)
       ENDIF
 c
-      ierr = NF_INQ_VARID (nid, "SO2ED95H", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2ED95H", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 edgar high'
          CALL exit(1)
@@ -79,14 +79,14 @@
       ELSE  !--GEIA 
 c
-      ierr = NF_INQ_VARID (nid, "SO2H", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2H", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 haut'
          CALL exit(1)
       ENDIF
 c
-      ierr = NF_INQ_VARID (nid, "SO2B", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2B", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 bas'
          CALL exit(1)
@@ -95,28 +95,28 @@
       ENDIF  !--edgar
 c
-      ierr = NF_INQ_VARID (nid, "SO2BB", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2BB", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2bb, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 bb'
          CALL exit(1)
       ENDIF
 c
-      ierr = NF_INQ_VARID (nid, "SO2BA", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2BA", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2ba, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 bateau'
          CALL exit(1)
       ENDIF
 c
-      ierr = NF_INQ_VARID (nid, "DMSB", nvarid)
+      ierr = nf90_inq_varid (nid, "DMSB", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_dmsbio, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms bio'
          CALL exit(1)
       ENDIF
 c
-      ierr = NF_INQ_VARID (nid, "H2SB", nvarid)
+      ierr = nf90_inq_varid (nid, "H2SB", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_h2sbio, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources h2s bio'
          CALL exit(1)
@@ -125,7 +125,7 @@
       IF (flag_dms==1) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSL", nvarid)
+      ierr = nf90_inq_varid (nid, "DMSL", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms liss'
          CALL exit(1)
@@ -134,7 +134,7 @@
       ELSEIF (flag_dms==2) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSW", nvarid)
+      ierr = nf90_inq_varid (nid, "DMSW", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms wann'
          CALL exit(1)
@@ -143,7 +143,7 @@
       ELSEIF (flag_dms==3) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSC1", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      ierr = nf90_inq_varid (nid, "DMSC1", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dmsconc old'
          CALL exit(1)
@@ -152,7 +152,7 @@
       ELSEIF (flag_dms==4) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSC2", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      ierr = nf90_inq_varid (nid, "DMSC2", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms conc 2'
          CALL exit(1)
@@ -161,7 +161,7 @@
       ELSEIF (flag_dms==5) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSC3", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      ierr = nf90_inq_varid (nid, "DMSC3", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms conc 3'
          CALL exit(1)
@@ -170,7 +170,7 @@
       ELSEIF (flag_dms==6) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSC4", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      ierr = nf90_inq_varid (nid, "DMSC4", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms conc 4'
          CALL exit(1)
@@ -179,7 +179,7 @@
       ELSEIF (flag_dms==7) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSC5", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      ierr = nf90_inq_varid (nid, "DMSC5", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms conc 5'
          CALL exit(1)
@@ -188,7 +188,7 @@
       ELSEIF (flag_dms==8) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSC6", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      ierr = nf90_inq_varid (nid, "DMSC6", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms conc 6'
          CALL exit(1)
@@ -197,7 +197,7 @@
       ELSEIF (flag_dms==9) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSC7", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      ierr = nf90_inq_varid (nid, "DMSC7", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms conc 7'
          CALL exit(1)
@@ -206,7 +206,7 @@
       ELSEIF (flag_dms==10) THEN 
 c
-      ierr = NF_INQ_VARID (nid, "DMSC8", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      ierr = nf90_inq_varid (nid, "DMSC8", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms conc 8'
          CALL exit(1)
@@ -220,5 +220,5 @@
       ENDIF
 c
-      ierr = NF_CLOSE(nid)
+      ierr = nf90_close(nid)
 c
       IF (flag_dms<=2) THEN 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.F	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.F	(revision 5088)
@@ -9,5 +9,5 @@
       USE mod_phys_lmdz_para
       USE dimphy
-      USE lmdz_netcdf, ONLY: nf90_get_var,nf_inq_varid,nf_close,nf_noerr,nf_open,nf_nowrite
+      USE netcdf, ONLY: nf90_get_var,nf90_inq_varid,nf90_close,nf90_noerr,nf90_open,nf90_nowrite
       IMPLICIT none
 c
@@ -61,6 +61,6 @@
 !=======================================================================
 !
-      ierr = NF_OPEN ("sulphur_emissions_antro.nc", NF_NOWRITE, nid)
-      if (ierr/=NF_NOERR) then
+      ierr = nf90_open ("sulphur_emissions_antro.nc", nf90_nowrite, nid)
+      if (ierr/=nf90_noerr) then
         write(6,*)' Pb d''ouverture du fichier sulphur_emissions_antro'
         write(6,*)' ierr = ', ierr
@@ -71,7 +71,7 @@
 ! SO2 Low level emissions
 !
-      ierr = NF_INQ_VARID (nid, "SO2FF_LOW", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2FF_LOW", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2b_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
         PRINT*, 'Pb de lecture pour les sources so2 low'
         print *,'JE klon, jour, debut ,epais ',klon_glo,jour,debut,epais
@@ -83,7 +83,7 @@
 ! SO2 High level emissions
 !
-      ierr = NF_INQ_VARID (nid, "SO2FF_HIGH", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2FF_HIGH", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2h_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
         PRINT*, 'Pb de lecture pour les sources so2 high'
         CALL exit(1)
@@ -92,7 +92,7 @@
 ! SO2 Biomass burning High level emissions
 !
-      ierr = NF_INQ_VARID (nid, "SO2BBH", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2BBH", nvarid)
       ierr = nf90_get_var(nid, nvarid,  lmt_so2bb_h_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
         PRINT*, 'Pb de lecture pour les sources so2 BB high'
         CALL exit(1)
@@ -101,7 +101,7 @@
 ! SO2 biomass burning low level emissions
 !
-      ierr = NF_INQ_VARID (nid, "SO2BBL", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2BBL", nvarid)
       ierr = nf90_get_var(nid, nvarid,  lmt_so2bb_l_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
         PRINT*, 'Pb de lecture pour les sources so2 BB low'
         CALL exit(1)
@@ -110,7 +110,7 @@
 ! SO2 ship emissions
 !
-      ierr = NF_INQ_VARID (nid, "SO2BA", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2BA", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2ba_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
         PRINT*, 'Pb de lecture pour les sources so2 ship'
         CALL exit(1)
@@ -119,18 +119,18 @@
 ! SO2 Non Fossil Fuel Emissions
 !
-      ierr = NF_INQ_VARID (nid, "SO2NFF", nvarid)
+      ierr = nf90_inq_varid (nid, "SO2NFF", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2nff_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
         PRINT*, 'Pb de lecture pour les sources so2 non FF'
         CALL exit(1)
       ENDIF
 !
-      ierr = NF_CLOSE(nid)
+      ierr = nf90_close(nid)
 !
 !=======================================================================
 !                      READING NATURAL EMISSIONS
 !=======================================================================
-      ierr = NF_OPEN ("sulphur_emissions_nat.nc", NF_NOWRITE, nid)
-      if (ierr/=NF_NOERR) then
+      ierr = nf90_open ("sulphur_emissions_nat.nc", nf90_nowrite, nid)
+      if (ierr/=nf90_noerr) then
         write(6,*)' Pb d''ouverture du fichier sulphur_emissions_nat'
         write(6,*)' ierr = ', ierr
@@ -140,7 +140,7 @@
 c Biologenic source of DMS
 c
-      ierr = NF_INQ_VARID (nid, "DMSB", nvarid)
+      ierr = nf90_inq_varid (nid, "DMSB", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_dmsbio_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms bio'
          CALL exit(1)
@@ -149,7 +149,7 @@
 c Biologenic source of H2S
 c
-      ierr = NF_INQ_VARID (nid, "H2SB", nvarid)
+      ierr = nf90_inq_varid (nid, "H2SB", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_h2sbio_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources h2s bio'
          CALL exit(1)
@@ -160,7 +160,7 @@
       IF (flag_dms==4) THEN
 c
-      ierr = NF_INQ_VARID (nid, "DMSC2", nvarid)
+      ierr = nf90_inq_varid (nid, "DMSC2", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_dmsconc_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources dms conc 2'
          CALL exit(1)
@@ -179,5 +179,5 @@
       ENDIF
 c
-      ierr = NF_CLOSE(nid)
+      ierr = nf90_close(nid)
 c
 !=======================================================================
@@ -186,6 +186,6 @@
       print *,'   ***      READING VOLCANIC EMISSIONS   ***   '
       print *,' Jour = ',jour
-      ierr = NF_OPEN ("sulphur_emissions_volc.nc", NF_NOWRITE, nid)
-      if (ierr/=NF_NOERR) then
+      ierr = nf90_open ("sulphur_emissions_volc.nc", nf90_nowrite, nid)
+      if (ierr/=nf90_noerr) then
         write(6,*)' Pb d''ouverture du fichier sulphur_emissions_volc'
         write(6,*)' ierr = ', ierr
@@ -195,8 +195,8 @@
 c Continuous Volcanic emissions
 c
-!      ierr = NF_INQ_VARID (nid, "VOLC", nvarid)
-      ierr = NF_INQ_VARID (nid, "flx_volc_cont", nvarid)
+!      ierr = nf90_inq_varid (nid, "VOLC", nvarid)
+      ierr = nf90_inq_varid (nid, "flx_volc_cont", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2volc_cont_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 volcan (cont)'
          CALL exit(1)
@@ -208,8 +208,8 @@
 c Altitud of continuous volcanic emissions
 c
-!      ierr = NF_INQ_VARID (nid, "ALTI", nvarid)
-      ierr = NF_INQ_VARID (nid, "flx_volc_altcont", nvarid)
+!      ierr = nf90_inq_varid (nid, "ALTI", nvarid)
+      ierr = nf90_inq_varid (nid, "flx_volc_altcont", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_altvolc_cont_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les altitudes volcan (cont)'
          CALL exit(1)
@@ -218,7 +218,7 @@
 c Explosive Volcanic emissions
 c
-      ierr = NF_INQ_VARID (nid, "flx_volc_expl", nvarid)
+      ierr = nf90_inq_varid (nid, "flx_volc_expl", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_so2volc_expl_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les sources so2 volcan (expl)'
          CALL exit(1)
@@ -230,7 +230,7 @@
 c Altitud of explosive volcanic emissions
 c
-      ierr = NF_INQ_VARID (nid, "flx_volc_altexpl", nvarid)
+      ierr = nf90_inq_varid (nid, "flx_volc_altexpl", nvarid)
       ierr = nf90_get_var(nid, nvarid, lmt_altvolc_expl_glo, debut, epais)
-      IF (ierr /= NF_NOERR) THEN
+      IF (ierr /= nf90_noerr) THEN
          PRINT*, 'Pb de lecture pour les altitudes volcan'
          CALL exit(1)
@@ -238,5 +238,5 @@
 !      lmt_altvolc_expl(:)=0.0
 
-      ierr = NF_CLOSE(nid)
+      ierr = nf90_close(nid)
 c
       PRINT*, 'Sources SOUFRE lues pour jour: ', jour
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90	(revision 5088)
@@ -390,5 +390,5 @@
     USE ioipsl, ONLY: histend, histsync
     USE iophy, ONLY: set_itau_iophy, histwrite_phy
-    USE lmdz_netcdf, ONLY: nf90_fill_real
+    USE netcdf, ONLY: nf90_fill_real
     ! ug Pour les sorties XIOS
     USE lmdz_xios, ONLY: xios_update_calendar, using_xios
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phytracr_spl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phytracr_spl_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phytracr_spl_mod.F90	(revision 5088)
@@ -4568,5 +4568,5 @@
       USE mod_grid_phy_lmdz
       USE mod_phys_lmdz_para
-      USE lmdz_netcdf, ONLY:nf_open,nf_close,nf_inq_varid,nf_nowrite,nf_noerr,nf90_get_var
+      USE netcdf, ONLY:nf90_open,nf90_close,nf90_inq_varid,nf90_nowrite,nf90_noerr,nf90_get_var
       IMPLICIT NONE
 
@@ -4587,6 +4587,6 @@
       IF (is_mpi_root .AND. is_omp_root) THEN
           !nci=NCOPN(trim(adjustl(filescaleparams)),NCNOWRIT,rcode)
-         ierr = NF_OPEN (trim(adjustl(filescaleparams)),NF_NOWRITE, nid)
-          if (ierr == NF_NOERR) THEN
+         ierr = nf90_open (trim(adjustl(filescaleparams)),nf90_nowrite, nid)
+          if (ierr == nf90_noerr) THEN
           debutread=step_sca
           countread=1
@@ -4596,7 +4596,7 @@
             varname= trim(adjustl(paramname))//aux_2s
             print *,varname
-            ierr = NF_INQ_VARID (nid,trim(adjustl(varname)), nvarid)
+            ierr = nf90_inq_varid (nid,trim(adjustl(varname)), nvarid)
             ierr = nf90_get_var (nid, nvarid, auxreal, debutread, countread)
-            IF (ierr /= NF_NOERR) THEN
+            IF (ierr /= nf90_noerr) THEN
              PRINT*, 'Pb de lecture pour modvalues'
        print *,'JE  scale_var, step_sca',trim(adjustl(varname)),step_sca
@@ -4611,5 +4611,5 @@
            enddo
 
-            ierr = NF_CLOSE(nid)
+            ierr = nf90_close(nid)
           else
            print *,'File '//trim(adjustl(filescaleparams))//' not found'
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_dust.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_dust.F	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_dust.F	(revision 5088)
@@ -3,5 +3,5 @@
       USE mod_grid_phy_lmdz
       USE mod_phys_lmdz_para
-      USE lmdz_netcdf, ONLY:nf90_get_var
+      USE netcdf, ONLY:nf90_get_var
       IMPLICIT NONE 
 c
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90	(revision 5088)
@@ -10,5 +10,5 @@
        USE mod_phys_lmdz_para
        USE iophy
-       USE lmdz_netcdf, ONLY:nf_inq_varid,nf_noerr,nf90_get_var
+       USE netcdf, ONLY:nf90_inq_varid,nf90_noerr,nf90_get_var
        IMPLICIT NONE
 
@@ -61,8 +61,8 @@
        if (i==4) aux4s='Latu'
        if (i==5) aux4s='latU'
-       status = NF_INQ_VARID (ncid, aux4s, rcode)
+       status = nf90_inq_varid (ncid, aux4s, rcode)
 !       print *,'stat,i',status,i,outcycle,aux4s
-!       print *,'ifclause',status.NE. NF_NOERR ,outcycle == .false.
-       IF ((.not.(status/= NF_NOERR) ).and.( .not. outcycle )) THEN
+!       print *,'ifclause',status.NE. nf90_noerr ,outcycle == .false.
+       IF ((.not.(status/= nf90_noerr) ).and.( .not. outcycle )) THEN
          outcycle=.true.
          latstr=aux4s
@@ -76,5 +76,5 @@
           status=nf90_get_var(ncid,varid,lats_glo,startj,endj)
 !      print *,latstr,varid,status,jjp1,rcode
-!      IF (status .NE. NF_NOERR) print*,'NOOOOOOO'
+!      IF (status .NE. nf90_noerr) print*,'NOOOOOOO'
 !      print *,lats
 !stop
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.F	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.F	(revision 5088)
@@ -3,5 +3,5 @@
       USE mod_grid_phy_lmdz
       USE mod_phys_lmdz_para
-      USE lmdz_netcdf, ONLY: nf90_get_var
+      USE netcdf, ONLY: nf90_get_var
 !      USE write_field_phy
       IMPLICIT NONE 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90	(revision 5088)
@@ -6,5 +6,5 @@
   USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, & 
                       nf95_inq_varid, nf95_inquire_dimension, nf95_open
-  USE lmdz_netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
+  USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
 
   USE mod_grid_phy_lmdz
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90	(revision 5088)
@@ -8,5 +8,5 @@
   USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, & 
                       nf95_inq_varid, nf95_inquire_dimension, nf95_open
-  USE lmdz_netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
+  USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
 
   USE mod_grid_phy_lmdz
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/condsurf.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/condsurf.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/condsurf.F90	(revision 5088)
@@ -7,5 +7,5 @@
   USE indice_sol_mod
   USE time_phylmdz_mod, ONLY: annee_ref
-  USE lmdz_netcdf, ONLY: nf90_get_var,nf_open,nf_inq_varid,nf_noerr,nf_close,nf_nowrite
+  USE netcdf, ONLY: nf90_get_var,nf90_open,nf90_inq_varid,nf90_noerr,nf90_close,nf90_nowrite
   IMPLICIT NONE
 
@@ -88,6 +88,6 @@
   !$OMP MASTER
   IF (is_mpi_root) THEN
-    ierr = nf_open(fich, nf_nowrite, nid)
-    IF (ierr/=nf_noerr) THEN
+    ierr = nf90_open(fich, nf90_nowrite, nid)
+    IF (ierr/=nf90_noerr) THEN
       WRITE (6, *) ' Pb d''ouverture du fichier ', fich
       WRITE (6, *) ' Le fichier limit ', fich, ' (avec 4 chiffres , pour'
@@ -105,11 +105,11 @@
     ! Bilan flux de chaleur au sol:
 
-    ierr = nf_inq_varid(nid, 'BILS', nvarid)
-    IF (ierr/=nf_noerr) THEN
+    ierr = nf90_inq_varid(nid, 'BILS', nvarid)
+    IF (ierr/=nf90_noerr) THEN
       CALL abort_physic('cond_surf', 'Le champ <BILS> est absent', 1)
     END IF
     PRINT *, 'debut,epais', debut, epais, 'jour,jourvrai', jour, jourvrai
     ierr = nf90_get_var(nid, nvarid,  lmt_bils_glo, debut, epais)
-    IF (ierr/=nf_noerr) THEN
+    IF (ierr/=nf90_noerr) THEN
       CALL abort_physic('condsurf', 'Lecture echouee pour <BILS>', 1)
     END IF
@@ -118,5 +118,5 @@
     ! Fermer le fichier:
 
-    ierr = nf_close(nid)
+    ierr = nf90_close(nid)
 
   END IF ! is_mpi_root==0
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/create_etat0_unstruct_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/create_etat0_unstruct_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/create_etat0_unstruct_mod.F90	(revision 5088)
@@ -23,5 +23,5 @@
   SUBROUTINE init_create_etat0_unstruct
   USE lmdz_xios
-  USE lmdz_netcdf, ONLY: NF90_NOWRITE,nf90_close,nf90_noerr,nf90_open
+  USE netcdf, ONLY: NF90_NOWRITE,nf90_close,nf90_noerr,nf90_open
   USE mod_phys_lmdz_para
   IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1DUTILS.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1DUTILS.h	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1DUTILS.h	(revision 5088)
@@ -673,5 +673,5 @@
       USE logic_mod, ONLY: fxyhypb, ysinus
       USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn
-      USE lmdz_netcdf, ONLY:nf_open,nf_write,nf_noerr
+      USE netcdf, ONLY:nf90_open,nf90_write,nf90_noerr
 
       IMPLICIT NONE
@@ -820,5 +820,5 @@
       USE logic_mod, ONLY: fxyhypb, ysinus
       USE temps_mod, ONLY: annee_ref,day_end,day_ref,itau_dyn,itaufin
-      USE lmdz_netcdf, ONLY:nf_open,nf_write,nf_noerr
+      USE netcdf, ONLY:nf90_open,nf90_write,nf90_noerr
 
       IMPLICIT NONE
@@ -868,6 +868,6 @@
 
 !     modname = 'dyn1dredem'
-!     ierr = NF_OPEN(fichnom, NF_WRITE, nid)
-!     IF (ierr .NE. NF_NOERR) THEN
+!     ierr = nf90_open(fichnom, nf90_write, nid)
+!     IF (ierr .NE. nf90_noerr) THEN
 !        abort_message="Pb. d ouverture "//fichnom
 !        CALL abort_gcm('Modele 1D',abort_message,1)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_amma_read.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_amma_read.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_amma_read.F90	(revision 5088)
@@ -1,5 +1,5 @@
 MODULE mod_1D_amma_read
-        USE lmdz_netcdf, ONLY: nf90_get_var,nf_open,nf_noerr,nf_open,nf_nowrite,&
-                nf_inq_dimid,nf_inq_dimlen,nf_strerror,nf_inq_varid
+        USE netcdf, ONLY: nf90_get_var,nf90_open,nf90_noerr,nf90_open,nf90_nowrite,&
+                nf90_inq_dimid,nf90_inquire_dimension,nf90_strerror,nf90_inq_varid
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !Declarations specifiques au cas AMMA
@@ -63,26 +63,26 @@
       fich_amma='amma.nc'
       print*,'fich_amma ',fich_amma
-      ierr = NF_OPEN(fich_amma,NF_NOWRITE,nid)
-      print*,'fich_amma,NF_NOWRITE,nid ',fich_amma,NF_NOWRITE,nid
-      if (ierr/=NF_NOERR) then
+      ierr = nf90_open(fich_amma,nf90_nowrite,nid)
+      print*,'fich_amma,nf90_nowrite,nid ',fich_amma,nf90_nowrite,nid
+      if (ierr/=nf90_noerr) then
          write(*,*) 'ERROR: GROS Pb opening forcings nc file '
-         write(*,*) NF_STRERROR(ierr)
+         write(*,*) nf90_strerror(ierr)
          stop ""
       endif
 !.......................................................................
-      ierr=NF_INQ_DIMID(nid,'lev',rid)
-      IF (ierr/=NF_NOERR) THEN
+      ierr=nf90_inq_dimid(nid,'lev',rid)
+      IF (ierr/=nf90_noerr) THEN
          print*, 'Oh probleme lecture dimension zz'
       ENDIF
-      ierr=NF_INQ_DIMLEN(nid,rid,nlev_amma)
+      ierr=nf90_inquire_dimension(nid,rid,len=nlev_amma)
       print*,'OK nid,rid,nlev_amma',nid,rid,nlev_amma
 !.......................................................................
-      ierr=NF_INQ_DIMID(nid,'time',rid)
+      ierr=nf90_inq_dimid(nid,'time',rid)
       print*,'nid,rid',nid,rid
       nt_amma=0
-      IF (ierr/=NF_NOERR) THEN
+      IF (ierr/=nf90_noerr) THEN
         stop 'probleme lecture dimension sens'
       ENDIF
-      ierr=NF_INQ_DIMLEN(nid,rid,nt_amma)
+      ierr=nf90_inquire_dimension(nid,rid,len=nt_amma)
       print*,'nid,rid,nlev_amma',nid,rid,nt_amma
 
@@ -195,68 +195,68 @@
       integer var3didin(nbvar3d)
 
-       ierr=NF_INQ_VARID(nid,"zz",var3didin(1)) 
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"zz",var3didin(1))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'lev'
          endif
 
 
-      ierr=NF_INQ_VARID(nid,"temp",var3didin(2))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"temp",var3didin(2))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'temp'
          endif
 
-      ierr=NF_INQ_VARID(nid,"qv",var3didin(3))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"qv",var3didin(3))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'qv'
          endif
 
-      ierr=NF_INQ_VARID(nid,"u",var3didin(4))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"u",var3didin(4))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'u'
          endif
 
-      ierr=NF_INQ_VARID(nid,"v",var3didin(5))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"v",var3didin(5))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'v'
          endif
 
-      ierr=NF_INQ_VARID(nid,"dw",var3didin(6))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"dw",var3didin(6))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'dw'
          endif
 
-      ierr=NF_INQ_VARID(nid,"dt",var3didin(7))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"dt",var3didin(7))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'dt'
          endif
 
-      ierr=NF_INQ_VARID(nid,"dq",var3didin(8))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"dq",var3didin(8))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'dq'
          endif
       
-      ierr=NF_INQ_VARID(nid,"sens",var3didin(9))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"sens",var3didin(9))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'sens'
          endif
 
-      ierr=NF_INQ_VARID(nid,"flat",var3didin(10))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"flat",var3didin(10))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'flat'
          endif
 
-      ierr=NF_INQ_VARID(nid,"pp",var3didin(11))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"pp",var3didin(11))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
       endif
 
@@ -265,6 +265,6 @@
  
          ierr = nf90_get_var(nid,var3didin(1),zz)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -272,6 +272,6 @@
 
          ierr = nf90_get_var(nid,var3didin(2),temp)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -279,6 +279,6 @@
 
          ierr = nf90_get_var(nid,var3didin(3),qv)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -286,6 +286,6 @@
  
          ierr = nf90_get_var(nid,var3didin(4),u)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -293,6 +293,6 @@
 
          ierr = nf90_get_var(nid,var3didin(5),v)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -300,6 +300,6 @@
 
          ierr = nf90_get_var(nid,var3didin(6),dw)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -307,6 +307,6 @@
 
          ierr = nf90_get_var(nid,var3didin(7),dt)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -314,6 +314,6 @@
 
          ierr = nf90_get_var(nid,var3didin(8),dq)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -321,6 +321,6 @@
 
          ierr = nf90_get_var(nid,var3didin(9),sens)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -328,6 +328,6 @@
 
          ierr = nf90_get_var(nid,var3didin(10),flat)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -335,6 +335,6 @@
 
          ierr = nf90_get_var(nid,var3didin(11),pp)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90	(revision 5088)
@@ -1,5 +1,5 @@
 MODULE mod_1D_cases_read
-  USE lmdz_netcdf, ONLY: nf_noerr,nf_strerror,nf_inq_varid,nf_inq_dimlen,nf_inq_dimid,&
-          nf_nowrite,nf_open,nf90_get_var
+  USE netcdf, ONLY: nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_inquire_dimension,nf90_inq_dimid,&
+          nf90_nowrite,nf90_open,nf90_get_var
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -93,40 +93,40 @@
       fich_cas='setup/cas.nc'
       print*,'fich_cas ',fich_cas
-      ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)
-      print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid
-      if (ierr/=NF_NOERR) then
+      ierr = nf90_open(fich_cas,nf90_nowrite,nid)
+      print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid
+      if (ierr/=nf90_noerr) then
          write(*,*) 'ERROR: GROS Pb opening forcings nc file '
-         write(*,*) NF_STRERROR(ierr)
+         write(*,*) nf90_strerror(ierr)
          stop ""
       endif
 !.......................................................................
-      ierr=NF_INQ_DIMID(nid,'lat',rid)
-      IF (ierr/=NF_NOERR) THEN
+      ierr=nf90_inq_dimid(nid,'lat',rid)
+      IF (ierr/=nf90_noerr) THEN
          print*, 'Oh probleme lecture dimension lat'
       ENDIF
-      ierr=NF_INQ_DIMLEN(nid,rid,ii)
+      ierr=nf90_inquire_dimension(nid,rid,len=ii)
       print*,'OK1 nid,rid,lat',nid,rid,ii
 !.......................................................................
-      ierr=NF_INQ_DIMID(nid,'lon',rid)
-      IF (ierr/=NF_NOERR) THEN
+      ierr=nf90_inq_dimid(nid,'lon',rid)
+      IF (ierr/=nf90_noerr) THEN
          print*, 'Oh probleme lecture dimension lon'
       ENDIF
-      ierr=NF_INQ_DIMLEN(nid,rid,jj)
+      ierr=nf90_inquire_dimension(nid,rid,len=jj)
       print*,'OK2 nid,rid,lat',nid,rid,jj
 !.......................................................................
-      ierr=NF_INQ_DIMID(nid,'lev',rid)
-      IF (ierr/=NF_NOERR) THEN
+      ierr=nf90_inq_dimid(nid,'lev',rid)
+      IF (ierr/=nf90_noerr) THEN
          print*, 'Oh probleme lecture dimension zz'
       ENDIF
-      ierr=NF_INQ_DIMLEN(nid,rid,nlev_cas)
+      ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas)
       print*,'OK3 nid,rid,nlev_cas',nid,rid,nlev_cas
 !.......................................................................
-      ierr=NF_INQ_DIMID(nid,'time',rid)
+      ierr=nf90_inq_dimid(nid,'time',rid)
       print*,'nid,rid',nid,rid
       nt_cas=0
-      IF (ierr/=NF_NOERR) THEN
+      IF (ierr/=nf90_noerr) THEN
         stop 'probleme lecture dimension sens'
       ENDIF
-      ierr=NF_INQ_DIMLEN(nid,rid,nt_cas)
+      ierr=nf90_inquire_dimension(nid,rid,len=nt_cas)
       print*,'OK4 nid,rid,nt_cas',nid,rid,nt_cas
 
@@ -288,243 +288,243 @@
       integer var3didin(nbvar3d)
 
-       ierr=NF_INQ_VARID(nid,"zz",var3didin(1))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"zz",var3didin(1))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'lev'
          endif
 
-      ierr=NF_INQ_VARID(nid,"pp",var3didin(2))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"pp",var3didin(2))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'plev'
          endif
 
 
-      ierr=NF_INQ_VARID(nid,"temp",var3didin(3))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"temp",var3didin(3))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'temp'
          endif
 
-      ierr=NF_INQ_VARID(nid,"qv",var3didin(4))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"qv",var3didin(4))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'qv'
          endif
 
-      ierr=NF_INQ_VARID(nid,"rh",var3didin(5))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"rh",var3didin(5))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'rh'
          endif
 
-      ierr=NF_INQ_VARID(nid,"theta",var3didin(6))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"theta",var3didin(6))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'theta'
          endif
 
-      ierr=NF_INQ_VARID(nid,"rv",var3didin(7))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"rv",var3didin(7))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'rv'
          endif
 
 
-      ierr=NF_INQ_VARID(nid,"u",var3didin(8))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"u",var3didin(8))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'u'
          endif
 
-      ierr=NF_INQ_VARID(nid,"v",var3didin(9))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"v",var3didin(9))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'v'
          endif
 
-       ierr=NF_INQ_VARID(nid,"ug",var3didin(10))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"ug",var3didin(10))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'ug'
          endif
 
-      ierr=NF_INQ_VARID(nid,"vg",var3didin(11))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"vg",var3didin(11))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vg'
          endif
 
-      ierr=NF_INQ_VARID(nid,"w",var3didin(12))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"w",var3didin(12))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'w'
          endif
 
-      ierr=NF_INQ_VARID(nid,"advu",var3didin(13))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"advu",var3didin(13))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'advu'
          endif
 
-      ierr=NF_INQ_VARID(nid,"hu",var3didin(14))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hu",var3didin(14))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hu'
          endif
 
-       ierr=NF_INQ_VARID(nid,"vu",var3didin(15))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"vu",var3didin(15))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vu'
          endif
 
-       ierr=NF_INQ_VARID(nid,"advv",var3didin(16))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"advv",var3didin(16))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'advv'
          endif
 
-      ierr=NF_INQ_VARID(nid,"hv",var3didin(17))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hv",var3didin(17))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hv'
          endif
 
-       ierr=NF_INQ_VARID(nid,"vv",var3didin(18))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"vv",var3didin(18))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vv'
          endif
 
-      ierr=NF_INQ_VARID(nid,"advT",var3didin(19))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"advT",var3didin(19))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'advT'
          endif
 
-      ierr=NF_INQ_VARID(nid,"hT",var3didin(20))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hT",var3didin(20))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hT'
          endif
 
-      ierr=NF_INQ_VARID(nid,"vT",var3didin(21))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"vT",var3didin(21))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vT'
          endif
 
-      ierr=NF_INQ_VARID(nid,"advq",var3didin(22))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"advq",var3didin(22))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'advq'
          endif
 
-      ierr=NF_INQ_VARID(nid,"hq",var3didin(23))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hq",var3didin(23))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hq'
          endif
 
-      ierr=NF_INQ_VARID(nid,"vq",var3didin(24))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"vq",var3didin(24))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vq'
          endif
 
-      ierr=NF_INQ_VARID(nid,"advth",var3didin(25))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"advth",var3didin(25))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'advth'
          endif
 
-      ierr=NF_INQ_VARID(nid,"hth",var3didin(26))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hth",var3didin(26))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hth'
          endif
 
-      ierr=NF_INQ_VARID(nid,"vth",var3didin(27))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"vth",var3didin(27))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vth'
          endif
 
-      ierr=NF_INQ_VARID(nid,"advr",var3didin(28))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"advr",var3didin(28))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'advr'
          endif
 
-      ierr=NF_INQ_VARID(nid,"hr",var3didin(29))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hr",var3didin(29))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hr'
          endif
 
-      ierr=NF_INQ_VARID(nid,"vr",var3didin(30))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"vr",var3didin(30))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vr'
          endif
 
-      ierr=NF_INQ_VARID(nid,"radT",var3didin(31))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"radT",var3didin(31))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'radT'
          endif
 
-      ierr=NF_INQ_VARID(nid,"sens",var3didin(32))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"sens",var3didin(32))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'sens'
          endif
 
-      ierr=NF_INQ_VARID(nid,"flat",var3didin(33))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"flat",var3didin(33))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'flat'
          endif
 
-      ierr=NF_INQ_VARID(nid,"ts",var3didin(34))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"ts",var3didin(34))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'ts'
          endif
 
-      ierr=NF_INQ_VARID(nid,"ustar",var3didin(35))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"ustar",var3didin(35))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'ustar'
          endif
 
-      ierr=NF_INQ_VARID(nid,"uw",var3didin(36))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"uw",var3didin(36))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'uw'
          endif
 
-      ierr=NF_INQ_VARID(nid,"vw",var3didin(37))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"vw",var3didin(37))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vw'
          endif
 
-      ierr=NF_INQ_VARID(nid,"q1",var3didin(38))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"q1",var3didin(38))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'q1'
          endif
 
-      ierr=NF_INQ_VARID(nid,"q2",var3didin(39))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"q2",var3didin(39))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'q2'
          endif
 
          ierr = nf90_get_var(nid,var3didin(1),zz)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -532,6 +532,6 @@
 
          ierr = nf90_get_var(nid,var3didin(2),pp)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -540,6 +540,6 @@
 
          ierr = nf90_get_var(nid,var3didin(3),temp)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -547,6 +547,6 @@
 
          ierr = nf90_get_var(nid,var3didin(4),qv)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -554,6 +554,6 @@
 
          ierr = nf90_get_var(nid,var3didin(5),rh)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -561,6 +561,6 @@
 
          ierr = nf90_get_var(nid,var3didin(6),theta)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -568,6 +568,6 @@
 
          ierr = nf90_get_var(nid,var3didin(7),rv)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -575,6 +575,6 @@
 
          ierr = nf90_get_var(nid,var3didin(8),u)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -582,6 +582,6 @@
 
          ierr = nf90_get_var(nid,var3didin(9),v)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -589,6 +589,6 @@
 
          ierr = nf90_get_var(nid,var3didin(10),ug)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -596,6 +596,6 @@
 
          ierr = nf90_get_var(nid,var3didin(11),vg)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -603,6 +603,6 @@
 
          ierr = nf90_get_var(nid,var3didin(12),w)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -610,6 +610,6 @@
 
          ierr = nf90_get_var(nid,var3didin(13),du)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -617,6 +617,6 @@
 
          ierr = nf90_get_var(nid,var3didin(14),hu)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -624,6 +624,6 @@
 
          ierr = nf90_get_var(nid,var3didin(15),vu)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -631,6 +631,6 @@
 
          ierr = nf90_get_var(nid,var3didin(16),dv)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -638,6 +638,6 @@
 
          ierr = nf90_get_var(nid,var3didin(17),hv)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -645,6 +645,6 @@
 
          ierr = nf90_get_var(nid,var3didin(18),vv)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -652,6 +652,6 @@
 
          ierr = nf90_get_var(nid,var3didin(19),dt)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -659,6 +659,6 @@
 
          ierr = nf90_get_var(nid,var3didin(20),ht)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -666,6 +666,6 @@
 
          ierr = nf90_get_var(nid,var3didin(21),vt)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -673,6 +673,6 @@
 
          ierr = nf90_get_var(nid,var3didin(22),dq)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -680,6 +680,6 @@
 
          ierr = nf90_get_var(nid,var3didin(23),hq)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -687,6 +687,6 @@
 
          ierr = nf90_get_var(nid,var3didin(24),vq)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -694,6 +694,6 @@
 
          ierr = nf90_get_var(nid,var3didin(25),dth)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -701,6 +701,6 @@
 
          ierr = nf90_get_var(nid,var3didin(26),hth)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -708,6 +708,6 @@
 
          ierr = nf90_get_var(nid,var3didin(27),vth)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -715,6 +715,6 @@
 
          ierr = nf90_get_var(nid,var3didin(28),dr)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -722,6 +722,6 @@
 
          ierr = nf90_get_var(nid,var3didin(29),hr)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -729,6 +729,6 @@
 
          ierr = nf90_get_var(nid,var3didin(30),vr)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -736,6 +736,6 @@
 
          ierr = nf90_get_var(nid,var3didin(31),dtrad)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -743,6 +743,6 @@
 
          ierr = nf90_get_var(nid,var3didin(32),sens)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -750,6 +750,6 @@
 
          ierr = nf90_get_var(nid,var3didin(33),flat)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -757,6 +757,6 @@
 
          ierr = nf90_get_var(nid,var3didin(34),ts)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -764,6 +764,6 @@
 
          ierr = nf90_get_var(nid,var3didin(35),ustar)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -771,6 +771,6 @@
 
          ierr = nf90_get_var(nid,var3didin(36),uw)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -778,6 +778,6 @@
 
          ierr = nf90_get_var(nid,var3didin(37),vw)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -785,6 +785,6 @@
 
          ierr = nf90_get_var(nid,var3didin(38),q1)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -792,6 +792,6 @@
 
          ierr = nf90_get_var(nid,var3didin(39),q2)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 5088)
@@ -3,6 +3,6 @@
 !
 MODULE mod_1D_cases_read2
-  USE lmdz_netcdf, ONLY: nf90_get_var,nf_noerr,nf_inq_varid,nf_inq_dimlen,nf_strerror,nf_open,&
-          nf_nowrite,nf_inq_dimid
+  USE netcdf, ONLY: nf90_get_var,nf90_noerr,nf90_inq_varid,nf90_inquire_dimension,nf90_strerror,nf90_open,&
+          nf90_nowrite,nf90_inq_dimid
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !Declarations specifiques au cas standard
@@ -87,40 +87,40 @@
     fich_cas='setup/cas.nc'
     print*,'fich_cas ',fich_cas
-    ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)
-    print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid
-    if (ierr/=NF_NOERR) then
+    ierr = nf90_open(fich_cas,nf90_nowrite,nid)
+    print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid
+    if (ierr/=nf90_noerr) then
        write(*,*) 'ERROR: GROS Pb opening forcings nc file '
-       write(*,*) NF_STRERROR(ierr)
+       write(*,*) nf90_strerror(ierr)
        stop ""
     endif
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lat',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lat',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension lat'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,ii)
+    ierr=nf90_inquire_dimension(nid,rid,len=ii)
     print*,'OK1 nid,rid,lat',nid,rid,ii
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lon',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lon',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension lon'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,jj)
+    ierr=nf90_inquire_dimension(nid,rid,len=jj)
     print*,'OK2 nid,rid,lat',nid,rid,jj
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lev',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lev',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension zz'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,nlev_cas)
+    ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas)
     print*,'OK3 nid,rid,nlev_cas',nid,rid,nlev_cas
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'time',rid)
+    ierr=nf90_inq_dimid(nid,'time',rid)
     print*,'nid,rid',nid,rid
     nt_cas=0
-    IF (ierr/=NF_NOERR) THEN
+    IF (ierr/=nf90_noerr) THEN
        stop 'probleme lecture dimension sens'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,nt_cas)
+    ierr=nf90_inquire_dimension(nid,rid,len=nt_cas)
     print*,'OK4 nid,rid,nt_cas',nid,rid,nt_cas
 
@@ -196,39 +196,39 @@
     fich_cas='setup/cas.nc'
     print*,'fich_cas ',fich_cas
-    ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)
-    print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid
-    if (ierr/=NF_NOERR) then
+    ierr = nf90_open(fich_cas,nf90_nowrite,nid)
+    print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid
+    if (ierr/=nf90_noerr) then
        write(*,*) 'ERROR: GROS Pb opening forcings nc file '
-       write(*,*) NF_STRERROR(ierr)
+       write(*,*) nf90_strerror(ierr)
        stop ""
     endif
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lat',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lat',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension lat'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,ii)
+    ierr=nf90_inquire_dimension(nid,rid,len=ii)
     print*,'OK1 read2: nid,rid,lat',nid,rid,ii
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lon',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lon',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension lon'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,jj)
+    ierr=nf90_inquire_dimension(nid,rid,len=jj)
     print*,'OK2 read2: nid,rid,lat',nid,rid,jj
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'nlev',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'nlev',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension nlev'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,nlev_cas)
+    ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas)
     print*,'OK3 read2: nid,rid,nlev_cas',nid,rid,nlev_cas
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'time',rid)
+    ierr=nf90_inq_dimid(nid,'time',rid)
     nt_cas=0
-    IF (ierr/=NF_NOERR) THEN
+    IF (ierr/=nf90_noerr) THEN
        stop 'Oh probleme lecture dimension time'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,nt_cas)
+    ierr=nf90_inquire_dimension(nid,rid,len=nt_cas)
     print*,'OK4 read2: nid,rid,nt_cas',nid,rid,nt_cas
 
@@ -324,31 +324,31 @@
     fich_cas='cas.nc'
     print*,'fich_cas ',fich_cas
-    ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)
-    print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid
-    if (ierr/=NF_NOERR) then
+    ierr = nf90_open(fich_cas,nf90_nowrite,nid)
+    print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid
+    if (ierr/=nf90_noerr) then
        write(*,*) 'ERROR: GROS Pb opening forcings nc file '
-       write(*,*) NF_STRERROR(ierr)
+       write(*,*) nf90_strerror(ierr)
        stop ""
     endif
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lat',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lat',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension lat'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,ii)
+    ierr=nf90_inquire_dimension(nid,rid,len=ii)
     print*,'OK1 read2: nid,rid,lat',nid,rid,ii
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lon',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lon',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension lon'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,jj)
+    ierr=nf90_inquire_dimension(nid,rid,len=jj)
     print*,'OK2 read2: nid,rid,lat',nid,rid,jj
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lev',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lev',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension nlev'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,nlev_cas)
+    ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas)
     print*,'OK3 read2: nid,rid,nlev_cas',nid,rid,nlev_cas
     IF ( .NOT. ( nlev_cas > 10 .AND. nlev_cas < 1000 )) THEN
@@ -357,21 +357,21 @@
     ENDIF
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'time',rid)
+    ierr=nf90_inq_dimid(nid,'time',rid)
     nt_cas=0
-    IF (ierr/=NF_NOERR) THEN
+    IF (ierr/=nf90_noerr) THEN
        stop 'Oh probleme lecture dimension time'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,nt_cas)
+    ierr=nf90_inquire_dimension(nid,rid,len=nt_cas)
     print*,'OK4 read2: nid,rid,nt_cas',nid,rid,nt_cas
     ! Lecture de l'axe des temps
     print*,'LECTURE DU TEMPS'
-    ierr=NF_INQ_VARID(nid,'time',timeid)
-    if(ierr/=NF_NOERR) then
+    ierr=nf90_inq_varid(nid,'time',timeid)
+    if(ierr/=nf90_noerr) then
        print *,'Variable time manquante dans cas.nc:'
-       ierr=NF_NOERR
+       ierr=nf90_noerr
     else
        allocate(time_val(nt_cas))
        ierr = NF90_GET_VAR(nid,timeid,time_val)
-       if(ierr/=NF_NOERR) then
+       if(ierr/=nf90_noerr) then
           print *,'Pb a la lecture de time cas.nc: '
        endif
@@ -573,7 +573,7 @@
   enddo
   do i=1,nbvar3d
-     ierr=NF_INQ_VARID(nid,name_var(i),var3didin(i)) 
+     ierr=nf90_inq_varid(nid,name_var(i),var3didin(i))
      print *,'ierr=',i,ierr,name_var(i),var3didin(i)
-     if(ierr/=NF_NOERR) then
+     if(ierr/=nf90_noerr) then
         print *,'Variable manquante dans cas.nc:',name_var(i)
      endif
@@ -584,5 +584,5 @@
         ierr = NF90_GET_VAR(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime])
         print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i)
-        if(ierr/=NF_NOERR) then
+        if(ierr/=nf90_noerr) then
            print *,'Pb a la lecture de cas.nc: ',name_var(i)
            stop "getvarup"
@@ -591,5 +591,5 @@
         print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i)
         ierr = NF90_GET_VAR(nid,var3didin(i),resul1, count = [1, 1, ntime])
-        if(ierr/=NF_NOERR) then
+        if(ierr/=nf90_noerr) then
            print *,'Pb a la lecture de cas.nc: ',name_var(i)
            stop "getvarup"
@@ -694,8 +694,8 @@
   !-----------------------------------------------------------------------
   do i=1,nbvar3d
-     ierr=NF_INQ_VARID(nid,name_var(i),var3didin(i)) 
-     if(ierr/=NF_NOERR) then
+     ierr=nf90_inq_varid(nid,name_var(i),var3didin(i))
+     if(ierr/=nf90_noerr) then
         print *,'Variable manquante dans cas.nc:',i,name_var(i)
-        ierr=NF_NOERR
+        ierr=nf90_noerr
         missing_var(i)=1
      else
@@ -704,5 +704,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),apbp, count = [1, 1, nlevel + 1])
            print *,'read2_cas(apbp), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
@@ -712,5 +712,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime])
            print *,'read2_cas(resul), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
@@ -720,5 +720,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),resul2, count = [1, 1, ntime])
            print *,'read2_cas(resul2), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
@@ -728,5 +728,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
            print *,'read2_cas(resul3), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
@@ -869,8 +869,8 @@
   print*,'ON EST LA'
   do i=1,nbvar3d
-     ierr=NF_INQ_VARID(nid,name_var(i),var3didin(i)) 
-     if(ierr/=NF_NOERR) then
+     ierr=nf90_inq_varid(nid,name_var(i),var3didin(i))
+     if(ierr/=nf90_noerr) then
         print *,'Variable manquante dans cas.nc:',i,name_var(i)
-        ierr=NF_NOERR
+        ierr=nf90_noerr
         missing_var(i)=1
      else
@@ -879,5 +879,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),apbp)
            print *,'read2_cas(apbp), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
@@ -887,5 +887,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),resul1)
            print *,'read2_cas(resul1), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
@@ -896,5 +896,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),resul)
            print *,'read2_cas(resul), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
@@ -905,5 +905,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),resul2)
            print *,'read2_cas(resul2), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
@@ -914,5 +914,5 @@
            ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
            print *,'read2_cas(resul3), on a lu ',i,name_var(i)
-           if(ierr/=NF_NOERR) then
+           if(ierr/=nf90_noerr) then
               print *,'Pb a la lecture de cas.nc: ',name_var(i)
               stop "getvarup"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 5088)
@@ -3,6 +3,6 @@
 !
 MODULE mod_1D_cases_read_std
-  USE lmdz_netcdf, ONLY:nf_noerr,nf_inq_varid,nf_inq_dimid,nf_inq_dimlen,nf_open,nf_nowrite,&
-          nf_strerror,nf90_get_var
+  USE netcdf, ONLY:nf90_noerr,nf90_inq_varid,nf90_inq_dimid,nf90_inquire_dimension,nf90_open,nf90_nowrite,&
+          nf90_strerror,nf90_get_var
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -99,31 +99,31 @@
     fich_cas='cas.nc'
     print*,'fich_cas ',fich_cas
-    ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)
-    print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid
-    if (ierr/=NF_NOERR) then
+    ierr = nf90_open(fich_cas,nf90_nowrite,nid)
+    print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid
+    if (ierr/=nf90_noerr) then
        write(*,*) 'ERROR: GROS Pb opening forcings nc file '
-       write(*,*) NF_STRERROR(ierr)
+       write(*,*) nf90_strerror(ierr)
        stop ""
     endif
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lat',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lat',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension lat'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,ii)
+    ierr=nf90_inquire_dimension(nid,rid,len=ii)
     print*,'OK1 read_SCM_cas: nid,rid,lat',nid,rid,ii
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lon',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lon',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension lon'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,jj)
+    ierr=nf90_inquire_dimension(nid,rid,len=jj)
     print*,'OK2 read_SCM_cas: nid,rid,lat',nid,rid,jj
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'lev',rid)
-    IF (ierr/=NF_NOERR) THEN
+    ierr=nf90_inq_dimid(nid,'lev',rid)
+    IF (ierr/=nf90_noerr) THEN
        print*, 'Oh probleme lecture dimension nlev'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,nlev_cas)
+    ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas)
     print*,'OK3 read_SCM_cas: nid,rid,nlev_cas',nid,rid,nlev_cas
     IF ( .NOT. ( nlev_cas > 10 .AND. nlev_cas < 200000 )) THEN
@@ -132,21 +132,21 @@
     ENDIF
     !.......................................................................
-    ierr=NF_INQ_DIMID(nid,'time',rid)
+    ierr=nf90_inq_dimid(nid,'time',rid)
     nt_cas=0
-    IF (ierr/=NF_NOERR) THEN
+    IF (ierr/=nf90_noerr) THEN
        stop 'Oh probleme lecture dimension time'
     ENDIF
-    ierr=NF_INQ_DIMLEN(nid,rid,nt_cas)
+    ierr=nf90_inquire_dimension(nid,rid,len=nt_cas)
     print*,'OK4 read_SCM_cas: nid,rid,nt_cas',nid,rid,nt_cas
     ! Lecture de l'axe des temps
     print*,'LECTURE DU TEMPS'
-    ierr=NF_INQ_VARID(nid,'time',timeid)
-    if(ierr/=NF_NOERR) then
+    ierr=nf90_inq_varid(nid,'time',timeid)
+    if(ierr/=nf90_noerr) then
        print *,'Variable time manquante dans cas.nc:'
-       ierr=NF_NOERR
+       ierr=nf90_noerr
     else
        allocate(time_val(nt_cas))
        ierr = NF90_GET_VAR(nid,timeid,time_val)
-       if(ierr/=NF_NOERR) then
+       if(ierr/=nf90_noerr) then
           print *,'A Pb a la lecture de time cas.nc: '
        endif
@@ -412,6 +412,6 @@
 
 
-    ierr=NF_INQ_VARID(nid,'ta',int_test)
-    if(ierr/=NF_NOERR) then
+    ierr=nf90_inq_varid(nid,'ta',int_test)
+    if(ierr/=nf90_noerr) then
        print*, '++++++++++++++++++++++++++++++'
        print*, 'variable ta missing in cas.nc '
@@ -429,9 +429,9 @@
     do i=1,nbvar3d
        missing_var(i)=0.
-       ierr=NF_INQ_VARID(nid,name_var(i),var3didin(i)) 
+       ierr=nf90_inq_varid(nid,name_var(i),var3didin(i))
        print*, 'name_var(i)', name_var(i), var3didin(i)
-       if(ierr/=NF_NOERR) then
+       if(ierr/=nf90_noerr) then
           print *,'Variable manquante dans cas.nc:',i,name_var(i)
-          ierr=NF_NOERR
+          ierr=nf90_noerr
           missing_var(i)=1
        else
@@ -456,5 +456,5 @@
              ierr = NF90_GET_VAR(nid,var3didin(i),apbp)
              print *,'read_SCM(apbp), on a lu ',i,name_var(i)
-             if(ierr/=NF_NOERR) then
+             if(ierr/=nf90_noerr) then
                 print *,'B Pb a la lecture de cas.nc: ',name_var(i)
                 stop "getvarup"
@@ -467,5 +467,5 @@
              ierr = NF90_GET_VAR(nid,var3didin(i),resul1)
              print *,'read_SCM(resul1), on a lu ',i,name_var(i)
-             if(ierr/=NF_NOERR) then
+             if(ierr/=nf90_noerr) then
                 print *,'C Pb a la lecture de cas.nc: ',name_var(i)
                 stop "getvarup"
@@ -480,5 +480,5 @@
              ierr = NF90_GET_VAR(nid,var3didin(i),resul)
              print *,'read_SCM(resul), on a lu ',i,name_var(i)
-             if(ierr/=NF_NOERR) then
+             if(ierr/=nf90_noerr) then
                 print *,'D Pb a la lecture de cas.nc: ',name_var(i)
                 stop "getvarup"
@@ -492,5 +492,5 @@
              ierr = NF90_GET_VAR(nid,var3didin(i),resul2)
              print *,'read_SCM(resul2), on a lu ',i,name_var(i)
-             if(ierr/=NF_NOERR) then
+             if(ierr/=nf90_noerr) then
                 print *,'E Pb a la lecture de cas.nc: ',name_var(i)
                 stop "getvarup"
@@ -504,5 +504,5 @@
              ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
              print *,'read_SCM(resul3), on a lu ',i,name_var(i)
-             if(ierr/=NF_NOERR) then
+             if(ierr/=nf90_noerr) then
                 print *,'F Pb a la lecture de cas.nc: ',name_var(i)
                 stop "getvarup"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 5088)
@@ -146,6 +146,6 @@
 !program reading forcings of the TWP-ICE experiment
 
-        use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,&
-            nf_inq_dimid,nf_inq_dimlen
+        use netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,&
+            nf90_inq_dimid,nf90_inquire_dimension
 
 
@@ -177,128 +177,128 @@
       integer var3didin(nbvar3d)
 
-      ierr = NF_OPEN(fich_twpice,NF_NOWRITE,nid)
-      if (ierr.NE.NF_NOERR) then
+      ierr = nf90_open(fich_twpice,nf90_nowrite,nid)
+      if (ierr.NE.nf90_noerr) then
          write(*,*) 'ERROR: Pb opening forcings cdf file '
-         write(*,*) NF_STRERROR(ierr)
+         write(*,*) nf90_strerror(ierr)
          stop ""
       endif
 
-      ierr=NF_INQ_VARID(nid,"lat",var3didin(1))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"lat",var3didin(1))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'lat'
          endif
       
-       ierr=NF_INQ_VARID(nid,"lon",var3didin(2))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"lon",var3didin(2))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'lon'
          endif
 
-       ierr=NF_INQ_VARID(nid,"alt",var3didin(3))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"alt",var3didin(3))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'alt'
          endif
 
-      ierr=NF_INQ_VARID(nid,"phis",var3didin(4))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"phis",var3didin(4))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'phis'
          endif
 
-      ierr=NF_INQ_VARID(nid,"T",var3didin(5))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"T",var3didin(5))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'T'
          endif
 
-      ierr=NF_INQ_VARID(nid,"q",var3didin(6))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"q",var3didin(6))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'q'
          endif
 
-      ierr=NF_INQ_VARID(nid,"u",var3didin(7))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"u",var3didin(7))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'u'
          endif
 
-      ierr=NF_INQ_VARID(nid,"v",var3didin(8))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"v",var3didin(8))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'v'
          endif
 
-      ierr=NF_INQ_VARID(nid,"omega",var3didin(9))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"omega",var3didin(9))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'omega'
          endif
 
-      ierr=NF_INQ_VARID(nid,"div",var3didin(10))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"div",var3didin(10))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'div'
          endif
 
-      ierr=NF_INQ_VARID(nid,"T_adv_h",var3didin(11))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"T_adv_h",var3didin(11))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'T_adv_h'
          endif
 
-      ierr=NF_INQ_VARID(nid,"T_adv_v",var3didin(12))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"T_adv_v",var3didin(12))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'T_adv_v'
          endif
 
-      ierr=NF_INQ_VARID(nid,"q_adv_h",var3didin(13))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"q_adv_h",var3didin(13))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'q_adv_h'
          endif
 
-      ierr=NF_INQ_VARID(nid,"q_adv_v",var3didin(14))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"q_adv_v",var3didin(14))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'q_adv_v'
          endif
 
-      ierr=NF_INQ_VARID(nid,"s",var3didin(15))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"s",var3didin(15))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 's'
          endif
 
-      ierr=NF_INQ_VARID(nid,"s_adv_h",var3didin(16))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"s_adv_h",var3didin(16))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 's_adv_h'
          endif
     
-      ierr=NF_INQ_VARID(nid,"s_adv_v",var3didin(17))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"s_adv_v",var3didin(17))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 's_adv_v'
          endif
 
-      ierr=NF_INQ_VARID(nid,"p_srf_aver",var3didin(18))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"p_srf_aver",var3didin(18))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'p_srf_aver'
          endif
 
-      ierr=NF_INQ_VARID(nid,"p_srf_center",var3didin(19))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"p_srf_center",var3didin(19))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'p_srf_center'
          endif
 
-      ierr=NF_INQ_VARID(nid,"T_srf",var3didin(20))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"T_srf",var3didin(20))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'T_srf'
          endif
@@ -315,6 +315,6 @@
           
          ierr = NF90_GET_VAR(nid,var3didin(1),lat)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -322,6 +322,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(2),lon)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -329,6 +329,6 @@
  
          ierr = NF90_GET_VAR(nid,var3didin(3),alt)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -336,6 +336,6 @@
  
          ierr = NF90_GET_VAR(nid,var3didin(4),phis)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -343,6 +343,6 @@
           
          ierr = NF90_GET_VAR(nid,var3didin(5),T)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -350,6 +350,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(6),q)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -362,6 +362,6 @@
        enddo
          ierr = NF90_GET_VAR(nid,var3didin(7),u)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -369,6 +369,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(8),v)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -376,6 +376,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(9),omega)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -389,6 +389,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(10),div)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -396,6 +396,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(11),T_adv_h)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -410,6 +410,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(12),T_adv_v)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -423,6 +423,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(13),q_adv_h)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -437,6 +437,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(14),q_adv_v)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -451,36 +451,36 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(15),s)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(16),s_adv_h)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(17),s_adv_v)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(18),p_srf_aver)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(19),p_srf_center)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(20),T_srf)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -492,6 +492,6 @@
          subroutine catchaxis(nid,ttm,llm,time,lev,ierr)
 
-         use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,&
-            nf_inq_dimid,nf_inq_dimlen
+         use netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,&
+            nf90_inq_dimid,nf90_inquire_dimension
 
          implicit none
@@ -507,19 +507,19 @@
 ! Control & lecture on dimensions
 ! ===============================
-         ierr=NF_INQ_DIMID(nid,"time",timedimin)
-         ierr=NF_INQ_VARID(nid,"time",timevar)
-         if (ierr.NE.NF_NOERR) then
+         ierr=nf90_inq_dimid(nid,"time",timedimin)
+         ierr=nf90_inq_varid(nid,"time",timevar)
+         if (ierr.NE.nf90_noerr) then
             write(*,*) 'ERROR: Field <time> is missing'
             stop ""  
          endif
-         ierr=NF_INQ_DIMLEN(nid,timedimin,timelen)
-
-         ierr=NF_INQ_DIMID(nid,"lev",levdimin)
-         ierr=NF_INQ_VARID(nid,"lev",levvar)
-         if (ierr.NE.NF_NOERR) then
+         ierr=nf90_inquire_dimension(nid,timedimin,len=timelen)
+
+         ierr=nf90_inq_dimid(nid,"lev",levdimin)
+         ierr=nf90_inq_varid(nid,"lev",levvar)
+         if (ierr.NE.nf90_noerr) then
              write(*,*) 'ERROR: Field <lev> is lacking'
              stop "" 
          endif
-         ierr=NF_INQ_DIMLEN(nid,levdimin,levlen)
+         ierr=nf90_inquire_dimension(nid,levdimin,len=levlen)
 
          if((timelen/=ttm).or.(levlen/=llm)) then
@@ -2170,6 +2170,6 @@
 
 
-      use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,&
-            nf_inq_dimid,nf_inq_dimlen
+      use netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,&
+            nf90_inq_dimid,nf90_inquire_dimension
       implicit none
 
@@ -2190,88 +2190,88 @@
       integer var3didin(nbvar3d)
 
-      ierr = NF_OPEN(fich_fire,NF_NOWRITE,nid)
-      if (ierr.NE.NF_NOERR) then
+      ierr = nf90_open(fich_fire,nf90_nowrite,nid)
+      if (ierr.NE.nf90_noerr) then
          write(*,*) 'ERROR: Pb opening forcings nc file '
-         write(*,*) NF_STRERROR(ierr)
+         write(*,*) nf90_strerror(ierr)
          stop ""
       endif
 
 
-       ierr=NF_INQ_VARID(nid,"zz",var3didin(1)) 
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"zz",var3didin(1))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'lev'
          endif
 
 
-      ierr=NF_INQ_VARID(nid,"thetal",var3didin(2))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"thetal",var3didin(2))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'temp'
          endif
 
-      ierr=NF_INQ_VARID(nid,"qt",var3didin(3))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"qt",var3didin(3))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'qv'
          endif
 
-      ierr=NF_INQ_VARID(nid,"u",var3didin(4))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"u",var3didin(4))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'u'
          endif
 
-      ierr=NF_INQ_VARID(nid,"v",var3didin(5))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"v",var3didin(5))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'v'
          endif
 
-      ierr=NF_INQ_VARID(nid,"tke",var3didin(6))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"tke",var3didin(6))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'tke'
          endif
 
-      ierr=NF_INQ_VARID(nid,"ugeo",var3didin(7))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"ugeo",var3didin(7))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'ug'
          endif
 
-      ierr=NF_INQ_VARID(nid,"vgeo",var3didin(8))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"vgeo",var3didin(8))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'vg'
          endif
       
-      ierr=NF_INQ_VARID(nid,"wls",var3didin(9))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"wls",var3didin(9))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'wls'
          endif
 
-      ierr=NF_INQ_VARID(nid,"dqtdx",var3didin(10))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"dqtdx",var3didin(10))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'dqtdx'
          endif
 
-      ierr=NF_INQ_VARID(nid,"dqtdy",var3didin(11))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"dqtdy",var3didin(11))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'dqtdy'
       endif
 
-      ierr=NF_INQ_VARID(nid,"dqtdt",var3didin(12))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"dqtdt",var3didin(12))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'dqtdt'
       endif
 
-      ierr=NF_INQ_VARID(nid,"thl_rad",var3didin(13))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"thl_rad",var3didin(13))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'thl_rad'
       endif
@@ -2280,6 +2280,6 @@
  
          ierr = NF90_GET_VAR(nid,var3didin(1),zz)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2287,6 +2287,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(2),thl)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2294,6 +2294,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(3),qt)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2301,6 +2301,6 @@
  
          ierr = NF90_GET_VAR(nid,var3didin(4),u)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2308,6 +2308,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(5),v)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2315,6 +2315,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(6),tke)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2322,6 +2322,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(7),ug)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2329,6 +2329,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(8),vg)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2336,6 +2336,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(9),wls)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2343,6 +2343,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(10),dqtdx)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2350,6 +2350,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(11),dqtdy)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2357,6 +2357,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(12),dqtdt)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2364,6 +2364,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(13),thl_rad)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2380,6 +2380,6 @@
 !program reading initial profils and forcings of the Dice case study
 
-      use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,&
-            nf_inq_dimid,nf_inq_dimlen
+      use netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,&
+            nf90_inq_dimid,nf90_inquire_dimension
 
       implicit none
@@ -2407,141 +2407,141 @@
 
       pzero=100000.
-      ierr = NF_OPEN(fich_dice,NF_NOWRITE,nid)
-      if (ierr.NE.NF_NOERR) then
+      ierr = nf90_open(fich_dice,nf90_nowrite,nid)
+      if (ierr.NE.nf90_noerr) then
          write(*,*) 'ERROR: Pb opening forcings nc file '
-         write(*,*) NF_STRERROR(ierr)
+         write(*,*) nf90_strerror(ierr)
          stop ""
       endif
 
 
-       ierr=NF_INQ_VARID(nid,"height",var3didin(1)) 
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"height",var3didin(1))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'height'
          endif
 
-       ierr=NF_INQ_VARID(nid,"pf",var3didin(11)) 
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"pf",var3didin(11))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'pf'
          endif
 
-      ierr=NF_INQ_VARID(nid,"theta",var3didin(12))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"theta",var3didin(12))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'theta'
          endif
 
-      ierr=NF_INQ_VARID(nid,"qv",var3didin(13))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"qv",var3didin(13))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'qv'
          endif
 
-      ierr=NF_INQ_VARID(nid,"u",var3didin(14))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"u",var3didin(14))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'u'
          endif
 
-      ierr=NF_INQ_VARID(nid,"v",var3didin(15))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"v",var3didin(15))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'v'
          endif
 
-      ierr=NF_INQ_VARID(nid,"o3mmr",var3didin(16))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"o3mmr",var3didin(16))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'o3'
          endif
 
-      ierr=NF_INQ_VARID(nid,"shf",var3didin(2))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"shf",var3didin(2))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'shf'
          endif
 
-      ierr=NF_INQ_VARID(nid,"lhf",var3didin(3))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"lhf",var3didin(3))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'lhf'
          endif
       
-      ierr=NF_INQ_VARID(nid,"lwup",var3didin(4))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"lwup",var3didin(4))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'lwup'
          endif
 
-      ierr=NF_INQ_VARID(nid,"swup",var3didin(5))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"swup",var3didin(5))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'dqtdx'
          endif
 
-      ierr=NF_INQ_VARID(nid,"Tg",var3didin(6))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"Tg",var3didin(6))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'Tg'
       endif
 
-      ierr=NF_INQ_VARID(nid,"ustar",var3didin(7))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"ustar",var3didin(7))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'ustar'
       endif
 
-      ierr=NF_INQ_VARID(nid,"psurf",var3didin(8))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"psurf",var3didin(8))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'psurf'
       endif
 
-      ierr=NF_INQ_VARID(nid,"Ug",var3didin(9))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"Ug",var3didin(9))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'Ug'
       endif
 
-      ierr=NF_INQ_VARID(nid,"Vg",var3didin(10))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"Vg",var3didin(10))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'Vg'
       endif
 
-      ierr=NF_INQ_VARID(nid,"hadvT",var3didin(17))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hadvT",var3didin(17))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hadvT'
       endif
 
-      ierr=NF_INQ_VARID(nid,"hadvq",var3didin(18))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hadvq",var3didin(18))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hadvq'
       endif
 
-      ierr=NF_INQ_VARID(nid,"hadvu",var3didin(19))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hadvu",var3didin(19))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hadvu'
       endif
 
-      ierr=NF_INQ_VARID(nid,"hadvv",var3didin(20))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hadvv",var3didin(20))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hadvv'
       endif
 
-      ierr=NF_INQ_VARID(nid,"w",var3didin(21))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"w",var3didin(21))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'w'
       endif
 
-      ierr=NF_INQ_VARID(nid,"omega",var3didin(22))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"omega",var3didin(22))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'omega'
       endif
@@ -2550,6 +2550,6 @@
  
          ierr = NF90_GET_VAR(nid,var3didin(1),zz)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2557,6 +2557,6 @@
  
          ierr = NF90_GET_VAR(nid,var3didin(11),pres)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2564,6 +2564,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(12),th)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2574,6 +2574,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(13),qv)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2581,6 +2581,6 @@
  
          ierr = NF90_GET_VAR(nid,var3didin(14),u)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2588,6 +2588,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(15),v)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2595,6 +2595,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(16),o3)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2602,6 +2602,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(2),shf)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2609,6 +2609,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(3),lhf)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2616,6 +2616,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(4),lwup)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2623,6 +2623,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(5),swup)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2630,6 +2630,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(6),tg)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2637,6 +2637,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(7),ustar)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2644,6 +2644,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(8),psurf)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2651,6 +2651,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(9),ug)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2658,6 +2658,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(10),vg)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2665,6 +2665,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(17),hadvt)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2672,6 +2672,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(18),hadvq)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2679,6 +2679,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(19),hadvu)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2686,6 +2686,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(20),hadvv)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2693,6 +2693,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(21),w)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2700,6 +2700,6 @@
 
          ierr = NF90_GET_VAR(nid,var3didin(22),omega)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
@@ -2714,6 +2714,6 @@
 !program reading initial profils and forcings of the Gabls4 case study
 
-      use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,&
-            nf_inq_dimid,nf_inq_dimlen
+      use netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,&
+            nf90_inq_dimid,nf90_inquire_dimension
 
       implicit none
@@ -2743,98 +2743,98 @@
       integer var3didin(nbvar3d)
 
-      ierr = NF_OPEN(fich_gabls4,NF_NOWRITE,nid)
-      if (ierr.NE.NF_NOERR) then
+      ierr = nf90_open(fich_gabls4,nf90_nowrite,nid)
+      if (ierr.NE.nf90_noerr) then
          write(*,*) 'ERROR: Pb opening forcings nc file '
-         write(*,*) NF_STRERROR(ierr)
+         write(*,*) nf90_strerror(ierr)
          stop ""
       endif
 
 
-       ierr=NF_INQ_VARID(nid,"height",var3didin(1)) 
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"height",var3didin(1))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'height'
          endif
 
-      ierr=NF_INQ_VARID(nid,"depth_sn",var3didin(2))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"depth_sn",var3didin(2))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'depth_sn'
       endif
 
-      ierr=NF_INQ_VARID(nid,"Ug",var3didin(3))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"Ug",var3didin(3))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'Ug'
       endif
 
-      ierr=NF_INQ_VARID(nid,"Vg",var3didin(4))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"Vg",var3didin(4))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'Vg'
       endif
-       ierr=NF_INQ_VARID(nid,"pf",var3didin(5)) 
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+       ierr=nf90_inq_varid(nid,"pf",var3didin(5))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'pf'
          endif
 
-      ierr=NF_INQ_VARID(nid,"theta",var3didin(6))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"theta",var3didin(6))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'theta'
          endif
 
-      ierr=NF_INQ_VARID(nid,"tempe",var3didin(7))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"tempe",var3didin(7))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'tempe'
          endif
 
-      ierr=NF_INQ_VARID(nid,"qv",var3didin(8))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"qv",var3didin(8))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'qv'
          endif
 
-      ierr=NF_INQ_VARID(nid,"u",var3didin(9))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"u",var3didin(9))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'u'
          endif
 
-      ierr=NF_INQ_VARID(nid,"v",var3didin(10))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"v",var3didin(10))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'v'
          endif
 
-      ierr=NF_INQ_VARID(nid,"hadvT",var3didin(11))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hadvT",var3didin(11))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hadvt'
          endif
 
-      ierr=NF_INQ_VARID(nid,"hadvQ",var3didin(12))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"hadvQ",var3didin(12))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'hadvq'
       endif
 
-      ierr=NF_INQ_VARID(nid,"Tsnow",var3didin(14))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"Tsnow",var3didin(14))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'tsnow'
       endif
 
-      ierr=NF_INQ_VARID(nid,"snow_density",var3didin(15))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"snow_density",var3didin(15))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'snow_density'
       endif
 
-      ierr=NF_INQ_VARID(nid,"Tg",var3didin(16))
-         if(ierr/=NF_NOERR) then
-           write(*,*) NF_STRERROR(ierr)
+      ierr=nf90_inq_varid(nid,"Tg",var3didin(16))
+         if(ierr/=nf90_noerr) then
+           write(*,*) nf90_strerror(ierr)
            stop 'Tg'
       endif
@@ -2845,90 +2845,90 @@
  
          ierr = NF90_GET_VAR(nid,var3didin(1),zz_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(2),depth_sn)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(3),ug_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(4),vg_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(5),pf_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(6),th_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(7),t_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(8),qv_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(9),u_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(10),v_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(11),hadvt_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(12),hadvq_i)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(14),tsnow)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
  
          ierr = NF90_GET_VAR(nid,var3didin(15),snow_dens)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
 
          ierr = NF90_GET_VAR(nid,var3didin(16),tg)
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
             stop "getvarup"
          endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90	(revision 5088)
@@ -435,5 +435,5 @@
 ! Purpose: Read parameters usually determined with grid_noro from a file.
 !===============================================================================
-  USE lmdz_netcdf, ONLY: NF90_OPEN,  NF90_INQ_DIMID, NF90_INQUIRE_DIMENSION,        &
+  USE netcdf, ONLY: NF90_OPEN,  nf90_inq_dimid, NF90_INQUIRE_DIMENSION,        &
         NF90_NOERR, NF90_CLOSE, NF90_INQ_VARID, NF90_GET_VAR, NF90_STRERROR,   &
         NF90_NOWRITE
@@ -509,5 +509,5 @@
   REAL, ALLOCATABLE :: tmp(:)
   INTEGER :: n
-  CALL ncerr(NF90_INQ_DIMID(fid,dimd,did))
+  CALL ncerr(nf90_inq_dimid(fid,dimd,did))
   CALL ncerr(NF90_INQUIRE_DIMENSION(fid,did,len=n)); ALLOCATE(tmp(n))
   CALL ncerr(NF90_INQ_VARID(fid,dimd,did))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90	(revision 5088)
@@ -96,6 +96,6 @@
   USE mod_phys_lmdz_para, ONLY: scatter, bcast
   USE print_control_mod, ONLY: lunout
-  USE lmdz_netcdf, ONLY: nf90_get_var, nf_inq_varid, nf_inq_dimlen, nf_inq_dimid, &
-      nf_open, nf_noerr
+  USE netcdf, ONLY: nf90_get_var, nf90_inq_varid, nf90_inquire_dimension, nf90_inq_dimid, &
+      nf90_open, nf90_noerr
 
   IMPLICIT NONE
@@ -134,19 +134,19 @@
   IF (is_mpi_root .AND. is_omp_root) THEN
       !
-      iret = nf_open('aircraft_phy.nc', 0, ncida)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to open aircraft_phy.nc file',1)
+      iret = nf90_open('aircraft_phy.nc', 0, ncida)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to open aircraft_phy.nc file',1)
       ! ... Get lengths
-      iret = nf_inq_dimid(ncida, 'time', varid)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get time dimid in aircraft_phy.nc file',1)
-      iret = nf_inq_dimlen(ncida, varid, ntimea)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get time dimlen aircraft_phy.nc file',1)
-      iret = nf_inq_dimid(ncida, 'vector', varid)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get vector dimid aircraft_phy.nc file',1)
-      iret = nf_inq_dimlen(ncida, varid, klona)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get vector dimlen aircraft_phy.nc file',1)
-      iret = nf_inq_dimid(ncida, 'lev', varid)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get lev dimid aircraft_phy.nc file',1)
-      iret = nf_inq_dimlen(ncida, varid, nleva)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get lev dimlen aircraft_phy.nc file',1)
+      iret = nf90_inq_dimid(ncida, 'time', varid)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get time dimid in aircraft_phy.nc file',1)
+      iret = nf90_inquire_dimension(ncida, varid,len= ntimea)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get time dimlen aircraft_phy.nc file',1)
+      iret = nf90_inq_dimid(ncida, 'vector', varid)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get vector dimid aircraft_phy.nc file',1)
+      iret = nf90_inquire_dimension(ncida, varid,len= klona)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get vector dimlen aircraft_phy.nc file',1)
+      iret = nf90_inq_dimid(ncida, 'lev', varid)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get lev dimid aircraft_phy.nc file',1)
+      iret = nf90_inquire_dimension(ncida, varid,len= nleva)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get lev dimlen aircraft_phy.nc file',1)
       !
       IF ( klona /= klon_glo ) THEN
@@ -167,18 +167,18 @@
       IF (error /= 0) CALL abort_physic(modname,'problem to allocate ph2o_airpl_glo',1)
       !
-      iret = nf_inq_varid(ncida, 'lev', varid)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get lev dimid aircraft_phy.nc file',1)
+      iret = nf90_inq_varid(ncida, 'lev', varid)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get lev dimid aircraft_phy.nc file',1)
       iret = nf90_get_var(ncida, varid, zmida)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to read zmida file',1)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to read zmida file',1)
       !
-      iret = nf_inq_varid(ncida, 'emi_co2_aircraft', varid)  !--CO2 as a proxy for m flown - 
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get emi_distance dimid aircraft_phy.nc file',1)
+      iret = nf90_inq_varid(ncida, 'emi_co2_aircraft', varid)  !--CO2 as a proxy for m flown -
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get emi_distance dimid aircraft_phy.nc file',1)
       iret = nf90_get_var(ncida, varid, pkm_airpl_glo)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to read pkm_airpl file',1)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to read pkm_airpl file',1)
       !
-      iret = nf_inq_varid(ncida, 'emi_h2o_aircraft', varid)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to get emi_h2o_aircraft dimid aircraft_phy.nc file',1)
+      iret = nf90_inq_varid(ncida, 'emi_h2o_aircraft', varid)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get emi_h2o_aircraft dimid aircraft_phy.nc file',1)
       iret = nf90_get_var(ncida, varid, ph2o_airpl_glo)
-      IF (iret /= NF_NOERR) CALL abort_physic(modname,'problem to read ph2o_airpl file',1)
+      IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to read ph2o_airpl file',1)
       ! 
      ENDIF    !--is_mpi_root and is_omp_root
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/interfoce_lim.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/interfoce_lim.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/interfoce_lim.F90	(revision 5088)
@@ -10,5 +10,5 @@
   USE mod_phys_lmdz_para
   USE indice_sol_mod
-  USE lmdz_netcdf, ONLY: nf90_get_var,nf_close,nf_noerr,nf_inq_varid,nf_open,nf_nowrite
+  USE netcdf, ONLY: nf90_get_var,nf90_close,nf90_noerr,nf90_inq_varid,nf90_open,nf90_nowrite
   
   IMPLICIT NONE
@@ -114,6 +114,6 @@
 
         fich = TRIM(fich)
-        ierr = NF_OPEN (fich, NF_NOWRITE,nid)
-        IF (ierr/=NF_NOERR) THEN
+        ierr = nf90_open (fich, nf90_nowrite,nid)
+        IF (ierr/=nf90_noerr) THEN
            abort_message = 'Pb d''ouverture du fichier de conditions aux limites'
            CALL abort_physic(modname,abort_message,1)
@@ -131,11 +131,11 @@
            ! Fraction "ocean" 
            !
-           ierr = NF_INQ_VARID(nid, 'FOCE', nvarid)
-           IF (ierr /= NF_NOERR) THEN
+           ierr = nf90_inq_varid(nid, 'FOCE', nvarid)
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Le champ <FOCE> est absent'
               CALL abort_physic(modname,abort_message,1)
            ENDIF
            ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_oce),start,epais)
-           IF (ierr /= NF_NOERR) THEN
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Lecture echouee pour <FOCE>'
               CALL abort_physic(modname,abort_message,1)
@@ -144,11 +144,11 @@
            ! Fraction "glace de mer" 
            !
-           ierr = NF_INQ_VARID(nid, 'FSIC', nvarid)
-           IF (ierr /= NF_NOERR) THEN
+           ierr = nf90_inq_varid(nid, 'FSIC', nvarid)
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Le champ <FSIC> est absent'
               CALL abort_physic(modname,abort_message,1)
            ENDIF
            ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_sic),start,epais)
-           IF (ierr /= NF_NOERR) THEN
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Lecture echouee pour <FSIC>'
               CALL abort_physic(modname,abort_message,1)
@@ -157,11 +157,11 @@
            ! Fraction "terre" 
            !
-           ierr = NF_INQ_VARID(nid, 'FTER', nvarid)
-           IF (ierr /= NF_NOERR) THEN
+           ierr = nf90_inq_varid(nid, 'FTER', nvarid)
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Le champ <FTER> est absent'
               CALL abort_physic(modname,abort_message,1)
            ENDIF
            ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_ter),start,epais)
-           IF (ierr /= NF_NOERR) THEN
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Lecture echouee pour <FTER>'
               CALL abort_physic(modname,abort_message,1)
@@ -170,11 +170,11 @@
            ! Fraction "glacier terre" 
            !
-           ierr = NF_INQ_VARID(nid, 'FLIC', nvarid)
-           IF (ierr /= NF_NOERR) THEN
+           ierr = nf90_inq_varid(nid, 'FLIC', nvarid)
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Le champ <FLIC> est absent'
               CALL abort_physic(modname,abort_message,1)
            ENDIF
            ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_lic),start,epais)
-           IF (ierr /= NF_NOERR) THEN
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Lecture echouee pour <FLIC>'
               CALL abort_physic(modname,abort_message,1)
@@ -183,11 +183,11 @@
         ELSE  ! on en est toujours a rnatur
            ! 
-           ierr = NF_INQ_VARID(nid, 'NAT', nvarid)
-           IF (ierr /= NF_NOERR) THEN
+           ierr = nf90_inq_varid(nid, 'NAT', nvarid)
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Le champ <NAT> est absent'
               CALL abort_physic(modname,abort_message,1)
            ENDIF
            ierr = nf90_get_var(nid,nvarid,nat_lu,start,epais)
-           IF (ierr /= NF_NOERR) THEN
+           IF (ierr /= nf90_noerr) THEN
               abort_message = 'Lecture echouee pour <NAT>'
               CALL abort_physic(modname,abort_message,1)
@@ -213,11 +213,11 @@
 ! Lecture SST
 !
-        ierr = NF_INQ_VARID(nid, 'SST', nvarid)
-        IF (ierr /= NF_NOERR) THEN
+        ierr = nf90_inq_varid(nid, 'SST', nvarid)
+        IF (ierr /= nf90_noerr) THEN
            abort_message = 'Le champ <SST> est absent'
            CALL abort_physic(modname,abort_message,1)
         ENDIF
         ierr = nf90_get_var(nid,nvarid,sst_lu,start,epais)
-        IF (ierr /= NF_NOERR) THEN
+        IF (ierr /= nf90_noerr) THEN
            abort_message = 'Lecture echouee pour <SST>'
            CALL abort_physic(modname,abort_message,1)
@@ -228,5 +228,5 @@
 !
 !****************************************************************************************
-        ierr = NF_CLOSE(nid)
+        ierr = nf90_close(nid)
      ENDIF ! is_mpi_root
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iostart.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iostart.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iostart.F90	(revision 5088)
@@ -30,5 +30,5 @@
 
   SUBROUTINE Open_startphy(filename)
-  USE lmdz_netcdf, ONLY: nf90_nowrite, nf90_noerr,nf90_open
+  USE netcdf, ONLY: nf90_nowrite, nf90_noerr,nf90_open
   USE mod_phys_lmdz_para
   IMPLICIT NONE
@@ -48,5 +48,5 @@
 
   SUBROUTINE Close_startphy
-  USE lmdz_netcdf, ONLY: nf90_close
+  USE netcdf, ONLY: nf90_close
   USE mod_phys_lmdz_para
   IMPLICIT NONE
@@ -61,5 +61,5 @@
 
   FUNCTION Inquire_Field(Field_name)
-  USE lmdz_netcdf, ONLY: nf90_noerr,nf90_inq_varid
+  USE netcdf, ONLY: nf90_noerr,nf90_inq_varid
   USE mod_phys_lmdz_para
   IMPLICIT NONE
@@ -115,5 +115,5 @@
   
   SUBROUTINE Get_field_rgen(field_name,field,field_size,found)
-  USE lmdz_netcdf, ONLY: nf90_inq_varid,nf90_noerr,nf90_get_var
+  USE netcdf, ONLY: nf90_inq_varid,nf90_noerr,nf90_get_var
   USE dimphy
   USE geometry_mod
@@ -251,5 +251,5 @@
 
   SUBROUTINE Get_var_rgen(var_name,var,var_size,found)
-  USE lmdz_netcdf, ONLY: nf90_noerr,nf90_get_var,nf90_inq_varid
+  USE netcdf, ONLY: nf90_noerr,nf90_get_var,nf90_inq_varid
   USE dimphy
   USE mod_grid_phy_lmdz
@@ -301,5 +301,5 @@
 
   SUBROUTINE open_restartphy(filename)
-  USE lmdz_netcdf, ONLY: nf90_create,nf90_clobber,nf90_64bit_offset,nf90_noerr,nf90_strerror,&
+  USE netcdf, ONLY: nf90_create,nf90_clobber,nf90_64bit_offset,nf90_noerr,nf90_strerror,&
           nf90_global,nf90_put_att,nf90_def_dim
   USE mod_phys_lmdz_para, ONLY: is_master
@@ -333,5 +333,5 @@
   
   SUBROUTINE enddef_restartphy
-  USE lmdz_netcdf, ONLY: nf90_enddef
+  USE netcdf, ONLY: nf90_enddef
   USE mod_phys_lmdz_para
   IMPLICIT NONE
@@ -343,5 +343,5 @@
 
   SUBROUTINE close_restartphy
-  USE lmdz_netcdf, ONLY: nf90_close
+  USE netcdf, ONLY: nf90_close
   USE mod_phys_lmdz_para
   IMPLICIT NONE
@@ -386,5 +386,6 @@
   
   SUBROUTINE put_field_rgen(pass, field_name,title,field,field_size)
-  USE lmdz_netcdf, ONLY: nf90_def_var,nf90_format,nf90_put_att,nf90_inq_varid,nf90_put_var
+  USE netcdf, ONLY: nf90_def_var,nf90_put_att,nf90_inq_varid,nf90_put_var
+  USE lmdz_netcdf_format, ONLY: nf90_format
   USE dimphy
   USE geometry_mod
@@ -425,5 +426,5 @@
          
 !      ierr = NF90_REDEF (nid_restart)
-      ierr = NF90_DEF_VAR (nid_restart, field_name, NF90_FORMAT,(/ idim /),nvarid)
+      ierr = NF90_DEF_VAR (nid_restart, field_name, nf90_format,(/ idim /),nvarid)
       IF (LEN_TRIM(title) > 0) ierr = NF90_PUT_ATT (nid_restart,nvarid,"title", title)
 !      ierr = NF90_ENDDEF(nid_restart)
@@ -509,5 +510,6 @@
 
   SUBROUTINE put_var_rgen(pass, var_name,title,var,var_size)
-  USE lmdz_netcdf, ONLY: nf90_format,nf90_def_var,nf90_put_var,nf90_inq_varid,nf90_put_att
+  USE netcdf, ONLY: nf90_def_var,nf90_put_var,nf90_inq_varid,nf90_put_att
+  USE lmdz_netcdf_format, ONLY: nf90_format
   USE dimphy
   USE mod_phys_lmdz_para
@@ -534,5 +536,5 @@
 !      ierr = NF90_REDEF (nid_restart)
 
-        ierr = NF90_DEF_VAR (nid_restart, var_name, NF90_FORMAT,(/ idim1 /),nvarid)
+        ierr = NF90_DEF_VAR (nid_restart, var_name, nf90_format,(/ idim1 /),nvarid)
         IF (LEN_TRIM(title)>0) ierr = NF90_PUT_ATT (nid_restart,nvarid,"title", title)
 !      ierr = NF90_ENDDEF(nid_restart)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90	(revision 5088)
@@ -22,6 +22,6 @@
 !=================================================================
  
-      USE lmdz_netcdf, ONLY: nf90_put_var,nf_inq_varid,nf_enddef,nf_redef,nf_sync,nf_noerr,&
-              nf_float,nf_def_var
+      USE netcdf, ONLY: nf90_put_var,nf90_inq_varid,nf90_enddef,nf90_redef,nf90_sync,nf90_noerr,&
+              nf90_float,nf90_def_var
       implicit none
 
@@ -103,7 +103,7 @@
            ! Get NetCDF ID of 'time' variable
 
-           ierr=NF_SYNC(nid)
+           ierr=nf90_sync(nid)
 
-           ierr= NF_INQ_VARID(nid,"time",varid)
+           ierr= nf90_inq_varid(nid,"time",varid)
            ! Write (append) the new date to the 'time' array
 
@@ -114,5 +114,5 @@
 !        print*,'IOTD Date ,varid,nid,ntime,date',varid,nid,ntime,date
 
-           if (ierr/=NF_NOERR) then
+           if (ierr/=nf90_noerr) then
               write(*,*) "***** PUT_VAR matter in writediagfi_nc"
               write(*,*) "***** with time"
@@ -161,13 +161,13 @@
 
       if (ntime==1) then
-          ierr = NF_REDEF (nid)
-          ierr = NF_DEF_VAR(nid,nom,NF_FLOAT,ndim,dim_cc,varid)
+          ierr = nf90_redef (nid)
+          ierr = nf90_def_var(nid,nom,nf90_float,dim_cc,varid)
           !print*,'DEF ',nom,nid,varid
-          ierr = NF_ENDDEF(nid)
+          ierr = nf90_enddef(nid)
       else
-         ierr= NF_INQ_VARID(nid,nom,varid)
+         ierr= nf90_inq_varid(nid,nom,varid)
           !print*,'INQ ',nom,nid,varid
 ! Commandes pour recuperer automatiquement les coordonnees
-!             ierr= NF_INQ_DIMID(nid,"longitude",id(1))
+!             ierr= nf90_inq_dimid(nid,"longitude",id(1))
       endif
 
@@ -175,5 +175,5 @@
       ierr= NF90_PUT_VAR(nid,varid,zx,corner,edges)
 
-      if (ierr/=NF_NOERR) then
+      if (ierr/=nf90_noerr) then
            write(*,*) "***** PUT_VAR problem in writediagfi"
            write(*,*) "***** with ",nom
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_fin.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_fin.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_fin.F90	(revision 5088)
@@ -1,4 +1,4 @@
 SUBROUTINE iotd_fin
-  USE lmdz_netcdf, ONLY : nf_close
+  USE netcdf, ONLY : nf90_close
 
   IMPLICIT NONE
@@ -21,5 +21,5 @@
   !   ----------
 
-  ierr = NF_close(nid)
+  ierr = nf90_close(nid)
 
 END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ini.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ini.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ini.F90	(revision 5088)
@@ -1,5 +1,5 @@
       SUBROUTINE iotd_ini(fichnom,iim,jjm,llm,prlon,prlat,pcoordv,jour0,mois0,an0,t0,timestep,calendrier)
-            USE lmdz_netcdf, ONLY: nf_enddef,nf_put_att_text,nf_float,nf_def_var,nf_redef,&
-                    nf_global,nf_def_dim,nf_create,nf_clobber,nf_unlimited,nf90_put_var
+            USE netcdf, ONLY: nf90_enddef,nf90_put_att,nf90_float,nf90_def_var,nf90_redef,&
+                    nf90_global,nf90_def_dim,nf90_create,nf90_clobber,nf90_unlimited,nf90_put_var
       IMPLICIT NONE
 
@@ -91,70 +91,70 @@
     
       ! Create the NetCDF file
-      ierr=NF_CREATE(fichnom, NF_CLOBBER, nid)
-      ierr=NF_DEF_DIM(nid, "lon", iim, dim_coord(1))
-      ierr=NF_DEF_DIM(nid, "lat", jjm, dim_coord(2))
-      ierr=NF_DEF_DIM(nid, "lev", llm, dim_coord(3))
-      ierr=NF_DEF_DIM(nid,"time",NF_UNLIMITED,dim_coord(4))
-      ierr = NF_PUT_ATT_TEXT(nid,NF_GLOBAL,'Conventions',6,"CF-1.1")
-      !ierr = NF_PUT_ATT_TEXT(nid,NF_GLOBAL,'file_name',TRIM(fname))
-      ierr=NF_ENDDEF(nid)
+      ierr=nf90_create(fichnom, nf90_clobber, nid)
+      ierr=nf90_def_dim(nid, "lon", iim, dim_coord(1))
+      ierr=nf90_def_dim(nid, "lat", jjm, dim_coord(2))
+      ierr=nf90_def_dim(nid, "lev", llm, dim_coord(3))
+      ierr=nf90_def_dim(nid,"time",nf90_unlimited,dim_coord(4))
+      ierr = nf90_put_att(nid,nf90_global,'Conventions',"CF-1.1")
+      !ierr = nf90_put_att(nid,nf90_global,'file_name',TRIM(fname))
+      ierr=nf90_enddef(nid)
 
       ! Switch out of NetCDF Define mode
 
 
-      ierr=NF_ENDDEF(nid)
+      ierr=nf90_enddef(nid)
 !
 !  Contol parameters for this run
 ! ---- longitude -----------
 
-      ierr=NF_REDEF(nid)
-      ierr=NF_DEF_VAR(nid,"lon", NF_FLOAT, 1, dim_coord(1),nvarid)
-      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'X')
-      ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east")
-      ierr=NF_ENDDEF(nid)
+      ierr=nf90_redef(nid)
+      ierr=nf90_def_var(nid,"lon", nf90_float, dim_coord(1),nvarid)
+      ierr = nf90_put_att(nid,nvarid,'axis','X')
+      ierr=nf90_put_att(nid,nvarid,'units',"degrees_east")
+      ierr=nf90_enddef(nid)
       ierr=nf90_put_var(nid,nvarid,rlon)
        print*,ierr
 
 ! ---- latitude ------------
-      ierr=NF_REDEF(nid)
-      ierr=NF_DEF_VAR(nid, "lat", NF_FLOAT, 1, dim_coord(2),nvarid)
-      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'Y')
-      ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north")
-      ierr=NF_ENDDEF(nid)
+      ierr=nf90_redef(nid)
+      ierr=nf90_def_var(nid, "lat", nf90_float, dim_coord(2),nvarid)
+      ierr = nf90_put_att(nid,nvarid,'axis','Y')
+      ierr=nf90_put_att(nid,nvarid,'units',"degrees_north")
+      ierr=nf90_enddef(nid)
       ierr=nf90_put_var(nid,nvarid,rlat)
 !
 ! ---- vertical ------------
-      ierr=NF_REDEF(nid)
-      ierr=NF_DEF_VAR(nid, "lev", NF_FLOAT, 1,dim_coord(3),nvarid)
-      ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"vert level")
+      ierr=nf90_redef(nid)
+      ierr=nf90_def_var(nid, "lev", nf90_float,dim_coord(3),nvarid)
+      ierr=nf90_put_att(nid,nvarid,"long_name","vert level")
       if ( coordv(2)>coordv(1) ) then
-         ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt")
-         ierr=NF_PUT_ATT_TEXT(nid,nvarid,'positive',2,"up")
+         ierr=nf90_put_att(nid,nvarid,"long_name","pseudo-alt")
+         ierr=nf90_put_att(nid,nvarid,'positive',"up")
       else
-         ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",8,"pressure")
-         ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',4,"down")
+         ierr=nf90_put_att(nid,nvarid,"long_name","pressure")
+         ierr = nf90_put_att(nid,nvarid,'positive',"down")
       endif
-      ierr=NF_ENDDEF(nid)
+      ierr=nf90_enddef(nid)
       ierr=nf90_put_var(nid,nvarid,coordv)
 
 !
 ! ---- time ----------------
-      ierr=NF_REDEF(nid)
+      ierr=nf90_redef(nid)
       ! Define the 'time' variable
-      ierr=NF_DEF_VAR(nid, "time", NF_FLOAT, 1, dim_coord(4),nvarid)
+      ierr=nf90_def_var(nid, "time", nf90_float, dim_coord(4),nvarid)
 !     ! Add attributes
-      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'T')
-      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'standard_name',4,'time')
+      ierr = nf90_put_att(nid,nvarid,'axis','T')
+      ierr = nf90_put_att(nid,nvarid,'standard_name','time')
       WRITE(date0,'(i4.4,"-",i2.2,"-",i2.2)') an0,mois0,jour0
-      ierr=NF_PUT_ATT_TEXT(nid, nvarid,'units',33, &
+      ierr=nf90_put_att(nid, nvarid,'units', &
    "seconds since "//date0//" 00:00:00")
-      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'calendar',9,calendrier)
-      !ierr = NF_PUT_ATT_TEXT(nid,nvarid,'calendar',4,'360d')
-      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'title',4,'Time')
-      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'long_name',9,'Time axis')
+      ierr = nf90_put_att(nid,nvarid,'calendar',calendrier)
+      !ierr = nf90_put_att(nid,nvarid,'calendar','360d')
+      ierr = nf90_put_att(nid,nvarid,'title','Time')
+      ierr = nf90_put_att(nid,nvarid,'long_name','Time axis')
       WRITE(date0b,'(i4.4,"-",a3,"-",i2.2)') an0,cmois(mois0),jour0
-      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'time_origin',20, &
+      ierr = nf90_put_att(nid,nvarid,'time_origin', &
           date0b//' 00:00:00')
-      ierr=NF_ENDDEF(nid)
+      ierr=nf90_enddef(nid)
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/limit_read_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/limit_read_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/limit_read_mod.F90	(revision 5088)
@@ -165,5 +165,5 @@
     USE mod_phys_lmdz_para
     USE surface_data, ONLY : type_ocean, ok_veget
-    USE lmdz_netcdf, ONLY:nf90_get_var,nf90_inq_varid,nf90_close,nf90_inquire_dimension,&
+    USE netcdf, ONLY:nf90_get_var,nf90_inq_varid,nf90_close,nf90_inquire_dimension,&
             nf90_inquire,nf90_get_att,nf90_inq_dimid,nf90_nowrite,nf90_noerr,nf90_open
     USE indice_sol_mod
@@ -249,5 +249,5 @@
           !--- ERROR IF FILE RECORDS NUMBER IS NOT EQUAL TO EXPECTED NUMBER OF DAYS          
           IF (grid_type==unstructured) THEN
-            ierr=NF90_INQ_DIMID(nid,"time_year",ndimid)
+            ierr=nf90_inq_dimid(nid,"time_year",ndimid)
           ELSE
             ierr=NF90_INQUIRE(nid, UnlimitedDimID=ndimid)
@@ -260,7 +260,7 @@
           !--- ERROR IF FILES AND LMDZ HORIZONTAL RESOLUTIONS DO NOT MATCH
           IF (grid_type==unstructured) THEN
-            ierr=NF90_INQ_DIMID(nid, 'cell', ndimid)
+            ierr=nf90_inq_dimid(nid, 'cell', ndimid)
           ELSE
-            ierr=NF90_INQ_DIMID(nid, 'points_physiques', ndimid)
+            ierr=nf90_inq_dimid(nid, 'points_physiques', ndimid)
           ENDIF
           ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90	(revision 5088)
@@ -6,5 +6,5 @@
   USE mod_grid_phy_lmdz, ONLY: klon_glo
   USE mod_phys_lmdz_para
-  USE lmdz_netcdf, ONLY: nf90_close,nf90_get_var,nf90_inq_varid,nf90_nowrite,nf90_noerr,nf90_open
+  USE netcdf, ONLY: nf90_close,nf90_get_var,nf90_inq_varid,nf90_nowrite,nf90_noerr,nf90_open
   USE indice_sol_mod
   USE ocean_slab_mod, ONLY: nslay
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/mo_simple_plumes.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/mo_simple_plumes.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/mo_simple_plumes.F90	(revision 5088)
@@ -24,5 +24,5 @@
 MODULE MO_SIMPLE_PLUMES
 
-    USE lmdz_netcdf, ONLY:nf90_get_var,nf90_close,nf90_inq_varid,nf90_inq_dimid,&
+    USE netcdf, ONLY:nf90_get_var,nf90_close,nf90_inq_varid,nf90_inq_dimid,&
             nf90_inquire_dimension,nf90_noerr,nf90_nowrite,nf90_open
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/moy_undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/moy_undefSTD.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/moy_undefSTD.F90	(revision 5088)
@@ -3,5 +3,5 @@
 
 SUBROUTINE moy_undefstd(itap, itapm1)
-  USE lmdz_netcdf, ONLY: nf90_fill_real
+  USE netcdf, ONLY: nf90_fill_real
   USE dimphy
 #ifdef CPP_IOIPSL 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/open_climoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/open_climoz_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/open_climoz_m.F90	(revision 5088)
@@ -13,5 +13,5 @@
 !-------------------------------------------------------------------------------
   USE netcdf95, ONLY: nf95_open, nf95_close, nf95_gw_var, nf95_inq_varid
-  USE lmdz_netcdf,   ONLY: nf90_nowrite
+  USE netcdf,   ONLY: nf90_nowrite
   USE mod_phys_lmdz_mpi_data,      ONLY: is_mpi_root
   USE mod_phys_lmdz_mpi_transfert, ONLY: bcast_mpi
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90	(revision 5088)
@@ -415,5 +415,5 @@
     use lmdz_blowing_snow_ini, only : zeta_bs
     USE wxios, ONLY: missing_val_xios => missing_val, using_xios
-    USE lmdz_netcdf, only: missing_val_netcdf => nf90_fill_real
+    USE netcdf, only: missing_val_netcdf => nf90_fill_real
 
      
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90	(revision 5088)
@@ -570,7 +570,8 @@
     USE mod_phys_lmdz_transfert_para, ONLY: gather
     USE phys_cal_mod, ONLY: year_len
-    use lmdz_netcdf, ONLY: nf90_def_var, nf90_put_var, nf90_get_var, nf_strerror, nf_close, &
-            nf_enddef, nf_put_att_text, nf_unlimited, nf_noerr, nf_global, nf_clobber, &
-            nf_64bit_offset, nf90_format, nf_def_dim, nf_create
+    USE netcdf, ONLY: nf90_def_var, nf90_put_var, nf90_get_var, nf90_strerror, nf90_close, &
+            nf90_enddef, nf90_put_att, nf90_unlimited, nf90_noerr, nf90_global, nf90_clobber, &
+            nf90_64bit_offset, nf90_def_dim, nf90_create
+    USE lmdz_netcdf_format, ONLY: nf90_format
     IMPLICIT NONE
 
@@ -604,49 +605,49 @@
       PRINT *, 'writelim: Ecriture du fichier limit'
 
-      ierr = nf_create('limit.nc', IOR(NF_CLOBBER,NF_64BIT_OFFSET), nid)
-
-      ierr = nf_put_att_text(nid, nf_global, 'title', 30, &
+      ierr = nf90_create('limit.nc', IOR(nf90_clobber,nf90_64bit_offset), nid)
+
+      ierr = nf90_put_att(nid, nf90_global, 'title', &
         'Fichier conditions aux limites')
-      ! !        ierr = NF_DEF_DIM (nid, "points_physiques", klon, ndim)
-      ierr = nf_def_dim(nid, 'points_physiques', klon_glo, ndim)
-      ierr = nf_def_dim(nid, 'time', nf_unlimited, ntim)
+      ! !        ierr = nf90_def_dim (nid, "points_physiques", klon, ndim)
+      ierr = nf90_def_dim(nid, 'points_physiques', klon_glo, ndim)
+      ierr = nf90_def_dim(nid, 'time', nf90_unlimited, ntim)
 
       dims(1) = ndim
       dims(2) = ntim
 
-      ierr = nf90_def_var(nid, 'TEMPS', NF90_FORMAT, [ntim], id_tim)
-      ierr = nf_put_att_text(nid, id_tim, 'title', 17, 'Jour dans l annee')
-
-      ierr = nf90_def_var(nid, 'NAT', NF90_FORMAT, dims, id_nat)
-      ierr = nf_put_att_text(nid, id_nat, 'title', 23, &
+      ierr = nf90_def_var(nid, 'TEMPS', nf90_format, [ntim], id_tim)
+      ierr = nf90_put_att(nid, id_tim, 'title', 'Jour dans l annee')
+
+      ierr = nf90_def_var(nid, 'NAT', nf90_format, dims, id_nat)
+      ierr = nf90_put_att(nid, id_nat, 'title', &
         'Nature du sol (0,1,2,3)')
 
-      ierr = nf90_def_var(nid, 'SST', NF90_FORMAT, dims, id_sst)
-      ierr = nf_put_att_text(nid, id_sst, 'title', 35, &
+      ierr = nf90_def_var(nid, 'SST', nf90_format, dims, id_sst)
+      ierr = nf90_put_att(nid, id_sst, 'title', &
         'Temperature superficielle de la mer')
 
-      ierr = nf90_def_var(nid, 'BILS', NF90_FORMAT, dims, id_bils)
-      ierr = nf_put_att_text(nid, id_bils, 'title', 32, &
+      ierr = nf90_def_var(nid, 'BILS', nf90_format, dims, id_bils)
+      ierr = nf90_put_att(nid, id_bils, 'title', &
         'Reference flux de chaleur au sol')
 
-      ierr = nf90_def_var(nid, 'ALB', NF90_FORMAT, dims, id_alb)
-      ierr = nf_put_att_text(nid, id_alb, 'title', 19, 'Albedo a la surface')
-
-      ierr = nf90_def_var(nid, 'RUG', NF90_FORMAT, dims, id_rug)
-      ierr = nf_put_att_text(nid, id_rug, 'title', 8, 'Rugosite')
-
-      ierr = nf90_def_var(nid, 'FTER', NF90_FORMAT, dims, id_fter)
-      ierr = nf_put_att_text(nid, id_fter, 'title',10,'Frac. Land')
-      ierr = nf90_def_var(nid, 'FOCE', NF90_FORMAT, dims, id_foce)
-      ierr = nf_put_att_text(nid, id_foce, 'title',11,'Frac. Ocean')
-      ierr = nf90_def_var(nid, 'FSIC', NF90_FORMAT, dims, id_fsic)
-      ierr = nf_put_att_text(nid, id_fsic, 'title',13,'Frac. Sea Ice')
-      ierr = nf90_def_var(nid, 'FLIC', NF90_FORMAT, dims, id_flic)
-      ierr = nf_put_att_text(nid, id_flic, 'title',14,'Frac. Land Ice')
-
-      ierr = nf_enddef(nid)
-      IF (ierr/=nf_noerr) THEN
+      ierr = nf90_def_var(nid, 'ALB', nf90_format, dims, id_alb)
+      ierr = nf90_put_att(nid, id_alb, 'title', 'Albedo a la surface')
+
+      ierr = nf90_def_var(nid, 'RUG', nf90_format, dims, id_rug)
+      ierr = nf90_put_att(nid, id_rug, 'title', 'Rugosite')
+
+      ierr = nf90_def_var(nid, 'FTER', nf90_format, dims, id_fter)
+      ierr = nf90_put_att(nid, id_fter, 'title','Frac. Land')
+      ierr = nf90_def_var(nid, 'FOCE', nf90_format, dims, id_foce)
+      ierr = nf90_put_att(nid, id_foce, 'title','Frac. Ocean')
+      ierr = nf90_def_var(nid, 'FSIC', nf90_format, dims, id_fsic)
+      ierr = nf90_put_att(nid, id_fsic, 'title','Frac. Sea Ice')
+      ierr = nf90_def_var(nid, 'FLIC', nf90_format, dims, id_flic)
+      ierr = nf90_put_att(nid, id_flic, 'title','Frac. Land Ice')
+
+      ierr = nf90_enddef(nid)
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error: failed to end define mode'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
 
@@ -655,7 +656,7 @@
       DO k = 1, year_len
         ierr = nf90_put_var(nid, id_tim, k, [k])
-        IF (ierr/=nf_noerr) THEN
+        IF (ierr/=nf90_noerr) THEN
           WRITE (*, *) 'writelim error with temps(k),k=', k
-          WRITE (*, *) nf_strerror(ierr)
+          WRITE (*, *) nf90_strerror(ierr)
         END IF
       END DO
@@ -668,7 +669,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_nat, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_nat'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -677,7 +678,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_sst, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_sst'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -686,7 +687,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_bils, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_bil'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -695,7 +696,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_alb, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_alb'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -704,7 +705,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_rug, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_rug'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -713,7 +714,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_fter, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_fter'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -722,7 +723,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_foce, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_foce'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -731,7 +732,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_fsic, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_fsic'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -740,7 +741,7 @@
     IF (is_master) THEN
       ierr = nf90_put_var(nid, id_flic, phy_glo)
-      IF (ierr/=nf_noerr) THEN
+      IF (ierr/=nf90_noerr) THEN
         WRITE (*, *) 'writelim error with phy_flic'
-        WRITE (*, *) nf_strerror(ierr)
+        WRITE (*, *) nf90_strerror(ierr)
       END IF
     END IF
@@ -748,5 +749,5 @@
     ! close file:
     IF (is_master) THEN
-      ierr = nf_close(nid)
+      ierr = nf90_close(nid)
     END IF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phyetat0_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phyetat0_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phyetat0_mod.F90	(revision 5088)
@@ -40,5 +40,5 @@
   USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy
   USE wxios, ONLY: missing_val_xios => missing_val, using_xios
-  use lmdz_netcdf, only: missing_val_netcdf => nf90_fill_real
+  use netcdf, only: missing_val_netcdf => nf90_fill_real
   use config_ocean_skin_m, only: activate_ocean_skin
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90	(revision 5088)
@@ -456,5 +456,5 @@
     USE ioipsl, ONLY: histend, histsync
     USE iophy, ONLY: set_itau_iophy, histwrite_phy
-    USE lmdz_netcdf, ONLY: nf90_fill_real
+    USE netcdf, ONLY: nf90_fill_real
     USE print_control_mod, ONLY: prt_level,lunout
     ! ug Pour les sorties XIOS
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_state_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_state_var_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_state_var_mod.F90	(revision 5088)
@@ -10,5 +10,5 @@
 ! Declaration des variables
       USE dimphy
-      USE lmdz_netcdf, only: nf90_fill_real
+      USE netcdf, only: nf90_fill_real
       INTEGER, PARAMETER :: nlevSTD=17
       INTEGER, PARAMETER :: nlevSTD8=8
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5088)
@@ -48,5 +48,5 @@
     USE mod_phys_lmdz_para
     USE netcdf95, only: nf95_close
-    USE lmdz_netcdf, only: nf90_fill_real     ! IM for NMC files
+    USE netcdf, only: nf90_fill_real     ! IM for NMC files
     USE open_climoz_m, only: open_climoz ! ozone climatology from a file
     USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/plevel.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/plevel.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/plevel.F90	(revision 5088)
@@ -7,5 +7,5 @@
   ! ================================================================
   ! ================================================================
-  USE lmdz_netcdf, ONLY: nf90_fill_real
+  USE netcdf, ONLY: nf90_fill_real
   USE dimphy
 #ifdef CPP_IOIPSL 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90	(revision 5088)
@@ -24,5 +24,5 @@
 
     use netcdf95, only: nf95_open, nf95_close, nf95_gw_var, nf95_inq_varid
-    use lmdz_netcdf, only: nf90_nowrite
+    use netcdf, only: nf90_nowrite
 
     use mod_phys_lmdz_mpi_data, only: is_mpi_root
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/read_map2D.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/read_map2D.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/read_map2D.F90	(revision 5088)
@@ -3,5 +3,5 @@
 ! Return variable for the given timestep. 
   USE dimphy
-  USE lmdz_netcdf, ONLY: nf90_open,nf90_close,nf90_nowrite,nf90_noerr,nf90_get_var,nf90_inq_varid
+  USE netcdf, ONLY: nf90_open,nf90_close,nf90_nowrite,nf90_noerr,nf90_get_var,nf90_inq_varid
   USE mod_grid_phy_lmdz
   USE mod_phys_lmdz_para
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/read_pstoke.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/read_pstoke.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/read_pstoke.F90	(revision 5088)
@@ -17,6 +17,6 @@
   ! ******************************************************************************
 
-  USE lmdz_netcdf, ONLY: nf90_open,nf90_inq_varid,nf90_nowrite,nf90_get_var,nf_inq_dim,&
-          nf_inq_dimid
+  USE netcdf, ONLY: nf90_open,nf90_inq_varid,nf90_nowrite,nf90_get_var,nf90_inquire_dimension,&
+          nf90_inq_dimid
   USE dimphy
   USE indice_sol_mod
@@ -225,15 +225,15 @@
     ! ID pour les dimensions
 
-    status = nf_inq_dimid(ncidp, 'y', yid)
-    status = nf_inq_dimid(ncidp, 'x', xid)
-    status = nf_inq_dimid(ncidp, 'sig_s', zid)
-    status = nf_inq_dimid(ncidp, 'time_counter', tid)
+    status = nf90_inq_dimid(ncidp, 'y', yid)
+    status = nf90_inq_dimid(ncidp, 'x', xid)
+    status = nf90_inq_dimid(ncidp, 'sig_s', zid)
+    status = nf90_inq_dimid(ncidp, 'time_counter', tid)
 
     ! lecture des dimensions
 
-    status = nf_inq_dim(ncidp, yid, namedim, ncjm)
-    status = nf_inq_dim(ncidp, xid, namedim, ncim)
-    status = nf_inq_dim(ncidp, zid, namedim, ncklevo)
-    status = nf_inq_dim(ncidp, tid, namedim, ncrec)
+    status = nf90_inquire_dimension(ncidp, yid, namedim, ncjm)
+    status = nf90_inquire_dimension(ncidp, xid, namedim, ncim)
+    status = nf90_inquire_dimension(ncidp, zid, namedim, ncklevo)
+    status = nf90_inquire_dimension(ncidp, tid, namedim, ncrec)
 
     zrec = ncrec
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/read_pstoke0.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/read_pstoke0.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/read_pstoke0.F90	(revision 5088)
@@ -16,5 +16,5 @@
   ! ******************************************************************************
 
-  USE lmdz_netcdf, ONLY: nf_inq_dimid,nf_inq_dim,nf90_get_var,nf90_inq_varid,nf90_open,&
+  USE netcdf, ONLY: nf90_inq_dimid,nf90_inquire_dimension,nf90_get_var,nf90_inq_varid,nf90_open,&
           nf90_nowrite
   USE dimphy
@@ -225,15 +225,15 @@
     ! ID pour les dimensions
 
-    status = nf_inq_dimid(ncidp, 'y', yid)
-    status = nf_inq_dimid(ncidp, 'x', xid)
-    status = nf_inq_dimid(ncidp, 'sig_s', zid)
-    status = nf_inq_dimid(ncidp, 'time_counter', tid)
+    status = nf90_inq_dimid(ncidp, 'y', yid)
+    status = nf90_inq_dimid(ncidp, 'x', xid)
+    status = nf90_inq_dimid(ncidp, 'sig_s', zid)
+    status = nf90_inq_dimid(ncidp, 'time_counter', tid)
 
     ! lecture des dimensions
 
-    status = nf_inq_dim(ncidp, yid, namedim, ncjm)
-    status = nf_inq_dim(ncidp, xid, namedim, ncim)
-    status = nf_inq_dim(ncidp, zid, namedim, nckev)
-    status = nf_inq_dim(ncidp, tid, namedim, ncrec)
+    status = nf90_inquire_dimension(ncidp, yid, namedim, ncjm)
+    status = nf90_inquire_dimension(ncidp, xid, namedim, ncim)
+    status = nf90_inquire_dimension(ncidp, zid, namedim, nckev)
+    status = nf90_inquire_dimension(ncidp, tid, namedim, ncrec)
 
     zrec = ncrec
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90	(revision 5088)
@@ -3,5 +3,5 @@
 MODULE readaerosol_mod
 
-  USE lmdz_netcdf, ONLY: nf90_strerror,nf90_noerr,nf90_get_var,nf90_inq_varid,&
+  USE netcdf, ONLY: nf90_strerror,nf90_noerr,nf90_get_var,nf90_inq_varid,&
           nf90_inquire_dimension,nf90_inq_dimid,nf90_open,nf90_nowrite,nf90_close
 
@@ -205,5 +205,5 @@
 
           ! Read and test longitudes
-          CALL check_err( nf90_inq_dimid(ncid, "lon", dimID),"pb inq dim lon") 
+          CALL check_err( nf90_inq_dimid(ncid, "lon", dimID),"pb inq dim lon")
           CALL check_err( nf90_inquire_dimension(ncid, dimID, len = nbp_lon_src),"pb inq dim lon")
           CALL check_err( nf90_inq_varid(ncid, 'lon', varid),"pb inq lon" )
@@ -212,5 +212,5 @@
 
           ! Read and test latitudes
-          CALL check_err( nf90_inq_dimid(ncid, "lat", dimID),"pb inq dim lat") 
+          CALL check_err( nf90_inq_dimid(ncid, "lat", dimID),"pb inq dim lat")
           CALL check_err( nf90_inquire_dimension(ncid, dimID, len = nbp_lat_src),"pb inq dim lat")
           CALL check_err( nf90_inq_varid(ncid, 'lat', varid),"pb inq lat" )
@@ -398,8 +398,8 @@
 !    Old type of file should contain the dimension 'PRESNIVS'
 !****************************************************************************************
-       ierr = nf90_inq_dimid(ncid, 'lev', dimid) 
+       ierr = nf90_inq_dimid(ncid, 'lev', dimid)
        IF (ierr /= NF90_NOERR) THEN
           ! Coordinate axe lev not found. Check for presnivs.
-          ierr = nf90_inq_dimid(ncid, 'presnivs', dimid) 
+          ierr = nf90_inq_dimid(ncid, 'presnivs', dimid)
           IF (ierr /= NF90_NOERR) THEN
              ierr = nf90_inq_dimid(ncid, 'PRESNIVS', dimid)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90	(revision 5088)
@@ -3,5 +3,5 @@
     use netcdf95, only: nf95_close, nf95_gw_var, nf95_inq_dimid, & 
                         nf95_inq_varid, nf95_open
-    use lmdz_netcdf, only: nf90_get_var, nf90_noerr, nf90_nowrite
+    use netcdf, only: nf90_get_var, nf90_noerr, nf90_nowrite
 
     USE phys_cal_mod, ONLY : mth_cur
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato_m.F90	(revision 5088)
@@ -24,5 +24,5 @@
 
 SUBROUTINE init_readaerosolstrato1
-  USE lmdz_netcdf, ONLY: nf90_nowrite
+  USE netcdf, ONLY: nf90_nowrite
   USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, &
                       nf95_inq_varid, nf95_open
@@ -67,5 +67,5 @@
   
 SUBROUTINE init_readaerosolstrato2
-  USE lmdz_netcdf, ONLY: nf90_nowrite
+  USE netcdf, ONLY: nf90_nowrite
   USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, &
                       nf95_inq_varid, nf95_open
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readchlorophyll.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readchlorophyll.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readchlorophyll.F90	(revision 5088)
@@ -8,5 +8,5 @@
 
     USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, nf95_inq_varid, nf95_open
-    USE lmdz_netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
+    USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
     USE phys_cal_mod, ONLY: mth_cur
     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid2dto1d_glo
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_horiz_time_climoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_horiz_time_climoz_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_horiz_time_climoz_m.F90	(revision 5088)
@@ -4,5 +4,5 @@
   USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, grid_type, unstructured
   USE nrtype,            ONLY: pi
-  USE lmdz_netcdf,   ONLY: NF90_CLOBBER, NF90_FLOAT,     NF90_OPEN,   &
+  USE netcdf,   ONLY: NF90_CLOBBER, NF90_FLOAT,     NF90_OPEN,   &
                       NF90_NOWRITE, NF90_NOERR,     NF90_GET_ATT, NF90_GLOBAL
   USE netcdf95, ONLY: NF95_DEF_DIM, NF95_INQ_DIMID, NF95_INQUIRE_DIMENSION,    &
@@ -702,5 +702,5 @@
 !
 !-------------------------------------------------------------------------------
-  USE lmdz_netcdf, ONLY: NF90_NOERR, NF90_strerror
+  USE netcdf, ONLY: NF90_NOERR, NF90_strerror
 !-------------------------------------------------------------------------------
 ! Arguments:
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90	(revision 5088)
@@ -45,5 +45,5 @@
     use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, nf95_get_var, &
          nf95_put_var, nf95_gw_var
-    use lmdz_netcdf, only: nf90_nowrite
+    use netcdf, only: nf90_nowrite
     use nrtype, only: pi
     use regular_lonlat_mod, only: boundslat_reg, south
@@ -245,5 +245,5 @@
     use netcdf95, only: nf95_create, nf95_def_dim, nf95_def_var, &
          nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var
-    use lmdz_netcdf, only: nf90_clobber, nf90_float, nf90_copy_att, nf90_global
+    use netcdf, only: nf90_clobber, nf90_float, nf90_copy_att, nf90_global
     use nrtype, only: pi
     use regular_lonlat_mod, only : lat_reg
@@ -328,5 +328,5 @@
     subroutine handle_err_copy_att(att_name)
 
-      use lmdz_netcdf, only: nf90_noerr, nf90_strerror
+      use netcdf, only: nf90_noerr, nf90_strerror
 
       character(len=*), intent(in):: att_name
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90	(revision 5088)
@@ -72,5 +72,5 @@
 
     use netcdf95, only: nf95_open, nf95_close
-    use lmdz_netcdf, only: nf90_nowrite
+    use netcdf, only: nf90_nowrite
     use assert_m, only: assert
     use dimphy, only: klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90	(revision 5088)
@@ -26,5 +26,5 @@
 
     use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, nf95_get_var
-    use lmdz_netcdf, only:  nf90_nowrite
+    use netcdf, only:  nf90_nowrite
     use assert_m, only: assert
     use regr_conserv_m, only: regr_conserv
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_time_av_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_time_av_m.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_time_av_m.F90	(revision 5088)
@@ -115,5 +115,5 @@
   USE netcdf95,       ONLY: NF95_INQ_VARID, NF95_INQUIRE_VARIABLE, &
                             NF95_INQ_DIMID, NF95_INQUIRE_DIMENSION, nf95_get_var
-  USE lmdz_netcdf,         ONLY: NF90_INQ_VARID, NF90_NOERR
+  USE netcdf,         ONLY: NF90_INQ_VARID, NF90_NOERR
   USE assert_m,       ONLY: assert
   USE assert_eq_m,    ONLY: assert_eq
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/tracco2i_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/tracco2i_mod.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/tracco2i_mod.F90	(revision 5088)
@@ -351,5 +351,5 @@
 
     USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_varid, nf95_open
-    USE lmdz_netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
+    USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
 
     USE carbon_cycle_mod, ONLY : fco2_ff, fco2_bb, fco2_land, fco2_ocean
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/undefSTD.F90	(revision 5087)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/undefSTD.F90	(revision 5088)
@@ -3,5 +3,5 @@
 
 SUBROUTINE undefstd(itap, read_climoz)
-  USE lmdz_netcdf, ONLY: nf90_fill_real
+  USE netcdf, ONLY: nf90_fill_real
   USE dimphy
 #ifdef CPP_IOIPSL 
