SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
read_teb_confn.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 ! #########
6  SUBROUTINE read_teb_conf_n (CHT, DGMTO, DGT, DGUT, T, TOP, &
7  hprogram)
8 ! #######################################################
9 !
10 !!**** *READ_TEB_CONF* - routine to read the configuration for TEB
11 !! (MESONH universe)
12 !!
13 !! PURPOSE
14 !! -------
15 !!
16 !!** METHOD
17 !! ------
18 !!
19 !! EXTERNAL
20 !! --------
21 !!
22 !!
23 !! IMPLICIT ARGUMENTS
24 !! ------------------
25 !!
26 !! REFERENCE
27 !! ---------
28 !!
29 !!
30 !! AUTHOR
31 !! ------
32 !! V. Masson *Meteo France*
33 !!
34 !! MODIFICATIONS
35 !! -------------
36 !! Original 01/2003
37 !! G. Pigeon 09/2012: add CH_BEM option for outdoor conv. coef
38 !-------------------------------------------------------------------------------
39 !
40 !* 0. DECLARATIONS
41 ! ------------
42 !
43 !
44 !
45 !
46 !
47 !
48 USE modd_ch_teb_n, ONLY : ch_teb_t
50 USE modd_diag_teb_n, ONLY : diag_teb_t
52 USE modd_teb_n, ONLY : teb_t
54 !
56 !
57 USE mode_pos_surf
58 USE modi_get_luout
59 USE modi_open_namelist
60 USE modi_close_namelist
61 !
63 !
64 USE modn_teb_n
65 !
66 USE modd_read_namelist, ONLY : lnam_read
67 USE modd_surf_par, ONLY : xundef
68 !
69 !
70 USE yomhook ,ONLY : lhook, dr_hook
71 USE parkind1 ,ONLY : jprb
72 !
73 IMPLICIT NONE
74 !
75 !* 0.1 Declarations of arguments
76 ! -------------------------
77 !
78 !
79 TYPE(ch_teb_t), INTENT(INOUT) :: cht
80 TYPE(diag_misc_teb_options_t), INTENT(INOUT) :: dgmto
81 TYPE(diag_teb_t), INTENT(INOUT) :: dgt
82 TYPE(diag_utci_teb_t), INTENT(INOUT) :: dgut
83 TYPE(teb_t), INTENT(INOUT) :: t
84 TYPE(teb_options_t), INTENT(INOUT) :: top
85 !
86  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling ISBA
87 
88 !
89 !* 0.2 Declarations of local variables
90 ! -------------------------------
91 !
92 !
93 LOGICAL :: gfound ! Return code when searching namelist
94 INTEGER :: iluout ! logical unit of output file
95 INTEGER :: inam ! logical unit of namelist file
96 INTEGER :: imi
97 REAL(KIND=JPRB) :: zhook_handle
98 !-------------------------------------------------------------------------------
99 !
100 !* get output listing file logical unit
101 !
102 IF (lhook) CALL dr_hook('READ_TEB_CONF_N',0,zhook_handle)
103  CALL get_luout(hprogram,iluout)
104 !
106 !
107 IF (imi.NE.-1 .AND. lnam_read) THEN
108  CALL init_nam_tebn(t, top)
109  CALL init_nam_diag_surfn(dgt, top)
110  CALL init_nam_diag_tebn(dgmto, dgt, dgut)
111  CALL init_nam_ch_tebn(cht)
112 ENDIF
113 !
114 IF (lnam_read) THEN
115  !
116  !* open namelist file
117  !
118  CALL open_namelist(hprogram,inam)
119  !
120  !* reading of namelist
121  ! -------------------
122  !
123  CALL posnam(inam,'NAM_TEBN',gfound,iluout)
124  IF (gfound) READ(unit=inam,nml=nam_tebn)
125  CALL posnam(inam,'NAM_DIAG_SURFN',gfound,iluout)
126  IF (gfound) READ(unit=inam,nml=nam_diag_surfn)
127  CALL posnam(inam,'NAM_DIAG_TEBN',gfound,iluout)
128  IF (gfound) READ(unit=inam,nml=nam_diag_tebn)
129  CALL posnam(inam,'NAM_CH_TEBN',gfound,iluout)
130  IF (gfound) READ(unit=inam,nml=nam_ch_tebn)
131  !
132  CALL test_nam_var_surf(iluout,'CZ0H',cz0h,'MASC95','BRUT82','KAND07')
133  CALL test_nam_var_surf(iluout,'CCH_BEM',cch_bem,'ROW30','DOE-2')
134  CALL test_nam_var_surf(iluout,'CCH_DRY_DEP',cch_dry_dep,' ','WES89 ','NONE ')
135  !
136  !* close namelist file
137  !
138  CALL close_namelist(hprogram,inam)
139  !
140 ENDIF
141 !
142 IF (imi.NE.-1) THEN
143  CALL update_nam_tebn(t, top)
144  CALL update_nam_diag_surfn(dgt)
145  CALL update_nam_diag_tebn(dgmto, dgt, dgut)
146  CALL update_nam_ch_tebn(cht)
147 ENDIF
148 !
149 !-------------------------------------------------------------------------------
150 !
151 !* surface time-step forced by the atmosphere
152 !
153 xtstep = xundef
154 IF (lhook) CALL dr_hook('READ_TEB_CONF_N',1,zhook_handle)
155 !
156 !-------------------------------------------------------------------------------
157 !
158 END SUBROUTINE read_teb_conf_n
subroutine init_nam_diag_surfn(DGF)
subroutine update_nam_tebn(T, TOP)
Definition: modn_tebn.F90:146
subroutine update_nam_ch_tebn(CHT)
Definition: modn_tebn.F90:183
subroutine update_nam_diag_surfn(DGF)
subroutine close_namelist(HPROGRAM, KLUNAM)
subroutine init_nam_diag_tebn(DGMTO, DGT, DGUT)
Definition: modn_tebn.F90:198
subroutine posnam(KULNAM, HDNAML, OFOUND, KLUOUT)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6
subroutine init_nam_ch_tebn(CHT)
Definition: modn_tebn.F90:168
subroutine init_nam_tebn(T, TOP)
Definition: modn_tebn.F90:126
subroutine read_teb_conf_n(CHT, DGMTO, DGT, DGUT, T, TOP, HPROGRAM)
subroutine open_namelist(HPROGRAM, KLUNAM, HFILE)
subroutine update_nam_diag_tebn(DGMTO, DGT, DGUT)
Definition: modn_tebn.F90:221
integer function get_current_model_index_surfex()