Index: /trunk/LMDZ.MARS/README
===================================================================
--- /trunk/LMDZ.MARS/README	(revision 2310)
+++ /trunk/LMDZ.MARS/README	(revision 2311)
@@ -2997,2 +2997,6 @@
 (NB: this last point also implies a change in concatnc.def, but retrocompatibility
 with old concatnc.def files has been ensured)
+
+== 06/05/2020 == EM
+More code tidying: use getin_p() instead of getin() and use "call abort_physic"
+instead of "stop" or "call abort"
Index: /trunk/LMDZ.MARS/libf/aeronomars/perosat.F
===================================================================
--- /trunk/LMDZ.MARS/libf/aeronomars/perosat.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/aeronomars/perosat.F	(revision 2311)
@@ -5,5 +5,5 @@
       use tracer_mod, only: igcm_h2o2, mmol
       use conc_mod, only: mmean
-      USE comcstfi_h
+      use comcstfi_h, only: g
       IMPLICIT NONE
 
@@ -32,15 +32,15 @@
       integer,intent(in) :: nlayer  ! number of atmospheric layers
       integer,intent(in) :: nq      ! number of tracers
-      INTEGER ig
-      REAL ptimestep                ! pas de temps physique (s)
-      REAL pplev(ngrid,nlayer+1)    ! pression aux inter-couches (Pa)
-      REAL pplay(ngrid,nlayer)      ! pression au milieu des couches (Pa)
-      REAL zt(nlayer)               ! temperature au centre des couches (K)
+      INTEGER,INTENT(IN) :: ig
+      REAL,INTENT(IN) :: ptimestep  ! pas de temps physique (s)
+      REAL,INTENT(IN) :: pplev(ngrid,nlayer+1)! pression aux inter-couches (Pa)
+      REAL,INTENT(IN) :: pplay(ngrid,nlayer)  ! pression au milieu des couches (Pa)
+      REAL,INTENT(IN) :: zt(nlayer) ! temperature au centre des couches (K)
                                     ! deja mise a jour dans calchim
 
 c   Traceurs :
-      real zy(nlayer,nq)        ! traceur (fraction molaire sortie chimie)
-      real pdqcloud(ngrid,nlayer,nq) ! tendance condensation (kg/kg.s-1)
-      real pdqscloud(ngrid,nq)         ! flux en surface (kg.m-2.s-1)
+      real,intent(in) :: zy(nlayer,nq) ! traceur (fraction molaire sortie chimie)
+      real,intent(out) :: pdqcloud(ngrid,nlayer,nq) ! tendance condensation (kg/kg.s-1)
+      real,intent(out) :: pdqscloud(ngrid,nq)       ! flux en surface (kg.m-2.s-1)
       
 c   local:
@@ -67,5 +67,5 @@
          if (igcm_h2o2.eq.0) then
            write(*,*) "perosat: error; no h2o2 tracer !!!!"
-           stop
+           call abort_physic("perosat","missing h2o2 tracer",1)
          endif
          firstcall=.false.
Index: /trunk/LMDZ.MARS/libf/aeronomars/read_phototable.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/aeronomars/read_phototable.F90	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/aeronomars/read_phototable.F90	(revision 2311)
@@ -21,5 +21,5 @@
 !***********************************************************************
 
-      use ioipsl_getincom, only: getin
+      use ioipsl_getin_p_mod, only: getin_p
       use datafile_mod, only: datadir
 
@@ -45,5 +45,5 @@
 ! look for a " phototable= ..." option in def files
 
-      call getin("phototable",phototable)
+      call getin_p("phototable",phototable)
 
       fic = 81
@@ -61,5 +61,5 @@
         write(*,*)'   callphys.def with:'
         write(*,*)'   phototable=filename'
-        stop
+        call abort_physic("read_phototable","missing "//trim(phototable)//"file",1)
       end if
 
Index: /trunk/LMDZ.MARS/libf/phymars/co2cloud.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/co2cloud.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/co2cloud.F	(revision 2311)
@@ -16,5 +16,5 @@
      &                rsedcloud,rhocloud,pzlev,pdqs_sedco2,
      &                pdu,pu,pcondicea)
