Index: /LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 4273)
+++ /LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 4274)
@@ -317,4 +317,5 @@
   !**********************************************************************************************
   SUBROUTINE old_read_SCM_cas
+    use netcdf, only: nf90_get_var
     implicit none
 
@@ -376,9 +377,5 @@
     else
        allocate(time_val(nt_cas))
-#ifdef NC_DOUBLE
-       ierr = NF_GET_VAR_DOUBLE(nid,timeid,time_val)
-#else
-       ierr = NF_GET_VAR_REAL(nid,timeid,time_val)
-#endif
+       ierr = NF90_GET_VAR(nid,timeid,time_val)
        if(ierr/=NF_NOERR) then
           print *,'Pb a la lecture de time cas.nc: '
@@ -544,4 +541,5 @@
 
   !program reading forcing of the case study
+  use netcdf, only: nf90_get_var
   implicit none
 #include "netcdf.inc"
@@ -591,9 +589,5 @@
      print *,'Dans read_cas2, on va lire ',var3didin(i),name_var(i)
      if(i.LE.35) then
-#ifdef NC_DOUBLE
-        ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul)
-#else
-        ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul)
-#endif
+        ierr = NF90_GET_VAR(nid,var3didin(i),resul)
         print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i)
         if(ierr/=NF_NOERR) then
@@ -602,9 +596,5 @@
         endif
      else
-#ifdef NC_DOUBLE
-        ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul1)
-#else
-        ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul1)
-#endif
+        ierr = NF90_GET_VAR(nid,var3didin(i),resul1)
         print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i)
         if(ierr/=NF_NOERR) then
@@ -667,4 +657,5 @@
 
   !program reading forcing of the case study
+  use netcdf, only: nf90_get_var
   implicit none
 #include "netcdf.inc"
@@ -720,9 +711,5 @@
         !-----------------------------------------------------------------------
         if(i.LE.4) then     ! Lecture des coord pression en (nlevelp1,lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),apbp)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),apbp)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),apbp)
            print *,'read2_cas(apbp), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
@@ -732,9 +719,5 @@
            !-----------------------------------------------------------------------
         else if(i.gt.4.and.i.LE.45) then   ! Lecture des variables en (time,nlevel,lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),resul)
            print *,'read2_cas(resul), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
@@ -744,9 +727,5 @@
            !-----------------------------------------------------------------------
         else if (i.gt.45.and.i.LE.51) then   ! Lecture des variables en (time,lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul2)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul2)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),resul2)
            print *,'read2_cas(resul2), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
@@ -756,9 +735,5 @@
            !-----------------------------------------------------------------------
         else     ! Lecture des constantes (lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul3)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul3)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
            print *,'read2_cas(resul3), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
@@ -853,4 +828,5 @@
 
   !program reading forcing of the case study
+  use netcdf, only: nf90_get_var
   implicit none
 #include "netcdf.inc"
@@ -912,9 +888,5 @@
         !-----------------------------------------------------------------------
         if(i.LE.4) then     ! Lecture des coord pression en (nlevelp1,lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),apbp)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),apbp)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),apbp)
            print *,'read2_cas(apbp), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
@@ -924,9 +896,5 @@
            !-----------------------------------------------------------------------
         else if(i.gt.4.and.i.LE.12) then   ! Lecture des variables en (time,nlevel,lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul1)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul1)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),resul1)
            print *,'read2_cas(resul1), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
@@ -937,9 +905,5 @@
            !-----------------------------------------------------------------------
         else if(i.gt.12.and.i.LE.54) then   ! Lecture des variables en (time,nlevel,lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),resul)
            print *,'read2_cas(resul), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
@@ -950,9 +914,5 @@
            !-----------------------------------------------------------------------
         else if (i.gt.54.and.i.LE.65) then   ! Lecture des variables en (time,lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul2)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul2)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),resul2)
            print *,'read2_cas(resul2), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
@@ -963,9 +923,5 @@
            !-----------------------------------------------------------------------
         else     ! Lecture des constantes (lat,lon)
-#ifdef NC_DOUBLE
-           ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul3)
-#else
-           ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul3)
-#endif
+           ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
            print *,'read2_cas(resul3), on a lu ',i,name_var(i)
            if(ierr/=NF_NOERR) then
Index: /LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 4273)
+++ /LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 4274)
@@ -87,4 +87,5 @@
   !**********************************************************************************************
   SUBROUTINE read_SCM_cas
+    use netcdf, only: nf90_get_var
     implicit none
 
