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

Last change on this file since 3831 was 3829, checked in by emillour, 5 days ago

Common physics routines:
Some minor reorganization of the print_control module, in line
with what is done in the Earth GCM and likely healthier with
respect to OpenMP.
EM

File size: 1.5 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
6IMPLICIT NONE
7 
8CONTAINS
9
10  SUBROUTINE init_print_control
11  USE print_control_mod, ONLY : set_print_control
12  USE ioipsl_getin_p_mod, ONLY : getin_p
13  USE mod_phys_lmdz_para, ONLY: is_omp_root, is_master
14  IMPLICIT NONE
15
16    INTEGER :: lunout ! default output file identifier (6==screen)
17    INTEGER :: prt_level ! Output level (0: none)
18    LOGICAL :: debug ! flag to specify if in "debug mode" (i.e. extra outputs)
19    LOGICAL :: opened
20    INTEGER :: number
21   
22    prt_level = 0 ! default (0: minimum verbosity)
23    CALL getin_p('prt_level',prt_level)
24
25    lunout=6 ! default (i.e. standard output = 6)
26    CALL getin_p('lunout', lunout)
27
28    IF (is_omp_root) THEN
29      IF (lunout /= 5 .and. lunout /= 6) THEN
30         INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number)
31         IF (opened) THEN
32           lunout=number
33         ELSE
34           OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write',  &
35                STATUS='unknown',FORM='formatted')
36         ENDIF
37      ENDIF
38    ENDIF
39
40    debug = .FALSE. ! default
41    CALL getin_p('debug',debug)
42   
43    IF (is_master) THEN
44      WRITE(lunout,*)"init_print_control: prt_level=",prt_level
45      WRITE(lunout,*)"init_print_control: lunout=",lunout
46      WRITE(lunout,*)"init_print_control: debug=",debug     
47    ENDIF
48   
49    CALL set_print_control(lunout,prt_level,debug)
50
51  END SUBROUTINE init_print_control 
52
53END MODULE init_print_control_mod
54
Note: See TracBrowser for help on using the repository browser.