Index: LMDZ6/trunk/libf/phylmd/acama_gwd_rando_m.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/acama_gwd_rando_m.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/acama_gwd_rando_m.F90	(revision 3531)
@@ -1,2 +1,5 @@
+!
+! $Id$
+!
 module ACAMA_GWD_rando_m
 
@@ -120,5 +123,5 @@
   !$OMP THREADPRIVATE(firstcall,gwd_reproductibilite_mpiomp)
 
-    CHARACTER (LEN=20) :: modname='flott_gwd_rando'
+    CHARACTER (LEN=20) :: modname='acama_gwd_rando_m'
     CHARACTER (LEN=80) :: abort_message
 
@@ -208,11 +211,15 @@
 
     IF(DELTAT < DTIME)THEN
-       PRINT *, 'flott_gwd_rando: deltat < dtime!'
-       STOP 1
+!       PRINT *, 'flott_gwd_rando: deltat < dtime!'
+!       STOP 1
+       abort_message=' deltat < dtime! '
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
     IF (KLEV < NW) THEN
-       PRINT *, 'flott_gwd_rando: you will have problem with random numbers'
-       STOP 1
+!       PRINT *, 'flott_gwd_rando: you will have problem with random numbers'
+!       STOP 1
+       abort_message=' you will have problem with random numbers'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
Index: LMDZ6/trunk/libf/phylmd/alpale_th.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/alpale_th.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/alpale_th.F90	(revision 3531)
@@ -1,2 +1,5 @@
+!
+! $Id$
+!
 SUBROUTINE alpale_th ( dtime, lmax_th, t_seri, cell_area,  &
                        cin, s2, n2,  &
@@ -62,4 +65,7 @@
  REAL umexp  ! expression of (1.-exp(-x))/x valid for all x, especially when x->0
  REAL x
+     CHARACTER (LEN=20) :: modname='alpale_th'
+     CHARACTER (LEN=80) :: abort_message
+     
  umexp(x) = max(sign(1.,x-1.e-3),0.)*(1.-exp(-x))/max(x,1.e-3) + &
             (1.-max(sign(1.,x-1.e-3),0.))*(1.-0.5*x*(1.-x/3.*(1.-0.25*x)))  !!! correct formula            (jyg)
@@ -104,5 +110,5 @@
              !
              IF (prt_level .GE. 10) THEN
-                print *,'cin, ale_bl_stat, alp_bl, alp_bl_stat ', &
+                WRITE(lunout,*)'cin, ale_bl_stat, alp_bl, alp_bl_stat ', &
                      cin, ale_bl_stat, alp_bl, alp_bl_stat
              ENDIF
@@ -122,7 +128,7 @@
              !
              IF (prt_level .GE. 10) THEN
-                print *,'random_notrig, tau_trig ', &
+                WRITE(lunout,*)'random_notrig, tau_trig ', &
                      random_notrig, tau_trig
-                print *,'s_trig,s2,n2 ', &
+                WRITE(lunout,*)'s_trig,s2,n2 ', &
                      s_trig,s2,n2
              ENDIF
@@ -178,5 +184,5 @@
              !
              IF (prt_level .GE. 10) THEN
-                print *,'proba_notrig, ale_bl_trig ', &
+                WRITE(lunout,*)'proba_notrig, ale_bl_trig ', &
                      proba_notrig, ale_bl_trig
              ENDIF
@@ -224,5 +230,5 @@
         !
         IF (prt_level .GE. 10) THEN
-           print *,'cin, ale_bl_stat, alp_bl_stat ', &
+           WRITE(lunout,*)'cin, ale_bl_stat, alp_bl_stat ', &
                 cin, ale_bl_stat, alp_bl_stat
         ENDIF
@@ -253,7 +259,7 @@
         !
         IF (prt_level .GE. 10) THEN
-           print *,'random_notrig, tau_trig ', &
+           WRITE(lunout,*)'random_notrig, tau_trig ', &
                 random_notrig, tau_trig
-           print *,'s_trig,s2,n2 ', &
+           WRITE(lunout,*)'s_trig,s2,n2 ', &
                 s_trig,s2,n2
         ENDIF
@@ -289,5 +295,5 @@
         !
         IF (prt_level .GE. 10) THEN
-           print *,'proba_notrig, ale_bl_trig ', &
+           WRITE(lunout,*)'proba_notrig, ale_bl_trig ', &
                 proba_notrig, ale_bl_trig
         ENDIF
@@ -300,5 +306,5 @@
 
           IF (prt_level .GE. 10) THEN
-             print *,'alpale_th: ale_bl_trig, alp_bl_stat, birth_rate ', &
+             WRITE(lunout,*)'alpale_th: ale_bl_trig, alp_bl_stat, birth_rate ', &
                       ale_bl_trig(1), alp_bl_stat(1), birth_rate(1)
           ENDIF
@@ -310,5 +316,5 @@
           if (iflag_coupl==2) then
              IF (prt_level .GE. 10) THEN
-                print*,'Couplage Thermiques/Emanuel seulement si T<0'
+                WRITE(lunout,*)'Couplage Thermiques/Emanuel seulement si T<0'
              ENDIF
              do i=1,klon
@@ -317,6 +323,8 @@
                 endif
              enddo
-    print *,'In order to run with iflag_coupl=2, you have to comment out the following stop'
-             STOP
+!    print *,'In order to run with iflag_coupl=2, you have to comment out the following stop'
+!             STOP
+             abort_message='In order to run with iflag_coupl=2, you have to comment out the following abort'
+             CALL abort_physic(modname,abort_message,1)
           endif
    RETURN
Index: LMDZ6/trunk/libf/phylmd/create_etat0_limit_unstruct.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/create_etat0_limit_unstruct.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/create_etat0_limit_unstruct.F90	(revision 3531)
@@ -65,5 +65,8 @@
   IMPLICIT NONE
       INTEGER :: iflag_phys
-      INTEGER :: ierr 
+      INTEGER :: ierr
+      CHARACTER (LEN=20) :: modname='create_etat0_limit_unstruct'
+      CHARACTER (LEN=80) :: abort_message
+     
       IF (grid_type==unstructured) THEN
   
@@ -83,9 +86,9 @@
                 CALL MPI_Finalize(ierr)
 #endif
-                WRITE(lunout,*)   'create_etat0_limit_unstruct, Initial state file are created, all is fine' 
-                STOP 0
+                abort_message='create_etat0_limit_unstruct, Initial state file are created, all is fine' 
+                CALL abort_physic(modname,abort_message,0)
               ENDIF
 !$OMP BARRIER
-              STOP 'create_etat0_limit_unstruct, Initial state file are created, all is fine' 
+              abort_message='create_etat0_limit_unstruct, Initial state file are created, all is fine'              CALL abort_physic(modname,abort_message,0)
           ENDIF 
         ELSE
@@ -102,6 +105,6 @@
               ENDIF
 !$OMP BARRIER
-              WRITE(lunout,*)   'create_etat0_limit_unstruct, Initial state file are created, all is fine' 
-              STOP 0
+              abort_message='create_etat0_limit_unstruct, Initial state file are created, all is fine' 
+              CALL abort_physic(modname,abort_message,0)
           ENDIF
         ENDIF
Index: LMDZ6/trunk/libf/phylmd/create_limit_unstruct.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/create_limit_unstruct.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/create_limit_unstruct.F90	(revision 3531)
@@ -200,5 +200,8 @@
    INTEGER :: ij,ierr, n_extrap
    LOGICAL :: skip
-   
+
+   CHARACTER (len = 50)         :: modname = 'create_limit_unstruct.time_interpolation'
+   CHARACTER (len = 80)         :: abort_message
+
   
    IF (is_omp_master) ndays_in=year_len(annee_ref, calendar)
@@ -212,5 +215,8 @@
      yder = pchsp_95(timeyear, field_in(ij, :), ibeg=2, iend=2, vc_beg=0., vc_end=0.)
      CALL pchfe_95(timeyear, field_in(ij, :), yder, skip, arth(0., real(ndays_in) / ndays, ndays), field_out(ij, :), ierr)
-     if (ierr < 0) stop 1
+     if (ierr < 0) then
+        abort_message='error in pchfe_95'
+        CALL abort_physic(modname,abort_message,1)
+     endif
      n_extrap = n_extrap + ierr
    END DO
Index: LMDZ6/trunk/libf/phylmd/cv30_routines.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/cv30_routines.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/cv30_routines.F90	(revision 3531)
@@ -3298,4 +3298,6 @@
       integer i,k    
       real hp_bak(nloc,nd)
+      CHARACTER (LEN=20) :: modname='cv30_epmax_fn_cape'
+      CHARACTER (LEN=80) :: abort_message
 
         ! on recalcule ep et hp
@@ -3346,5 +3348,5 @@
            write(*,*) 'clw(i,k)=',clw(i,k)
            write(*,*) 'cpd,cpv=',cpd,cpv
-           stop
+           CALL abort_physic(modname,abort_message,0)
         endif
        enddo !do k=1,nl
Index: LMDZ6/trunk/libf/phylmd/flott_gwd_rando_m.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/flott_gwd_rando_m.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/flott_gwd_rando_m.F90	(revision 3531)
@@ -1,2 +1,5 @@
+!
+! $Id$
+!
 module FLOTT_GWD_rando_m
 
@@ -20,4 +23,6 @@
       USE ioipsl_getin_p_mod, ONLY : getin_p
       USE vertical_layers_mod, ONLY : presnivs
+      CHARACTER (LEN=20) :: modname='flott_gwd_rando'
+      CHARACTER (LEN=80) :: abort_message
 
       include "YOMCST.h"
@@ -115,8 +120,4 @@
     LOGICAL, SAVE :: firstcall = .TRUE.
   !$OMP THREADPRIVATE(firstcall,gwd_reproductibilite_mpiomp)
-
-    CHARACTER (LEN=20) :: modname='flott_gwd_rando'
-    CHARACTER (LEN=80) :: abort_message
-
 
 
@@ -198,11 +199,11 @@
 
     IF(DELTAT < DTIME)THEN
-       PRINT *, 'flott_gwd_rando: deltat < dtime!'
-       STOP 1
+       abort_message='flott_gwd_rando: deltat < dtime!'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
     IF (KLEV < NW) THEN
-       PRINT *, 'flott_gwd_rando: you will have problem with random numbers'
-       STOP 1
+       abort_message='flott_gwd_rando: you will have problem with random numbers'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
Index: LMDZ6/trunk/libf/phylmd/mo_simple_plumes.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/mo_simple_plumes.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/mo_simple_plumes.F90	(revision 3531)
@@ -78,4 +78,7 @@
     !
     INTEGER :: iret, ncid, DimID, VarID, xdmy
+    CHARACTER (len = 50)     :: modname = 'mo_simple_plumes.sp_setup'
+    CHARACTER (len = 80)     :: abort_message
+
     !
     ! ---------- 
@@ -84,5 +87,8 @@
        !    
        iret = nf90_open("MACv2.0-SP_v1.nc", NF90_NOWRITE, ncid)
-       IF (iret /= NF90_NOERR) STOP 'NetCDF File not opened'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF File not opened'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        !
        ! read dimensions and make sure file conforms to expected size
@@ -90,17 +96,29 @@
        iret = nf90_inq_dimid(ncid, "plume_number"  , DimId)
        iret = nf90_inquire_dimension(ncid, DimId, len = xdmy)
-       IF (xdmy /= nplumes) STOP 'NetCDF improperly dimensioned -- plume_number'
+       IF (xdmy /= nplumes) THEN
+          abort_message='NetCDF improperly dimensioned -- plume_number'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        !
        iret = nf90_inq_dimid(ncid, "plume_feature", DimId)
        iret = nf90_inquire_dimension(ncid, DimId, len = xdmy)
-       IF (xdmy /= nfeatures) STOP 'NetCDF improperly dimensioned -- plume_feature'
+       IF (xdmy /= nfeatures) THEN
+          abort_message='NetCDF improperly dimensioned -- plume_feature'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        !
        iret = nf90_inq_dimid(ncid, "year_fr"   , DimId)
        iret = nf90_inquire_dimension(ncid, DimID, len = xdmy)
-       IF (xdmy /= ntimes) STOP 'NetCDF improperly dimensioned -- year_fr'
+       IF (xdmy /= ntimes) THEN
+          abort_message='NetCDF improperly dimensioned -- year_fr'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        !
        iret = nf90_inq_dimid(ncid, "years"   , DimId)
        iret = nf90_inquire_dimension(ncid, DimID, len = xdmy)
-       IF (xdmy /= nyears) STOP 'NetCDF improperly dimensioned -- years'
+       IF (xdmy /= nyears) THEN
+          abort_message='NetCDF improperly dimensioned -- years'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        !
        ! read variables that define the simple plume climatology
@@ -108,54 +126,105 @@
        iret = nf90_inq_varid(ncid, "plume_lat", VarId)
        iret = nf90_get_var(ncid, VarID, plume_lat(:), start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lat'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading plume_lat'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "plume_lon", VarId)
        iret = nf90_get_var(ncid, VarID, plume_lon(:), start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lon'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading plume_lon'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "beta_a"   , VarId)
        iret = nf90_get_var(ncid, VarID, beta_a(:)   , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading beta_a'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading beta_a'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "beta_b"   , VarId)
        iret = nf90_get_var(ncid, VarID, beta_b(:)   , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading beta_b'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading beta_b'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "aod_spmx" , VarId)
        iret = nf90_get_var(ncid, VarID, aod_spmx(:)  , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading aod_spmx'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading aod_spmx'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "aod_fmbg" , VarId)
        iret = nf90_get_var(ncid, VarID, aod_fmbg(:)  , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading aod_fmbg'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading aod_fmbg'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "ssa550"   , VarId)
        iret = nf90_get_var(ncid, VarID, ssa550(:)  , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading ssa550'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading ssa550'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "asy550"   , VarId)
        iret = nf90_get_var(ncid, VarID, asy550(:)  , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading asy550'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading asy550'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "angstrom" , VarId)
        iret = nf90_get_var(ncid, VarID, angstrom(:), start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading angstrom'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading angstrom'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        !
        iret = nf90_inq_varid(ncid, "sig_lat_W"     , VarId)
        iret = nf90_get_var(ncid, VarID, sig_lat_W(:,:)    , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lat_W'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading sig_lat_W'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "sig_lat_E"     , VarId)
        iret = nf90_get_var(ncid, VarID, sig_lat_E(:,:)    , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lat_E'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading sig_lat_E'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "sig_lon_E"     , VarId)
        iret = nf90_get_var(ncid, VarID, sig_lon_E(:,:)    , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lon_E'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading sig_lon_E'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "sig_lon_W"     , VarId)
        iret = nf90_get_var(ncid, VarID, sig_lon_W(:,:)    , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading sig_lon_W'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading sig_lon_W'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "theta"         , VarId)
        iret = nf90_get_var(ncid, VarID, theta(:,:)        , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading theta'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading theta'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "ftr_weight"    , VarId)
        iret = nf90_get_var(ncid, VarID, ftr_weight(:,:)   , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading plume_lat'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading plume_lat'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "year_weight"   , VarId)
        iret = nf90_get_var(ncid, VarID, year_weight(:,:)  , start=(/1,1/),count=(/nyears,nplumes   /))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading year_weight'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading year_weight'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        iret = nf90_inq_varid(ncid, "ann_cycle"     , VarId)
        iret = nf90_get_var(ncid, VarID, ann_cycle(:,:,:)  , start=(/1,1,1/),count=(/nfeatures,ntimes,nplumes/))
-       IF (iret /= NF90_NOERR) STOP 'NetCDF Error reading ann_cycle'
+       IF (iret /= NF90_NOERR) THEN
+          abort_message='NetCDF Error reading ann_cycle'
+          CALL abort_physic(modname,abort_message,1)
+       ENDIF
        !
        iret = nf90_close(ncid)
Index: LMDZ6/trunk/libf/phylmd/mod_synchro_omp.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/mod_synchro_omp.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/mod_synchro_omp.F90	(revision 3531)
@@ -1,2 +1,5 @@
+!
+! $Id$
+!
 MODULE mod_synchro_omp
 
@@ -21,4 +24,6 @@
   IMPLICIT NONE
   LOGICAL :: out
+  CHARACTER (LEN=20) :: modname='synchro_omp'
+  CHARACTER (LEN=80) :: abort_message
   
     out=.FALSE.
@@ -46,5 +51,6 @@
 
     IF (exit_omp/=0) THEN
-      STOP 'synchro_omp'
+       abort_message='synchro_omp'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
Index: LMDZ6/trunk/libf/phylmd/phyaqua_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/phyaqua_mod.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/phyaqua_mod.F90	(revision 3531)
@@ -112,4 +112,8 @@
     REAL paire
 
+    ! Local
+    CHARACTER (LEN=20) :: modname='phyaqua'
+    CHARACTER (LEN=80) :: abort_message
+
 
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -128,5 +132,6 @@
     IF (klon/=nlon) THEN
       WRITE (*, *) 'iniaqua: klon=', klon, ' nlon=', nlon
-      STOP 'probleme de dimensions dans iniaqua'
+      abort_message= 'probleme de dimensions dans iniaqua'
+      CALL abort_physic(modname,abort_message,1)
     END IF
     CALL phys_state_var_init(read_climoz)
@@ -812,6 +817,11 @@
     PARAMETER (nlat_max=72)
     REAL x_anom_sst(nlat_max)
-
-    IF (klon/=nlon) STOP 'probleme de dimensions dans iniaqua'
+    CHARACTER (LEN=20) :: modname='profil_sst'
+    CHARACTER (LEN=80) :: abort_message
+
+    IF (klon/=nlon) THEN
+       abort_message='probleme de dimensions dans profil_sst'
+       CALL abort_physic(modname,abort_message,1)
+    ENDIF
     WRITE (*, *) ' profil_sst: type_profil=', type_profil
     DO i = 1, 360
Index: LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3531)
@@ -1270,5 +1270,6 @@
           WRITE (lunout, *) ' iflag_ice_thermo==1 requires 3 H2O tracers ', &
                '(H2Ov, H2Ol, H2Oi) but nqo=', nqo, '. Might as well stop here.'
-          STOP
+          abort_message='see above'
+          CALL abort_physic(modname,abort_message,1)
        ENDIF
 
Index: LMDZ6/trunk/libf/phylmd/phytrac_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/phytrac_mod.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/phytrac_mod.F90	(revision 3531)
@@ -602,5 +602,5 @@
        IF (lessivage .AND. type_trac .EQ. 'inca') THEN
           CALL abort_physic('phytrac', 'lessivage=T config_inca=inca impossible',1)
-          STOP
+!          STOP
        ENDIF
        !
Index: LMDZ6/trunk/libf/phylmd/readaerosolstrato.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/readaerosolstrato.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/readaerosolstrato.F90	(revision 3531)
@@ -15,4 +15,5 @@
     USE aero_mod
     USE dimphy
+    USE print_control_mod, ONLY: prt_level,lunout
 #ifdef CPP_XIOS
     USE xios
@@ -61,4 +62,7 @@
     data alpha_strat_wave/3.36780953,3.34667683,3.20444202,3.0293026,2.82108808/
 
+    CHARACTER (len = 20)                      :: modname = 'readaerosolstrato'
+    CHARACTER (len = 80)                      :: abort_message
+
 !--------------------------------------------------------
 
@@ -72,6 +76,6 @@
 
     IF (nbands.NE.2) THEN 
-        print *,'nbands doit etre egal a 2 dans readaerosolstrat'
-        STOP
+        abort_message='nbands doit etre egal a 2 dans readaerosolstrat'
+        CALL abort_physic(modname,abort_message,1)
     ENDIF
 
@@ -82,6 +86,6 @@
     n_lev = size(lev)
     IF (n_lev.NE.klev) THEN 
-       print *,'Le nombre de niveaux n est pas egal a klev'
-       STOP
+       abort_message='Le nombre de niveaux n est pas egal a klev'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
@@ -89,9 +93,9 @@
     CALL nf95_gw_var(ncid_in, varid, latitude)
     n_lat = size(latitude)
-    print *, 'LAT aerosol strato=', n_lat, latitude
+    WRITE(lunout,*) 'LAT aerosol strato=', n_lat, latitude
     IF (grid_type/=unstructured) THEN
       IF (n_lat.NE.nbp_lat) THEN 
-         print *,'Le nombre de lat n est pas egal a nbp_lat'
-         STOP
+         abort_message='Le nombre de lat n est pas egal a nbp_lat'
+         CALL abort_physic(modname,abort_message,1)
       ENDIF
     ENDIF
@@ -101,8 +105,8 @@
     n_lon = size(longitude)
     IF (grid_type/=unstructured) THEN
-      print *, 'LON aerosol strato=', n_lon, longitude
+      WRITE(lunout,*) 'LON aerosol strato=', n_lon, longitude
       IF (n_lon.NE.nbp_lon) THEN 
-         print *,'Le nombre de lon n est pas egal a nbp_lon'
-         STOP
+         abort_message='Le nombre de lon n est pas egal a nbp_lon'
+         CALL abort_physic(modname,abort_message,1)
       ENDIF
     ENDIF
@@ -111,8 +115,8 @@
     CALL nf95_gw_var(ncid_in, varid, time)
     n_month = size(time)
-    print *, 'TIME aerosol strato=', n_month, time
+    WRITE(lunout,*) 'TIME aerosol strato=', n_month, time
     IF (n_month.NE.12) THEN 
-       print *,'Le nombre de month n est pas egal a 12'
-       STOP
+       abort_message='Le nombre de month n est pas egal a 12'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
@@ -124,5 +128,5 @@
     CALL nf95_inq_varid(ncid_in, "TAUSTRAT", varid)
     ncerr = nf90_get_var(ncid_in, varid, tauaerstrat)
-    print *,'code erreur readaerosolstrato=', ncerr, varid
+    WRITE(lunout,*) 'code erreur readaerosolstrato=', ncerr, varid
 
     CALL nf95_close(ncid_in)
@@ -130,5 +134,5 @@
 !---select the correct month
     IF (mth_cur.LT.1.OR.mth_cur.GT.12) THEN
-      print *,'probleme avec le mois dans readaerosolstrat =', mth_cur
+     WRITE(lunout,*) 'probleme avec le mois dans readaerosolstrat =', mth_cur
     ENDIF
     tauaerstrat_mois(:,:,:) = tauaerstrat(:,:,:,mth_cur)
Index: LMDZ6/trunk/libf/phylmd/readchlorophyll.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/readchlorophyll.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/readchlorophyll.F90	(revision 3531)
@@ -15,4 +15,5 @@
     USE mod_phys_lmdz_para, ONLY: scatter 
     USE phys_state_var_mod, ONLY: chl_con
+    USE print_control_mod, ONLY: prt_level,lunout
 
     IMPLICIT NONE
@@ -45,4 +46,6 @@
 
 !--------------------------------------------------------
+    CHARACTER (len = 20)  :: modname = 'readchlorophyll'
+    CHARACTER (len = 80)  :: abort_message
 
 !--only read file if beginning of run or start of new month
@@ -56,8 +59,7 @@
     CALL nf95_gw_var(ncid_in, varid, longitude)
     n_lon = size(longitude)
-!    print *, 'LON chlorophyll=', n_lon, longitude
     IF (n_lon.NE.nbp_lon) THEN
-       print *,'Le nombre de lon n est pas egal a nbp_lon'
-       STOP
+       abort_message='Le nombre de lon n est pas egal a nbp_lon'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
@@ -65,8 +67,7 @@
     CALL nf95_gw_var(ncid_in, varid, latitude)
     n_lat = size(latitude)
-!    print *, 'LAT chlorophyll=', n_lat, latitude
     IF (n_lat.NE.nbp_lat) THEN 
-       print *,'Le nombre de lat n est pas egal a jnbp_lat'
-       STOP
+       abort_message='Le nombre de lat n est pas egal a jnbp_lat'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
@@ -74,8 +75,7 @@
     CALL nf95_gw_var(ncid_in, varid, time)
     n_month = size(time)
-!    print *, 'TIME aerosol strato=', n_month, time
     IF (n_month.NE.12) THEN 
-       print *,'Le nombre de month n est pas egal a 12'
-       STOP
+       abort_message='Le nombre de month n est pas egal a 12'
+       CALL abort_physic(modname,abort_message,1)
     ENDIF
 
@@ -87,5 +87,5 @@
     CALL nf95_inq_varid(ncid_in, "CHL", varid)
     ncerr = nf90_get_var(ncid_in, varid, chlorocon)
-    print *,'code erreur readchlorophyll=', ncerr, varid
+    WRITE(lunout,*)'code erreur readchlorophyll=', ncerr, varid
 
     CALL nf95_close(ncid_in)
@@ -93,5 +93,5 @@
 !---select the correct month
     IF (mth_cur.LT.1.OR.mth_cur.GT.12) THEN
-      print *,'probleme avec le mois dans readchlorophyll =', mth_cur
+      WRITE(lunout,*)'probleme avec le mois dans readchlorophyll =', mth_cur
     ENDIF
     chlorocon_mois(:,:) = chlorocon(:,:,mth_cur)
@@ -100,5 +100,5 @@
     CALL grid2dTo1d_glo(chlorocon_mois,chlorocon_mois_glo)
 
-    print *,"chrolophyll current month",mth_cur
+    WRITE(lunout,*)"chrolophyll current month",mth_cur
     DO i=1,klon_glo
 !      if(isnan(chlorocon_mois_glo(i)))then ! isnan() is not in the Fortran standard...
Index: LMDZ6/trunk/libf/phylmd/simu_airs.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/simu_airs.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/simu_airs.F90	(revision 3531)
@@ -2,15 +2,17 @@
         module m_simu_airs
 
+        USE print_control_mod, ONLY: prt_level,lunout
+          
         implicit none
 
-        real, parameter :: tau_thresh = 0.05 ! seuil nuages detectables
-        real, parameter :: p_thresh = 445.   ! seuil nuages hauts
-        real, parameter :: em_min = 0.2      ! seuils nuages semi-transp
-        real, parameter :: em_max = 0.85
-        real, parameter :: undef = 999.
+        REAL, PARAMETER :: tau_thresh = 0.05 ! seuil nuages detectables
+        REAL, PARAMETER :: p_thresh = 445.   ! seuil nuages hauts
+        REAL, PARAMETER :: em_min = 0.2      ! seuils nuages semi-transp
+        REAL, PARAMETER :: em_max = 0.85
+        REAL, PARAMETER :: undef = 999.
 
         contains
 
-        real function search_tropopause(P,T,alt,N) result(P_tropo)
+        REAL function search_tropopause(P,T,alt,N) result(P_tropo)
 ! this function searches for the tropopause pressure in [hPa].
 ! The search is based on ideology described in
@@ -18,11 +20,11 @@
 ! GRL, 30(20) 2042, doi:10.1029/2003GL018240, 2003
 
-        integer N,i,i_lev,first_point,exit_flag,i_dir
-        real P(N),T(N),alt(N),slope(N)
-        real P_min, P_max, slope_limit,slope_2km, &
+        INTEGER N,i,i_lev,first_point,exit_flag,i_dir
+        REAL P(N),T(N),alt(N),slope(N)
+        REAL P_min, P_max, slope_limit,slope_2km, &
      & delta_alt_limit,tmp,delta_alt
-        parameter(P_min=75.0, P_max=470.0)   ! hPa
-        parameter(slope_limit=0.002)         ! 2 K/km converted to K/m
-        parameter(delta_alt_limit=2000.0)    ! 2000 meters
+        PARAMETER(P_min=75.0, P_max=470.0)   ! hPa
+        PARAMETER(slope_limit=0.002)         ! 2 K/km converted to K/m
+        PARAMETER(delta_alt_limit=2000.0)    ! 2000 meters
 
         do i=1,N-1
@@ -93,12 +95,12 @@
 
      
-        integer :: i, n, nss
-
-        integer, intent(in) :: len_cs
-        real, dimension(:), intent(in) :: rneb_cs, temp_cs
-        real, dimension(:), intent(in) :: emis_cs, iwco_cs, rad_cs
-        real, dimension(:), intent(in) :: pres_cs, dz_cs, rhodz_cs
-
-        real, intent(out) :: cc_tot_cs, cc_hc_cs, cc_hist_cs, &
+        INTEGER :: i, n, nss
+
+        INTEGER, intent(in) :: len_cs
+        REAL, DIMENSION(:), intent(in) :: rneb_cs, temp_cs
+        REAL, DIMENSION(:), intent(in) :: emis_cs, iwco_cs, rad_cs
+        REAL, DIMENSION(:), intent(in) :: pres_cs, dz_cs, rhodz_cs
+
+        REAL, intent(out) :: cc_tot_cs, cc_hc_cs, cc_hist_cs, &
      & cc_Cb_cs, cc_ThCi_cs, cc_Anv_cs, &
      & pcld_hc_cs, tcld_hc_cs, em_hc_cs, iwp_hc_cs, &
@@ -109,15 +111,18 @@
      & deltaz_hc_cs, deltaz_hist_cs, rad_hist_cs
 
-        real, dimension(len_cs) :: rneb_ord
-        real :: rneb_min
-
-        real, dimension(:), allocatable :: s, s_hc, s_hist, rneb_max
-        real, dimension(:), allocatable :: sCb, sThCi, sAnv
-        real, dimension(:), allocatable :: iwp_ss, pcld_ss, tcld_ss,&
+        REAL, DIMENSION(len_cs) :: rneb_ord
+        REAL :: rneb_min
+
+        REAL, DIMENSION(:), allocatable :: s, s_hc, s_hist, rneb_max
+        REAL, DIMENSION(:), allocatable :: sCb, sThCi, sAnv
+        REAL, DIMENSION(:), allocatable :: iwp_ss, pcld_ss, tcld_ss,&
      & emis_ss
-        real, dimension(:), allocatable :: deltaz_ss, rad_ss
-
-
-        write(*,*) 'dans cloud_structure'
+        REAL, DIMENSION(:), allocatable :: deltaz_ss, rad_ss
+
+        CHARACTER (len = 50)      :: modname = 'simu_airs.cloud_structure'
+        CHARACTER (len = 160)     :: abort_message
+        
+
+        write(lunout,*) 'dans cloud_structure'
 
         call ordonne(len_cs, rneb_cs, rneb_ord)
@@ -300,13 +305,11 @@
         if (cc_tot_cs .gt. maxval(rneb_cs) .and. &
      & abs(cc_tot_cs-maxval(rneb_cs)) .gt. 1.e-4 )  then
-        write(*,*) 'cc_tot_cs > max rneb_cs'
-        write(*,*) cc_tot_cs, maxval(rneb_cs)
-        STOP
+          WRITE(abort_message,*) 'cc_tot_cs > max rneb_cs', cc_tot_cs, maxval(rneb_cs)
+          CALL abort_physic(modname,abort_message,1)
         endif
 
         if (iwp_hc_cs .lt. 0.) then
-        write(*,*) 'cloud_structure:'
-        write(*,*) 'iwp_hc_cs < 0'
-        STOP
+          abort_message= 'cloud_structure: iwp_hc_cs < 0'
+          CALL abort_physic(modname,abort_message,1)
         endif
  
@@ -316,6 +319,6 @@
         subroutine normal_undef(num, den)
 
-        real, intent(in) :: den
-        real, intent(inout) :: num
+        REAL, intent(in) :: den
+        REAL, intent(inout) :: num
 
         if (den .ne. 0) then
@@ -330,7 +333,7 @@
         subroutine normal2_undef(res,num,den)
 
-        real, intent(in) :: den
-        real, intent(in) :: num
-        real, intent(out) :: res
+        REAL, intent(in) :: den
+        REAL, intent(in) :: num
+        REAL, intent(out) :: res
 
         if (den .ne. 0.) then
@@ -350,18 +353,21 @@
      & emis, pcld, tcld, iwp, deltaz, rad)
 