@@ -146,9 +147,5 @@
     else
        allocate(time_val(nt_cas))
-#ifdef NC_DOUBLE
-       ierr = NF_GET_VAR_DOUBLE(nid,timeid,time_val)
-#else
-       ierr = NF_GET_VAR_REAL(nid,timeid,time_val)
-#endif
+       ierr = NF90_GET_VAR(nid,timeid,time_val)
        if(ierr/=NF_NOERR) then
           print *,'Pb a la lecture de time cas.nc: '
@@ -332,4 +329,5 @@
 
     !program reading forcing of the case study
+    use netcdf, only: nf90_get_var
     implicit none
 #include "netcdf.inc"
@@ -458,9 +456,5 @@
           !-----------------------------------------------------------------------
           if(i.LE.4) then
-#ifdef NC_DOUBLE
-             ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),apbp)
-#else
-             ierr = NF_GET_VAR_REAL(nid,var3didin(i),apbp)
-#endif
+             ierr = NF90_GET_VAR(nid,var3didin(i),apbp)
              print *,'read2_cas(apbp), on a lu ',i,name_var(i)
              if(ierr/=NF_NOERR) then
@@ -473,9 +467,5 @@
              !-----------------------------------------------------------------------
           else if(i.gt.4.and.i.LE.12) then  
-#ifdef NC_DOUBLE
-             ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul1)
-#else
-             ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul1)
-#endif
+             ierr = NF90_GET_VAR(nid,var3didin(i),resul1)
              print *,'read2_cas(resul1), on a lu ',i,name_var(i)
              if(ierr/=NF_NOERR) then
@@ -490,9 +480,5 @@
              !-----------------------------------------------------------------------
           else if(i.gt.12.and.i.LE.61) then
-#ifdef NC_DOUBLE
-             ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul)
-#else
-             ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul)
-#endif
+             ierr = NF90_GET_VAR(nid,var3didin(i),resul)
              print *,'read2_cas(resul), on a lu ',i,name_var(i)
              if(ierr/=NF_NOERR) then
@@ -506,9 +492,5 @@
              !-----------------------------------------------------------------------
           else if (i.gt.62.and.i.LE.75) then
-#ifdef NC_DOUBLE
-             ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul2)
-#else
-             ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul2)
-#endif
+             ierr = NF90_GET_VAR(nid,var3didin(i),resul2)
              print *,'read2_cas(resul2), on a lu ',i,name_var(i)
              if(ierr/=NF_NOERR) then
@@ -522,9 +504,5 @@
              !-----------------------------------------------------------------------
           else
-#ifdef NC_DOUBLE
-             ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul3)
-#else
-             ierr = NF_GET_VAR_REAL(nid,var3didin(i),resul3)
-#endif
+             ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
              print *,'read2_cas(resul3), on a lu ',i,name_var(i)
              if(ierr/=NF_NOERR) then
Index: /LMDZ6/trunk/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h
===================================================================
--- /LMDZ6/trunk/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 4273)
+++ /LMDZ6/trunk/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 4274)
@@ -146,5 +146,5 @@
 !program reading forcings of the TWP-ICE experiment
 
-!      use netcdf
+        use netcdf, only: nf90_get_var
 
       implicit none
@@ -314,9 +314,5 @@
        enddo
           
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),lat)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(1),lat)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(1),lat)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -325,9 +321,5 @@
 !         write(*,*)'lecture lat ok',lat
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),lon)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(2),lon)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(2),lon)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -336,9 +328,5 @@
 !         write(*,*)'lecture lon ok',lon
  
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),alt)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(3),alt)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(3),alt)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -347,9 +335,5 @@
 !          write(*,*)'lecture alt ok',alt
  
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),phis)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(4),phis)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(4),phis)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -358,9 +342,5 @@
 !          write(*,*)'lecture phis ok',phis
           
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),T)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(5),T)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(5),T)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -369,9 +349,5 @@
 !         write(*,*)'lecture T ok'
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),q)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(6),q)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(6),q)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -385,9 +361,5 @@
        enddo
        enddo
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),u)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(7),u)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(7),u)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -396,9 +368,5 @@
 !         write(*,*)'lecture u ok'
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),v)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(8),v)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(8),v)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -407,9 +375,5 @@
 !         write(*,*)'lecture v ok'
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),omega)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(9),omega)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(9),omega)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -424,9 +388,5 @@
        enddo
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),div)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(10),div)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(10),div)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -435,9 +395,5 @@
 !         write(*,*)'lecture div ok'
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),T_adv_h)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(11),T_adv_h)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(11),T_adv_h)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -453,9 +409,5 @@
 
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(12),T_adv_v)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(12),T_adv_v)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(12),T_adv_v)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -470,9 +422,5 @@
        enddo
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(13),q_adv_h)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(13),q_adv_h)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(13),q_adv_h)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -488,9 +436,5 @@
 
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(14),q_adv_v)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(14),q_adv_v)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(14),q_adv_v)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -506,59 +450,35 @@
 
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(15),s)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(15),s)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(16),s_adv_h)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(16),s_adv_h)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(17),s_adv_v)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(17),s_adv_v)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(18),p_srf_aver)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(18),p_srf_aver)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(19),p_srf_center)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(19),p_srf_center)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(20),T_srf)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(20),T_srf)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(15),s)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(16),s_adv_h)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(17),s_adv_v)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(18),p_srf_aver)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(19),p_srf_center)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(20),T_srf)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -572,5 +492,5 @@
          subroutine catchaxis(nid,ttm,llm,time,lev,ierr)
 
