Index: /LMDZ6/trunk/libf/phylmd/Dust/read_dust.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/Dust/read_dust.f90	(revision 5462)
+++ /LMDZ6/trunk/libf/phylmd/Dust/read_dust.f90	(revision 5463)
@@ -21,5 +21,5 @@
   save ncid1, varid1, ncid2, varid2
 !$OMP THREADPRIVATE(ncid1, varid1, ncid2, varid2)
-  integer :: start(4),count(4), status
+  integer :: start_(4),count_(4)
   integer :: i, j, ig
   !
@@ -28,23 +28,27 @@
   if (debutphy) then
   !
-     ncid1=nf90_open('dust.nc',nf90_nowrite,rcode)
-     varid1=nf90_inq_varid(ncid1,'EMISSION',rcode)
+     rcode=nf90_open('dust.nc',nf90_nowrite,ncid1)
+     if ( rcode /= 0 ) then ; call abort_physic('LMDZ','open dust.nc dans read_vent',1) ; endif
+
+     rcode=nf90_inq_varid(ncid1,'EMISSION',varid1)
+     if ( rcode /= 0 ) then ; call abort_physic('LMDZ','inq varid EMISSION dans read_vent',1) ; endif
   !
   endif
   !
-  start(1)=1
-  start(2)=1
-  start(4)=0
+  start_(1)=1
+  start_(2)=1
+  start_(3)=step
+  start_(4)=0
 
-   ! count(1)=iip1
-  count(1)=nbp_lon+1
-   ! count(2)=jjp1
-  count(2)=nbp_lat
-  count(3)=1
-  count(4)=0
+   ! count_(1)=iip1
+  count_(1)=nbp_lon+1
+   ! count_(2)=jjp1
+  count_(2)=nbp_lat
+  count_(3)=1
+  count_(4)=0
   !
-  start(3)=step
   !
-  status = nf90_get_var(ncid1, varid1, dust_nc_glo, start, count)
+  rcode = nf90_get_var(ncid1, varid1, dust_nc_glo, start_, count_)
+  if ( rcode /= 0 ) then ; call abort_physic('LMDZ','get EMISSION dans read_vent',1) ; endif
 
   !
Index: /LMDZ6/trunk/libf/phylmd/Dust/read_surface.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/Dust/read_surface.f90	(revision 5462)
+++ /LMDZ6/trunk/libf/phylmd/Dust/read_surface.f90	(revision 5463)
@@ -31,6 +31,6 @@
        real surfa_glo(klon_glo,5)
 !
-       integer ncid, varid, rcode
-       integer start(2),count(2),status
+       integer ncid, varid, rcode, varlatid,tmpid
+       integer start_(2),count_(2)
        integer i,j,l,ig
        character*1 str1
@@ -41,5 +41,5 @@
       real, dimension(nbp_lat) :: lats
       real, dimension(nbp_lat) :: lats_glo
-      integer, dimension(1) :: startj,endj
+      integer, dimension(1) :: start_j,endj
 !JE20140526>>
 !$OMP MASTER
@@ -47,5 +47,7 @@
 
        print*,'Lecture du fichier donnees_lisa.nc' 
-       ncid=nf90_open('donnees_lisa.nc',nf90_nowrite,rcode)
+       rcode=nf90_open('donnees_lisa.nc',nf90_nowrite,ncid)
+       if ( rcode /= 0 ) then ; call abort_physic('LMDZ','open donnees_lisa.nc dans read_vent',1) ; endif
+
 
 !JE20140526<<: check if are inversed or not the latitude grid in donnes_lisa
@@ -54,27 +56,21 @@
       isinversed=.false.
       do i=1,5
-       if (i==1) aux4s='latu'
-       if (i==2) aux4s='LATU'
-       if (i==3) aux4s='LatU'
-       if (i==4) aux4s='Latu'
-       if (i==5) aux4s='latU'
-       status = nf90_inq_varid(ncid, aux4s, rcode)
-!       print *,'stat,i',status,i,outcycle,aux4s
-!       print *,'ifclause',status.NE. nf90_noerr ,outcycle == .false.
-       IF ((.not.(status.NE. nf90_noerr) ).and.( .not. outcycle )) THEN
-         outcycle=.true.
-         latstr=aux4s
-       ENDIF
+          if (i==1) aux4s='latu'
+          if (i==2) aux4s='LATU'
+          if (i==3) aux4s='LatU'
+          if (i==4) aux4s='Latu'
+          if (i==5) aux4s='latU'
+          rcode = nf90_inq_varid(ncid, aux4s, tmpid)
+          IF ((rcode==0).and.( .not. outcycle )) THEN
+            outcycle=.true.
+            varlatid=tmpid
+          ENDIF
       enddo ! check if it inversed lat
-      startj(1)=1
-!      endj(1)=jjp1
+      start_j(1)=1
       endj(1)=nbp_lat
-      varid=nf90_inq_varid(ncid,latstr,rcode)
+      rcode = nf90_get_var(ncid, varlatid, lats_glo, start_j, endj)
+      if ( .not. outcycle ) then ; call abort_physic('LMDZ','get lat dans read_surface',1) ; endif
 
-          status = nf90_get_var(ncid, varid, lats_glo, startj, endj)
-!      print *,latstr,varid,status,jjp1,rcode
-!      IF (status .NE. nf90_noerr) print*,'NOOOOOOO'
-!      print *,lats
-!stop
+
 
 ! check if netcdf is latitude inversed or not. 