-        integer, intent(in) :: len_cs
-        real, dimension(len_cs), intent(in) :: rneb_cs, temp_cs
-        real, dimension(len_cs), intent(in) :: emis_cs, iwco_cs, &
+        INTEGER, intent(in) :: len_cs
+        REAL, DIMENSION(len_cs), intent(in) :: rneb_cs, temp_cs
+        REAL, DIMENSION(len_cs), intent(in) :: emis_cs, iwco_cs, &
      & rneb_ord
-        real, dimension(len_cs), intent(in) :: pres_cs, dz_cs, rad_cs
-        real, dimension(len_cs), intent(in) :: rhodz_cs
-        real, dimension(len_cs) :: tau_cs, w
-        real, intent(in) :: rnebmax
-        real, intent(inout) :: stot, shc, shist
-        real, intent(inout) :: sCb, sThCi, sAnv
-        real, intent(out) :: emis, pcld, tcld, iwp, deltaz, rad
-
-        integer :: i, ideb, ibeg, iend, nuage, visible
-        real :: som, som_tau, som_iwc, som_dz, som_rad, tau
+        REAL, DIMENSION(len_cs), intent(in) :: pres_cs, dz_cs, rad_cs
+        REAL, DIMENSION(len_cs), intent(in) :: rhodz_cs
+        REAL, DIMENSION(len_cs) :: tau_cs, w
+        REAL, intent(in) :: rnebmax
+        REAL, intent(inout) :: stot, shc, shist
+        REAL, intent(inout) :: sCb, sThCi, sAnv
+        REAL, intent(out) :: emis, pcld, tcld, iwp, deltaz, rad
+
+        INTEGER :: i, ideb, ibeg, iend, nuage, visible
+        REAL :: som, som_tau, som_iwc, som_dz, som_rad, tau
+
+        CHARACTER (len = 50)      :: modname = 'simu_airs.sous_section'
+        CHARACTER (len = 160)     :: abort_message
 
 
@@ -491,16 +497,16 @@
 
         if (iwp .lt. 0.) then
