SURFEX v8.1
General documentation of Surfex
interpol_npts.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 interpol_npts (UG, U, HPROGRAM,KLUOUT,KNPTS,KCODE,PX,PY,PFIELD,KNEAR_NBR)
7 ! #########################################################
8 !
9 !!**** *INTERPOL_NPTS* interpolates with ###ine f77 programs a 2D field
10 !! from all grid points valid values
11 !!
12 !! PURPOSE
13 !! -------
14 !!
15 !! The points are all on only one grid (defined with the coordinates
16 !! of all the points). The code to apply for each point is:
17 !!
18 !! KCODE>0 : data point (with field valid for interpolation)
19 !! KCODE=-1: point to ignore
20 !! KCODE=0 : point to interpolate
21 !!
22 !!
23 !!
24 !! METHOD
25 !! ------
26 !!
27 !! EXTERNAL
28 !! --------
29 !!
30 !! IMPLICIT ARGUMENTS
31 !! ------------------
32 !!
33 !!
34 !!
35 !! REFERENCE
36 !! ---------
37 !!
38 !! AUTHOR
39 !! ------
40 !!
41 !! V. Masson Meteo-France
42 !!
43 !! MODIFICATION
44 !! ------------
45 !!
46 !! Original 03/2004
47 !! Modification
48 !! B. Decharme 2014 scan all point case if gaussien grid or NHALO = 0
49 !----------------------------------------------------------------------------
50 !
51 !* 0. DECLARATION
52 ! -----------
53 !
54 !
56 USE modd_surf_atm_n, ONLY : surf_atm_t
57 !
58 USE modd_surfex_omp, ONLY : nblock
60 USE modd_surf_par, ONLY : xundef
61 !
64 USE modi_get_near_meshes
65 USE modi_sum_on_all_procs
66 !
67 USE yomhook ,ONLY : lhook, dr_hook
68 USE parkind1 ,ONLY : jprb
69 !
70 #ifdef SFX_MNH
71 USE modd_io_ll, ONLY : isp, isnproc
72 USE modd_var_ll, ONLY : nmnh_comm_world
73 USE mode_gather_ll
74 USE mode_fd_ll, ONLY : getfd, fd_ll
75 USE mode_tools_ll, ONLY : get_globaldims_ll
76 USE modd_parameters_ll,ONLY : jphext
77 !
78 USE modd_io_surf_mnh, ONLY : niu, nju
79 #endif
80 !
81 IMPLICIT NONE
82 !
83 #if defined(SFX_MPI) || defined(SFX_MNH)
84 include "mpif.h"
85 #endif
86 !
87 !* 0.1 Declaration of arguments
88 ! ------------------------
89 !
90 !
91 TYPE(surf_atm_grid_t), INTENT(INOUT) :: UG
92 TYPE(surf_atm_t), INTENT(INOUT) :: U
93 !
94  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! host program
95 INTEGER, INTENT(IN) :: KLUOUT ! output listing
96 INTEGER, INTENT(IN) :: KNPTS ! number of points to interpolate with
97 INTEGER,DIMENSION(:), INTENT(INOUT) :: KCODE ! code for each point
98  ! >0 point used for interpolation
99  ! 0 point to interpolate
100  ! -1 point not used
101  ! -2 point not used
102 ! ! -3 if spline is no computed
103 ! ! for this point
104 REAL, DIMENSION(:), INTENT(IN) :: PX ! x of each grid mesh.
105 REAL, DIMENSION(:), INTENT(IN) :: PY ! y of each grid mesh.
106 REAL, DIMENSION(:,:),INTENT(INOUT) :: PFIELD ! pgd field on grid mesh.
107 INTEGER, INTENT(IN) :: KNEAR_NBR
108 !
109 !* 0.2 Declaration of local variables
110 ! ------------------------------
111 !
112 REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZFIELD, ZFIELD2
113 REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZFIELD3
114 REAL, DIMENSION(:,:), ALLOCATABLE :: ZNDIST ! 3 nearest square distances
115 REAL, DIMENSION(:,:), ALLOCATABLE :: ZNVAL ! 3 corresponding field values
116 REAL, DIMENSION(:), ALLOCATABLE :: ZX, ZY
117 REAL, DIMENSION(:), ALLOCATABLE :: ZDIST ! square distance between two interpolating and interpolated points
118 !
119 INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: ININD0, ININD_ALL ! 3 corresponding field values
120 INTEGER, DIMENSION(:,:), ALLOCATABLE :: ININD
121 INTEGER, DIMENSION(:), ALLOCATABLE :: IINDEX ! list of index to scan
122 INTEGER, DIMENSION(:), ALLOCATABLE :: ISIZE, ISIZE_TOT
123 !
124 REAL :: ZSUM
125 INTEGER :: IP, ICPT, IL1, JL, JP, JK, JKK
126 !
127 INTEGER :: ICOUNT, IL2 ! counter
128 INTEGER :: INPTS
129 INTEGER :: INFOMPI, IDIM_FULL, INEAR_NBR, IOLD
130 !
131 #if defined(SFX_MPI) || defined(SFX_MNH)
132 INTEGER, DIMENSION(MPI_STATUS_SIZE) :: ISTATUS
133 #endif
134 !
135 #ifdef SFX_MNH
136 TYPE(fd_ll), POINTER :: TZFD
137 !
138 REAL, DIMENSION(:,:), ALLOCATABLE :: ZCOORD_2D, ZCOORD_2D_ALL
139 INTEGER, DIMENSION(:,:), ALLOCATABLE :: ISIZE_2D, ISIZE_2D_ALL, INUM_2D, INUM_2D_ALL, IINDEX_2D, IINDEX_2D_ALL
140 INTEGER, DIMENSION(:), ALLOCATABLE :: INUM_1D, IINDEX_1D, INUM_TOT, IINDEX_TOT
141 INTEGER :: IIMAX, IJMAX, IIU, IJU, JI
142 INTEGER :: IRANK_SAVE, IPROC_SAVE, IPIO_SAVE, ICOMM_SAVE
143 #endif
144 !
145 REAL(KIND=JPRB) :: ZHOOK_HANDLE
146 !-------------------------------------------------------------------------------
147 !
148 IF (lhook) CALL dr_hook('INTERPOL_NPTS_1',0,zhook_handle)
149 !
150 iold = 0
151 !NHALO /= 0
152 IF ( knear_nbr/=u%NDIM_FULL ) THEN
153  iold = 1
154 ELSE
155 ! case mesonh and NHALO = 0
156 #ifdef SFX_MNH
157  iold = 2
158 ! case NHALO = 0
159 #else
160  iold = 1
161 #endif
162 ENDIF
163 !
164 IF (iold==2) THEN
165  !
166 #ifdef SFX_MNH
167  !physical dimensions of the task
168  CALL get_dim_phys_ll('B',iiu,iju)
169  ! total dimensions
170  CALL get_globaldims_ll(iimax,ijmax)
171  idim_full = (iimax) * (ijmax)
172  inear_nbr = idim_full
173  !
174  tzfd=>getfd(nmnh_comm_world)
175  !
176  ! on sauve les infos de bases
177  irank_save = nrank
178  iproc_save = nproc
179  ipio_save = npio
180  icomm_save = ncomm
181  !
182  ! on met les infos de mésonh
183  nrank = isp-1
184  nproc = isnproc
185  npio = tzfd%OWNER-1
186  ncomm = tzfd%COMM
187  !
188  !KCODE to 2D
189  ALLOCATE(isize_2d(iiu+2*jphext,iju+2*jphext))
190  isize_2d(:,:) = -1
191  isize_2d(1+jphext:iiu+jphext,1+jphext:iju+jphext) = reshape(kcode, (/ iiu,iju /) )
192  ! tasks to whole domaine
193  ALLOCATE(isize_2d_all(iimax+2*jphext,ijmax+2*jphext))
194  CALL gather_xyfield(isize_2d,isize_2d_all,tzfd%OWNER,tzfd%COMM)
195  DEALLOCATE(isize_2d)
196  ALLOCATE(isize_tot(idim_full))
197  isize_tot = reshape(isize_2d_all(1+jphext:iimax+jphext,1+jphext:ijmax+jphext),(/idim_full/))
198  DEALLOCATE(isize_2d_all)
199 #endif
200  !
201 ELSEIF (iold==1) THEN
202  !
203  idim_full = u%NDIM_FULL
204  inear_nbr = knear_nbr
205  !
206  ALLOCATE(isize_tot(idim_full))
207  CALL gather_and_write_mpi(kcode,isize_tot)
208  !
209 ENDIF
210 !
211 !...known by all tasks
212 IF (nproc>1) THEN
213 #if defined(SFX_MPI) || defined(SFX_MNH)
214  CALL mpi_bcast(isize_tot,idim_full*kind(isize_tot)/4,mpi_integer,npio,ncomm,infompi)
215 #endif
216 ENDIF
217 !
218 IF (all(isize_tot/=0)) THEN
219  IF (iold==2) THEN
220 #ifdef SFX_MNH
221  nrank = irank_save
222  nproc = iproc_save
223  npio = ipio_save
224  ncomm = icomm_save
225 #endif
226  ENDIF
227  DEALLOCATE(isize_tot)
228  CALL dr_hook('INTERPOL_NPTS_1',1,zhook_handle)
229  RETURN
230 ENDIF
231 !
232 !
233 ip = count(kcode(:)==0)
234 !
235 il1 = SIZE(pfield,1)
236 il2 = SIZE(pfield,2)
237 !
238 IF (iold==2) THEN
239  !
240 #ifdef SFX_MNH
241 !
242  ! NNUM
243  ALLOCATE(inum_1d(u%NDIM_FULL))
244  DO ji = 1,u%NDIM_FULL
245  inum_1d(ji) = ji
246  ENDDO
247  ! INUM_1D to 2D
248  ALLOCATE(inum_2d(iiu+2*jphext,iju+2*jphext))
249  inum_2d = 0
250  inum_2d(1+jphext:iiu+jphext,1+jphext:iju+jphext) = reshape(inum_1d, (/ iiu,iju /) )
251  DEALLOCATE(inum_1d)
252  ! tasks to whole domaine
253  ALLOCATE(inum_2d_all(iimax+2*jphext,ijmax+2*jphext))
254  CALL gather_xyfield(inum_2d,inum_2d_all,tzfd%OWNER,tzfd%COMM)
255  DEALLOCATE(inum_2d)
256  ALLOCATE(inum_tot(idim_full))
257  inum_tot = reshape(inum_2d_all(1+jphext:iimax+jphext,1+jphext:ijmax+jphext),(/idim_full/))
258  DEALLOCATE(inum_2d_all)
259  !
260  ! NINDEX
261  ALLOCATE(iindex_1d(u%NDIM_FULL))
262  iindex_1d(:) = isp - 1
263  ! INDEX_1D to 2D
264  ALLOCATE(iindex_2d(iiu+2*jphext,iju+2*jphext))
265  iindex_2d(:,:) = 0
266  iindex_2d(1+jphext:iiu+jphext,1+jphext:iju+jphext) = reshape(iindex_1d, (/ iiu,iju /) )
267  DEALLOCATE(iindex_1d)
268  ! tasks to whole domaine
269  ALLOCATE(iindex_2d_all(iimax+2*jphext,ijmax+2*jphext))
270  CALL gather_xyfield(iindex_2d,iindex_2d_all,tzfd%OWNER,tzfd%COMM)
271  DEALLOCATE(iindex_2d)
272  ALLOCATE(iindex_tot(idim_full))
273  iindex_tot = reshape(iindex_2d_all(1+jphext:iimax+jphext,1+jphext:ijmax+jphext),(/idim_full/))
274  DEALLOCATE(iindex_2d_all)
275  !
276  !PX, PY: coordinates of all the points
277  !ZX, ZY: coordinates of the points in this task
278  ALLOCATE(zcoord_2d(iiu+2*jphext,iju+2*jphext))
279  ALLOCATE(zcoord_2d_all(iimax+2*jphext,ijmax+2*jphext))
280  !
281  zcoord_2d = 0.
282  zcoord_2d(1+jphext:iiu+jphext,1+jphext:iju+jphext) = reshape(px, (/ iiu,iju /) )
283  CALL gather_xyfield(zcoord_2d,zcoord_2d_all,tzfd%OWNER,tzfd%COMM)
284  ALLOCATE(zx(idim_full))
285  zx = reshape(zcoord_2d_all(1+jphext:iimax+jphext,1+jphext:ijmax+jphext),(/idim_full/))
286  !
287  zcoord_2d = 0.
288  zcoord_2d(1+jphext:iiu+jphext,1+jphext:iju+jphext) = reshape(py, (/ iiu,iju /) )
289  CALL gather_xyfield(zcoord_2d,zcoord_2d_all,tzfd%OWNER,tzfd%COMM)
290  ALLOCATE(zy(idim_full))
291  zy = reshape(zcoord_2d_all(1+jphext:iimax+jphext,1+jphext:ijmax+jphext),(/idim_full/))
292  !
293  DEALLOCATE(zcoord_2d,zcoord_2d_all)
294  !
295  IF (nproc>1) THEN
296  CALL mpi_bcast(inum_tot,idim_full*kind(inum_tot)/4,mpi_integer,npio,ncomm,infompi)
297  CALL mpi_bcast(iindex_tot,idim_full*kind(iindex_tot)/4,mpi_integer,npio,ncomm,infompi)
298  CALL mpi_bcast(zx,idim_full*kind(zx)/4,mpi_float,npio,ncomm,infompi)
299  CALL mpi_bcast(zy,idim_full*kind(zy)/4,mpi_float,npio,ncomm,infompi)
300  ENDIF
301 !
302 #endif
303  !
304 ELSEIF (iold==1) THEN
305  !
306  !PX, PY: coordinates of all the points
307  !ZX, ZY: coordinates of the points in this task
308  ALLOCATE(zx(il1),zy(il1))
309  CALL read_and_send_mpi(px,zx)
310  CALL read_and_send_mpi(py,zy)
311  !
312 ENDIF
313 !
314 IF (inear_nbr/=idim_full) THEN
315  IF (.NOT.ASSOCIATED(ug%NNEAR)) THEN
316  ALLOCATE(ug%NNEAR(il1,inear_nbr))
317  !seach near meshes in the complete grid (xgrid_full_par) for this task
318  CALL get_near_meshes(ug%G%CGRID,ug%NGRID_FULL_PAR,idim_full,ug%XGRID_FULL_PAR,inear_nbr,ug%NNEAR)
319  ENDIF
320 ENDIF
321 !
322 IF (lhook) CALL dr_hook('INTERPOL_NPTS_1',1,zhook_handle)
323 IF (lhook) CALL dr_hook('INTERPOL_NPTS_2',0,zhook_handle)
324 !
325 ALLOCATE(iindex(inear_nbr))
326 iindex(:) = 0
327 !
328 IF (inear_nbr==idim_full) THEN
329 
330  icount = 0
331  DO jl=1,idim_full
332  !is the neareast point available to interpolation
333  IF (isize_tot(jl)>0) THEN
334  icount = icount+1
335  iindex(icount) = jl
336  END IF
337  END DO
338 
339  !did we found enough points for interpolate
340  IF (icount>=1) THEN
341  inpts = min(knpts,icount)
342  ELSE
343  WHERE(kcode(:)==0) kcode(:) = -4
344  END IF
345  ALLOCATE(zdist(icount))
346 ELSE
347  ALLOCATE(zdist(inear_nbr))
348 ENDIF
349 !
350 zdist(:) = 0.
351 !
352 IF (lhook) CALL dr_hook('INTERPOL_NPTS_2',1,zhook_handle)
353 IF (lhook) CALL dr_hook('INTERPOL_NPTS_3',0,zhook_handle)
354 !
355 !indexes of points used for interpolation, for each point to interpolate
356 ALLOCATE(inind(ip,knpts))
357 inind(:,:) = 0
358 !distances of the points used for interpolation
359 ALLOCATE(zndist(ip,0:knpts))
360 zndist(:,1:knpts) = 1.e20
361 zndist(:,0) = 0.
362 !
363 icpt=0
364 !loop on points for this task
365 DO jl=1,il1
366  !
367  !does this point need to be interpolated?
368  IF (kcode(jl)/=0) cycle
369  !
370  IF (inear_nbr/=idim_full) THEN
371 
372  icount = 0
373  DO jk=1,inear_nbr
374  IF (ug%NNEAR(jl,jk)>0) THEN
375  !is the neareast point available to interpolation
376  IF (isize_tot(ug%NNEAR(jl,jk))>0) THEN
377  icount = icount+1
378  iindex(icount) = ug%NNEAR(jl,jk)
379  END IF
380  END IF
381  END DO
382  !
383  !did we found enough points for interpolate
384  IF (icount>=knpts) THEN
385  inpts = knpts
386  ELSE
387  kcode(jl) = -4
388  cycle
389  END IF
390  !
391  ENDIF
392  !
393  !one point more to interpolate
394  icpt = icpt + 1
395  !
396  IF (iold==2) THEN
397 #ifdef SFX_MNH
398  zdist(1:icount) = (zx(iindex(1:icount))-px(jl))**2 + (zy(iindex(1:icount))-py(jl))**2
399 #endif
400  ELSE
401  zdist(1:icount) = (px(iindex(1:icount))-zx(jl))**2 + (py(iindex(1:icount))-zy(jl))**2
402  ENDIF
403  !
404  DO jp = 1,icount
405  !
406  IF (zdist(jp)>zndist(icpt,inpts)) cycle
407  !
408  DO jk = inpts,1,-1
409  !
410  IF ( zdist(jp)>zndist(icpt,jk-1) ) THEN
411  !
412  IF ( jk<inpts ) THEN
413  DO jkk = inpts,jk+1,-1
414  zndist(icpt,jkk) = zndist(icpt,jkk-1)
415  inind(icpt,jkk) = inind(icpt,jkk-1)
416  ENDDO
417  ENDIF
418  !
419  !distances and indexes of points used to interpolate are saved
420  zndist(icpt,jk) = zdist(jp)
421  inind(icpt,jk) = iindex(jp)
422  !
423  EXIT
424  !
425  ENDIF
426  !
427  ENDDO
428  !
429  ENDDO
430  !
431 ENDDO
432 !
433 IF (lhook) CALL dr_hook('INTERPOL_NPTS_3',1,zhook_handle)
434 IF (lhook) CALL dr_hook('INTERPOL_NPTS_4',0,zhook_handle)
435 !
436 DEALLOCATE(iindex,zx,zy,isize_tot,zdist)
437 !
438 zndist(:,:) = sqrt(zndist(:,:))
439 !
440 ALLOCATE(isize(0:nproc-1))
441 
442 !numbers of points to interpolated are gathered
443 IF (nproc>1) THEN
444 #if defined(SFX_MPI) || defined(SFX_MNH)
445  CALL mpi_allgather(icpt,kind(icpt)/4,mpi_integer,&
446  isize,kind(isize)/4,mpi_integer,ncomm,infompi)
447 #endif
448 ELSE
449  isize(:) = icpt
450 ENDIF
451 !
452 !this array contains, for each point to interpolate,
453 !the correspondance between the task where is the point to use for interpolation
454 !(NINDEX) and its index in this task (NNUM)
455 ALLOCATE(inind0(maxval(isize),knpts,0:nproc-1))
456 inind0(:,:,:) = 0
457 !
458 !number of points needed to interpolated
459 DO jl=1,knpts
460  !number of points to interpolated
461  DO jp=1,icpt
462  !index of the point needed in the whole grid
463  jk = inind(jp,jl)
464  !inind0 contains the task and the index in this task for this point
465  IF (iold==2) THEN
466 #ifdef SFX_MNH
467  IF (jk/=0) inind0(jp,jl,iindex_tot(jk)) = inum_tot(jk)
468 #endif
469  ELSEIF (iold==1) THEN
470  IF (jk/=0) inind0(jp,jl,nindex(jk)) = nnum(jk)
471  ENDIF
472  ENDDO
473 ENDDO
474 !
475 !for each task, points needed and located in this task are gathered
476 ALLOCATE(inind_all(maxval(isize),knpts,0:nproc-1))
477 !
478 IF (nproc>1) THEN
479  !for each task
480  DO jp=0,nproc-1
481 #if defined(SFX_MPI) || defined(SFX_MNH)
482  !inind_all receives from all tasks the points they need that are
483  !located in it
484  CALL mpi_gather(inind0(:,:,jp),maxval(isize)*knpts*kind(inind0)/4,mpi_integer,&
485  inind_all,maxval(isize)*knpts*kind(inind_all)/4,mpi_integer,&
486  jp,ncomm,infompi)
487 #endif
488  ENDDO
489  !
490 ELSE
491  inind_all(:,:,:) = inind0(:,:,:)
492 ENDIF
493 !
494 DEALLOCATE(inind0)
495 !
496 IF (lhook) CALL dr_hook('INTERPOL_NPTS_4',1,zhook_handle)
497 IF (lhook) CALL dr_hook('INTERPOL_NPTS_5',0,zhook_handle)
498 !
499 !zfield contains the values of the points needed located in this task
500 !(ie values for indexes of ININD_ALL)
501 ALLOCATE(zfield(maxval(isize),knpts,SIZE(pfield,2),0:nproc-1))
502 zfield(:,:,:,:) = xundef
503 DO jp=0,nproc-1
504  DO jk=1,maxval(isize)
505  DO jl=1,knpts
506  IF (inind_all(jk,jl,jp)/=0) THEN
507  !pfield in only on this task
508  zfield(jk,jl,:,jp) = pfield(inind_all(jk,jl,jp),:)
509  ENDIF
510  ENDDO
511  ENDDO
512 ENDDO
513 !
514 DEALLOCATE(inind_all)
515 !
516 !ZFIELD2 gathers values needed for this task from all other tasks
517 !(inverse operation than before)
518 ALLOCATE(zfield2(icpt,knpts,SIZE(pfield,2),0:nproc-1))
519 IF (nproc>1) THEN
520  DO jp=0,nproc-1
521 #if defined(SFX_MPI) || defined(SFX_MNH)
522  CALL mpi_gather(zfield(1:isize(jp),:,:,jp),SIZE(zfield(1:isize(jp),:,:,jp))*kind(zfield)/4,mpi_real,&
523  zfield2,isize(jp)*knpts*SIZE(pfield,2)*kind(zfield2)/4,mpi_real,jp,ncomm,infompi)
524 #endif
525  ENDDO
526 ELSE
527  zfield2(:,:,:,:) = zfield(:,:,:,:)
528 ENDIF
529 !
530 DEALLOCATE(zfield)
531 !
532 !zfield3 contains the values of the points needed for interpolation, gathered from all tasks
533 ALLOCATE(zfield3(icpt,knpts,SIZE(pfield,2)))
534 DO jp=0,nproc-1
535  WHERE (zfield2(:,:,:,jp)/=xundef) zfield3(:,:,:) = zfield2(:,:,:,jp)
536 ENDDO
537 DEALLOCATE(zfield2)
538 !
539 IF (lhook) CALL dr_hook('INTERPOL_NPTS_5',1,zhook_handle)
540 IF (lhook) CALL dr_hook('INTERPOL_NPTS_6',0,zhook_handle)
541 !
542 !values of the points used for interpolation
543 ALLOCATE(znval(ip,il2))
544 znval(:,:) = xundef
545 !
546 !znval contains the averaged values for the knpts points
547 znval(:,:) = 0.
548 DO jl=1,icpt
549  zsum = 0.
550  DO jp=1,knpts
551  IF (inind(jl,jp)/=0) THEN
552  znval(jl,:) = znval(jl,:) + zfield3(jl,jp,:)/zndist(jl,jp)
553  zsum = zsum + 1./zndist(jl,jp)
554  ENDIF
555  ENDDO
556  IF (zsum/=0.) znval(jl,:) = znval(jl,:) / zsum
557 ENDDO
558 !
559 DEALLOCATE(inind, zndist, zfield3)
560 !
561 !
562 !finally, pfield contains the interpolated values!
563 icpt=0
564 DO jl=1,il1
565 
566  IF (kcode(jl)/=0) cycle
567 
568  icpt = icpt + 1
569  pfield(jl,:) = znval(icpt,:)
570 
571 ENDDO
572 !
573 DEALLOCATE(znval)
574 !
575 DEALLOCATE(isize)
576 !
577 IF (iold==2) THEN
578 #ifdef SFX_MNH
579  nrank = irank_save
580  nproc = iproc_save
581  npio = ipio_save
582  ncomm = icomm_save
583  DEALLOCATE(iindex_tot,inum_tot)
584 #endif
585 ENDIF
586 !
587 IF (lhook) CALL dr_hook('INTERPOL_NPTS_6',1,zhook_handle)
588 !-------------------------------------------------------------------------------
589 !
590 END SUBROUTINE interpol_npts
subroutine interpol_npts(UG, U, HPROGRAM, KLUOUT, KNPTS, KCODE, PX, PY
integer, dimension(:), allocatable nnum
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
subroutine get_near_meshes(HGRID, KGRID_PAR, KL, PGRID_PAR, KNEAR_NBR,
integer, dimension(:), allocatable nindex
static int count
Definition: memory_hook.c:21