Ignore:
Timestamp:
Sep 9, 2021, 3:50:44 PM (4 years ago)
Author:
Laurent Fairhead
Message:

Adds a routine 'prt_alerte' 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/physiq_mod.F90

    r3956 r3981  
    5959    USE phys_output_mod
    6060    USE phys_output_ctrlout_mod
    61     USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
     61    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level, &
     62         alert_first_call, call_alert, prt_alerte
    6263    USE readaerosol_mod, ONLY : init_aero_fromfile
    6364    USE readaerosolstrato_m, ONLY : init_readaerosolstrato
     
    10281029!JLD    REAL zstophy, zout
    10291030
    1030     CHARACTER*20 modname
    1031     CHARACTER*80 abort_message
     1031    CHARACTER (LEN=20) :: modname='physiq_mod'
     1032    CHARACTER*80 message, abort_message
    10321033    LOGICAL, SAVE ::  ok_sync, ok_sync_omp
    10331034    !$OMP THREADPRIVATE(ok_sync)
     
    11941195    pi = 4. * ATAN(1.)
    11951196
     1197    ! set-up call to alerte function
     1198    call_alert = (alert_first_call .AND. is_master)
     1199   
    11961200    ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter"
    11971201    jjmp1=nbp_lat
     
    13111315    forall (k=1: nbp_lev) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg
    13121316
    1313     modname = 'physiq'
    13141317
    13151318    IF (debut) THEN
     
    52495252    !
    52505253
     5254    ! Disabling calls to the prt_alerte function
     5255    alert_first_call = .FALSE.
     5256   
    52515257    IF (lafin) THEN
    52525258       itau_phy = itau_phy + itap
Note: See TracChangeset for help on using the changeset viewer.