-        write(*,*) 'ideb iwp =', ideb, iwp
-        STOP
+          WRITE(abort_message,*) 'ideb iwp =', ideb, iwp
+          CALL abort_physic(modname,abort_message,1)
         endif
 
         if (deltaz .lt. 0.) then
-        write(*,*) 'ideb deltaz =', ideb, deltaz
-        STOP
+          WRITE(abort_message,*)'ideb deltaz =', ideb, deltaz
+          CALL abort_physic(modname,abort_message,1)
         endif
 
         if (emis .lt. 0.048 .and. emis .ne. 0.) then
-        write(*,*) 'ideb emis =', ideb, emis
-        STOP
+          WRITE(abort_message,*) 'ideb emis =', ideb, emis
+          CALL abort_physic(modname,abort_message,1)
         endif
 
@@ -511,11 +517,11 @@
      & visible, w)
 
-        integer, intent(in) :: ibeg, iend
-        real, intent(in) :: som_tau
-
-        integer, intent(inout) :: visible
-        real, dimension(:), intent(inout) :: w
-
-        integer :: i
+        INTEGER, intent(in) :: ibeg, iend
+        REAL, intent(in) :: som_tau
+
+        INTEGER, intent(inout) :: visible
+        REAL, DIMENSION(:), intent(inout) :: w
+
+        INTEGER :: i
 
 
@@ -553,12 +559,15 @@
      & som_tau, som_iwc, som_dz, som_rad)
 
