SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
read_default_tebn.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_default_teb_n (CHT, DGMTO, DGT, DGUT, TGRO, T, TOP, &
7  hprogram)
8 ! #######################################################
9 !
10 !!**** *READ_TEB_CONF* - routine to read the configuration for TEB
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 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
41 !
42 !
43 !
44 !
45 !
46 !
47 USE modd_ch_teb_n, ONLY : ch_teb_t
49 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_get_default_nam_n
60 !
61 USE modd_read_namelist, ONLY : lnam_read
62 USE modn_teb_n
64 !
65 !
66 !
67 USE yomhook ,ONLY : lhook, dr_hook
68 USE parkind1 ,ONLY : jprb
69 !
70 IMPLICIT NONE
71 !
72 !* 0.1 Declarations of arguments
73 ! -------------------------
74 !
75 !
76 TYPE(ch_teb_t), INTENT(INOUT) :: cht
77 TYPE(diag_misc_teb_options_t), INTENT(INOUT) :: dgmto
78 TYPE(diag_teb_t), INTENT(INOUT) :: dgt
79 TYPE(diag_utci_teb_t), INTENT(INOUT) :: dgut
80 TYPE(teb_greenroof_options_t), INTENT(INOUT) :: tgro
81 TYPE(teb_t), INTENT(INOUT) :: t
82 TYPE(teb_options_t), INTENT(INOUT) :: top
83 !
84  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling ISBA
85 
86 !
87 !* 0.2 Declarations of local variables
88 ! -------------------------------
89 !
90 !
91 LOGICAL :: gfound ! Return code when searching namelist
92 INTEGER :: iluout ! output listing logical unit
93 INTEGER :: iludes ! .des file logical unit
94 INTEGER :: imi
95 REAL(KIND=JPRB) :: zhook_handle
96 !-------------------------------------------------------------------------------
97 !
98 IF (lhook) CALL dr_hook('READ_DEFAULT_TEB_N',0,zhook_handle)
99  CALL get_luout(hprogram,iluout)
100 
101  CALL get_default_nam_n(hprogram,'READ ',iludes)
102 !
103 IF (iludes==0 .AND. lhook) CALL dr_hook('READ_DEFAULT_TEB_N',1,zhook_handle)
104 IF (iludes==0) RETURN
105 !
107 !
108 IF (imi.NE.-1 .AND. lnam_read) THEN
109  CALL init_nam_tebn(t, top)
110  CALL init_nam_diag_surfn(dgt, top)
111  CALL init_nam_diag_tebn(dgmto, dgt, dgut)
112  CALL init_nam_ch_tebn(cht)
113  CALL init_nam_teb_greenroofn(tgro)
114 ENDIF
115 !
116 IF (lnam_read) THEN
117  !
118  !* reading of namelist
119  ! -------------------
120  !
121  CALL posnam(iludes,'NAM_TEBN',gfound,iluout)
122  IF (gfound) READ(unit=iludes,nml=nam_tebn)
123  CALL posnam(iludes,'NAM_DIAG_SURFN',gfound,iluout)
124  IF (gfound) READ(unit=iludes,nml=nam_diag_surfn)
125  CALL posnam(iludes,'NAM_DIAG_TEBN',gfound,iluout)
126  IF (gfound) READ(unit=iludes,nml=nam_diag_tebn)
127  CALL posnam(iludes,'NAM_CH_TEBN',gfound,iluout)
128  IF (gfound) READ(unit=iludes,nml=nam_ch_tebn)
129  CALL posnam(iludes,'NAM_TEB_GREENROOFN',gfound,iluout)
130  IF (gfound) READ(unit=iludes,nml=nam_teb_greenroofn)
131  !
132 ENDIF
133 !
134 IF (imi.NE.-1) THEN
135  CALL update_nam_tebn(t, top)
136  CALL update_nam_diag_surfn(dgt)
137  CALL update_nam_diag_tebn(dgmto, dgt, dgut)
138  CALL update_nam_ch_tebn(cht)
139  CALL update_nam_teb_greenroofn(tgro)
140 ENDIF
141 IF (lhook) CALL dr_hook('READ_DEFAULT_TEB_N',1,zhook_handle)
142 !
143 !-------------------------------------------------------------------------------
144 !
145 END SUBROUTINE read_default_teb_n
subroutine update_nam_teb_greenroofn(TGRO)
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 read_default_teb_n(CHT, DGMTO, DGT, DGUT, TGRO, T, TOP, HPROGRAM)
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_teb_greenroofn(TGRO)
subroutine init_nam_tebn(T, TOP)
Definition: modn_tebn.F90:126
subroutine update_nam_diag_tebn(DGMTO, DGT, DGUT)
Definition: modn_tebn.F90:221
integer function get_current_model_index_surfex()
subroutine get_default_nam_n(HPROGRAM, HACTION, KLUDES)