@@ -86,6 +82,6 @@
           write(str1,'(i1)') i
           varname=trim(name)//str1
-       print*,'lecture variable:',varname
-          varid=nf90_inq_varid(ncid,trim(varname),rcode)
+          rcode=nf90_inq_varid(ncid,trim(varname),varid)
+          if ( rcode /= 0 ) then ; call abort_physic('LMDZ','get'//varname//'  dans read_vent',1) ; endif
 !          varid=nf90_inq_varid(ncid,varname,rcode)
 
@@ -93,10 +89,10 @@
 !  -----------------------------------------------------
 
-          start(1)=1
-          start(2)=1      
-          count(1)=nbp_lon+1
-!          count(1)=iip1
-          count(2)=nbp_lat
-!          count(2)=jjp1
+          start_(1)=1
+          start_(2)=1      
+          count_(1)=nbp_lon+1
+!          count_(1)=iip1
+          count_(2)=nbp_lat
+!          count_(2)=jjp1
 
 ! mise a zero des tableaux 
@@ -106,5 +102,6 @@
 ! Lecture
 ! -----------------------
-          status = nf90_get_var(ncid, varid, tmp_dyn_glo, start, count)
+          rcode = nf90_get_var(ncid, varid, tmp_dyn_glo, start_, count_)
+          if ( rcode /= 0 ) then ; call abort_physic('LMDZ','get'//varname//'  dans read_vent',1) ; endif
 
 !      call dump2d(iip1,jjp1,tmp_dyn,'tmp_dyn   ')
Index: /LMDZ6/trunk/libf/phylmd/Dust/read_vent.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/Dust/read_vent.f90	(revision 5462)
+++ /LMDZ6/trunk/libf/phylmd/Dust/read_vent.f90	(revision 5463)
@@ -23,5 +23,5 @@
   save ncidu1, varidu1, ncidv1, varidv1
 !$OMP THREADPRIVATE(ncidu1, varidu1, ncidv1, varidv1)
-  integer :: start(4),count(4), status
+  integer :: start(4),count_(4)
   integer :: i, j, ig
 
@@ -32,8 +32,12 @@
   if (debutphy) then
   !
-     ncidu1=nf90_open('u10m.nc',nf90_nowrite,rcode)
-     varidu1=nf90_inq_varid(ncidu1,'U10M',rcode)
-     ncidv1=nf90_open('v10m.nc',nf90_nowrite,rcode)
-     varidv1=nf90_inq_varid(ncidv1,'V10M',rcode)
+     rcode=nf90_open('u10m.nc',nf90_nowrite,ncidu1)
+     if ( rcode /= 0 ) then ; call abort_physic('LMDZ','open u10m.nc dans read_vent',1) ; endif
+     rcode=nf90_inq_varid(ncidu1,'U10M',varidu1)
+     if ( rcode /= 0 ) then ; call abort_physic('LMDZ','get id u10m dans read_vent',1) ; endif
+     rcode=nf90_open('v10m.nc',nf90_nowrite,ncidv1)
+     if ( rcode /= 0 ) then ; call abort_physic('LMDZ','open v10m.nc dans read_vent',1) ; endif
+     rcode=nf90_inq_varid(ncidv1,'V10M',varidv1)
+     if ( rcode /= 0 ) then ; call abort_physic('LMDZ','get id v10m dans read_vent',1) ; endif
   !
   endif
@@ -41,20 +45,30 @@
   start(1)=1
   start(2)=1
+  start(3)=step
   start(4)=0
 
-   ! count(1)=iip1
-  count(1)=nbp_lon+1
-   ! count(2)=jjp1
-  count(2)=nbp_lat
-  count(3)=1
-  count(4)=0
+   ! count_(1)=iip1
+  count_(1)=nbp_lon+1
+   ! count_(2)=jjp1
+  count_(2)=nbp_lat
+  count_(3)=1
+  count_(4)=0
   !
-  start(3)=step
   !
-  status = nf90_get_var(ncidu1, varidu1, u10m_nc_glo, start, count)
+  rcode = nf90_get_var(ncidu1, varidu1, u10m_nc_glo, start, count_)
+  if ( rcode /= 0 ) then ; call abort_physic('LMDZ','lecture u10m dans read_vent',1) ; endif
+  rcode = nf90_get_var(ncidv1, varidv1, v10m_nc_glo, start, count_)
+  if ( rcode /= 0 ) then ; call abort_physic('LMDZ','lecture v10m dans read_vent',1) ; endif
 
-    ! print *,status
-  !
-  status = nf90_get_var(ncidv1, varidv1, v10m_nc_glo, start, count)
+
+! ------- Tests 2024/12/31-FH----------------------------------------
+! print*,'nbp_lon,npb_lat ',nbp_lon,nbp_lat
+! print*,'start ',start
+! print*,'count_ ',count_
+! print*,'satus lecture u10m ',rcode
+! call dump2d(nbp_lon+1,nbp_lat,u10m_nc_glo,'U10M global read_vent')
+! call dump2d(nbp_lon+1,nbp_lat,v10m_nc_glo,'V10M global read_vent')
+! stop
+! ------- Tests -----------------------------------------------------
 
   !
@@ -63,5 +77,5 @@
   !  print *,'beforebidcor v10m_nc', v10m_nc(1,jjp1)
 
-  !   print *,status
+  !   print *,rcode
   !  call correctbid(iim,jjp1,u10m_nc)
   !  call correctbid(iim,jjp1,v10m_nc)