-        integer, intent(in) :: ibeg, iend
-        real, dimension(:), intent(in) :: tau_cs, iwco_cs, temp_cs
-        real, dimension(:), intent(in) :: pres_cs, dz_cs, rad_cs
-        real, dimension(:), intent(in) :: rhodz_cs
-        real, intent(out) :: som_tau, som_iwc, som_dz, som_rad
-        real , intent(out) :: pcld, tcld
-
-        integer :: i, ibase, imid
+        INTEGER, intent(in) :: ibeg, iend
+        REAL, DIMENSION(:), intent(in) :: tau_cs, iwco_cs, temp_cs
+        REAL, DIMENSION(:), intent(in) :: pres_cs, dz_cs, rad_cs
+        REAL, DIMENSION(:), intent(in) :: rhodz_cs
+        REAL, intent(out) :: som_tau, som_iwc, som_dz, som_rad
+        REAL , intent(out) :: pcld, tcld
+
+        INTEGER :: i, ibase, imid
+
+        CHARACTER (len = 50)      :: modname = 'simu_airs.caract'
+        CHARACTER (len = 160)     :: abort_message
 
 ! Somme des epaisseurs optiques et des contenus en glace sur le nuage
@@ -585,12 +594,13 @@
 
         if (som_dz .ne. 0.) then