-      USE ioipsl_getincom, only: getin
+      USE ioipsl_getin_p_mod, ONLY : getin_p
       use dimradmars_mod, only: naerkind
       USE comcstfi_h, only: pi, g, cpp
@@ -201,5 +201,5 @@
            write(*,*) 'stop in co2cloud (nq.gt.nqmx)!'
            write(*,*) 'nq=',nq,' nqmx=',nqmx
-           stop
+           call abort_physic("co2cloud","nq.gt.nqmx",1)
         endif
         write(*,*) "co2cloud.F: rho_ice_co2 = ",rho_ice_co2
@@ -213,5 +213,5 @@
         imicroco2 = 30
 #endif
-        call getin("imicroco2",imicroco2)
+        call getin_p("imicroco2",imicroco2)
         write(*,*)"imicroco2 = ",imicroco2
         
@@ -257,5 +257,6 @@
            write(*,*) 'file optprop_co2ice_1mic.dat should be in '
      &          ,trim(datadir)
-           STOP
+           call abort_physic("co2cloud",
+     &          "missing file optprop_co2ice_1mic.dat",1)
         endif
 !        open(newunit=uQext,file=trim(datadir)//
Index: /trunk/LMDZ.MARS/libf/phymars/convadj.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/convadj.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/convadj.F	(revision 2311)
@@ -8,5 +8,5 @@
       use tracer_mod, only: noms, ! tracer names
      &                      igcm_h2o_vap ! index of water vapor tracer
-      USE comcstfi_h
+      use comcstfi_h, only: g
       implicit none
 
@@ -32,5 +32,5 @@
 !     ------------
 
-#include "callkeys.h"
+      include "callkeys.h"
 
 
@@ -70,16 +70,15 @@
 
 !     Tracers
-      INTEGER iq,ico2
-      save ico2
+      INTEGER iq
+      integer,save :: ico2
       REAL zq(ngrid,nlay,nq), zq2(ngrid,nlay,nq)
       REAL zqm(nq),zqco2m
-      real m_co2, m_noco2, A , B
-      save A, B
+      real m_co2, m_noco2
+      real,save :: A, B
 
       real mtot1, mtot2 , mm1, mm2
-       integer l1ref, l2ref
-      LOGICAL vtest(ngrid),down,firstcall
-      save firstcall
-      data firstcall/.true./
+      integer l1ref, l2ref
+      LOGICAL vtest(ngrid),down
+      logical,save :: firstcall=.true.
 
 !     for conservation test
@@ -376,5 +375,5 @@
             print*,'jadrs=',jadrs
 
-            call abort
+            call abort_physic("convadj","crashed",1)
          endif
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Index: /trunk/LMDZ.MARS/libf/phymars/param_slope.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/param_slope.F90	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/param_slope.F90	(revision 2311)
@@ -89,5 +89,5 @@
   if ((theta_s > 90.) .or. (theta_s < 0.)) then
         print *, 'please set theta_s between 0 and 90', theta_s
-        stop 
+        call abort_physic("param_slopes","invalid theta_s",1) 
   endif
 
Index: /trunk/LMDZ.MARS/libf/phymars/soil_settings.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/soil_settings.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/soil_settings.F	(revision 2311)
@@ -135,5 +135,6 @@
           if (ierr.ne.0) then
             write(*,*) 'soil_settings: failed allocation of oldmlayer!'
-            stop
+            call abort_physic("soil_settings",
+     &           "failed oldmlayer allocation",1)
           endif
         endif
@@ -255,5 +256,6 @@
        if (.not.found) then
          write(*,*) "soil_settings: Failed loading <inertiedat>"
-         call abort
+         call abort_physic("soil_settings",
+     &        "failed loading <inertiedat>",1)
        endif
        
@@ -272,5 +274,6 @@
             write(*,*) 'soil_settings: failed allocation of ',
      &                 'oldinertiedat!'
-            stop
+            call abort_physic("soil_settings",
+     &        "failed allocation of oldinertiedat",1)
            endif
          endif ! of if (.not.allocated(oldinertiedat))
@@ -284,5 +287,6 @@
         if (.not.found) then
           write(*,*) "soil_settings: Failed loading <inertiedat>"
-          call abort
+         call abort_physic("soil_settings",
+     &        "failed loading <inertiedat>",1)
         endif
        else ! put values in therm_i
@@ -295,5 +299,6 @@
          if (.not.found) then
            write(*,*) "soil_settings: Failed loading <inertiedat>"
-           call abort
+           call abort_physic("soil_settings",
+     &        "failed loading <inertiedat>",1)
          endif
 !        endif
@@ -320,5 +325,6 @@
              write(*,*) 'soil_settings: failed allocation of ',
      &                  'oldtsoil!'
-             stop
+             call abort_physic("soil_settings",
+     &        "failed allocation of oldtsoil",1)
            endif
          endif
@@ -332,5 +338,6 @@
          if (.not.found) then
            write(*,*) "soil_settings: Failed loading <tsoil>"
-           call abort
+           call abort_physic("soil_settings",
+     &          "failed loading <tsoil>",1)
          endif
        else ! put values in tsoil
@@ -351,5 +358,6 @@
          if (.not.found) then
            write(*,*) "soil_settings: Failed loading <tsoil>"
-           call abort
+           call abort_physic("soil_settings",
+     &          "failed loading <tsoil>",1)
          endif
        endif ! of if (interpol) 
Index: /trunk/LMDZ.MARS/libf/phymars/suaer.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/suaer.F90	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/suaer.F90	(revision 2311)
@@ -232,5 +232,5 @@
   write(*,*)' change it in file phymars/suaer.F90. Just'
   write(*,*)' modify the variable called file_id.'
-  CALL ABORT 
+  CALL abort_physic("suaer","missing file "//trim(file_id(iaer,idomain)),1)
 ENDIF
 OPEN(UNIT=file_unit,&
@@ -249,5 +249,5 @@
     TRIM(datadir)//&
     '/'//TRIM(file_id(iaer,idomain))
-    call abort
+    call abort_physic("suaer","problem reading "//trim(file_id(iaer,idomain)),1)
   endif
   IF ((scanline(1:1) .ne. '#').and.&
@@ -263,5 +263,6 @@
           TRIM(datadir)//&
           '/'//TRIM(file_id(iaer,idomain))
-          call abort
+          call abort_physic("suaer",&
+               "problem reading "//trim(file_id(iaer,idomain)),1)
         endif
         jfile = jfile+1
@@ -274,5 +275,6 @@
           TRIM(datadir)//&
           '/'//TRIM(file_id(iaer,idomain))
-          call abort
+          call abort_physic("suaer",&
+               "problem reading "//trim(file_id(iaer,idomain)),1)
         endif
         endwhile = .true.
@@ -280,5 +282,6 @@
         WRITE(*,*) 'readoptprop: ',& 
           'Error while loading optical properties.' 
-        CALL ABORT 
+        call abort_physic("suaer",&
+               "problem loading optical properties",1) 
     END SELECT reading1_seq ! ==============================
   ENDIF
@@ -346,5 +349,6 @@
         WRITE(*,*) 'suaer.F90: ',&
           'Error while loading optical properties.'
-        CALL ABORT
+        call abort_physic("suaer",&
+               "problem loading optical properties",1) 
     END SELECT reading2_seq ! ==============================
   ENDIF
@@ -378,5 +382,5 @@
    write(*,*) "       you must increase the value of nsizemax"
    write(*,*) "       in dimradmars_mod !"
-   stop
+   call abort_physic("suaer","nsizemax too small",1)
  endif
 ! ------------------------------------------------
Index: /trunk/LMDZ.MARS/libf/phymars/surfini.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/surfini.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/surfini.F	(revision 2311)
@@ -1,5 +1,5 @@
       SUBROUTINE surfini(ngrid,piceco2,qsurf)
 
-      USE ioipsl_getincom, only: getin
+      USE ioipsl_getin_p_mod, ONLY : getin_p
       use netcdf
       use tracer_mod, only: nqmx, noms
@@ -141,5 +141,5 @@
          write(*,*) "surfini: Ice dryness ?"
          icedryness=1. ! default value
-         call getin("icedryness",icedryness)
+         call getin_p("icedryness",icedryness)
          write(*,*) "surfini: icedryness = ",icedryness
          dryness (:) = icedryness
@@ -187,5 +187,5 @@
        write(*,*)'   can be obtained online on:'
        write(*,*)' http://www.lmd.jussieu.fr/~lmdz/planets/mars/datadir'
-       CALL ABORT
+       call abort_physic("surfini","missing surface.nc file",1)
          ENDIF
       
@@ -196,5 +196,5 @@
           write(*,*) ' in file ',trim(zedatafile),'/surface.nc'
           write(*,*)trim(nf90_strerror(ierr))
-          stop
+          call abort_physic("surfini","missing "//trim(string),1)
          endif
 
@@ -204,5 +204,5 @@
           write(*,*) 'surfini: error failed loading ',trim(string)
           write(*,*)trim(nf90_strerror(ierr))
-          stop
+          call abort_physic("surfini","failed loading "//trim(string),1)
          endif
  
@@ -359,5 +359,6 @@
           print*,'Please change icelocationmode in surfini.F'
           print*,'Or add some new definitions ...'
-          call abort
+          call abort_physic("surfini",
+     &         "no pre-definitions for this resolution",1)
           
          endif
@@ -434,5 +435,5 @@
          print*, 'In surfini.F, icelocationmode is ', icelocationmode
          print*, 'It should be 1, 2 or 3.'
-         call abort 
+         call abort_physic("surfini","wrong icelocationmode",1)
 
         ENDIF ! of if (icelocation)
Index: /trunk/LMDZ.MARS/libf/phymars/swmain_mod.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/swmain_mod.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/swmain_mod.F	(revision 2311)
@@ -160,5 +160,5 @@
           else
             write(*,*) "swmain: invalid swrtype value !!"
-            stop
+            call abort_physic("swmain","invalid swrtype",1)
           endif ! of if (swrtype.eq.2)
         endif ! of if (swrtype.eq.1)
Index: /trunk/LMDZ.MARS/libf/phymars/tabfi.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/tabfi.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/tabfi.F	(revision 2311)
@@ -267,5 +267,6 @@
         write(*,*) "tabfi: Error modifying tab_control should",
      &             " only happen in serial mode (eg: by newstart)"
-        stop
+        call abort_physic(modname,
+     &       "tab_control modification not possible in parallel",1)
       endif
 c-----------------------------------------------------------------------
Index: /trunk/LMDZ.MARS/libf/phymars/vlz_fi.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/vlz_fi.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/vlz_fi.F	(revision 2311)
@@ -168,5 +168,5 @@
 c               wq(ij,l+1)= (MQtot + (-w(ij,l+1)-Mtot)*qm(ij,1))
                 write(*,*) 'a rather weird situation in vlz_fi !'
-                stop
+                call abort_physic("vlz_fi","weird situation",1)
              end if
 
Index: /trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F	(revision 2311)
@@ -13,5 +13,5 @@
      &                nq,tau,tauscaling,rdust,rice,nuice,
      &                rsedcloud,rhocloud,totcloudfrac)
-      USE ioipsl_getincom, ONLY: getin
+      USE ioipsl_getin_p_mod, ONLY : getin_p
       USE updaterad, ONLY: updaterdust, updaterice_micro,
      &                     updaterice_typ
@@ -132,5 +132,5 @@
            write(*,*) 'stop in watercloud (nq.gt.nqmx)!'
            write(*,*) 'nq=',nq,' nqmx=',nqmx
-           stop
+           call abort_physic("watercloud","nq.gt.nqmx",1)
         endif
          
@@ -144,5 +144,5 @@
         imicro = 30
 #endif
-        call getin("imicro",imicro)
+        call getin_p("imicro",imicro)
         write(*,*)"watercloud: imicro = ",imicro
         
Index: /trunk/LMDZ.MARS/libf/phymars/writediagfi.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/writediagfi.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/writediagfi.F	(revision 2311)
@@ -144,5 +144,6 @@
             if (n.ge.n_nom_def_max) then
                write(*,*)"n_nom_def_max too small in writediagfi.F:",n
-               stop
+               call abort_physic("writediagfi",
+     &             "n_nom_def_max too small",1)
             end if 
             n_nom_def=n-1
@@ -177,5 +178,5 @@
            write(*,*) "   firstnom string not long enough!!"
            write(*,*) "   increase its size to at least ",len_trim(nom)
-           stop
+           call abort_physic("writediagfi","firstnom too short",1)
          endif
          
@@ -363,5 +364,6 @@
      &                   trim(nom)
               write(*,*) "it seems it already exists!"
-              stop
+              call abort_physic("writediagfi",
+     &             trim(nom)//" already exists",1)
              endif
            endif 
@@ -398,5 +400,6 @@
               write(*,*) "***** with dx3: ",trim(nom)
               write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr)
-              stop
+              call abort_physic("writediagfi",
+     &             "failed writing "//trim(nom),1)
            endif 
 
@@ -465,5 +468,6 @@
      &                   trim(nom)
               write(*,*) "it seems it already exists!"
-              stop
+              call abort_physic("writediagfi",
+     &             trim(nom)//" already exists",1)
              endif
            endif
@@ -495,5 +499,6 @@
               write(*,*) "***** with dx2: ",trim(nom)
               write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr)
-              stop
+              call abort_physic("writediagfi",
+     &             "failed writing "//trim(nom),1)
            endif 
 
@@ -507,5 +512,6 @@
            write(*,*) "writediagfi error: dim=1 not implemented ",
      &                 "in parallel mode. Problem for ",trim(nom)
-           stop
+              call abort_physic("writediagfi",
+     &             "failed writing "//trim(nom),1)
          endif
 !         Passage variable physique -->  physique dynamique
@@ -533,5 +539,6 @@
      &                   trim(nom)
               write(*,*) "it seems it already exists!"
-              stop
+              call abort_physic("writediagfi",
+     &             trim(nom)//" already exists",1)
              endif
            endif
@@ -552,5 +559,6 @@
               write(*,*) "***** with dx1: ",trim(nom)
               write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr)
-              stop
+              call abort_physic("writediagfi",
+     &             "failed writing "//trim(nom),1)
            endif 
 
@@ -581,5 +589,6 @@
      &                   trim(nom)
               write(*,*) "it seems it already exists!"
-              stop
+              call abort_physic("writediagfi",
+     &             trim(nom)//" already exists",1)
              endif
            endif
@@ -597,5 +606,6 @@
               write(*,*) "***** with dx0: ",trim(nom)
               write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr)
-              stop
+              call abort_physic("writediagfi",
+     &             "failed writing "//trim(nom),1)
            endif 
 
Index: /trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90	(revision 2311)
@@ -84,5 +84,5 @@
     write(*,*) "   firstname string not long enough!!"
     write(*,*) "   increase its size to at least ",len_trim(name)
-    stop
+    call abort_physic("writediagsoil","firstname too short",1)
   endif
   
@@ -96,5 +96,5 @@
    if (ierr.ne.NF_NOERR) then
     write(*,*)'writediagsoil: Error, failed creating file '//trim(filename)
-    stop
+    call abort_physic("writediagsoil","failed creating"//trim(filename),1)
    endif
   endif
@@ -178,5 +178,5 @@
      if (ierr.ne.NF_NOERR) then
       write(*,*)"writediagsoil: Failed writing date to time variable"
-      stop 
+      call abort_physic("writediagsoil","failed writing time",1) 
      endif
     endif ! of if (is_master)
@@ -354,5 +354,5 @@
 #ifdef CPP_PARA
   write(*,*) "writediagsoil: dimps==0 case not implemented in // mode!!"
-  stop
+  call abort_physic("writediagsoil","dimps==0 not implemented",1)
 #endif
   ! A. Copy data value
Index: /trunk/LMDZ.MARS/libf/phymars/wstats.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/wstats.F90	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/wstats.F90	(revision 2311)
@@ -171,5 +171,5 @@
 
    write (*,*) "====================="
-   write (*,*) "STATS: creation de ",nom
+   write (*,*) "STATS: creating ",nom
    namebis=trim(nom)
    call def_var_stats(nid,namebis,titre,unite,nbdim,id,meanid,ierr)
@@ -245,5 +245,5 @@
          write (*,*) "wstats error reading :",trim(nom)
          write (*,*) NF_STRERROR(ierr)
-         stop ""
+         call abort_physic("wstats","Failed reading "//trim(nom),1)
       endif
 
@@ -265,5 +265,5 @@
          write (*,*) "wstats error reading :",trim(nom)
          write (*,*) NF_STRERROR(ierr)
-         stop ""
+         call abort_physic("wstats","Failed reading "//trim(nom),1)
       endif
    endif
@@ -303,5 +303,5 @@
      write (*,*) "wstats error writing :",trim(nom)
      write (*,*) NF_STRERROR(ierr)
-     stop ""
+     call abort_physic("wstats","Failed writing "//trim(nom),1)
   endif
 
@@ -325,5 +325,5 @@
      write(*,*) "sd2d:",sd2d
      write (*,*) NF_STRERROR(ierr)
-     stop ""
+     call abort_physic("wstats","Failed writing "//trim(nom),1)
   endif
 
@@ -399,5 +399,5 @@
      write (*,*) "inivar error writing variable"
      write (*,*) NF_STRERROR(ierr)
-     stop ""
+     call abort_physic("inivar","error writing variable",1)
   endif
 
@@ -445,5 +445,5 @@
      write (*,*) "inivar error writing variable"
      write (*,*) NF_STRERROR(ierr)
-     stop ""
+     call abort_physic("inivar","error writing variable",1)
   endif
 
@@ -491,5 +491,5 @@
    write(*,*) "def_var_stats: Failed defining variable "//trim(name)
    write(*,*) NF_STRERROR(ierr)
-   stop ""
+   call abort_physic("def_var_stats","Failed defining "//trim(name),1)
 endif
 
@@ -500,5 +500,5 @@
    write(*,*) "def_var_stats: Failed writing title attribute for "//trim(name)
    write(*,*) NF_STRERROR(ierr)
-   stop ""
+   call abort_physic("def_var_stats","Failed writing title for "//trim(name),1)
 endif
 
@@ -508,5 +508,5 @@
    write(*,*) "def_var_stats: Failed writing units attribute for "//trim(name)
    write(*,*) NF_STRERROR(ierr)
-   stop ""
+   call abort_physic("def_var_stats","Failed writing units for "//trim(name),1)
 endif
 
Index: /trunk/LMDZ.MARS/libf/phymars/yamada4.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/yamada4.F	(revision 2310)
+++ /trunk/LMDZ.MARS/libf/phymars/yamada4.F	(revision 2311)
@@ -16,5 +16,5 @@
 !.......................................................................
 ! MARS
-#include "callkeys.h"
+      include "callkeys.h"
 !.......................................................................
 !
@@ -171,5 +171,6 @@
       
       if (.not.(iflag_pbl.ge.6.and.iflag_pbl.le.10)) then
-           stop'probleme de coherence dans appel a MY'
+        call abort_physic("yamada4",
+     &       'probleme de coherence dans appel a MY',1)
       endif
 
@@ -608,5 +609,5 @@
 !.......................................................................
 ! MARS
-#include "callkeys.h"
+      include "callkeys.h"
 !.......................................................................
 !
@@ -686,5 +687,5 @@
 !.......................................................................
 ! MARS
-#include "callkeys.h"
+      include "callkeys.h"
 !.......................................................................
 !
