SURFEX v8.1
General documentation of Surfex
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, DMTO, DGO, DUT, IO, T, TOP, HPROGRAM)
7 ! #######################################################
8 !
9 !!**** *READ_TEB_CONF* - routine to read the configuration for TEB
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !!** METHOD
15 !! ------
16 !!
17 !! EXTERNAL
18 !! --------
19 !!
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !!
28 !! AUTHOR
29 !! ------
30 !! V. Masson *Meteo France*
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 01/2003
35 !-------------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 ! ------------
39 !
40 !
41 USE modd_ch_teb_n, ONLY : ch_teb_t
43 USE modd_diag_n, ONLY : diag_options_t
46 USE modd_teb_n, ONLY : teb_t
48 !
50 !
51 USE mode_pos_surf
52 USE modi_get_luout
53 USE modi_get_default_nam_n
54 !
55 USE modd_read_namelist, ONLY : lnam_read
56 USE modn_teb_n
58 !
59 !
60 !
61 USE yomhook ,ONLY : lhook, dr_hook
62 USE parkind1 ,ONLY : jprb
63 !
64 IMPLICIT NONE
65 !
66 !* 0.1 Declarations of arguments
67 ! -------------------------
68 !
69 !
70 TYPE(ch_teb_t), INTENT(INOUT) :: CHT
71 TYPE(diag_misc_teb_options_t), INTENT(INOUT) :: DMTO
72 TYPE(diag_options_t), INTENT(INOUT) :: DGO
73 TYPE(diag_utci_teb_t), INTENT(INOUT) :: DUT
74 TYPE(isba_options_t), INTENT(INOUT) :: IO
75 TYPE(teb_t), INTENT(INOUT) :: T
76 TYPE(teb_options_t), INTENT(INOUT) :: TOP
77 !
78  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling ISBA
79 
80 !
81 !* 0.2 Declarations of local variables
82 ! -------------------------------
83 !
84 !
85 LOGICAL :: GFOUND ! Return code when searching namelist
86 INTEGER :: ILUOUT ! output listing logical unit
87 INTEGER :: ILUDES ! .des file logical unit
88 INTEGER :: IMI
89 REAL(KIND=JPRB) :: ZHOOK_HANDLE
90 !-------------------------------------------------------------------------------
91 !
92 IF (lhook) CALL dr_hook('READ_DEFAULT_TEB_N',0,zhook_handle)
93  CALL get_luout(hprogram,iluout)
94 
95  CALL get_default_nam_n(hprogram,'READ ',iludes)
96 !
97 IF (iludes==0 .AND. lhook) CALL dr_hook('READ_DEFAULT_TEB_N',1,zhook_handle)
98 IF (iludes==0) RETURN
99 !
101 !
102 IF (imi.NE.-1 .AND. lnam_read) THEN
103  CALL init_nam_tebn(t, top)
104  CALL init_nam_diag_surfn(dgo, top)
105  CALL init_nam_diag_tebn(dmto, dgo, dut)
106  CALL init_nam_ch_tebn(cht)
107  CALL init_nam_teb_greenroofn(io)
108 ENDIF
109 !
110 IF (lnam_read) THEN
111  !
112  !* reading of namelist
113  ! -------------------
114  !
115  CALL posnam(iludes,'NAM_TEBN',gfound,iluout)
116  IF (gfound) READ(unit=iludes,nml=nam_tebn)
117  CALL posnam(iludes,'NAM_DIAG_SURFN',gfound,iluout)
118  IF (gfound) READ(unit=iludes,nml=nam_diag_surfn)
119  CALL posnam(iludes,'NAM_DIAG_TEBN',gfound,iluout)
120  IF (gfound) READ(unit=iludes,nml=nam_diag_tebn)
121  CALL posnam(iludes,'NAM_CH_TEBN',gfound,iluout)
122  IF (gfound) READ(unit=iludes,nml=nam_ch_tebn)
123  CALL posnam(iludes,'NAM_TEB_GREENROOFN',gfound,iluout)
124  IF (gfound) READ(unit=iludes,nml=nam_teb_greenroofn)
125  !
126 ENDIF
127 !
128 IF (imi.NE.-1) THEN
129  CALL update_nam_tebn(t, top)
130  CALL update_nam_diag_surfn(dgo)
131  CALL update_nam_diag_tebn(dmto, dgo, dut)
132  CALL update_nam_ch_tebn(cht)
134 ENDIF
135 IF (lhook) CALL dr_hook('READ_DEFAULT_TEB_N',1,zhook_handle)
136 !
137 !-------------------------------------------------------------------------------
138 !
139 END SUBROUTINE read_default_teb_n
subroutine update_nam_diag_surfn(DGO)
Definition: modn_tebn.F90:105
subroutine get_default_nam_n(HPROGRAM, HACTION, KLUDES, ONAM_WRITTEN)
subroutine update_nam_teb_greenroofn(TGRO)
subroutine update_nam_tebn(T, TOP)
Definition: modn_tebn.F90:146
integer function get_current_model_index_surfex()
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
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 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
subroutine init_nam_teb_greenroofn(TGRO)
subroutine read_default_teb_n(CHT, DMTO, DGO, DUT, IO, T, TOP, HP
subroutine init_nam_ch_tebn(CHT)
Definition: modn_tebn.F90:168