-        som_rad = som_rad/som_dz
+          som_rad = som_rad/som_dz
         else
-        write(*,*) 'som_dez = 0 STOP'
-        write(*,*) 'ibeg, iend =', ibeg, iend
-        do i = ibeg, iend
-        write(*,*) dz_cs(i), rhodz_cs(i)
-        enddo
-        STOP
+          write(*,*) 'som_dez = 0 STOP'
+          write(*,*) 'ibeg, iend =', ibeg, iend
+          do i = ibeg, iend
+             write(*,*) dz_cs(i), rhodz_cs(i)
+          enddo
+          abort_message='see above'
+          CALL abort_physic(modname,abort_message,1)
         endif
 
@@ -611,9 +621,9 @@
         subroutine topbot(ideb,w,ibeg,iend)
 
-        integer, intent(in) :: ideb
-        real, dimension(:), intent(in) :: w
-        integer, intent(out) :: ibeg, iend
-
-        integer :: i, itest
+        INTEGER, intent(in) :: ideb
+        REAL, DIMENSION(:), intent(in) :: w
+        INTEGER, intent(out) :: ibeg, iend
+
+        INTEGER :: i, itest
 
         itest = 0
@@ -642,12 +652,12 @@
         subroutine ordonne(len_cs, rneb_cs, rneb_ord)
 
