Index: LMDZ6/trunk/libf/phy_common/print_control_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phy_common/print_control_mod.F90	(revision 3980)
+++ LMDZ6/trunk/libf/phy_common/print_control_mod.F90	(revision 3981)
@@ -5,5 +5,7 @@
   INTEGER,SAVE :: prt_level ! debug output level
   LOGICAL,SAVE :: debug ! flag to specify if in "debug mode"
-!$OMP THREADPRIVATE(lunout,prt_level,debug)
+  LOGICAL,SAVE :: alert_first_call = .TRUE. ! for printing alerts on first call to routine only           
+  LOGICAL,SAVE :: call_alert ! (combination of is_master and alert_first_call for easier use     
+!$OMP THREADPRIVATE(lunout,prt_level,debug, alert_first_call, call_alert)
 
   ! NB: Module variable Initializations done by set_print_control
@@ -15,7 +17,7 @@
   SUBROUTINE set_print_control(lunout_,prt_level_,debug_)
   IMPLICIT NONE
-    INTEGER :: lunout_
-    INTEGER :: prt_level_
-    LOGICAL :: debug_
+    INTEGER, INTENT(IN) :: lunout_
+    INTEGER, INTENT(IN) :: prt_level_
+    LOGICAL, INTENT(IN) :: debug_
       
     lunout = lunout_
@@ -25,3 +27,36 @@
   END SUBROUTINE set_print_control
 
+  SUBROUTINE prt_alerte(message, modname, niv_alerte)
+    ! Function to print different values of alarms when first encountered
+    ! Meant for informative purposee
+    IMPLICIT NONE
+    ! Arguments:
+    ! message: message to print out
+    ! modname: module/routine name
+    ! niv_alerte: alert level (0/1/2)
+    CHARACTER(LEN=*), INTENT(IN) :: modname
+    CHARACTER(LEN=*) :: message
+    INTEGER :: niv_alerte
+    ! local variables
+    CHARACTER(LEN=7), DIMENSION(0:2) :: alarm_color = (/ 'VERTE  ','ORANGE ','ROUGE  ' /)
+    CHARACTER(LEN=7) :: alarm_couleur
+    INTEGER :: alarm_file=15 ! in case we want/need to print out the special alarms in a separate file     
+
+    IF ( alert_first_call) then
+       IF ( alarm_file .ne. lunout ) THEN
+          OPEN(unit = alarm_file, file = "ALERTES.txt")
+       ENDIF
+    ENDIF
+
+    alarm_couleur = alarm_color(niv_alerte)
+    IF (niv_alerte < 0 .OR. niv_alerte > 3) then
+       message = 'NIVEAU ALERTE INVALIDE  '//message
+       alarm_couleur='NOIRE  '
+    ENDIF
+
+    WRITE(alarm_file, *)' ALERTE ',alarm_couleur, trim(modname),  trim(message)
+    
+  END SUBROUTINE prt_alerte
+
+  
 END MODULE print_control_mod
Index: LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3980)
+++ LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3981)
@@ -59,5 +59,6 @@
     USE phys_output_mod
     USE phys_output_ctrlout_mod
-    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
+    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level, &
+         alert_first_call, call_alert, prt_alerte
     USE readaerosol_mod, ONLY : init_aero_fromfile
     USE readaerosolstrato_m, ONLY : init_readaerosolstrato
@@ -1028,6 +1029,6 @@
 !JLD    REAL zstophy, zout
 
-    CHARACTER*20 modname
-    CHARACTER*80 abort_message
+    CHARACTER (LEN=20) :: modname='physiq_mod'
+    CHARACTER*80 message, abort_message
     LOGICAL, SAVE ::  ok_sync, ok_sync_omp
     !$OMP THREADPRIVATE(ok_sync)
@@ -1194,4 +1195,7 @@
     pi = 4. * ATAN(1.)
 
+    ! set-up call to alerte function
+    call_alert = (alert_first_call .AND. is_master)
+    
     ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter"
     jjmp1=nbp_lat
@@ -1311,5 +1315,4 @@
     forall (k=1: nbp_lev) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg
 
-    modname = 'physiq'
 
     IF (debut) THEN
@@ -5249,4 +5252,7 @@
     !
 
+    ! Disabling calls to the prt_alerte function
+    alert_first_call = .FALSE.
+    
     IF (lafin) THEN
        itau_phy = itau_phy + itap
