source: trunk/LMDZ.COMMON/libf/phy_common/init_print_control_mod.F90 @ 3287

Last change on this file since 3287 was 1791, checked in by emillour, 7 years ago

Common dynamics:
Bug fix: variables from print_control_mod should be directly accessed (to retain default value).
EM

File size: 2.1 KB
Line 
1MODULE init_print_control_mod
2
3! init_print_control to initialize print_control_mod variables
4! not included there because of circular dependecy issues
5
6CONTAINS
7
8  SUBROUTINE init_print_control
9  USE print_control_mod, ONLY : set_print_control, &
10                                prt_level, lunout, debug
11  USE ioipsl_getin_p_mod, ONLY : getin_p
12  USE mod_phys_lmdz_para, ONLY: is_omp_root, is_master
13  IMPLICIT NONE
14
15!    INTEGER :: lunout ! default output file identifier (6==screen)
16!    INTEGER :: prt_level ! Output level
17!    LOGICAL :: debug ! flag to specify if in "debug mode"
18    LOGICAL :: opened
19    INTEGER :: number
20   
21    !Config  Key  = prt_level
22    !Config  Desc = niveau d'impressions de débogage
23    !Config  Def  = 0
24    !Config  Help = Niveau d'impression pour le débogage
25    !Config         (0 = minimum d'impression)
26!    prt_level = 0 ! default set in  print_control_mod)
27    CALL getin_p('prt_level',prt_level)
28
29    !Config  Key  = lunout
30    !Config  Desc = unite de fichier pour les impressions
31    !Config  Def  = 6
32    !Config  Help = unite de fichier pour les impressions
33    !Config         (defaut sortie standard = 6)
34!    lunout=6 ! default set in  print_control_mod)
35    CALL getin_p('lunout', lunout)
36
37    IF (is_omp_root) THEN
38      IF (lunout /= 5 .and. lunout /= 6) THEN
39         INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number)
40         IF (opened) THEN
41           lunout=number
42         ELSE
43           OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write',  &
44                STATUS='unknown',FORM='formatted')
45         ENDIF
46      ENDIF
47    ENDIF
48
49    !Config  Key  = debug
50    !Config  Desc = mode debogage
51    !Config  Def  = false
52    !Config  Help = positionne le mode debogage
53
54!    debug = .FALSE. ! default set in  print_control_mod)
55    CALL getin_p('debug',debug)
56   
57    IF (is_master) THEN
58      WRITE(lunout,*)"init_print_control: prt_level=",prt_level
59      WRITE(lunout,*)"init_print_control: lunout=",lunout
60      WRITE(lunout,*)"init_print_control: debug=",debug     
61    ENDIF
62   
63    CALL set_print_control(lunout,prt_level,debug)
64
65  END SUBROUTINE init_print_control 
66
67END MODULE init_print_control_mod
68
Note: See TracBrowser for help on using the repository browser.