-        integer, intent(in) :: len_cs
-        real, dimension(:), intent(in) :: rneb_cs
-        real, dimension(:), intent(out) :: rneb_ord
-
-        integer :: i, j, ind_min
-
-        real, dimension(len_cs) :: rneb
-        real :: rneb_max
+        INTEGER, intent(in) :: len_cs
+        REAL, DIMENSION(:), intent(in) :: rneb_cs
+        REAL, DIMENSION(:), intent(out) :: rneb_ord
+
+        INTEGER :: i, j, ind_min
+
+        REAL, DIMENSION(len_cs) :: rneb
+        REAL :: rneb_max
 
 
@@ -689,55 +699,58 @@
        USE dimphy
 
-       real, dimension(klev), intent(in) :: rneb_1D, temp_1D, emis_1D, &
+       REAL, DIMENSION(klev), intent(in) :: rneb_1D, temp_1D, emis_1D, &
      & iwcon_1D, rad_1D
-        real, dimension(klev), intent(in) :: pres, dz, rhodz_1D
-        real, intent(out) :: cc_tot_mesh, cc_hc_mesh, cc_hist_mesh
-        real, intent(out) :: cc_Cb_mesh, cc_ThCi_mesh, cc_Anv_mesh
-        real, intent(out) :: em_hc_mesh, pcld_hc_mesh, tcld_hc_mesh, &
+        REAL, DIMENSION(klev), intent(in) :: pres, dz, rhodz_1D
+        REAL, intent(out) :: cc_tot_mesh, cc_hc_mesh, cc_hist_mesh
+        REAL, intent(out) :: cc_Cb_mesh, cc_ThCi_mesh, cc_Anv_mesh
+        REAL, intent(out) :: em_hc_mesh, pcld_hc_mesh, tcld_hc_mesh, &
      & iwp_hc_mesh
 
-        real, intent(out) :: pcld_Cb_mesh, tcld_Cb_mesh, em_Cb_mesh
-        real, intent(out) :: pcld_ThCi_mesh, tcld_ThCi_mesh, &
+        REAL, intent(out) :: pcld_Cb_mesh, tcld_Cb_mesh, em_Cb_mesh
+        REAL, intent(out) :: pcld_ThCi_mesh, tcld_ThCi_mesh, &
      & em_ThCi_mesh
-        real, intent(out) :: pcld_Anv_mesh, tcld_Anv_mesh, em_Anv_mesh
-
-        real, intent(out) :: em_hist_mesh, iwp_hist_mesh, rad_hist_mesh
-        real, intent(out) :: deltaz_hc_mesh, deltaz_hist_mesh
-
-        real, dimension(:), allocatable :: rneb_cs, temp_cs, emis_cs, &
+        REAL, intent(out) :: pcld_Anv_mesh, tcld_Anv_mesh, em_Anv_mesh
+
+        REAL, intent(out) :: em_hist_mesh, iwp_hist_mesh, rad_hist_mesh
+        REAL, intent(out) :: deltaz_hc_mesh, deltaz_hist_mesh
+
+        REAL, DIMENSION(:), allocatable :: rneb_cs, temp_cs, emis_cs, &
      & iwco_cs
-        real, dimension(:), allocatable :: pres_cs, dz_cs, rad_cs, &
+        REAL, DIMENSION(:), allocatable :: pres_cs, dz_cs, rad_cs, &
      & rhodz_cs
 
-        integer :: i,j,l
-        integer :: ltop, itop, ibot, num_cs, N_cs, len_cs, ics
-
-        real :: som_emi_hc,som_pcl_hc,som_tcl_hc,som_iwp_hc,som_hc,&
+        INTEGER :: i,j,l
+        INTEGER :: ltop, itop, ibot, num_cs, N_cs, len_cs, ics
+
+        REAL :: som_emi_hc,som_pcl_hc,som_tcl_hc,som_iwp_hc,som_hc,&
      & som_hist
-        real :: som_emi_hist, som_iwp_hist, som_deltaz_hc, &
+        REAL :: som_emi_hist, som_iwp_hist, som_deltaz_hc, &
      & som_deltaz_hist
-        real :: som_rad_hist
-        real :: som_Cb, som_ThCi, som_Anv
-        real :: som_emi_Cb, som_tcld_Cb, som_pcld_Cb
-        real :: som_emi_Anv, som_tcld_Anv, som_pcld_Anv
-        real :: som_emi_ThCi, som_tcld_ThCi, som_pcld_ThCi
-        real :: tsom_tot, tsom_hc, tsom_hist
-        real :: prod, prod_hh
-
-        real :: cc_tot_cs, cc_hc_cs, cc_hist_cs
-        real :: cc_Cb_cs, cc_ThCi_cs, cc_Anv_cs
-        real :: pcld_hc_cs, tcld_hc_cs
-        real :: em_hc_cs, iwp_hc_cs, deltaz_hc_cs
-        real :: pcld_Cb_cs, tcld_Cb_cs, em_Cb_cs
-        real :: pcld_ThCi_cs, tcld_ThCi_cs, em_ThCi_cs
-        real :: pcld_Anv_cs, tcld_Anv_cs, em_Anv_cs
-        real :: em_hist_cs, iwp_hist_cs, deltaz_hist_cs, rad_hist_cs
-
-        real, dimension(klev) :: test_tot, test_hc, test_hist
-        real, dimension(klev) :: test_pcld, test_tcld, test_em, test_iwp
-
+        REAL :: som_rad_hist
+        REAL :: som_Cb, som_ThCi, som_Anv
+        REAL :: som_emi_Cb, som_tcld_Cb, som_pcld_Cb
+        REAL :: som_emi_Anv, som_tcld_Anv, som_pcld_Anv
+        REAL :: som_emi_ThCi, som_tcld_ThCi, som_pcld_ThCi
+        REAL :: tsom_tot, tsom_hc, tsom_hist
+        REAL :: prod, prod_hh
+
+        REAL :: cc_tot_cs, cc_hc_cs, cc_hist_cs
+        REAL :: cc_Cb_cs, cc_ThCi_cs, cc_Anv_cs
+        REAL :: pcld_hc_cs, tcld_hc_cs
+        REAL :: em_hc_cs, iwp_hc_cs, deltaz_hc_cs
+        REAL :: pcld_Cb_cs, tcld_Cb_cs, em_Cb_cs
+        REAL :: pcld_ThCi_cs, tcld_ThCi_cs, em_ThCi_cs
+        REAL :: pcld_Anv_cs, tcld_Anv_cs, em_Anv_cs
+        REAL :: em_hist_cs, iwp_hist_cs, deltaz_hist_cs, rad_hist_cs
+
+        REAL, DIMENSION(klev) :: test_tot, test_hc, test_hist
+        REAL, DIMENSION(klev) :: test_pcld, test_tcld, test_em, test_iwp
+
+        CHARACTER (len = 50)      :: modname = 'simu_airs.sim_mesh'
+        CHARACTER (len = 160)     :: abort_message
+        
 
         do j = 1, klev
-        write(*,*) 'simu_airs, j, rneb_1D =', rneb_1D(j)
+          WRITE(lunout,*) 'simu_airs, j, rneb_1D =', rneb_1D(j)
         enddo
 
@@ -991,41 +1004,35 @@
        if (cc_tot_mesh .gt. tsom_tot .and. &
      & abs(cc_tot_mesh-tsom_tot) .gt. 1.e-4) then