-!         use netcdf
+         use netcdf, only: nf90_get_var
 
          implicit none
@@ -610,11 +530,6 @@
          endif
 
-!#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,timevar,time)
-         ierr = NF_GET_VAR_DOUBLE(nid,levvar,lev)
-!#else
-!        ierr = NF_GET_VAR_REAL(nid,timevar,time)
-!        ierr = NF_GET_VAR_REAL(nid,levvar,lev)
-!#endif
+         ierr = NF90_GET_VAR(nid,timevar,time)
+         ierr = NF90_GET_VAR(nid,levvar,lev)
 
        return
@@ -2255,4 +2170,5 @@
 
 
+      use netcdf, only: nf90_get_var
       implicit none
 
@@ -2364,9 +2280,5 @@
 !      call catchaxis(nid,ntime,nlevel,time,z,ierr)
  
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),zz)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(1),zz)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(1),zz)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2375,9 +2287,5 @@
 !          write(*,*)'lecture z ok',zz
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),thl)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(2),thl)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(2),thl)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2386,9 +2294,5 @@
 !          write(*,*)'lecture thl ok',thl
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),qt)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(3),qt)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(3),qt)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2397,9 +2301,5 @@
 !          write(*,*)'lecture qt ok',qt
  
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),u)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(4),u)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(4),u)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2408,9 +2308,5 @@
 !          write(*,*)'lecture u ok',u
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),v)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(5),v)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(5),v)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2419,9 +2315,5 @@
 !          write(*,*)'lecture v ok',v
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),tke)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(6),tke)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(6),tke)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2430,9 +2322,5 @@
 !          write(*,*)'lecture tke ok',tke
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),ug)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(7),ug)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(7),ug)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2441,9 +2329,5 @@
 !          write(*,*)'lecture ug ok',ug
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),vg)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(8),vg)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(8),vg)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2452,9 +2336,5 @@
 !          write(*,*)'lecture vg ok',vg
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),wls)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(9),wls)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(9),wls)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2463,9 +2343,5 @@
 !          write(*,*)'lecture wls ok',wls
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),dqtdx)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(10),dqtdx)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(10),dqtdx)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2474,9 +2350,5 @@
 !          write(*,*)'lecture dqtdx ok',dqtdx
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),dqtdy)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(11),dqtdy)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(11),dqtdy)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2485,9 +2357,5 @@
 !          write(*,*)'lecture dqtdy ok',dqtdy
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(12),dqtdt)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(12),dqtdt)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(12),dqtdt)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2496,9 +2364,5 @@
 !          write(*,*)'lecture dqtdt ok',dqtdt
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(13),thl_rad)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(13),thl_rad)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(13),thl_rad)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2517,4 +2381,5 @@
 !program reading initial profils and forcings of the Dice case study
 
+      use netcdf, only: nf90_get_var
 
       implicit none
