SURFEX v8.1
General documentation of Surfex
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, DMTO, DGO, DUT, T, TOP, HPROGRAM)
7 ! #######################################################
8 !
9 !!**** *READ_TEB_CONF* - routine to read the configuration for TEB
10 !! (MESONH universe)
11 !!
12 !! PURPOSE
13 !! -------
14 !!
15 !!** METHOD
16 !! ------
17 !!
18 !! EXTERNAL
19 !! --------
20 !!
21 !!
22 !! IMPLICIT ARGUMENTS
23 !! ------------------
24 !!
25 !! REFERENCE
26 !! ---------
27 !!
28 !!
29 !! AUTHOR
30 !! ------
31 !! V. Masson *Meteo France*
32 !!
33 !! MODIFICATIONS
34 !! -------------
35 !! Original 01/2003
36 !! G. Pigeon 09/2012: add CH_BEM option for outdoor conv. coef
37 !-------------------------------------------------------------------------------
38 !
39 !* 0. DECLARATIONS
40 ! ------------
41 !
42 !
43 !
44 !
45 !
46 !
47 USE modd_ch_teb_n, ONLY : ch_teb_t
49 USE modd_diag_n, ONLY : diag_options_t
51 USE modd_teb_n, ONLY : teb_t
53 !
55 !
56 USE mode_pos_surf
57 USE modi_get_luout
58 USE modi_open_namelist
59 USE modi_close_namelist
60 !
62 !
63 USE modn_teb_n
64 !
65 USE modd_read_namelist, ONLY : lnam_read
66 USE modd_surf_par, ONLY : xundef
67 !
68 !
69 USE yomhook ,ONLY : lhook, dr_hook
70 USE parkind1 ,ONLY : jprb
71 !
72 IMPLICIT NONE
73 !
74 !* 0.1 Declarations of arguments
75 ! -------------------------
76 !
77 !
78 TYPE(ch_teb_t), INTENT(INOUT) :: CHT
79 TYPE(diag_misc_teb_options_t), INTENT(INOUT) :: DMTO
80 TYPE(diag_options_t), INTENT(INOUT) :: DGO
81 TYPE(diag_utci_teb_t), INTENT(INOUT) :: DUT
82 TYPE(teb_t), INTENT(INOUT) :: T
83 TYPE(teb_options_t), INTENT(INOUT) :: TOP
84 !
85  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling ISBA
86 
87 !
88 !* 0.2 Declarations of local variables
89 ! -------------------------------
90 !
91 !
92 LOGICAL :: GFOUND ! Return code when searching namelist
93 INTEGER :: ILUOUT ! logical unit of output file
94 INTEGER :: INAM ! logical unit of namelist file
95 INTEGER :: IMI
96 REAL(KIND=JPRB) :: ZHOOK_HANDLE
97 !-------------------------------------------------------------------------------
98 !
99 !* get output listing file logical unit
100 !
101 IF (lhook) CALL dr_hook('READ_TEB_CONF_N',0,zhook_handle)
102  CALL get_luout(hprogram,iluout)
103 !
105 !
106 IF (imi.NE.-1 .AND. lnam_read) THEN
107  CALL init_nam_tebn(t, top)
108  CALL init_nam_diag_surfn(dgo, top)
109  CALL init_nam_diag_tebn(dmto, dgo, dut)
110  CALL init_nam_ch_tebn(cht)
111 ENDIF
112 !
113 IF (lnam_read) THEN
114  !
115  !* open namelist file
116  !
117  CALL open_namelist(hprogram,inam)
118  !
119  !* reading of namelist
120  ! -------------------
121  !
122  CALL posnam(inam,'NAM_TEBN',gfound,iluout)
123  IF (gfound) READ(unit=inam,nml=nam_tebn)
124  CALL posnam(inam,'NAM_DIAG_SURFN',gfound,iluout)
125  IF (gfound) READ(unit=inam,nml=nam_diag_surfn)
126  CALL posnam(inam,'NAM_DIAG_TEBN',gfound,iluout)
127  IF (gfound) READ(unit=inam,nml=nam_diag_tebn)
128  CALL posnam(inam,'NAM_CH_TEBN',gfound,iluout)
129  IF (gfound) READ(unit=inam,nml=nam_ch_tebn)
130  !
131  CALL test_nam_var_surf(iluout,'CZ0H',cz0h,'MASC95','BRUT82','KAND07')
132  CALL test_nam_var_surf(iluout,'CCH_BEM',cch_bem,'ROW30','DOE-2')
133  CALL test_nam_var_surf(iluout,'CCH_DRY_DEP',cch_dry_dep,' ','WES89 ','NONE ')
134  !
135  !* close namelist file
136  !
137  CALL close_namelist(hprogram,inam)
138  !
139 ENDIF
140 !
141 IF (imi.NE.-1) THEN
142  CALL update_nam_tebn(t, top)
143  CALL update_nam_diag_surfn(dgo)
144  CALL update_nam_diag_tebn(dmto, dgo, dut)
145  CALL update_nam_ch_tebn(cht)
146 ENDIF
147 !
148 !-------------------------------------------------------------------------------
149 !
150 !* surface time-step forced by the atmosphere
151 !
152 xtstep = xundef
153 IF (lhook) CALL dr_hook('READ_TEB_CONF_N',1,zhook_handle)
154 !
155 !-------------------------------------------------------------------------------
156 !
157 END SUBROUTINE read_teb_conf_n
subroutine update_nam_diag_surfn(DGO)
Definition: modn_tebn.F90:105
subroutine update_nam_tebn(T, TOP)
Definition: modn_tebn.F90:146
real xtstep
Definition: modn_tebn.F90:64
integer function get_current_model_index_surfex()
character(len=6) cz0h
Definition: modn_tebn.F90:59
character(len=5) cch_bem
Definition: modn_tebn.F90:60
subroutine init_nam_tebn(T, TOP)
Definition: modn_tebn.F90:126
subroutine posnam(KULNAM, HDNAML, OFOUND, KLUOUT)
subroutine init_nam_diag_tebn(DMTO, DGO, DUT)
Definition: modn_tebn.F90:198
real, parameter xundef
subroutine init_nam_diag_surfn(DGO, TOP)
Definition: modn_tebn.F90:80
integer, parameter jprb
Definition: parkind1.F90:32
subroutine update_nam_ch_tebn(CHT)
Definition: modn_tebn.F90:183
subroutine close_namelist(HPROGRAM, KLUNAM)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
subroutine update_nam_diag_tebn(DMTO, DGO, DUT)
Definition: modn_tebn.F90:220
logical lhook
Definition: yomhook.F90:15
character(len=6) cch_dry_dep
Definition: modn_tebn.F90:58
subroutine init_nam_ch_tebn(CHT)
Definition: modn_tebn.F90:168
subroutine open_namelist(HPROGRAM, KLUNAM, HFILE)
subroutine read_teb_conf_n(CHT, DMTO, DGO, DUT, T, TOP, HPROGRAM)