-        write(*,*) 'cc_tot_mesh > tsom_tot'
-        write(*,*) cc_tot_mesh, tsom_tot
-        STOP
+           WRITE(abort_message,*)'cc_tot_mesh > tsom_tot', cc_tot_mesh, tsom_tot
+           CALL abort_physic(modname,abort_message,1)
         endif
 
         if (cc_tot_mesh .lt. maxval(test_tot(1:N_CS)) .and. &
      & abs(cc_tot_mesh-maxval(test_tot(1:N_CS))) .gt. 1.e-4) then
-        write(*,*) 'cc_tot_mesh < max'
-        write(*,*) cc_tot_mesh, maxval(test_tot(1:N_CS))
-        STOP
+           WRITE(abort_message,*) 'cc_tot_mesh < max', cc_tot_mesh, maxval(test_tot(1:N_CS))
+           CALL abort_physic(modname,abort_message,1)
         endif
 
         if (cc_hc_mesh .gt. tsom_hc .and. &
      & abs(cc_hc_mesh-tsom_hc) .gt. 1.e-4) then
-        write(*,*) 'cc_hc_mesh > tsom_hc'
-        write(*,*) cc_hc_mesh, tsom_hc
-        STOP
+           WRITE(abort_message,*) 'cc_hc_mesh > tsom_hc', cc_hc_mesh, tsom_hc
+           CALL abort_physic(modname,abort_message,1)
         endif
 
         if (cc_hc_mesh .lt. maxval(test_hc(1:N_CS)) .and. &
      & abs(cc_hc_mesh-maxval(test_hc(1:N_CS))) .gt. 1.e-4) then
-        write(*,*) 'cc_hc_mesh < max'
-        write(*,*) cc_hc_mesh, maxval(test_hc(1:N_CS))
-        STOP
+           WRITE(abort_message,*) 'cc_hc_mesh < max', cc_hc_mesh, maxval(test_hc(1:N_CS))
+           CALL abort_physic(modname,abort_message,1)
         endif
 
         if (cc_hist_mesh .gt. tsom_hist .and. &
      & abs(cc_hist_mesh-tsom_hist) .gt. 1.e-4) then
-        write(*,*) 'cc_hist_mesh > tsom_hist'
-        write(*,*) cc_hist_mesh, tsom_hist
-        STOP
+           WRITE(abort_message,*) 'cc_hist_mesh > tsom_hist', cc_hist_mesh, tsom_hist
+           CALL abort_physic(modname,abort_message,1)
         endif
 
         if (cc_hist_mesh .lt. 0.) then
-        write(*,*) 'cc_hist_mesh < 0'
-        write(*,*) cc_hist_mesh
-        STOP
+           WRITE(abort_message,*) 'cc_hist_mesh < 0', cc_hist_mesh
+           CALL abort_physic(modname,abort_message,1)
         endif
 
@@ -1035,8 +1042,7 @@
      & maxval(test_pcld(1:N_CS)) .ne. 999. &
      & .and. minval(test_pcld(1:N_CS)) .ne. 999.) then
-        write(*,*) 'pcld_hc_mesh est faux'
-        write(*,*) pcld_hc_mesh, maxval(test_pcld(1:N_CS)), &
+           WRITE(abort_message,*) 'pcld_hc_mesh est faux', pcld_hc_mesh, maxval(test_pcld(1:N_CS)), &
      & minval(test_pcld(1:N_CS))
-        STOP
+           CALL abort_physic(modname,abort_message,1)
         endif
 
@@ -1046,7 +1052,7 @@
      & maxval(test_tcld(1:N_CS)) .ne. 999. &
      & .and. minval(test_tcld(1:N_CS)) .ne. 999.) then
-        write(*,*) 'tcld_hc_mesh est faux'
-        write(*,*) tcld_hc_mesh, maxval(test_tcld(1:N_CS)), &
-     & minval(test_tcld(1:N_CS))
+           WRITE(abort_message,*) 'tcld_hc_mesh est faux', tcld_hc_mesh, maxval(test_tcld(1:N_CS)), &
+                & minval(test_tcld(1:N_CS))
+           CALL abort_physic(modname,abort_message,1)
         endif
 
@@ -1056,8 +1062,7 @@
      & minval(test_em(1:N_CS)) .ne. 999. .and. &
      & maxval(test_em(1:N_CS)) .ne. 999. ) then
-        write(*,*) 'em_hc_mesh est faux'
-        write(*,*) em_hc_mesh, maxval(test_em(1:N_CS)), &
+           WRITE(abort_message,*) 'em_hc_mesh est faux', em_hc_mesh, maxval(test_em(1:N_CS)), &
      & minval(test_em(1:N_CS))
-        STOP
+           CALL abort_physic(modname,abort_message,1)
         endif
 
@@ -1101,11 +1106,12 @@
         subroutine test_bornes(sx,x,bsup,binf)
 
-        real, intent(in) :: x, bsup, binf
+        REAL, intent(in) :: x, bsup, binf
         character*14, intent(in) :: sx
+        CHARACTER (len = 50)      :: modname = 'simu_airs.test_bornes'
+        CHARACTER (len = 160)     :: abort_message
 
         if (x .gt. bsup .or. x .lt. binf) then
-        write(*,*) sx, 'est faux'
-        write(*,*) sx, x
-        STOP
+          WRITE(abort_message,*) sx, 'est faux', sx, x
+          CALL abort_physic(modname,abort_message,1)
         endif
  
@@ -1134,44 +1140,44 @@
         include "YOMCST.h"
 
-        integer,intent(in) :: itap
-
-        real, dimension(klon,klev), intent(in) :: &
+        INTEGER,intent(in) :: itap
+
+        REAL, DIMENSION(klon,klev), intent(in) :: &
      & rneb_airs, temp_airs, cldemi_airs, iwcon0_airs, &
      & rad_airs, geop_airs, pplay_airs, paprs_airs
 
-       real, dimension(klon,klev) :: &
+       REAL, DIMENSION(klon,klev) :: &
      & rhodz_airs, rho_airs, iwcon_airs
 
-        real, dimension(klon),intent(out) :: alt_tropo
-
-        real, dimension(klev) :: rneb_1D, temp_1D, &
+        REAL, DIMENSION(klon),intent(out) :: alt_tropo
+
+        REAL, DIMENSION(klev) :: rneb_1D, temp_1D, &
      & emis_1D, rad_1D, pres_1D, alt_1D, &
      & rhodz_1D, dz_1D, iwcon_1D
 
