63 USE modd_assim, ONLY : lassim, cassim_isba, nvar
67 USE modi_init_io_surf_n
69 USE modi_end_io_surf_n
71 USE yomhook
,ONLY : lhook, dr_hook
72 USE parkind1
,ONLY : jprb
85 TYPE(isba_t
),
INTENT(INOUT) :: i
87 CHARACTER(LEN=6),
INTENT(IN) :: hprogram
93 CHARACTER(LEN=1) :: yvar
94 CHARACTER(LEN=12) :: yrecfm
95 CHARACTER(LEN=100):: ycomment
96 CHARACTER(LEN=2) :: ylvl
97 CHARACTER(LEN=20) :: yform
99 INTEGER :: jlayer, jj, idepth, jvar
101 REAL(KIND=JPRB) :: zhook_handle
107 IF (lhook) CALL dr_hook(
'WRITE_DIAG_MISC_ISBA_N',0,zhook_handle)
109 hprogram,
'NATURE',
'ISBA ',
'WRITE')
113 IF (dgmi%LSURF_MISC_BUDGET)
THEN
123 ycomment=
'Halstead coefficient averaged over tile nature (-)'
125 hprogram,yrecfm,dgmi%XAVG_HV(:),iresp,hcomment=ycomment)
131 ycomment=
'snow fraction over ground averaged over tile nature (-)'
133 hprogram,yrecfm,dgmi%XAVG_PSNG(:),iresp,hcomment=ycomment)
136 ycomment=
'snow fraction over vegetation averaged over tile nature (-)'
138 hprogram,yrecfm,dgmi%XAVG_PSNV(:),iresp,hcomment=ycomment)
141 ycomment=
'total snow fraction averaged over tile nature (-)'
143 hprogram,yrecfm,dgmi%XAVG_PSN(:),iresp,hcomment=ycomment)
149 ycomment=
'total albedo over tile nature (-)'
151 hprogram,yrecfm,dgmi%XAVG_ALBT(:),iresp,hcomment=ycomment)
153 IF (i%TSNOW%SCHEME==
'3-L' .OR. i%TSNOW%SCHEME==
'CRO')
THEN
156 ycomment=
'total surface temperature (isba+snow) over tile nature'
158 hprogram,yrecfm,dgi%XAVG_TS(:),iresp,hcomment=ycomment)
161 ycomment=
'total radiative surface temperature (isba+snow) over tile nature'
163 hprogram,yrecfm,i%XTSRAD_NAT(:),iresp,hcomment=ycomment)
170 IF(i%CISBA==
'DIF')
THEN
171 DO jlayer = 1,i%NGROUND_LAYER
172 DO jj=1,
SIZE(i%NWG_LAYER,1)
173 idepth=maxval(i%NWG_LAYER(jj,:),i%NWG_LAYER(jj,:)/=nundef)
174 IF(jlayer>idepth)
THEN
175 dgmi%XAVG_SWI (jj,jlayer) = xundef
176 dgmi%XAVG_TSWI(jj,jlayer) = xundef
182 DO jlayer=1,i%NGROUND_LAYER
184 WRITE(ylvl,
'(I2)') jlayer
186 yrecfm=
'SWI'//adjustl(ylvl(:len_trim(ylvl)))
187 yrecfm=yrecfm(:len_trim(yrecfm))//
'_ISBA'
188 yform=
'(A29,I1.1,A4)'
189 IF (jlayer >= 10) yform=
'(A29,I2.2,A4)'
190 WRITE(ycomment,fmt=yform)
'soil wetness index for layer ',jlayer,
' (-)'
192 hprogram,yrecfm,dgmi%XAVG_SWI(:,jlayer),iresp,hcomment=ycomment)
194 yrecfm=
'TSWI'//adjustl(ylvl(:len_trim(ylvl)))
195 yrecfm=yrecfm(:len_trim(yrecfm))//
'_ISBA'
196 yform=
'(A29,I1.1,A4)'
197 IF (jlayer >= 10) yform=
'(A29,I2.2,A4)'
198 WRITE(ycomment,fmt=yform)
'total swi (liquid+solid) for layer ',jlayer,
' (-)'
200 hprogram,yrecfm,dgmi%XAVG_TSWI(:,jlayer),iresp,hcomment=ycomment)
205 ycomment=
'soil wetness index over the soil column (-)'
207 hprogram,yrecfm,dgmi%XSOIL_SWI(:),iresp,hcomment=ycomment)
210 ycomment=
'total soil wetness index over the soil column (-)'
212 hprogram,yrecfm,dgmi%XSOIL_TSWI(:),iresp,hcomment=ycomment)
214 yrecfm=
'WGTOT_T_ISBA'
215 ycomment=
'total water content (liquid+solid) over the soil column (kg/m2)'
217 hprogram,yrecfm,dgmi%XSOIL_TWG(:),iresp,hcomment=ycomment)
220 ycomment=
'total ice content (solid) over the soil column (kg/m2)'
222 hprogram,yrecfm,dgmi%XSOIL_TWGI(:),iresp,hcomment=ycomment)
225 ycomment=
'total volumetric water content (liquid+solid) over the soil column (m3/m3)'
227 hprogram,yrecfm,dgmi%XSOIL_WG(:),iresp,hcomment=ycomment)
230 ycomment=
'total volumetric ice content (solid) over the soil column (m3/m3)'
232 hprogram,yrecfm,dgmi%XSOIL_WGI(:),iresp,hcomment=ycomment)
234 IF(i%CISBA==
'DIF')
THEN
236 IF (dgmi%LSURF_MISC_DIF)
THEN
238 yrecfm=
'TSWI_D2_ISBA'
239 ycomment=
'total soil wetness index over comparable FR-DG2 reservoir (-)'
241 hprogram,yrecfm,dgmi%XFRD2_TSWI(:),iresp,hcomment=ycomment)
244 ycomment=
'liquid water content over comparable FR-DG2 reservoir (m3/m3)'
246 hprogram,yrecfm,dgmi%XFRD2_TWG(:),iresp,hcomment=ycomment)
249 ycomment=
'ice content over comparable FR-DG2 reservoir (m3/m3)'
251 hprogram,yrecfm,dgmi%XFRD2_TWGI(:),iresp,hcomment=ycomment)
253 yrecfm=
'TSWI_D3_ISBA'
254 ycomment=
'total soil wetness index over comparable FR-DG3 reservoir (-)'
256 hprogram,yrecfm,dgmi%XFRD3_TSWI(:),iresp,hcomment=ycomment)
259 ycomment=
'liquid water content over comparable FR-DG3 reservoir (m3/m3)'
261 hprogram,yrecfm,dgmi%XFRD3_TWG(:),iresp,hcomment=ycomment)
264 ycomment=
'ice content over comparable FR-DG3 reservoir (m3/m3)'
266 hprogram,yrecfm,dgmi%XFRD3_TWGI(:),iresp,hcomment=ycomment)
271 ycomment=
'active layer thickness over permafrost (m)'
273 hprogram,yrecfm,dgmi%XAVG_ALT(:),iresp,hcomment=ycomment)
276 ycomment=
'frozen layer thickness over non-permafrost (m)'
278 hprogram,yrecfm,dgmi%XAVG_FLT(:),iresp,hcomment=ycomment)
286 ycomment=
'Total_snow_reservoir (kg/m2)'
288 hprogram,yrecfm,dgmi%XAVG_TWSNOW(:),iresp,hcomment=ycomment)
291 ycomment=
'Total_snow_depth (m)'
293 hprogram,yrecfm,dgmi%XAVG_TDSNOW(:),iresp,hcomment=ycomment)
296 ycomment=
'Total_snow_temperature (K)'
298 hprogram,yrecfm,dgmi%XAVG_TTSNOW(:),iresp,hcomment=ycomment)
303 IF(i%CRUNOFF==
'SGH '.OR.i%CRUNOFF==
'DT92')
THEN
305 ycomment=
'Soil saturated fraction (-)'
307 hprogram,yrecfm,dgmi%XAVG_FSAT(:),iresp,hcomment=ycomment)
310 IF(i%CRAIN==
'SGH ')
THEN
312 ycomment=
'fraction of the grid cell reached by the rainfall (-)'
314 hprogram,yrecfm,i%XMUF(:),iresp,hcomment=ycomment)
323 ycomment=
'flood fraction over ground averaged over tile nature (-)'
325 hprogram,yrecfm,dgmi%XAVG_FFG(:),iresp,hcomment=ycomment)
328 ycomment=
'flood fraction over vegetation averaged over tile nature (-)'
330 hprogram,yrecfm,dgmi%XAVG_FFV(:),iresp,hcomment=ycomment)
333 ycomment=
'total flood fraction averaged over tile nature (-)'
335 hprogram,yrecfm,dgmi%XAVG_FF(:),iresp,hcomment=ycomment)
338 ycomment=
'Grdi-cell potential flood fraction (-)'
340 hprogram,yrecfm,i%XFFLOOD(:),iresp,hcomment=ycomment)
342 yrecfm=
'PIFLOOD_ISBA'
343 ycomment=
'Grdi-cell Potential_floodplain_infiltration (kg/m2/s)'
345 hprogram,yrecfm,i%XPIFLOOD(:),iresp,hcomment=ycomment)
352 IF(i%CPHOTO/=
'NON'.OR.i%NPATCH>1)
THEN
354 ycomment=
'leaf area index (m2/m2)'
356 hprogram,yrecfm,dgmi%XAVG_LAI(:),iresp,hcomment=ycomment)
365 ycomment=
'grid-cell fraction of water table to rise'
367 hprogram,yrecfm,i%XFWTD(:),iresp,hcomment=ycomment)
370 ycomment=
'water table depth from RRM model or observation (m)'
372 hprogram,yrecfm,i%XWTD(:),iresp,hcomment=ycomment)
380 IF(dgi%LPATCH_BUDGET)
THEN
386 DO jlayer=1,i%NGROUND_LAYER
388 WRITE(ylvl,
'(I2)') jlayer
390 yrecfm=
'SWI'//adjustl(ylvl(:len_trim(ylvl)))
391 yform=
'(A39,I1.1,A4)'
392 IF (jlayer >= 10) yform=
'(A39,I2.2,A4)'
393 WRITE(ycomment,fmt=yform)
'soil wetness index per patch for layer ',jlayer,
' (-)'
395 hprogram,yrecfm,dgmi%XSWI(:,jlayer,:),iresp,hcomment=ycomment)
397 yrecfm=
'TSWI'//adjustl(ylvl(:len_trim(ylvl)))
398 yform=
'(A39,I1.1,A4)'
399 IF (jlayer >= 10) yform=
'(A39,I2.2,A4)'
400 WRITE(ycomment,fmt=yform)
'total swi (liquid+solid) per patch for layer ',jlayer,
' (-)'
402 hprogram,yrecfm,dgmi%XTSWI(:,jlayer,:),iresp,hcomment=ycomment)
406 IF(i%CISBA==
'DIF')
THEN
409 ycomment=
'active layer thickness over permafrost per patch (m)'
411 hprogram,yrecfm,dgmi%XALT(:,:),iresp,hcomment=ycomment)
414 ycomment=
'frozen layer thickness over non-permafrost per patch (m)'
416 hprogram,yrecfm,dgmi%XFLT(:,:),iresp,hcomment=ycomment)
424 ycomment=
'snow fraction per patch over ground '
426 hprogram,yrecfm,dgmi%XDPSNG(:,:),iresp,hcomment=ycomment)
429 ycomment=
'snow fraction per patch over vegetation'
431 hprogram,yrecfm,dgmi%XDPSNV(:,:),iresp,hcomment=ycomment)
434 ycomment=
'total snow fraction per patch'
436 hprogram,yrecfm,dgmi%XDPSN(:,:),iresp,hcomment=ycomment)
441 IF(i%CRUNOFF==
'DT92')
THEN
443 ycomment=
'Soil saturated fraction per patch (-)'
445 hprogram,yrecfm,dgmi%XDFSAT(:,:),iresp,hcomment=ycomment)
454 ycomment=
'flood fraction per patch over ground '
456 hprogram,yrecfm,dgmi%XDFFG(:,:),iresp,hcomment=ycomment)
459 ycomment=
'flood fraction per patch over vegetation'
461 hprogram,yrecfm,dgmi%XDFFV(:,:),iresp,hcomment=ycomment)
464 ycomment=
'total flood fraction per patch'
466 hprogram,yrecfm,dgmi%XDFF(:,:),iresp,hcomment=ycomment)
474 ycomment=
'total albedo per patch'
477 hprogram,yrecfm,dgmi%XALBT(:,:),iresp,hcomment=ycomment)
479 IF (i%TSNOW%SCHEME==
'3-L' .OR. i%TSNOW%SCHEME==
'CRO')
THEN
481 ycomment=
'total surface temperature (isba+snow) per patch'
483 hprogram,yrecfm,dgi%XTS(:,:),iresp,hcomment=ycomment)
485 ycomment=
'total radiative surface temperature (isba+snow) per patch'
487 hprogram,yrecfm,dgi%XTSRAD(:,:),iresp,hcomment=ycomment)
494 ycomment=
'Halstead coefficient per patch'
496 hprogram,yrecfm,dgmi%XHV(:,:),iresp,hcomment=ycomment)
502 ycomment=
'X_Y_WSNOW_TOT (kg/m2) per patch'
504 hprogram,yrecfm,dgmi%XTWSNOW(:,:),iresp,hcomment=ycomment)
507 ycomment=
'X_Y_DSNOW_TOT (m) per patch'
509 hprogram,yrecfm,dgmi%XTDSNOW(:,:),iresp,hcomment=ycomment)
512 ycomment=
'X_Y_TSNOW_TOT (k) per patch'
514 hprogram,yrecfm,dgmi%XTTSNOW(:,:),iresp,hcomment=ycomment)
516 IF (i%TSNOW%SCHEME==
'3-L' .OR. i%TSNOW%SCHEME==
'CRO')
THEN
518 DO jlayer=1,i%TSNOW%NLAYER
520 WRITE(ylvl,
'(I2)') jlayer
522 yrecfm=
'SNOWLIQ'//adjustl(ylvl(:len_trim(ylvl)))
523 yform=
'(A17,I1.1,A4)'
524 IF (jlayer >= 10) yform=
'(A17,I2.2,A4)'
525 WRITE(ycomment,fmt=yform)
'snow liquid water',jlayer,
' (m)'
527 hprogram,yrecfm,dgmi%XSNOWLIQ(:,jlayer,:),iresp,hcomment=ycomment)
529 yrecfm=
'SNOWTEMP'//adjustl(ylvl(:len_trim(ylvl)))
530 yform=
'(A16,I1.1,A4)'
531 IF (jlayer >= 10) yform=
'(A16,I2.2,A4)'
532 WRITE(ycomment,fmt=yform)
'snow temperature',jlayer,
' (K)'
534 hprogram,yrecfm,dgmi%XSNOWTEMP(:,jlayer,:),iresp,hcomment=ycomment)
548 ycomment=
'irrigation threshold per patch'
550 hprogram,yrecfm,dgmi%XSEUIL(:,:),iresp,hcomment=ycomment)
559 hprogram,yrecfm,dgmi%XFAPAR(:,:),iresp,hcomment=ycomment)
564 hprogram,yrecfm,dgmi%XFAPIR(:,:),iresp,hcomment=ycomment)
567 ycomment=
'FAPAR_BS (-)'
569 hprogram,yrecfm,dgmi%XFAPAR_BS(:,:),iresp,hcomment=ycomment)
572 ycomment=
'FAPIR_BS (-)'
574 hprogram,yrecfm,dgmi%XFAPIR_BS(:,:),iresp,hcomment=ycomment)
577 ycomment=
'DFAPARC (-)'
579 hprogram,yrecfm,dgmi%XDFAPARC(:,:),iresp,hcomment=ycomment)
582 ycomment=
'DFAPIRC (-)'
584 hprogram,yrecfm,dgmi%XDFAPIRC(:,:),iresp,hcomment=ycomment)
587 ycomment=
'DLAI_EFFC (m2/m2)'
589 hprogram,yrecfm,dgmi%XDLAI_EFFC(:,:),iresp,hcomment=ycomment)
593 IF (lassim .AND. cassim_isba==
"EKF ")
THEN
596 WRITE(yvar,fmt=
'(I1.1)') jvar
597 yrecfm=
"ANAL_INCR"//yvar
600 hprogram,yrecfm,i%XINCR(:,i%NPATCH*(jvar-1)+1:i%NPATCH*jvar),iresp,hcomment=ycomment)
609 IF (lhook) CALL dr_hook(
'WRITE_DIAG_MISC_ISBA_N',1,zhook_handle)
subroutine init_io_surf_n(DTCO, DGU, U, HPROGRAM, HMASK, HSCHEME, HACTION)
subroutine write_diag_misc_isba_n(DTCO, DGU, U, DGI, DGMI, I, HPROGRAM)
subroutine end_io_surf_n(HPROGRAM)