58 USE yomhook
,ONLY : lhook, dr_hook
59 USE parkind1
,ONLY : jprb
73 CHARACTER(LEN=6),
INTENT(IN) :: hprogram
79 CHARACTER(LEN=12) :: yrecfm
80 CHARACTER(LEN=100):: ycomment
84 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zwork
85 REAL(KIND=JPRB) :: zhook_handle
89 IF (lhook) CALL dr_hook(
'WRITESURF_PGD_ISBA_PAR_N',0,zhook_handle)
93 hprogram,yrecfm,dti%LDATA_VEGTYPE,iresp,hcomment=ycomment)
94 IF (dti%LDATA_VEGTYPE)
THEN
96 ycomment=
'X_Y_DATA_VEGTYPE'
98 hprogram,yrecfm,dti%XPAR_VEGTYPE(:,:),iresp,hcomment=ycomment)
101 IF (dti%LDATA_LAI .OR. dti%LDATA_VEG .OR. dti%LDATA_Z0 .OR. dti%LDATA_EMIS)
THEN
105 hprogram,yrecfm,dti%NTIME,iresp,hcomment=ycomment)
111 hprogram,yrecfm,dti%LDATA_VEG,iresp,hcomment=ycomment)
112 IF (dti%LDATA_VEG)
THEN
114 WRITE(yrecfm,fmt=
'(A7,I2.2)')
'D_VEG_T',jtime
117 hprogram,yrecfm,dti%XPAR_VEG(:,jtime,:),iresp,hcomment=ycomment)
124 hprogram,yrecfm,dti%LDATA_LAI,iresp,hcomment=ycomment)
125 IF (dti%LDATA_LAI)
THEN
127 WRITE(yrecfm,fmt=
'(A7,I2.2)')
'D_LAI_T',jtime
130 hprogram,yrecfm,dti%XPAR_LAI(:,jtime,:),iresp,hcomment=ycomment)
137 hprogram,yrecfm,dti%LDATA_LAIGV,iresp,hcomment=ycomment)
138 IF (dti%LDATA_LAIGV)
THEN
140 WRITE(yrecfm,fmt=
'(A9,I2.2)')
'D_LAIGV_T',jtime
141 ycomment=
'X_Y_D_LAIGV'
143 hprogram,yrecfm,dti%XPAR_LAIGV(:,jtime,:),iresp,hcomment=ycomment)
150 hprogram,yrecfm,dti%LDATA_H_VEG,iresp,hcomment=ycomment)
151 IF (dti%LDATA_H_VEG)
THEN
153 WRITE(yrecfm,fmt=
'(A9,I2.2)')
'D_H_VEG_T',jtime
154 ycomment=
'X_Y_D_H_VEG'
156 hprogram,yrecfm,dti%XPAR_H_VEG(:,jtime,:),iresp,hcomment=ycomment)
163 hprogram,yrecfm,dti%LDATA_GNDLITTER,iresp,hcomment=ycomment)
164 IF (dti%LDATA_GNDLITTER)
THEN
166 WRITE(yrecfm,fmt=
'(A7,I2.2)')
'D_GNDLITTER',jtime
167 ycomment=
'X_Y_D_GNDLITTER'
169 hprogram,yrecfm,dti%XPAR_GNDLITTER(:,jtime,:),iresp,hcomment=ycomment)
176 hprogram,yrecfm,dti%LDATA_Z0,iresp,hcomment=ycomment)
177 IF (dti%LDATA_Z0)
THEN
179 WRITE(yrecfm,fmt=
'(A6,I2.2)')
'D_Z0_T',jtime
182 hprogram,yrecfm,dti%XPAR_Z0(:,jtime,:),iresp,hcomment=ycomment)
189 hprogram,yrecfm,dti%LDATA_Z0LITTER,iresp,hcomment=ycomment)
190 IF (dti%LDATA_Z0LITTER)
THEN
192 WRITE(yrecfm,fmt=
'(A8,I2.2)')
'D_Z0LITTER_T',jtime
193 ycomment=
'X_Y_D_Z0LITTER'
195 hprogram,yrecfm,dti%XPAR_Z0LITTER(:,jtime,:),iresp,hcomment=ycomment)
202 hprogram,yrecfm,dti%LDATA_EMIS,iresp,hcomment=ycomment)
203 IF (dti%LDATA_EMIS)
THEN
205 WRITE(yrecfm,fmt=
'(A8,I2.2)')
'D_EMIS_T',jtime
206 ycomment=
'X_Y_D_EMIS'
208 hprogram,yrecfm,dti%XPAR_EMIS(:,jtime,:),iresp,hcomment=ycomment)
215 hprogram,yrecfm,dti%LDATA_RSMIN,iresp,hcomment=ycomment)
216 IF (dti%LDATA_RSMIN)
THEN
218 ycomment=
'X_Y_D_RSMIN'
220 hprogram,yrecfm,dti%XPAR_RSMIN(:,:),iresp,hcomment=ycomment)
226 hprogram,yrecfm,dti%LDATA_RSMINGV,iresp,hcomment=ycomment)
227 IF (dti%LDATA_RSMINGV)
THEN
229 ycomment=
'X_Y_D_RSMINGV'
231 hprogram,yrecfm,dti%XPAR_RSMINGV(:,:),iresp,hcomment=ycomment)
237 hprogram,yrecfm,dti%LDATA_GAMMA,iresp,hcomment=ycomment)
238 IF (dti%LDATA_GAMMA)
THEN
240 ycomment=
'X_Y_D_GAMMA'
242 hprogram,yrecfm,dti%XPAR_GAMMA(:,:),iresp,hcomment=ycomment)
248 hprogram,yrecfm,dti%LDATA_GAMMAGV,iresp,hcomment=ycomment)
249 IF (dti%LDATA_GAMMAGV)
THEN
251 ycomment=
'X_Y_D_GAMMAGV'
253 hprogram,yrecfm,dti%XPAR_GAMMAGV(:,:),iresp,hcomment=ycomment)
259 hprogram,yrecfm,dti%LDATA_WRMAX_CF,iresp,hcomment=ycomment)
260 IF (dti%LDATA_WRMAX_CF)
THEN
262 ycomment=
'X_Y_D_WRMAX_CF'
264 hprogram,yrecfm,dti%XPAR_WRMAX_CF(:,:),iresp,hcomment=ycomment)
267 yrecfm=
'L_WRMAX_CFGV'
270 hprogram,yrecfm,dti%LDATA_WRMAX_CFGV,iresp,hcomment=ycomment)
271 IF (dti%LDATA_WRMAX_CFGV)
THEN
272 yrecfm=
'D_WRMAX_CFGV'
273 ycomment=
'X_Y_D_WRMAX_CFGV'
275 hprogram,yrecfm,dti%XPAR_WRMAX_CFGV(:,:),iresp,hcomment=ycomment)
281 hprogram,yrecfm,dti%LDATA_RGL,iresp,hcomment=ycomment)
282 IF (dti%LDATA_RGL)
THEN
286 hprogram,yrecfm,dti%XPAR_RGL(:,:),iresp,hcomment=ycomment)
292 hprogram,yrecfm,dti%LDATA_RGLGV,iresp,hcomment=ycomment)
293 IF (dti%LDATA_RGLGV)
THEN
295 ycomment=
'X_Y_D_RGLGV'
297 hprogram,yrecfm,dti%XPAR_RGLGV(:,:),iresp,hcomment=ycomment)
303 hprogram,yrecfm,dti%LDATA_CV,iresp,hcomment=ycomment)
304 IF (dti%LDATA_CV)
THEN
308 hprogram,yrecfm,dti%XPAR_CV(:,:),iresp,hcomment=ycomment)
314 hprogram,yrecfm,dti%LDATA_Z0_O_Z0H,iresp,hcomment=ycomment)
315 IF (dti%LDATA_Z0_O_Z0H)
THEN
317 ycomment=
'X_Y_D_Z0_O_Z0H'
319 hprogram,yrecfm,dti%XPAR_Z0_O_Z0H(:,:),iresp,hcomment=ycomment)
325 hprogram,yrecfm,dti%LDATA_DG,iresp,hcomment=ycomment)
326 IF (dti%LDATA_DG)
THEN
327 ALLOCATE(zwork(
SIZE(dti%XPAR_DG,1),
SIZE(dti%XPAR_DG,3)))
328 DO jlayer=1,
SIZE(dti%XPAR_DG,2)
329 IF (jlayer<10)
WRITE(yrecfm,fmt=
'(A4,I1.1)')
'D_DG',jlayer
330 IF (jlayer>=10)
WRITE(yrecfm,fmt=
'(A4,I2.2)')
'D_DG',jlayer
331 ycomment=
'X_Y_'//yrecfm
332 DO jpatch=1,
SIZE(dti%XPAR_DG,3)
333 zwork(:,jpatch) = dti%XPAR_DG(:,jlayer,jpatch)
336 hprogram,yrecfm,zwork,iresp,hcomment=ycomment)
344 hprogram,yrecfm,dti%LDATA_ROOTFRAC,iresp,hcomment=ycomment)
345 IF (dti%LDATA_ROOTFRAC)
THEN
346 ALLOCATE(zwork(
SIZE(dti%XPAR_ROOTFRAC,1),
SIZE(dti%XPAR_ROOTFRAC,3)))
347 DO jlayer=1,
SIZE(dti%XPAR_ROOTFRAC,2)
348 IF (jlayer<10)
WRITE(yrecfm,fmt=
'(A10,I1.1)')
'D_ROOTFRAC',jlayer
349 IF (jlayer>=10)
WRITE(yrecfm,fmt=
'(A10,I2.2)')
'D_ROOTFRAC',jlayer
350 ycomment=
'X_Y_'//yrecfm
351 DO jpatch=1,
SIZE(dti%XPAR_ROOTFRAC,3)
352 zwork(:,jpatch) = dti%XPAR_ROOTFRAC(:,jlayer,jpatch)
355 hprogram,yrecfm,zwork,iresp,hcomment=ycomment)
362 hprogram,yrecfm,dti%LDATA_ROOTFRACGV,iresp,hcomment=ycomment)
363 IF (dti%LDATA_ROOTFRACGV)
THEN
364 ALLOCATE(zwork(
SIZE(dti%XPAR_ROOTFRACGV,1),
SIZE(dti%XPAR_ROOTFRACGV,3)))
365 DO jlayer=1,
SIZE(dti%XPAR_ROOTFRACGV,2)
366 IF (jlayer<10)
WRITE(yrecfm,fmt=
'(A10,I1.1)')
'D_RTFRACGV',jlayer
367 IF (jlayer>=10)
WRITE(yrecfm,fmt=
'(A10,I2.2)')
'D_RTFRACGV',jlayer
368 ycomment=
'X_Y_'//yrecfm
369 DO jpatch=1,
SIZE(dti%XPAR_ROOTFRACGV,3)
370 zwork(:,jpatch) = dti%XPAR_ROOTFRACGV(:,jlayer,jpatch)
373 hprogram,yrecfm,zwork,iresp,hcomment=ycomment)
378 yrecfm=
'L_GROUND_DPT'
381 hprogram,yrecfm,dti%LDATA_GROUND_DEPTH,iresp,hcomment=ycomment)
382 IF (dti%LDATA_GROUND_DEPTH)
THEN
383 yrecfm=
'D_GROUND_DPT'
384 ycomment=
'X_Y_'//yrecfm
386 hprogram,yrecfm,dti%XPAR_GROUND_DEPTH(:,:),iresp,hcomment=ycomment)
389 yrecfm=
'L_ROOT_DEPTH'
392 hprogram,yrecfm,dti%LDATA_ROOT_DEPTH,iresp,hcomment=ycomment)
393 IF (dti%LDATA_ROOT_DEPTH)
THEN
394 yrecfm=
'D_ROOT_DEPTH'
395 ycomment=
'X_Y_'//yrecfm
397 hprogram,yrecfm,dti%XPAR_ROOT_DEPTH(:,:),iresp,hcomment=ycomment)
400 yrecfm=
'L_RT_DEPTHGV'
403 hprogram,yrecfm,dti%LDATA_ROOT_DEPTHGV,iresp,hcomment=ycomment)
404 IF (dti%LDATA_ROOT_DEPTHGV)
THEN
405 yrecfm=
'D_RT_DEPTHGV'
406 ycomment=
'X_Y_'//yrecfm
408 hprogram,yrecfm,dti%XPAR_ROOT_DEPTHGV(:,:),iresp,hcomment=ycomment)
414 hprogram,yrecfm,dti%LDATA_ROOT_EXTINCTION,iresp,hcomment=ycomment)
415 IF (dti%LDATA_ROOT_EXTINCTION)
THEN
417 ycomment=
'X_Y_'//yrecfm
419 hprogram,yrecfm,dti%XPAR_ROOT_EXTINCTION(:,:),iresp,hcomment=ycomment)
425 hprogram,yrecfm,dti%LDATA_ROOT_EXTINCTIONGV,iresp,hcomment=ycomment)
426 IF (dti%LDATA_ROOT_EXTINCTIONGV)
THEN
428 ycomment=
'X_Y_'//yrecfm
430 hprogram,yrecfm,dti%XPAR_ROOT_EXTINCTIONGV(:,:),iresp,hcomment=ycomment)
436 hprogram,yrecfm,dti%LDATA_ROOT_LIN,iresp,hcomment=ycomment)
437 IF (dti%LDATA_ROOT_LIN)
THEN
439 ycomment=
'X_Y_'//yrecfm
441 hprogram,yrecfm,dti%XPAR_ROOT_LIN(:,:),iresp,hcomment=ycomment)
447 hprogram,yrecfm,dti%LDATA_DICE,iresp,hcomment=ycomment)
448 IF (dti%LDATA_DICE)
THEN
450 ycomment=
'X_Y_'//yrecfm
452 hprogram,yrecfm,dti%XPAR_DICE(:,:),iresp,hcomment=ycomment)
455 yrecfm=
'L_ALBNIR_VEG'
458 hprogram,yrecfm,dti%LDATA_ALBNIR_VEG,iresp,hcomment=ycomment)
459 IF (dti%LDATA_ALBNIR_VEG)
THEN
460 yrecfm=
'D_ALBNIR_VEG'
461 ycomment=
'X_Y_'//yrecfm
463 hprogram,yrecfm,dti%XPAR_ALBNIR_VEG(:,:),iresp,hcomment=ycomment)
466 yrecfm=
'L_ALBVIS_VEG'
469 hprogram,yrecfm,dti%LDATA_ALBVIS_VEG,iresp,hcomment=ycomment)
470 IF (dti%LDATA_ALBVIS_VEG)
THEN
471 yrecfm=
'D_ALBVIS_VEG'
472 ycomment=
'X_Y_'//yrecfm
474 hprogram,yrecfm,dti%XPAR_ALBVIS_VEG(:,:),iresp,hcomment=ycomment)
480 hprogram,yrecfm,dti%LDATA_ALBUV_VEG,iresp,hcomment=ycomment)
481 IF (dti%LDATA_ALBUV_VEG)
THEN
483 ycomment=
'X_Y_'//yrecfm
485 hprogram,yrecfm,dti%XPAR_ALBUV_VEG(:,:),iresp,hcomment=ycomment)
488 yrecfm=
'L_ALBNIR_SOI'
491 hprogram,yrecfm,dti%LDATA_ALBNIR_SOIL,iresp,hcomment=ycomment)
492 IF (dti%LDATA_ALBNIR_SOIL)
THEN
493 yrecfm=
'D_ALBNIR_SOI'
494 ycomment=
'X_Y_'//yrecfm
496 hprogram,yrecfm,dti%XPAR_ALBNIR_SOIL(:,:),iresp,hcomment=ycomment)
499 yrecfm=
'L_ALBVIS_SOI'
502 hprogram,yrecfm,dti%LDATA_ALBVIS_SOIL,iresp,hcomment=ycomment)
503 IF (dti%LDATA_ALBVIS_SOIL)
THEN
504 yrecfm=
'D_ALBVIS_SOI'
505 ycomment=
'X_Y_'//yrecfm
507 hprogram,yrecfm,dti%XPAR_ALBVIS_SOIL(:,:),iresp,hcomment=ycomment)
513 hprogram,yrecfm,dti%LDATA_ALBUV_SOIL,iresp,hcomment=ycomment)
514 IF (dti%LDATA_ALBUV_SOIL)
THEN
516 ycomment=
'X_Y_'//yrecfm
518 hprogram,yrecfm,dti%XPAR_ALBUV_SOIL(:,:),iresp,hcomment=ycomment)
524 hprogram,yrecfm,dti%LDATA_GMES,iresp,hcomment=ycomment)
525 IF (dti%LDATA_GMES)
THEN
527 ycomment=
'X_Y_'//yrecfm
529 hprogram,yrecfm,dti%XPAR_GMES(:,:),iresp,hcomment=ycomment)
535 hprogram,yrecfm,dti%LDATA_BSLAI,iresp,hcomment=ycomment)
536 IF (dti%LDATA_BSLAI)
THEN
538 ycomment=
'X_Y_'//yrecfm
540 hprogram,yrecfm,dti%XPAR_BSLAI(:,:),iresp,hcomment=ycomment)
546 hprogram,yrecfm,dti%LDATA_LAIMIN,iresp,hcomment=ycomment)
547 IF (dti%LDATA_LAIMIN)
THEN
549 ycomment=
'X_Y_'//yrecfm
551 hprogram,yrecfm,dti%XPAR_LAIMIN(:,:),iresp,hcomment=ycomment)
557 hprogram,yrecfm,dti%LDATA_SEFOLD,iresp,hcomment=ycomment)
558 IF (dti%LDATA_SEFOLD)
THEN
560 ycomment=
'X_Y_'//yrecfm
562 hprogram,yrecfm,dti%XPAR_SEFOLD(:,:),iresp,hcomment=ycomment)
568 hprogram,yrecfm,dti%LDATA_GC,iresp,hcomment=ycomment)
569 IF (dti%LDATA_GC)
THEN
571 ycomment=
'X_Y_'//yrecfm
573 hprogram,yrecfm,dti%XPAR_GC(:,:),iresp,hcomment=ycomment)
579 hprogram,yrecfm,dti%LDATA_DMAX,iresp,hcomment=ycomment)
580 IF (dti%LDATA_DMAX)
THEN
582 ycomment=
'X_Y_'//yrecfm
584 hprogram,yrecfm,dti%XPAR_DMAX(:,:),iresp,hcomment=ycomment)
590 hprogram,yrecfm,dti%LDATA_F2I,iresp,hcomment=ycomment)
591 IF (dti%LDATA_F2I)
THEN
593 ycomment=
'X_Y_'//yrecfm
595 hprogram,yrecfm,dti%XPAR_F2I(:,:),iresp,hcomment=ycomment)
601 hprogram,yrecfm,dti%LDATA_STRESS,iresp,hcomment=ycomment)
602 IF (dti%LDATA_STRESS)
THEN
603 ALLOCATE(zwork(
SIZE(dti%LPAR_STRESS,1),
SIZE(dti%LPAR_STRESS,2)))
605 WHERE(dti%LPAR_STRESS) zwork=1.
607 ycomment=
'X_Y_'//yrecfm
609 hprogram,yrecfm,zwork(:,:),iresp,hcomment=ycomment)
616 hprogram,yrecfm,dti%LDATA_H_TREE,iresp,hcomment=ycomment)
617 IF (dti%LDATA_H_TREE)
THEN
619 ycomment=
'X_Y_'//yrecfm
621 hprogram,yrecfm,dti%XPAR_H_TREE(:,:),iresp,hcomment=ycomment)
627 hprogram,yrecfm,dti%LDATA_RE25,iresp,hcomment=ycomment)
628 IF (dti%LDATA_RE25)
THEN
630 ycomment=
'X_Y_'//yrecfm
632 hprogram,yrecfm,dti%XPAR_RE25(:,:),iresp,hcomment=ycomment)
638 hprogram,yrecfm,dti%LDATA_CE_NITRO,iresp,hcomment=ycomment)
639 IF (dti%LDATA_CE_NITRO)
THEN
641 ycomment=
'X_Y_'//yrecfm
643 hprogram,yrecfm,dti%XPAR_CE_NITRO(:,:),iresp,hcomment=ycomment)
649 hprogram,yrecfm,dti%LDATA_CF_NITRO,iresp,hcomment=ycomment)
650 IF (dti%LDATA_CF_NITRO)
THEN
652 ycomment=
'X_Y_'//yrecfm
654 hprogram,yrecfm,dti%XPAR_CF_NITRO(:,:),iresp,hcomment=ycomment)
660 hprogram,yrecfm,dti%LDATA_CNA_NITRO,iresp,hcomment=ycomment)
661 IF (dti%LDATA_CNA_NITRO)
THEN
663 ycomment=
'X_Y_'//yrecfm
665 hprogram,yrecfm,dti%XPAR_CNA_NITRO(:,:),iresp,hcomment=ycomment)
671 hprogram,yrecfm,dti%LDATA_IRRIG,iresp,hcomment=ycomment)
672 IF (dti%LDATA_IRRIG)
THEN
674 WRITE(yrecfm,fmt=
'(A9,I2.2)')
'D_IRRIG_T',jtime
677 hprogram,yrecfm,dti%XPAR_IRRIG(:,jtime,:),iresp,hcomment=ycomment)
684 hprogram,yrecfm,dti%LDATA_WATSUP,iresp,hcomment=ycomment)
685 IF (dti%LDATA_WATSUP)
THEN
687 WRITE(yrecfm,fmt=
'(A10,I2.2)')
'D_WATSUP_T',jtime
688 ycomment=
'X_Y_WATSUP'
690 hprogram,yrecfm,dti%XPAR_WATSUP(:,jtime,:),iresp,hcomment=ycomment)
694 IF (lhook) CALL dr_hook(
'WRITESURF_PGD_ISBA_PAR_N',1,zhook_handle)
subroutine writesurf_pgd_isba_par_n(DGU, U, DTI, HPROGRAM)