SURFEX v8.1
General documentation of Surfex
pgd_topo_index.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_topo_index (DTCO, UG, U, USS, S, OCTI, &
7  HPROGRAM,KLU,HCTI,HCTIFILETYPE,OIMP_CTI)
8 ! ##################################################################
9 !
10 !!**** *PGD_TOPO_INDEX* monitor for computing topographic index statistics used by TOIPMODEL
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 !! B. Decharme Meteo-France
32 !!
33 !! MODIFICATION
34 !! ------------
35 !!
36 !! Original 06/2009
37 !! B. Decharme 05/2013 New topographic index linear regression for Topmodel
38 !!
39 !----------------------------------------------------------------------------
40 !
41 !* 0. DECLARATION
42 ! -----------
43 !
44 !
47 USE modd_surf_atm_n, ONLY : surf_atm_t
48 USE modd_sso_n, ONLY : sso_t
49 USE modd_isba_n, ONLY : isba_s_t
50 !
51 USE modd_surfex_mpi, ONLY : nrank, npio
52 !
53 USE modd_pgd_grid, ONLY : nl
54 !
55 !
56 USE modd_pgdwork, ONLY : xall, xext_all, nsize_all, &
60 !
61 USE modd_surf_par, ONLY : xundef
62 !
63 !
64 USE modd_sgh_par, ONLY : xregp, xrega
65 !
66 USE modi_get_luout
67 USE modi_get_grid_coord
69 USE modi_treat_field
71 USE modi_interpol_field
72 !
73 USE modi_init_io_surf_n
74 USE modi_end_io_surf_n
75 #ifdef SFX_ASC
76 USE modd_io_surf_asc, ONLY : cfilein
77 #endif
78 #ifdef SFX_FA
79 USE modd_io_surf_fa, ONLY : cfilein_fa
80 #endif
81 #ifdef SFX_LFI
82 USE modd_io_surf_lfi, ONLY : cfilein_lfi
83 #endif
84 !
85 USE yomhook ,ONLY : lhook, dr_hook
86 USE parkind1 ,ONLY : jprb
87 !
88 USE modi_abor1_sfx
89 !
90 USE modi_get_surf_mask_n
91 !
92 USE modi_get_type_dim_n
93 !
94 IMPLICIT NONE
95 !
96 !* 0.1 Declaration of arguments
97 ! ------------------------
98 !
99 !
100 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
101 TYPE(surf_atm_grid_t), INTENT(INOUT) :: UG
102 TYPE(surf_atm_t), INTENT(INOUT) :: U
103 TYPE(sso_t), INTENT(INOUT) :: USS
104 !
105 TYPE(isba_s_t), INTENT(INOUT) :: S
106 !
107 LOGICAL, INTENT(INOUT) :: OCTI
108 !
109  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling
110 INTEGER, INTENT(IN) :: KLU ! number of nature points
111  CHARACTER(LEN=28), INTENT(IN) :: HCTI ! topographic index file name
112  CHARACTER(LEN=6), INTENT(IN) :: HCTIFILETYPE ! topographic index file type
113 LOGICAL, INTENT(IN) :: OIMP_CTI ! .true. if topographic index statistics is imposed
114 !
115 !
116 !* 0.2 Declaration of local variables
117 ! ------------------------------
118 !
119 REAL, DIMENSION(:), ALLOCATABLE :: ZLAT, ZDELTA, ZMEAN_INI, &
120  ZTI_MEAN, ZTI_STD, ZTI_SKEW
121 !
122 INTEGER, DIMENSION(:), ALLOCATABLE :: IMASK
123 !
124 LOGICAL :: LREG,LREG10,LREG2
125 !
126 INTEGER :: IFULL ! total number of points
127 INTEGER :: I_DIM
128 INTEGER :: IRET ! error code
129 INTEGER :: ILUOUT ! output listing logical unit
130 !
131  CHARACTER(LEN=6 ) :: YFILETYPE, YSCHEME, YSUBROUTINE
132  CHARACTER(LEN=20) :: YFIELD ! Name of the field.
133 REAL(KIND=JPRB) :: ZHOOK_HANDLE
134 !
135 !-------------------------------------------------------------------------------
136 !
137 !* 1. Initializations
138 ! ---------------
139 !
140 IF (lhook) CALL dr_hook('PGD_TOPO_INDEX',0,zhook_handle)
141 IF(len_trim(hcti)==0)THEN
142 !
143  ALLOCATE(s%XTI_MIN (0))
144  ALLOCATE(s%XTI_MAX (0))
145  ALLOCATE(s%XTI_MEAN(0))
146  ALLOCATE(s%XTI_STD (0))
147  ALLOCATE(s%XTI_SKEW(0))
148 !
149 !-------------------------------------------------------------------------------
150 ELSE
151 !-------------------------------------------------------------------------------
152 !
153  octi = .true.
154 !
155 !* 2. Find LUOUT
156 ! ----------
157 !
158  CALL get_luout(hprogram,iluout)
159 !
160  WRITE(iluout,*) '*****************************************'
161  WRITE(iluout,*) 'Comput Topographic indexes for TOPMODEL '
162  WRITE(iluout,*) '*****************************************'
163 !
164 !* 3. Allocations of statistics arrays
165 ! --------------------------------
166 !
167  ALLOCATE(s%XTI_MIN (klu))
168  ALLOCATE(s%XTI_MAX (klu))
169  ALLOCATE(s%XTI_MEAN(klu))
170  ALLOCATE(s%XTI_STD (klu))
171  ALLOCATE(s%XTI_SKEW(klu))
172 !
173  s%XTI_MIN (:) = xundef
174  s%XTI_MAX (:) = xundef
175  s%XTI_MEAN(:) = xundef
176  s%XTI_STD (:) = xundef
177  s%XTI_SKEW(:) = xundef
178 !
179 !-------------------------------------------------------------------------------
180 !
181 !* 4. Allocations of work arrays
182 ! --------------------------
183 !
184  CALL get_type_dim_n(dtco, u, 'NATURE',i_dim)
185  IF (i_dim/=klu) THEN
186  WRITE(iluout,*)'PGD_TOPO_INDEX: Wrong dimension of MASK: ',i_dim,klu
187  CALL abor1_sfx('PGD_TOPO_INDEX: WRONG DIMENSION OF MASK')
188  ENDIF
189 !
190  ALLOCATE(imask(klu))
191  ifull=0
192  CALL get_surf_mask_n(dtco, u, &
193  'NATURE',klu,imask,ifull,iluout)
194  IF (ifull/=nl) THEN
195  WRITE(iluout,*)'PGD_TOPO_INDEX: Wrong dimension of FULL: ',ifull,nl
196  CALL abor1_sfx('PGD_TOPO_INDEX: WRONG DIMENSION OF FULL')
197  ENDIF
198 !
199  ALLOCATE(xmin_work(ifull))
200  ALLOCATE(xmax_work(ifull))
201  ALLOCATE(xmean_work(ifull))
202  ALLOCATE(xstd_work(ifull))
203  ALLOCATE(xskew_work(ifull))
204 !
205  xmin_work(:)=xundef
206  xmax_work(:)=xundef
207  xmean_work(:)=xundef
208  xstd_work(:)=xundef
209  xskew_work(:)=xundef
210 !
211 !-------------------------------------------------------------------------------
212 !
213 !* 5. Use of imposed field
214 ! --------------------
215 !
216  IF (oimp_cti) THEN
217 !
218  yfiletype=hctifiletype
219  IF(hctifiletype=='NETCDF')THEN
220  CALL abor1_sfx('Use another format than netcdf for cti input file with LIMP_CTI')
221  ELSE
222 #ifdef SFX_ASC
223  cfilein = adjustl(adjustr(hcti)//'.txt')
224 #endif
225 #ifdef SFX_FA
226  cfilein_fa = adjustl(adjustr(hcti)//'.fa')
227 #endif
228 #ifdef SFX_LFI
229  cfilein_lfi = adjustl(hcti)
230 #endif
231  CALL init_io_surf_n(dtco, u, &
232  yfiletype,'FULL ','SURF ','READ ')
233  ENDIF
234 !
235  CALL read_surf(yfiletype,'TI_MIN' ,xmin_work ,iret)
236  CALL read_surf(yfiletype,'TI_MAX' ,xmax_work ,iret)
237  CALL read_surf(yfiletype,'TI_MEAN',xmean_work,iret)
238  CALL read_surf(yfiletype,'TI_STD' ,xstd_work ,iret)
239  CALL read_surf(yfiletype,'TI_SKEW',xskew_work,iret)
240 !
241  CALL end_io_surf_n(yfiletype)
242 !
243  ELSE
244 !
245 !-------------------------------------------------------------------------------
246 !
247 !* 6. Use of cti file
248 ! ---------------
249 !
250  ALLOCATE(nsize_all(u%NDIM_FULL,1))
251  ALLOCATE(xext_all(u%NDIM_FULL,2))
252  ALLOCATE(xall(u%NDIM_FULL,3,1))
253 !
254  nsize_all(:,1) = 0.
255  xext_all (:,1) = -99999.
256  xext_all (:,2) = 99999.
257  xall (:,:,1) = 0.
258 !
259  xmax_work(:) =-99999.
260 !
261  yfield = 'CTI'
262  yscheme = 'SURF '
263  ysubroutine = 'A_CTI '
264  CALL treat_field(ug, u, uss, &
265  hprogram,yscheme,hctifiletype,ysubroutine,hcti,yfield)
266 !
267 !-------------------------------------------------------------------------------
268 !
269 !* 7. Coherence
270 ! ---------
271 !
272  WHERE(nsize(:,1)<36.OR.xstd_work(:)==0.0)
273  xmin_work(:) = xundef
274  xmax_work(:) = xundef
275  xmean_work(:) = xundef
276  xstd_work(:) = xundef
277  xskew_work(:) = xundef
278  nsize(:,1) = 0
279  ENDWHERE
280 !
281  WHERE(u%XNATURE(:)>0.0.AND.xskew_work(:)<=-8.0)
282  xmin_work(:) = xundef
283  xmax_work(:) = xundef
284  xmean_work(:) = xundef
285  xstd_work(:) = xundef
286  xskew_work(:) = xundef
287  nsize(:,1) = 0
288  ENDWHERE
289 !
290  WHERE(u%XNATURE(:)==0.)
291  xmin_work(:) = xundef
292  xmax_work(:) = xundef
293  xmean_work(:) = xundef
294  xstd_work(:) = xundef
295  xskew_work(:) = xundef
296  nsize(:,1) = 0
297  ENDWHERE
298 !
299 !-------------------------------------------------------------------------------
300 !
301 !* 8. Regression 1km to 100m or 2m
302 ! ----------------------------
303 !
304  IF(hctifiletype=='DIRECT')THEN
305 !
306 ! Topographic index linear regression for Topmodel if topo ref at 1km
307 ! pan and king (2012) 1km to 2m
308 !
309  CALL ctireg(lreg,lreg10,lreg2)
310 !
311  IF(all(xmean_work(:)==xundef))lreg=.false.
312 !
313  IF(lreg)THEN
314 !
315  WRITE(iluout,*)'WITH DIF, TOPO INDEX USED REGRESSIONS OF '
316 !
317  ALLOCATE(zdelta(ifull))
318  ALLOCATE(zmean_ini(ifull))
319  ALLOCATE(zti_mean(ifull))
320  ALLOCATE(zti_std(ifull))
321  ALLOCATE(zti_skew(ifull))
322 !
323  zmean_ini(:)=xmean_work(:)
324  zti_mean(:)=xundef
325  zti_std(:)=xundef
326  zti_skew(:)=xundef
327  zdelta(:)= 0.0
328 !
329 ! 1km to 10m
330  IF(lreg10)THEN
331  WRITE(iluout,*)' PAN AND KING (2012) 1km to 10m '
332  WHERE(xmean_work(:)/=xundef.AND.(xmax_work(:)-xmin_work(:))>0.2)
333  zti_mean(:)= 1.136+0.657*xmean_work(:)-0.640*xstd_work(:)+0.053*xskew_work(:)
334  zti_std(:)=-0.128+0.187*xmean_work(:)+0.168*xstd_work(:)-0.261*xskew_work(:)
335  zti_skew(:)= 3.768-0.246*xmean_work(:)+0.317*xstd_work(:)+0.222*xskew_work(:)
336  ENDWHERE
337  xmean_work(:)=zti_mean(:)
338  xstd_work(:)=zti_std(:)
339  xskew_work(:)=zti_skew(:)
340  ELSE
341  zti_mean(:)=xmean_work(:)
342  zti_std(:)=xstd_work(:)
343  zti_skew(:)=xskew_work(:)
344  ENDIF
345 !
346 ! 10m to 2m
347  IF(lreg2)THEN
348  WRITE(iluout,*)' PAN AND KING (2012) 10m to 2m '
349  WHERE(xmean_work(:)/=xundef.AND.(xmax_work(:)-xmin_work(:))>0.2)
350  xmean_work(:)=-3.826+1.402*zti_mean(:)-0.434*zti_std(:)+0.328*zti_skew(:)
351  xstd_work(:)= 3.655-0.209*zti_mean(:)+0.440*zti_std(:)-0.091*zti_skew(:)
352  xskew_work(:)= 2.266-0.023*zti_mean(:)-0.245*zti_std(:)-0.240*zti_skew(:)
353  ENDWHERE
354  ENDIF
355 !
356  WHERE(xmean_work(:)/=xundef.AND.(xmax_work(:)-xmin_work(:))>0.2)
357  xstd_work(:)=max(0.2,xstd_work(:))
358  xskew_work(:)=max(0.2,xskew_work(:))
359  ENDWHERE
360 !
361  WHERE(xmean_work(:)>0.0.AND.xmean_work(:)/=xundef)
362  zdelta(:)= (xmean_work(:)-zmean_ini(:))
363  xmin_work(:)= max( 0.0,xmin_work(:)+zdelta(:))
364  xmax_work(:)= max(xmin_work(:)+0.2,xmax_work(:)+zdelta(:))
365  ELSEWHERE
366  xmin_work(:) = xundef
367  xmax_work(:) = xundef
368  xmean_work(:) = xundef
369  xstd_work(:) = xundef
370  xskew_work(:) = xundef
371  nsize(:,1) = 0
372  ENDWHERE
373 !
374  DEALLOCATE(zdelta )
375  DEALLOCATE(zmean_ini)
376  DEALLOCATE(zti_mean )
377  DEALLOCATE(zti_std )
378  DEALLOCATE(zti_skew )
379 !
380  ENDIF
381 !
382  ENDIF
383 !
384 !-------------------------------------------------------------------------------
385 !
386 !* 10. Interpolation if some points are not initialized (no data for these points)
387 ! ------------------------------------------------
388 !
389  WRITE(iluout,*) '*********************************************'
390  WRITE(iluout,*) 'Interpolation if some index not initialized '
391  WRITE(iluout,*) '*********************************************'
392 !
393  ALLOCATE(zlat(nl))
394  CALL get_grid_coord(ug%G%CGRID, ug%G%NGRID_PAR, ug%G%XGRID_PAR, u%NSIZE_FULL, &
395  iluout,py=zlat)
396 !
397  WHERE (u%XNATURE(:)==0..AND.nsize(:,1)==0) nsize(:,1) = -1
398 !
399 ! No Antarctic
400  WHERE(u%XNATURE(:)>0..AND.zlat(:)<-60.)
401  xmin_work(:) = xundef
402  xmax_work(:) = xundef
403  xmean_work(:) = xundef
404  xstd_work(:) = xundef
405  xskew_work(:) = xundef
406  nsize(:,1) = -1
407  ENDWHERE
408 !
409  IF(all(nsize(:,1)==0.0))nsize(:,1)=-1
410 !
411  CALL interpol_field(ug, u, hprogram,iluout,nsize(:,1),xmin_work(:),'TI_MIN ',pdef=xundef,knpts=1)
412  CALL interpol_field(ug, u, hprogram,iluout,nsize(:,1),xmax_work(:),'TI_MAX ',pdef=xundef,knpts=1)
413  CALL interpol_field(ug, u, hprogram,iluout,nsize(:,1),xmean_work(:),'TI_MEAN',pdef=xundef,knpts=1)
414  CALL interpol_field(ug, u, hprogram,iluout,nsize(:,1),xstd_work(:),'TI_STD ',pdef=xundef,knpts=1)
415  CALL interpol_field(ug, u, hprogram,iluout,nsize(:,1),xskew_work(:),'TI_SKEW',pdef=xundef,knpts=1)
416 !
417  DEALLOCATE(nsize )
418  DEALLOCATE(xsumval )
419  DEALLOCATE(zlat )
420 !
421  ENDIF
422 !-------------------------------------------------------------------------------
423 !
424 !* 11. Asign parameters
425 ! ----------------
426 !
427  CALL pack_same_rank(imask,xmin_work ,s%XTI_MIN)
428  CALL pack_same_rank(imask,xmax_work ,s%XTI_MAX)
429  CALL pack_same_rank(imask,xmean_work,s%XTI_MEAN)
430  CALL pack_same_rank(imask,xstd_work ,s%XTI_STD)
431  CALL pack_same_rank(imask,xskew_work,s%XTI_SKEW)
432 !
433 !-------------------------------------------------------------------------------
434 !
435  DEALLOCATE(xmin_work )
436  DEALLOCATE(xmax_work )
437  DEALLOCATE(xmean_work)
438  DEALLOCATE(xstd_work )
439  DEALLOCATE(xskew_work)
440 !
441  WRITE(iluout,*) '******************************'
442  WRITE(iluout,*) 'End Comput Topographic indexes'
443  WRITE(iluout,*) '******************************'
444 !
445 ENDIF
446 !
447 IF (lhook) CALL dr_hook('PGD_TOPO_INDEX',1,zhook_handle)
448 !-------------------------------------------------------------------------------
449 !
450 CONTAINS
451 !
452 SUBROUTINE ctireg(OREG,OREG10,OREG2)
453 !
454 !* 0. DECLARATION
455 ! -----------
456 !
457 USE modi_open_namelist
458 USE modi_close_namelist
459 !
460 USE yomhook ,ONLY : lhook, dr_hook
461 USE parkind1 ,ONLY : jprb
462 !
463 IMPLICIT NONE
464 !
465 !* 0.1 Declaration of arguments
466 ! ------------------------
467 !
468 LOGICAL, INTENT(OUT) :: OREG,OREG10,OREG2 ! regression key
469 !
470 !* 0.2 Declaration of local variables
471 ! ------------------------------
472 !
473 REAL :: ZDLAT ! latitude mesh in the data file
474 REAL :: ZDLON ! longitude mesh in the data file
475 REAL :: ZGLBLATMIN ! minimum latitude of data box in the file
476 REAL :: ZGLBLONMIN ! minimum longitude of data box in the file
477 REAL :: ZGLBLATMAX ! maximum latitude of data box in the file
478 REAL :: ZGLBLONMAX ! maximum longitude of data box in the file
479 !
480  CHARACTER(LEN=28) :: YFILEHDR ! Name of the field file header
481 !
482 INTEGER :: INBLAT
483 INTEGER :: INBLON
484 INTEGER :: IGLB
485 INTEGER :: JHEAD ! loop control
486 INTEGER :: ININDEX ! index of character 'N' in YSTRING1
487 INTEGER :: ISINDEX ! index of character 'S' in YSTRING1
488 INTEGER :: IEINDEX ! index of character 'E' in YSTRING1
489 INTEGER :: IWINDEX ! index of character 'W' in YSTRING1
490 REAL, DIMENSION(7) :: ZVAL ! values of the head data
491 INTEGER :: IHEAD ! index of the data in the array ZVAL
492  CHARACTER(LEN=100) :: YSTRING ! total string in the head
493  CHARACTER(LEN=100) :: YSTRING1 ! string less the begining line descriptor
494  CHARACTER(LEN=100) :: YVAL ! absolute value of the data of the line
495 INTEGER :: IPOINT ! index of '.' in the string YVAL
496 INTEGER :: ILENGTH ! length of the string YVAL
497 INTEGER :: IFRACLENGTH! length of the fractional part in string YVAL
498  CHARACTER(LEN=2) :: YLENGTH ! length of the string YVAL
499  CHARACTER(LEN=2) :: YFRACLENGTH! length of the fractional part in string YVAL
500  CHARACTER(LEN=10) :: YINTERNALFORMAT ! format to read YVAL in real ZVAL
501 !
502 REAL :: Z1000M, Z100M, Z10M
503 !
504 REAL(KIND=JPRB) :: ZHOOK_HANDLE
505 !
506 !-------------------------------------------------------------------------------
507 !
508 IF (lhook) CALL dr_hook('PGD_TOPO_INDEX:CTIREG',0,zhook_handle)
509 !
510 oreg =.false.
511 oreg10=.false.
512 oreg2 =.false.
513 !
514 iglb=11
515 yfilehdr =adjustl(adjustr(hcti)//'.hdr')
516  CALL open_namelist(hprogram,iglb,yfilehdr)
517 !
518 !* 1. Line of comments
519 ! ----------------
520 !
521 READ (iglb,'(A100)',end=99) ystring
522 !
523 !-------------------------------------------------------------------------------
524 !
525 !* 2. Other lines
526 ! -----------
527 !
528 DO jhead=1,7
529  READ (iglb,'(A100)',end=99) ystring
530  ystring=adjustl(ystring)
531 !
532 !* 2.1 Selection of the line
533 ! ---------------------
534 !
535  SELECT CASE (ystring(1:5))
536  CASE('cutva')
537  ihead=1
538  ystring1=ystring(10:100)
539  CASE('nodat')
540  ihead=1
541  ystring1=ystring(8:100)
542  CASE('north')
543  ihead=2
544  ystring1=ystring(7:100)
545  CASE('south')
546  ihead=3
547  ystring1=ystring(7:100)
548  CASE('east:')
549  ihead=4
550  ystring1=ystring(6:100)
551  CASE('west:')
552  ihead=5
553  ystring1=ystring(6:100)
554  CASE('rows:')
555  ihead=6
556  ystring1=ystring(6:100)
557  CASE('cols:')
558  ihead=7
559  ystring1=ystring(6:100)
560  END SELECT
561 !
562 !* 2.2 Test on presence of geographical descritor (N, E, S or W)
563 ! ---------------------------------------------------------
564 !
565  inindex=index(ystring1,'N')
566  isindex=index(ystring1,'S')
567  ieindex=index(ystring1,'E')
568  iwindex=index(ystring1,'W')
569  yval=adjustl(ystring1)
570  IF (inindex/=0) yval=adjustl(ystring1(1:inindex-1))
571  IF (isindex/=0) yval='-'//adjustl(ystring1(1:isindex-1))
572  IF (ieindex/=0) yval=adjustl(ystring1(1:ieindex-1))
573  IF (iwindex/=0) yval='-'//adjustl(ystring1(1:iwindex-1))
574 !
575 !* 2.3 Transformation of the data in real
576 ! ----------------------------------
577 !
578  ipoint=index(yval,'.')
579  IF (ipoint==0) yval=adjustl(adjustr(yval)//'.')
580 !
581 !* 2.4 Definition of the format of the data
582 ! ------------------------------------
583 !
584  ilength=len_trim(adjustl(adjustr(yval)))
585  ifraclength=ilength-index(yval,'.')
586  WRITE(ylength,'(I2)') ilength
587  WRITE(yfraclength,'(I2)') ifraclength
588  yinternalformat='(F'//ylength//'.'//yfraclength//')'
589 !
590 !* 2.5 Data definition
591 ! ---------------
592 !
593  READ(yval,adjustl(yinternalformat)) zval(ihead)
594 !
595 ENDDO
596 !
597 !-------------------------------------------------------------------------------
598 !
599 !* 3. Initialization of arguments, longitudes and latitudes
600 ! -----------------------------------------------------
601 !
602 zglblatmax=zval(2)
603 zglblatmin=zval(3)
604 zglblonmin=zval(5)
605 zglblonmax=zval(4)+nint((zval(5)-zval(4)+180.+1.e-10)/360.)*360.
606 inblat=nint(zval(6))
607 inblon=nint(zval(7))
608 !
609 zdlat=(zglblatmax-zglblatmin)/inblat
610 zdlon=(zglblonmax-zglblonmin)/inblon
611 !
612 z1000m = 30./3600. !(minute arc to m)
613 z100m = z1000m/10.
614 z10m = z1000m/100.
615 !
616 IF(sqrt(zdlat*zdlon)>z100m)THEN
617  oreg =.true.
618  oreg10=.true.
619  oreg2 =.true.
620 ENDIF
621 !
622 IF(sqrt(zdlat*zdlon)>=z10m.AND.sqrt(zdlat*zdlon)<=z100m)THEN
623  oreg =.true.
624  oreg10=.false.
625  oreg2 =.true.
626 ENDIF
627 !
628  CALL close_namelist(hprogram,iglb)
629 !
630 IF (lhook) CALL dr_hook('PGD_TOPO_INDEX:CTIREG',1,zhook_handle)
631 RETURN
632 99 CONTINUE
633  CALL abor1_sfx('CTIREG: PB READING TOPO INDEX FILE HEADER')
634 IF (lhook) CALL dr_hook('PGD_TOPO_INDEX:CTIREG',1,zhook_handle)
635 !
636 END SUBROUTINE ctireg
637 !
638 !-------------------------------------------------------------------------------
639 END SUBROUTINE pgd_topo_index
subroutine get_type_dim_n(DTCO, U, HTYPE, KDIM)
real, parameter xrega
subroutine pgd_topo_index(DTCO, UG, U, USS, S, OCTI, HPROGRAM, KLU, HCTI, HCTIFILETYPE, OIMP_CTI
integer, dimension(:,:), allocatable nsize_all
subroutine ctireg(OREG, OREG10, OREG2)
real, dimension(:,:,:), allocatable xall
real, parameter xregp
real, dimension(:), allocatable xmax_work
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:7
real, parameter xundef
subroutine get_surf_mask_n(DTCO, U, HTYPE, KDIM, KMASK, KLU, KLUOUT)
integer, parameter jprb
Definition: parkind1.F90:32
real, dimension(:,:), allocatable xsumval
subroutine get_grid_coord(HGRID_IN, KGRID_PAR_IN, PGRID_PAR_IN, K
subroutine close_namelist(HPROGRAM, KLUNAM)
real, dimension(:), allocatable xmean_work
subroutine end_io_surf_n(HPROGRAM)
Definition: end_io_surfn.F90:7
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
real, dimension(:), allocatable xskew_work
logical lhook
Definition: yomhook.F90:15
integer, dimension(:,:), allocatable nsize
real, dimension(:,:), allocatable xext_all
real, dimension(:), allocatable xmin_work
subroutine treat_field(UG, U, USS, HPROGRAM, HSCHEME, HFILETYPE, HSUBROUTINE, HFILENAME, HFIELD, PPGDARRAY)
Definition: treat_field.F90:10
subroutine open_namelist(HPROGRAM, KLUNAM, HFILE)
character(len=28), save cfilein
character(len=28), save cfilein_fa
subroutine init_io_surf_n(DTCO, U, HPROGRAM, HMASK, HSCHEME, HACTION
subroutine interpol_field(UG, U, HPROGRAM, KLUOUT, KCODE, PFIELD, HFIELD, PDE
ERROR in index
Definition: ecsort_shared.h:90
real, dimension(:), allocatable xstd_work
character(len=28), save cfilein_lfi