HowTo: Print alert messages : Différence entre versions

De LMDZPedia
Aller à : navigation, rechercher
(Page créée avec « Routine 'prt_alerte' has been added to module phy_common/print_control_mod.F90 to enable developpers to print out informative messages on the first pass through physics an... »)
 
 
Ligne 32 : Ligne 32 :
  
 
in your output file.
 
in your output file.
 +
 +
[[Catégorie:HowTo]]

Version actuelle en date du 17 septembre 2021 à 12:04

Routine 'prt_alerte' has been added to module phy_common/print_control_mod.F90 to enable developpers to print out informative messages on the first pass through physics and from the master process only. This can be used to remind oneself of potential problems or further enhancements.

Messages can be differentiated by a 'priority' code 0/1/2 (corresponding to GREEN/ORANGE/RED alerts)

By default, the messages are output in a file called ALERTES.txt but changing the unit number to 6 in the print_control_mod.F90 file allows you to print out your messages to the screen.

To use you simply need to:

  • have this USE statement at the start of your routine:
   USE print_control_mod, ONLY: prt_level, lunout, call_alert, prt_alerte
  • ensure that the modname variable is defined and contains the name of your routine

then you just need to add the following lines in your routine wherever you want to ouput your message (preferably not in a do loop)

   message='your informative message'
   IF (call_alert) CALL prt_alerte(message,modname,CODE)

where

   message is the message to print out
   modname is the routine name
   CODE is an integer representing your priority code (0/1/2) 

and you should get messages of the form

   ALERTE ROUGE cva_driver! ym missing init, need to have a look by developpers
   ALERTE VERTE orosetup_strato! ym correction en attendant mieux


in your output file.