@@ -2685,9 +2550,5 @@
 !      call catchaxis(nid,ntime,nlevel,time,z,ierr)
  
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),zz)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(1),zz)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(1),zz)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2696,9 +2557,5 @@
 !          write(*,*)'lecture zz ok',zz
  
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),pres)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(11),pres)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(11),pres)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2707,9 +2564,5 @@
 !          write(*,*)'lecture pres ok',pres
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(12),th)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(12),th)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(12),th)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2721,9 +2574,5 @@
            enddo
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(13),qv)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(13),qv)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(13),qv)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2732,9 +2581,5 @@
 !          write(*,*)'lecture qv ok',qv
  
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(14),u)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(14),u)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(14),u)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2743,9 +2588,5 @@
 !          write(*,*)'lecture u ok',u
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(15),v)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(15),v)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(15),v)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2754,9 +2595,5 @@
 !          write(*,*)'lecture v ok',v
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(16),o3)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(16),o3)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(16),o3)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2765,9 +2602,5 @@
 !          write(*,*)'lecture o3 ok',o3
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),shf)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(2),shf)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(2),shf)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2776,9 +2609,5 @@
 !          write(*,*)'lecture shf ok',shf
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),lhf)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(3),lhf)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(3),lhf)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2787,9 +2616,5 @@
 !          write(*,*)'lecture lhf ok',lhf
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),lwup)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(4),lwup)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(4),lwup)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2798,9 +2623,5 @@
 !          write(*,*)'lecture lwup ok',lwup
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),swup)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(5),swup)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(5),swup)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2809,9 +2630,5 @@
 !          write(*,*)'lecture swup ok',swup
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),tg)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(6),tg)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(6),tg)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2820,9 +2637,5 @@
 !          write(*,*)'lecture tg ok',tg
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),ustar)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(7),ustar)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(7),ustar)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2831,9 +2644,5 @@
 !          write(*,*)'lecture ustar ok',ustar
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),psurf)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(8),psurf)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(8),psurf)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2842,9 +2651,5 @@
 !          write(*,*)'lecture psurf ok',psurf
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),ug)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(9),ug)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(9),ug)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2853,9 +2658,5 @@
 !          write(*,*)'lecture ug ok',ug
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),vg)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(10),vg)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(10),vg)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2864,9 +2665,5 @@
 !          write(*,*)'lecture vg ok',vg
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(17),hadvt)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(17),hadvt)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(17),hadvt)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2875,9 +2672,5 @@
 !          write(*,*)'lecture hadvt ok',hadvt
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(18),hadvq)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(18),hadvq)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(18),hadvq)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2886,9 +2679,5 @@
 !          write(*,*)'lecture hadvq ok',hadvq
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(19),hadvu)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(19),hadvu)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(19),hadvu)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2897,9 +2686,5 @@
 !          write(*,*)'lecture hadvu ok',hadvu
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(20),hadvv)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(20),hadvv)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(20),hadvv)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2908,9 +2693,5 @@
 !          write(*,*)'lecture hadvv ok',hadvv
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(21),w)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(21),w)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(21),w)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2919,9 +2700,5 @@
 !          write(*,*)'lecture w ok',w
 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(22),omega)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(22),omega)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(22),omega)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
@@ -2938,4 +2715,5 @@
 !program reading initial profils and forcings of the Gabls4 case study
 
+      use netcdf, only: nf90_get_var
 
       implicit none
@@ -3068,149 +2846,89 @@
 !      call catchaxis(nid,ntime,nlevel,time,z,ierr)
  
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),zz_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(1),zz_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),depth_sn)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(2),depth_sn)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),ug_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(3),ug_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),vg_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(4),vg_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),pf_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(5),pf_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),th_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(6),th_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),t_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(7),t_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),qv_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(8),qv_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),u_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(9),u_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),v_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(10),v_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),hadvt_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(11),hadvt_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(12),hadvq_i)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(12),hadvq_i)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(14),tsnow)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(14),tsnow)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
- 
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(15),snow_dens)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(15),snow_dens)
-#endif
-         if(ierr/=NF_NOERR) then
-            write(*,*) NF_STRERROR(ierr)
-            stop "getvarup"
-         endif
-
-#ifdef NC_DOUBLE
-         ierr = NF_GET_VAR_DOUBLE(nid,var3didin(16),tg)
-#else
-         ierr = NF_GET_VAR_REAL(nid,var3didin(16),tg)
-#endif
+         ierr = NF90_GET_VAR(nid,var3didin(1),zz_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(2),depth_sn)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(3),ug_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(4),vg_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(5),pf_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(6),th_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(7),t_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(8),qv_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(9),u_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(10),v_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(11),hadvt_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(12),hadvq_i)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(14),tsnow)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = NF90_GET_VAR(nid,var3didin(15),snow_dens)
+         if(ierr/=NF_NOERR) then
+            write(*,*) NF_STRERROR(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = NF90_GET_VAR(nid,var3didin(16),tg)
          if(ierr/=NF_NOERR) then
             write(*,*) NF_STRERROR(ierr)