-        integer :: i, j
-
-        real :: cc_tot_mesh, cc_hc_mesh, cc_hist_mesh
-        real :: cc_Cb_mesh, cc_ThCi_mesh, cc_Anv_mesh
-        real :: pcld_hc_mesh, tcld_hc_mesh, em_hc_mesh, iwp_hc_mesh
-        real :: em_hist_mesh, iwp_hist_mesh
-        real :: deltaz_hc_mesh, deltaz_hist_mesh, rad_hist_mesh
-        real :: pcld_Cb_mesh, tcld_Cb_mesh, em_Cb_mesh
-        real :: pcld_ThCi_mesh, tcld_ThCi_mesh, em_ThCi_mesh
-        real :: pcld_Anv_mesh, tcld_Anv_mesh, em_Anv_mesh
-
-        real, dimension(klon),intent(out) :: map_prop_hc, map_prop_hist
-        real, dimension(klon),intent(out) :: map_emis_hc, map_iwp_hc
-        real, dimension(klon),intent(out) :: map_deltaz_hc, map_pcld_hc
-        real, dimension(klon),intent(out) :: map_tcld_hc
-        real, dimension(klon),intent(out) :: map_emis_Cb,map_pcld_Cb,map_tcld_Cb 
-        real, dimension(klon),intent(out) :: &
+        INTEGER :: i, j
+
+        REAL :: cc_tot_mesh, cc_hc_mesh, cc_hist_mesh
+        REAL :: cc_Cb_mesh, cc_ThCi_mesh, cc_Anv_mesh
+        REAL :: pcld_hc_mesh, tcld_hc_mesh, em_hc_mesh, iwp_hc_mesh
+        REAL :: em_hist_mesh, iwp_hist_mesh
+        REAL :: deltaz_hc_mesh, deltaz_hist_mesh, rad_hist_mesh
+        REAL :: pcld_Cb_mesh, tcld_Cb_mesh, em_Cb_mesh
+        REAL :: pcld_ThCi_mesh, tcld_ThCi_mesh, em_ThCi_mesh
+        REAL :: pcld_Anv_mesh, tcld_Anv_mesh, em_Anv_mesh
+
+        REAL, DIMENSION(klon),intent(out) :: map_prop_hc, map_prop_hist
+        REAL, DIMENSION(klon),intent(out) :: map_emis_hc, map_iwp_hc
+        REAL, DIMENSION(klon),intent(out) :: map_deltaz_hc, map_pcld_hc
+        REAL, DIMENSION(klon),intent(out) :: map_tcld_hc
+        REAL, DIMENSION(klon),intent(out) :: map_emis_Cb,map_pcld_Cb,map_tcld_Cb 
+        REAL, DIMENSION(klon),intent(out) :: &
      & map_emis_ThCi,map_pcld_ThCi,map_tcld_ThCi
-        real, dimension(klon),intent(out) :: &
+        REAL, DIMENSION(klon),intent(out) :: &
      & map_emis_Anv,map_pcld_Anv,map_tcld_Anv
-        real, dimension(klon),intent(out) :: &
+        REAL, DIMENSION(klon),intent(out) :: &
      & map_emis_hist,map_iwp_hist,map_deltaz_hist,&
      & map_rad_hist
-       real, dimension(klon),intent(out) :: map_ntot,map_hc,map_hist
-       real, dimension(klon),intent(out) :: map_Cb,map_ThCi,map_Anv
+        REAL, DIMENSION(klon),intent(out) :: map_ntot,map_hc,map_hist
+        REAL, DIMENSION(klon),intent(out) :: map_Cb,map_ThCi,map_Anv
  
  
Index: LMDZ6/trunk/libf/phylmd/slab_heat_transp_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/slab_heat_transp_mod.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/slab_heat_transp_mod.F90	(revision 3531)
@@ -106,9 +106,12 @@
     REAL,INTENT(IN) :: omeg
 
+    CHARACTER (len = 20) :: modname = 'slab_heat_transp'
+    CHARACTER (len = 80) :: abort_message
+    
     ! Sanity check on dimensions
     if ((ip1jm.ne.((nbp_lon+1)*(nbp_lat-1))).or. &
         (ip1jmp1.ne.((nbp_lon+1)*nbp_lat))) then
-      write(*,*) "ini_slab_transp_geom Error: wrong array sizes"
-      stop
+      abort_message="ini_slab_transp_geom Error: wrong array sizes"
+      CALL abort_physic(modname,abort_message,1)
     endif
 ! Allocations could be done only on master process/thread...
@@ -925,8 +928,11 @@
   INTEGER j,ifield,ig
 
+  CHARACTER (len = 20)                      :: modname = 'slab_heat_transp'
+  CHARACTER (len = 80)                      :: abort_message
+
   ! Sanity check:
   IF(klon_glo.NE.2+(jm-2)*(im-1)) THEN
-    WRITE(*,*) "gr_dyn_fi error, wrong sizes"
-    STOP
+    abort_message="gr_dyn_fi error, wrong sizes"
+    CALL abort_physic(modname,abort_message,1)
   ENDIF
 
Index: LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90	(revision 3531)
@@ -161,4 +161,7 @@
     LOGICAL, PARAMETER :: readco2ff=.TRUE., readco2bb=.FALSE. 
 
+    CHARACTER (len = 20) :: modname = 'tracco2i.co2_emissions'
+    CHARACTER (len = 80) :: abort_message
+
     IF (debutphy) THEN 
 
@@ -182,6 +185,6 @@
         n_glo = size(vector)
         IF (n_glo.NE.klon_glo) THEN
-           PRINT *,'sflx_lmdz_co2_ff: le nombre de points n est pas egal a klon_glo'
-           STOP
+           abort_message='sflx_lmdz_co2_ff: le nombre de points n est pas egal a klon_glo'
+           CALL abort_physic(modname,abort_message,1)
         ENDIF
 
@@ -190,6 +193,6 @@
         n_month = size(time)
         IF (n_month.NE.12) THEN
-           PRINT *,'sflx_lmdz_co2_ff: le nombre de month n est pas egal a 12'
-           STOP
+           abort_message='sflx_lmdz_co2_ff: le nombre de month n est pas egal a 12'
+           CALL abort_physic(modname,abort_message,1)
         ENDIF
 
@@ -214,6 +217,6 @@
       n_glo = size(vector)
       IF (n_glo.NE.klon_glo) THEN
-         PRINT *,'sflx_lmdz_co2_bb: le nombre de points n est pas egal a klon_glo'
-         STOP
+         abort_message='sflx_lmdz_co2_bb: le nombre de points n est pas egal a klon_glo'
+         CALL abort_physic(modname,abort_message,1)
       ENDIF
 
@@ -222,6 +225,6 @@
       n_month = size(time)
       IF (n_month.NE.12) THEN
-         PRINT *,'sflx_lmdz_co2_bb: le nombre de month n est pas egal a 12'
-         STOP
+         abort_message='sflx_lmdz_co2_bb: le nombre de month n est pas egal a 12'
+         CALL abort_physic(modname,abort_message,1)
       ENDIF
 
Index: LMDZ6/trunk/libf/phylmd/yamada4.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/yamada4.F90	(revision 3530)
+++ LMDZ6/trunk/libf/phylmd/yamada4.F90	(revision 3531)
@@ -152,4 +152,7 @@
   !$OMP THREADPRIVATE(firstcall)
 
+  CHARACTER (len = 20) :: modname = 'yamada4'
+  CHARACTER (len = 80) :: abort_message
+
 
 
@@ -199,5 +202,5 @@
     ENDIF
 
-    PRINT*,'YAMADA4 RIc, RIfc, Sm_min, Alpha_min',ric,rifc,seuilsm,seuilalpha
+    WRITE(lunout,*)'YAMADA4 RIc, RIfc, Sm_min, Alpha_min',ric,rifc,seuilsm,seuilalpha
     firstcall = .FALSE.
     CALL getin_p('lmixmin',lmixmin)
@@ -216,5 +219,6 @@
 
   IF (.NOT. (iflag_pbl>=6 .AND. iflag_pbl<=12)) THEN
-    STOP 'probleme de coherence dans appel a MY'
+    abort_message='probleme de coherence dans appel a MY'
+    CALL abort_physic(modname,abort_message,1)
   END IF
 
@@ -537,5 +541,6 @@
 
   ELSE
-    STOP 'Cas nom prevu dans yamada4'
+     abort_message='Cas nom prevu dans yamada4'
+     CALL abort_physic(modname,abort_message,1)
 
   END IF ! Fin du cas 8
@@ -590,5 +595,5 @@
 
   IF (prt_level>1) THEN
-    PRINT *, 'YAMADA4 0'
+    WRITE(lunout,*) 'YAMADA4 0'
   END IF 
 
@@ -660,5 +665,5 @@
 
   IF (prt_level>1) THEN
-    PRINT *, 'YAMADA4 1'
+    WRITE(lunout,*)'YAMADA4 1'
   END IF !(prt_level>1) THEN
 
