SURFEX v8.1
General documentation of Surfex
pgd_teb.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 pgd_teb (DTCO, UG, U, USS, TOP, BOP, TG, BDD, DTT, DTB, &
7  GDO, GDK, DTGD, GDIR, GRO, GRS, GRK, DTGR, HPROGRAM)
8 ! ##############################################################
9 !
10 !!**** *PGD_TEB* monitor for averaging and interpolations of TEB physiographic fields
11 !!
12 !! PURPOSE
13 !! -------
14 !!
15 !! METHOD
16 !! ------
17 !!
18 !
19 !! EXTERNAL
20 !! --------
21 !!
22 !! IMPLICIT ARGUMENTS
23 !! ------------------
24 !!
25 !! REFERENCE
26 !! ---------
27 !!
28 !! AUTHOR
29 !! ------
30 !!
31 !! V. Masson Meteo-France
32 !!
33 !! MODIFICATION
34 !! ------------
35 !!
36 !! Original 10/12/97
37 !! A. Lemonsu 05/2009 Key for garden option
38 !! G. Pigeon /09/12: WALL, ROOF, FLOOR, MASS LAYER default to 5
39 !!
40 !----------------------------------------------------------------------------
41 !
42 !* 0. DECLARATION
43 ! -----------
44 !
45 USE modd_surfex_mpi, ONLY : nrank, npio
46 !
49 USE modd_surf_atm_n, ONLY : surf_atm_t
50 USE modd_sso_n, ONLY : sso_t
51 !
54 USE modd_sfx_grid_n, ONLY : grid_t
56 USE modd_data_teb_n, ONLY : data_teb_t
57 USE modd_data_bem_n, ONLY : data_bem_t
58 !
60 USE modd_isba_n, ONLY : isba_s_t, isba_k_t
61 USE modd_data_isba_n, ONLY : data_isba_t
62 USE modd_teb_irrig_n, ONLY : teb_irrig_t
63 !
64 USE modd_data_cover_par, ONLY : jpcover
65 !
66 USE modi_get_surf_size_n
67 USE modi_pack_pgd
68 USE modi_pgd_teb_par
69 USE modi_pgd_teb_veg
70 USE modi_get_luout
71 USE modi_read_nam_pgd_teb
73 USE modi_pgd_bem_par
74 USE modi_abor1_sfx
75 !
76 !
77 USE yomhook ,ONLY : lhook, dr_hook
78 USE parkind1 ,ONLY : jprb
79 !
80 USE modi_write_cover_tex_teb
81 !
82 IMPLICIT NONE
83 !
84 !* 0.1 Declaration of arguments
85 ! ------------------------
86 !
87 !
88 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
89 TYPE(surf_atm_grid_t), INTENT(INOUT) :: UG
90 TYPE(surf_atm_t), INTENT(INOUT) :: U
91 TYPE(sso_t), INTENT(INOUT) :: USS
92 TYPE(teb_options_t), INTENT(INOUT) :: TOP
93 TYPE(bem_options_t), INTENT(INOUT) :: BOP
94 TYPE(grid_t), INTENT(INOUT) :: TG
95 TYPE(bld_desc_t), INTENT(INOUT) :: BDD
96 TYPE(data_teb_t), INTENT(INOUT) :: DTT
97 TYPE(data_bem_t), INTENT(INOUT) :: DTB
98 !
99 TYPE(isba_options_t), INTENT(INOUT) :: GDO
100 TYPE(isba_k_t), INTENT(INOUT) :: GDK
101 TYPE(data_isba_t), INTENT(INOUT) :: DTGD
102 TYPE(teb_irrig_t), INTENT(INOUT) :: GDIR
103 TYPE(isba_options_t), INTENT(INOUT) :: GRO
104 TYPE(isba_s_t), INTENT(INOUT) :: GRS
105 TYPE(isba_k_t), INTENT(INOUT) :: GRK
106 TYPE(data_isba_t), INTENT(INOUT) :: DTGR
107 !
108  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! Type of program
109 !
110 !
111 !* 0.2 Declaration of local variables
112 ! ------------------------------
113 !
114 INTEGER :: ILUOUT ! output listing logical unit
115 REAL(KIND=JPRB) :: ZHOOK_HANDLE
116 !
117 !-------------------------------------------------------------------------------
118 !
119 !* 1. Initializations of defaults
120 ! ---------------------------
121 !
122 IF (lhook) CALL dr_hook('PGD_TEB',0,zhook_handle)
123  CALL get_luout(hprogram,iluout)
124 
125 top%NROOF_LAYER = 5
126 top%NROAD_LAYER = 5
127 top%NWALL_LAYER = 5
128 bop%NFLOOR_LAYER = 5
129 !
130 !-------------------------------------------------------------------------------
131 !
132 !* 2. Reading of namelist
133 ! -------------------
134 !
135  CALL read_nam_pgd_teb(hprogram,top%NTEB_PATCH,top%CBEM,bop%CCOOL_COIL, &
136  bop%CHEAT_COIL,bop%LAUTOSIZE,top%NROAD_LAYER, &
137  top%NROOF_LAYER,top%NWALL_LAYER,bop%NFLOOR_LAYER, &
138  top%LGREENROOF,top%LHYDRO,top%LSOLAR_PANEL )
139 !
140 !-------------------------------------------------------------------------------
141 !
142 !* 3. Coherence of options
143 ! --------------------
144 !
145  CALL test_nam_var_surf(iluout,'CBLD',top%CBEM,'DEF','BEM ')
146  CALL test_nam_var_surf(iluout,'CCOOL_COIL',bop%CCOOL_COIL,'IDEAL ','DXCOIL')
147  CALL test_nam_var_surf(iluout,'CHEAT_COIL',bop%CHEAT_COIL,'IDEAL ','FINCAP')
148 !
149 IF (.NOT. u%LGARDEN) THEN
150  IF (top%LGREENROOF) CALL abor1_sfx('ERROR: You cannot activate LGREENROOF if LGARDEN is FALSE')
151  IF (top%LHYDRO ) CALL abor1_sfx('ERROR: You cannot activate LHYDRO if LGARDEN is FALSE')
152 ENDIF
153 !
154 !-------------------------------------------------------------------------------
155 !
156 !* 4. Number of points and packing
157 ! ----------------------------
158 !
159  CALL get_surf_size_n(dtco, u, 'TOWN ',tg%NDIM)
160 !
161 ALLOCATE(top%LCOVER (jpcover))
162 ALLOCATE(top%XZS (tg%NDIM))
163 ALLOCATE(tg%XLAT (tg%NDIM))
164 ALLOCATE(tg%XLON (tg%NDIM))
165 ALLOCATE(tg%XMESH_SIZE (tg%NDIM))
166 !
167  CALL pack_pgd(dtco, u, hprogram, 'TOWN ', tg, top%LCOVER, top%XCOVER, top%XZS )
168 !
169 !-------------------------------------------------------------------------------
170 !
171 !* 5. TEB specific fields
172 ! -------------------
173 !
174 top%LECOCLIMAP = u%LECOCLIMAP
175  CALL pgd_teb_par(dtco, ug, u, uss, bdd, dtt, tg%NDIM, &
176  hprogram,u%LGARDEN,top%LGREENROOF,top%CBLD_ATYPE)
177 !
178 !-------------------------------------------------------------------------------
179 !
180 !* 6. Prints of cover parameters in a tex file
181 ! ----------------------------------------
182 !
183 IF (u%LECOCLIMAP .AND. nrank==npio) CALL write_cover_tex_teb
184 !
185 !
186 !-------------------------------------------------------------------------------
187 !
188 !* 7. Case of urban green areas (and hydrology)
189 ! -----------------------------------------
190 !
191 top%LGARDEN = u%LGARDEN
192 !
193 IF (top%LGARDEN) CALL pgd_teb_veg(dtco, ug, u, uss, gdo, gdk, dtgd, gdir, &
194  gro, grs, grk, dtgr, top, tg%NDIM, hprogram)
195 !
196 !-------------------------------------------------------------------------------
197 !
198 !* 8. Case of Building Energy Model
199 ! -----------------------------
200 !
201 IF (top%CBEM .EQ. 'BEM') CALL pgd_bem_par(dtco, ug, u, uss, dtb, tg%NDIM, &
202  hprogram,bop%LAUTOSIZE)
203 !
204 IF (lhook) CALL dr_hook('PGD_TEB',1,zhook_handle)
205 !
206 !-------------------------------------------------------------------------------
207 !
208 END SUBROUTINE pgd_teb
subroutine read_nam_pgd_teb(HPROGRAM, KTEB_PATCH, HBEM, HCOOL_COIL, HHEAT_COIL, OAUTOSIZE, KROAD_LAYER, KROOF_LAYER, KWALL_LAYER, KFLOOR_LAYER, OGREENROOF, OHYDRO, OSOLAR_PANEL)
subroutine get_surf_size_n(DTCO, U, HTYPE, KL)
subroutine write_cover_tex_teb
subroutine pack_pgd(DTCO, U, HPROGRAM, HSURF, G, OCOVER, PCOVER,
Definition: pack_pgd.F90:7
subroutine pgd_teb(DTCO, UG, U, USS, TOP, BOP, TG, BDD, DTT, DTB,
Definition: pgd_teb.F90:7
subroutine pgd_bem_par(DTCO, UG, U, USS, DTB, KDIM, HPROGRAM, OAUTOSIZE)
Definition: pgd_bem_par.F90:8
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
subroutine pgd_teb_veg(DTCO, UG, U, USS, GDO, GDK, DTGD, GDIR, GRO, GRS, GRK, DTGR, TOP, KDIM, HPROGRAM)
Definition: pgd_teb_veg.F90:8
integer, parameter jprb
Definition: parkind1.F90:32
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine pgd_teb_par(DTCO, UG, U, USS, BDD, DTT, KDIM, HPROGRAM, OGARDEN, OGREENROOF, HBLD_ATYPE)
Definition: pgd_teb_par.F90:8