SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
write_diag_pgd_grdnn.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 write_diag_pgd_grdn_n (DTCO, DGU, U, DGMTO, TGDPE, TGDP, TVG, &
7  hprogram)
8 ! #########################################
9 !
10 !!**** *WRITE_DIAG_PGD_TEB_GARDEN_n* - writes the ISBA physiographic diagnostic fields
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/2004
36 !! Modified 10/2004 by P. Le Moigne: add XZ0REL, XVEGTYPE_PATCH
37 !! Modified 11/2005 by P. Le Moigne: limit length of VEGTYPE_PATCH field names
38 !-------------------------------------------------------------------------------
39 !
40 !* 0. DECLARATIONS
41 ! ------------
42 !
43 !
46 USE modd_surf_atm_n, ONLY : surf_atm_t
51 !
52 USE modd_surf_par, ONLY : xundef
53 !
54 !
55 USE modd_io_surf_fa, ONLY : lfanocompact, lprep
56 !
57 USE modi_init_io_surf_n
59 USE modi_end_io_surf_n
60 !
61 !
62 USE yomhook ,ONLY : lhook, dr_hook
63 USE parkind1 ,ONLY : jprb
64 !
65 IMPLICIT NONE
66 !
67 !* 0.1 Declarations of arguments
68 ! -------------------------
69 !
70 !
71 TYPE(data_cover_t), INTENT(INOUT) :: dtco
72 TYPE(diag_surf_atm_t), INTENT(INOUT) :: dgu
73 TYPE(surf_atm_t), INTENT(INOUT) :: u
74 TYPE(diag_misc_teb_options_t), INTENT(INOUT) :: dgmto
75 TYPE(teb_garden_pgd_evol_t), INTENT(INOUT) :: tgdpe
76 TYPE(teb_garden_pgd_t), INTENT(INOUT) :: tgdp
77 TYPE(teb_veg_options_t), INTENT(INOUT) :: tvg
78 !
79  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling
80 !
81 !* 0.2 Declarations of local variables
82 ! -------------------------------
83 !
84 INTEGER :: iresp ! IRESP : return-code if a problem appears
85  CHARACTER(LEN=12) :: yrecfm ! Name of the article to be read
86  CHARACTER(LEN=100):: ycomment ! Comment string
87  CHARACTER(LEN=2) :: ylvlv, ypas
88 !
89 INTEGER :: jl, jp
90 REAL(KIND=JPRB) :: zhook_handle
91 !-------------------------------------------------------------------------------
92 !
93 ! Initialisation for IO
94 !
95 IF (lhook) CALL dr_hook('WRITE_DIAG_PGD_GRDN_N',0,zhook_handle)
96  CALL init_io_surf_n(dtco, dgu, u, &
97  hprogram,'TOWN ','TEB ','WRITE')
98 !
99 !* Leaf Area Index
100 !
101 IF (tvg%CPHOTO=='NON' .OR. tvg%CPHOTO=='AGS' .OR. tvg%CPHOTO=='AST') THEN
102  !
103  yrecfm='GD_LAI'
104  ycomment='leaf area index (-)'
105  !
106  CALL write_surf(dgu, u, &
107  hprogram,yrecfm,tgdpe%CUR%XLAI(:),iresp,hcomment=ycomment)
108  !
109 ENDIF
110 !
111 !-------------------------------------------------------------------------------
112 !
113 !* Vegetation fraction
114 !
115 yrecfm='GD_VEG'
116 ycomment='vegetation fraction (-)'
117 !
118  CALL write_surf(dgu, u, &
119  hprogram,yrecfm,tgdpe%CUR%XVEG(:),iresp,hcomment=ycomment)
120 !
121 !* Surface roughness length (without snow)
122 !
123 yrecfm='GD_Z0VEG'
124 ycomment='surface roughness length (without snow) (M)'
125 !
126  CALL write_surf(dgu, u, &
127  hprogram,yrecfm,tgdpe%CUR%XZ0(:),iresp,hcomment=ycomment)
128 !
129 !-------------------------------------------------------------------------------
130 !
131 !* Soil depth for each patch
132 !
133 DO jl=1,SIZE(tgdp%XDG,2)
134  WRITE(yrecfm,fmt='(A5,I1)') 'GD_DG',jl
135  ycomment='soil depth'//' (M)'
136  CALL write_surf(dgu, u, &
137  hprogram,yrecfm,tgdp%XDG(:,jl),iresp,hcomment=ycomment)
138 END DO
139 !
140 !-------------------------------------------------------------------------------
141 ! For Earth System Model
142 IF(lfanocompact.AND..NOT.lprep)THEN
143  CALL end_io_surf_n(hprogram)
144  IF (lhook) CALL dr_hook('WRITE_DIAG_PGD_GRDN_N',1,zhook_handle)
145  RETURN
146 ENDIF
147 !
148 !-------------------------------------------------------------------------------
149 !
150 !* Runoff soil ice depth for each patch
151 !
152 IF(tvg%CHORT=='SGH')THEN
153  yrecfm='GD_DICE'
154  ycomment='soil ice depth for runoff (m)'
155  CALL write_surf(dgu, u, &
156  hprogram,yrecfm,tgdp%XD_ICE(:),iresp,hcomment=ycomment)
157 ENDIF
158 !
159 !-------------------------------------------------------------------------------
160 !
161 !* Fraction of each vegetation type for each patch
162 !
163 DO jl=1,SIZE(tgdp%XVEGTYPE,2)
164  WRITE(ypas,'(I2)') jl
165  ylvlv=adjustl(ypas(:len_trim(ypas)))
166  WRITE(yrecfm,fmt='(A12)') 'GD_VEGTY_P'//ylvlv
167  ycomment='fraction of each vegetation type '//' (-)'
168  CALL write_surf(dgu, u, &
169  hprogram,yrecfm,tgdp%XVEGTYPE(:,jl),iresp,hcomment=ycomment)
170 END DO
171 !-------------------------------------------------------------------------------
172 !
173 !* other surface parameters
174 !
175 yrecfm='GD_RSMIN'
176 ycomment='minimum stomatal resistance (SM-1)'
177  CALL write_surf(dgu, u, &
178  hprogram,yrecfm,tgdp%XRSMIN(:),iresp,hcomment=ycomment)
179 !
180 yrecfm='GD_GAMMA'
181 ycomment='coefficient for RSMIN calculation (-)'
182  CALL write_surf(dgu, u, &
183  hprogram,yrecfm,tgdp%XGAMMA(:),iresp,hcomment=ycomment)
184 !
185 yrecfm='GD_CV'
186 ycomment='vegetation thermal inertia coefficient (-)'
187  CALL write_surf(dgu, u, &
188  hprogram,yrecfm,tgdp%XCV(:),iresp,hcomment=ycomment)
189 !
190 yrecfm='GD_RGL'
191 ycomment='maximum solar radiation usable in photosynthesis (-)'
192  CALL write_surf(dgu, u, &
193  hprogram,yrecfm,tgdp%XRGL(:),iresp,hcomment=ycomment)
194 !
195 yrecfm='GD_EMIS_ISBA'
196 ycomment='surface emissivity (-)'
197  CALL write_surf(dgu, u, &
198  hprogram,yrecfm,tgdpe%CUR%XEMIS(:),iresp,hcomment=ycomment)
199 !
200 yrecfm='GD_WRMAX_CF'
201 ycomment='coefficient for maximum water interception (-)'
202  CALL write_surf(dgu, u, &
203  hprogram,yrecfm,tgdp%XWRMAX_CF(:),iresp,hcomment=ycomment)
204 !
205 !-------------------------------------------------------------------------------
206 !
207 IF (dgmto%LSURF_DIAG_ALBEDO) THEN
208 !
209 !* Soil albedos
210 !
211 !
212  yrecfm='GD_ALBNIR_S'
213  ycomment='soil near-infra-red albedo (-)'
214  CALL write_surf(dgu, u, &
215  hprogram,yrecfm,tgdp%XALBNIR_SOIL(:),iresp,hcomment=ycomment)
216 !
217 !-------------------------------------------------------------------------------
218 !
219  yrecfm='GD_ALBVIS_S'
220  ycomment='soil visible albedo (-)'
221  CALL write_surf(dgu, u, &
222  hprogram,yrecfm,tgdp%XALBVIS_SOIL(:),iresp,hcomment=ycomment)
223 !
224 !-------------------------------------------------------------------------------
225 !
226  yrecfm='GD_ALBUV_S'
227  ycomment='soil UV albedo (-)'
228  CALL write_surf(dgu, u, &
229  hprogram,yrecfm,tgdp%XALBUV_SOIL(:),iresp,hcomment=ycomment)
230 !
231 !-------------------------------------------------------------------------------
232 !
233 !* albedos
234 !
235  yrecfm='GD_ALBNIR_T'
236  ycomment='total near-infra-red albedo (-)'
237  CALL write_surf(dgu, u, &
238  hprogram,yrecfm,tgdpe%CUR%XALBNIR(:),iresp,hcomment=ycomment)
239 !
240 !-------------------------------------------------------------------------------
241 !
242  yrecfm='GD_ALBVIS_T'
243  ycomment='total visible albedo (-)'
244  CALL write_surf(dgu, u, &
245  hprogram,yrecfm,tgdpe%CUR%XALBVIS(:),iresp,hcomment=ycomment)
246 !
247 !-------------------------------------------------------------------------------
248 !
249  yrecfm='GD_ALBUV_T'
250  ycomment='total UV albedo (-)'
251  CALL write_surf(dgu, u, &
252  hprogram,yrecfm,tgdpe%CUR%XALBUV(:),iresp,hcomment=ycomment)
253 !
254 END IF
255 !
256 !-------------------------------------------------------------------------------
257 !
258 ! End of IO
259 !
260  CALL end_io_surf_n(hprogram)
261 IF (lhook) CALL dr_hook('WRITE_DIAG_PGD_GRDN_N',1,zhook_handle)
262 !
263 !
264 END SUBROUTINE write_diag_pgd_grdn_n
subroutine init_io_surf_n(DTCO, DGU, U, HPROGRAM, HMASK, HSCHEME, HACTION)
subroutine write_diag_pgd_grdn_n(DTCO, DGU, U, DGMTO, TGDPE, TGDP, TVG, HPROGRAM)
subroutine end_io_surf_n(HPROGRAM)
Definition: end_io_surfn.F90:6