Index: LMDZ6/trunk/libf/phylmdiso/phyaqua_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmdiso/phyaqua_mod.F90	(revision 5249)
+++ LMDZ6/trunk/libf/phylmdiso/phyaqua_mod.F90	(revision 5270)
@@ -539,6 +539,4 @@
     IMPLICIT NONE
 
-    include "netcdf.inc"
-
     INTEGER, INTENT (IN) :: klon
     REAL, INTENT (IN) :: phy_nat(klon, 360)
@@ -593,8 +591,9 @@
     USE mod_phys_lmdz_transfert_para, ONLY: gather
     USE phys_cal_mod, ONLY: year_len
-    USE netcdf, ONLY: nf90_put_var, nf90_def_var
+    USE netcdf, ONLY: nf90_clobber, nf90_close, nf90_noerr, nf90_strerror, nf90_put_att, nf90_def_var, &
+            nf90_def_dim, nf90_create, nf90_put_var, nf90_unlimited, nf90_global, nf90_64bit_offset, &
+            nf90_enddef
     USE lmdz_cppkeys_wrapper, ONLY: nf90_format
     IMPLICIT NONE
-    include "netcdf.inc"
 
     INTEGER, INTENT (IN) :: klon
@@ -627,11 +626,10 @@
       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, &
-        '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_create('limit.nc', IOR(nf90_clobber,nf90_64bit_offset), nid)
+
+      ierr = nf90_put_att(nid, nf90_global, 'title', 'Fichier conditions aux limites')
+      ! !        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
@@ -639,37 +637,34 @@
 
       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_put_att(nid, id_tim, 'title', '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, &
-        'Nature du sol (0,1,2,3)')
+      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, &
-        'Temperature superficielle de la mer')
+      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, &
-        'Reference flux de chaleur au sol')
+      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_put_att(nid, id_alb, 'title', '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_put_att(nid, id_rug, 'title', '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_put_att(nid, id_fter, 'title','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_put_att(nid, id_foce, 'title','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_put_att(nid, id_fsic, 'title','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_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
 
@@ -678,7 +673,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
@@ -691,7 +686,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
@@ -700,7 +695,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
@@ -709,7 +704,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
@@ -718,7 +713,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
@@ -727,7 +722,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
@@ -736,7 +731,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
@@ -745,7 +740,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
@@ -754,7 +749,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
@@ -763,7 +758,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
@@ -771,5 +766,5 @@
     ! close file:
     IF (is_master) THEN
-      ierr = nf_close(nid)
+      ierr = nf90_close(nid)
     END IF
 
