105 MI,MO,KM,IBI,LI,GI, &
106 NO,RLAT,RLON,IBO,LO,GO,IRET)
107 class(ip_grid),
intent(in) :: grid_in, grid_out
109 INTEGER,
INTENT(IN ) :: IBI(KM), IPOPT(20), KM, MI, MO
110 INTEGER,
INTENT( OUT) :: IBO(KM), IRET, NO
112 LOGICAL*1,
INTENT(IN ) :: LI(MI,KM)
113 LOGICAL*1,
INTENT( OUT) :: LO(MO,KM)
115 REAL,
INTENT(IN ) :: GI(MI,KM)
116 REAL,
INTENT( OUT) :: GO(MO,KM), RLAT(MO), RLON(MO)
118 REAL,
PARAMETER :: FILL=-9999.
121 INTEGER :: JB, J1, K, LB, LSW, MP, N
122 INTEGER :: N11(MO), NB, NB1, NB2, NB3, NB4, NV
124 REAL :: PMP,RLOB(MO),RLAB(MO)
125 REAL :: WB, WO(MO,KM), XI, YI
126 REAL :: XPTB(MO),YPTB(MO),XPTS(MO),YPTS(MO)
128 logical :: to_station_points
130 select type(grid_out)
131 type is(ip_station_points_grid)
132 to_station_points = .true.
134 to_station_points = .false.
140 if(to_station_points)
then
141 CALL gdswzd(grid_out, 0,mo,fill,xpts,ypts,rlon,rlat,no)
143 CALL gdswzd(grid_in,-1,no,fill,xpts,ypts,rlon,rlat,nv)
146 CALL gdswzd(grid_out, 0,mo,fill,xpts,ypts,rlon,rlat,no)
153 IF(iret.EQ.0.AND.nb1.LT.0) iret=32
155 IF(ipopt(1).EQ.-1.OR.ipopt(2).EQ.-1) lsw=0
156 IF(iret.EQ.0.AND.lsw.EQ.1.AND.nb1.GT.15) iret=32
158 IF(mp.EQ.-1.OR.mp.EQ.0) mp=50
159 IF(mp.LT.0.OR.mp.GT.100) iret=32
168 nb4=nb4+8*ib*ipopt(2+ib)
188 ib=nb-(jb+nb1)*nb2-nb1-1
189 lb=max(abs(ib),abs(jb))
191 IF(lsw.EQ.1) wb=ipopt(2+lb)
194 xptb(n)=xpts(n)+ib/real(nb2)
195 yptb(n)=ypts(n)+jb/real(nb2)
197 if(to_station_points)
then
198 CALL gdswzd(grid_in, 1,no,fill,xptb,yptb,rlob,rlab,nv)
199 CALL gdswzd(grid_in,-1,no,fill,xptb,yptb,rlob,rlab,nv)
201 CALL gdswzd(grid_out, 1,no,fill,xptb,yptb,rlob,rlab,nv)
202 CALL gdswzd(grid_in,-1,no,fill,xptb,yptb,rlob,rlab,nv)
204 IF(iret.EQ.0.AND.nv.EQ.0.AND.lb.EQ.0) iret=2
208 IF(xi.NE.fill.AND.yi.NE.fill)
THEN
211 n11(n)=grid_in%field_pos(i1, j1)
221 IF(ibi(k).EQ.0.OR.li(n11(n),k))
THEN
222 go(n,k)=go(n,k)+wb*gi(n11(n),k)
235 lo(n,k)=wo(n,k).GE.pmp*nb4
237 go(n,k)=go(n,k)/wo(n,k)
245 select type(grid_out)
246 type is(ip_equid_cylind_grid)
247 CALL polfixs(no,mo,km,rlat,ibo,lo,go)
349 MI,MO,KM,IBI,LI,UI,VI, &
350 NO,RLAT,RLON,CROT,SROT,IBO,LO,UO,VO,IRET)
351 class(ip_grid),
intent(in) :: grid_in, grid_out
353 INTEGER,
INTENT(IN ) :: IPOPT(20), IBI(KM)
354 INTEGER,
INTENT(IN ) :: KM, MI, MO
355 INTEGER,
INTENT( OUT) :: IRET, NO, IBO(KM)
357 LOGICAL*1,
INTENT(IN ) :: LI(MI,KM)
358 LOGICAL*1,
INTENT( OUT) :: LO(MO,KM)
360 REAL,
INTENT(IN ) :: UI(MI,KM),VI(MI,KM)
361 REAL,
INTENT(INOUT) :: RLAT(MO),RLON(MO)
362 REAL,
INTENT( OUT) :: UO(MO,KM),VO(MO,KM)
363 REAL,
INTENT( OUT) :: CROT(MO),SROT(MO)
365 REAL,
PARAMETER :: FILL=-9999.
368 INTEGER :: IB, JB, I1, J1
369 INTEGER :: K, LB, LSW, MP, N, NV
370 INTEGER :: NB, NB1, NB2, NB3, NB4
374 REAL :: C11(MO),S11(MO)
375 REAL :: CM11, SM11, PMP
376 REAL :: U11, V11, UROT, VROT
377 REAL :: WB, WO(MO,KM), XI, YI
378 REAL :: RLOB(MO),RLAB(MO)
379 REAL :: XPTS(MO),YPTS(MO)
380 REAL :: XPTB(MO),YPTB(MO)
382 logical :: to_station_points
385 INTEGER,
SAVE :: MIX=-1
386 REAL,
ALLOCATABLE,
SAVE :: CROI(:),SROI(:)
387 REAL,
ALLOCATABLE,
SAVE :: XPTI(:),YPTI(:)
388 REAL,
ALLOCATABLE,
SAVE :: RLOI(:),RLAI(:)
389 class(ip_grid),
allocatable,
save :: prev_grid_in
391 select type(grid_out)
392 type is(ip_station_points_grid)
393 to_station_points = .true.
395 to_station_points = .false.
401 CALL gdswzd(grid_out, 0,mo,fill,xpts,ypts,rlon,rlat,no,crot,srot)
403 if(to_station_points)
then
404 CALL gdswzd(grid_in,-1,no,fill,xpts,ypts,rlon,rlat,nv,crot,srot)
408 if (.not.
allocated(prev_grid_in))
then
409 allocate(prev_grid_in, source = grid_in)
413 same_grid = grid_in == prev_grid_in
415 if (.not. same_grid)
then
416 deallocate(prev_grid_in)
417 allocate(prev_grid_in, source = grid_in)
421 IF(.NOT.same_grid)
THEN
423 IF(mix.GE.0)
DEALLOCATE(xpti,ypti,rloi,rlai,croi,sroi)
424 ALLOCATE(xpti(mi),ypti(mi),rloi(mi),rlai(mi),croi(mi),sroi(mi))
427 CALL gdswzd(grid_in,0,mi,fill,xpti,ypti, &
428 rloi,rlai,nv,croi,sroi)
434 IF(iret.EQ.0.AND.nb1.LT.0) iret=32
436 IF(ipopt(1).EQ.-1.OR.ipopt(2).EQ.-1) lsw=0
437 IF(iret.EQ.0.AND.lsw.EQ.1.AND.nb1.GT.15) iret=32
439 IF(mp.EQ.-1.OR.mp.EQ.0) mp=50
440 IF(mp.LT.0.OR.mp.GT.100) iret=32
449 nb4=nb4+8*ib*ipopt(2+ib)
469 ib=nb-(jb+nb1)*nb2-nb1-1
470 lb=max(abs(ib),abs(jb))
472 IF(lsw.EQ.1) wb=ipopt(2+lb)
475 xptb(n)=xpts(n)+ib/real(nb2)
476 yptb(n)=ypts(n)+jb/real(nb2)
478 if(to_station_points)
then
479 CALL gdswzd(grid_in, 1,no,fill,xptb,yptb,rlob,rlab,nv)
480 CALL gdswzd(grid_in,-1,no,fill,xptb,yptb,rlob,rlab,nv)
482 CALL gdswzd(grid_out, 1,no,fill,xptb,yptb,rlob,rlab,nv)
483 CALL gdswzd(grid_in,-1,no,fill,xptb,yptb,rlob,rlab,nv)
485 IF(iret.EQ.0.AND.nv.EQ.0.AND.lb.EQ.0) iret=2
489 IF(xi.NE.fill.AND.yi.NE.fill)
THEN
492 n11(n)=grid_in%field_pos(i1, j1)
494 CALL movect(rlai(n11(n)),rloi(n11(n)),rlat(n),rlon(n),cm11,sm11)
495 c11(n)=cm11*croi(n11(n))+sm11*sroi(n11(n))
496 s11(n)=sm11*croi(n11(n))-cm11*sroi(n11(n))
507 IF(ibi(k).EQ.0.OR.li(n11(n),k))
THEN
508 u11=c11(n)*ui(n11(n),k)-s11(n)*vi(n11(n),k)
509 v11=s11(n)*ui(n11(n),k)+c11(n)*vi(n11(n),k)
510 uo(n,k)=uo(n,k)+wb*u11
511 vo(n,k)=vo(n,k)+wb*v11
524 lo(n,k)=wo(n,k).GE.pmp*nb4
526 uo(n,k)=uo(n,k)/wo(n,k)
527 vo(n,k)=vo(n,k)/wo(n,k)
528 urot=crot(n)*uo(n,k)-srot(n)*vo(n,k)
529 vrot=srot(n)*uo(n,k)+crot(n)*vo(n,k)
540 select type(grid_out)
541 type is(ip_equid_cylind_grid)
542 CALL polfixv(no,mo,km,rlat,rlon,ibo,lo,uo,vo)
subroutine movect(FLAT, FLON, TLAT, TLON, CROT, SROT)
This subprogram provides the rotation parameters to move a vector along a great circle from one posit...
Driver module for gdswzd routines.
Re-export the individual grids.
Interpolate scalar fields (neighbor).
subroutine interpolate_neighbor_budget_vector(IPOPT, grid_in, grid_out, MI, MO, KM, IBI, LI, UI, VI, NO, RLAT, RLON, CROT, SROT, IBO, LO, UO, VO, IRET)
Interpolate vector fields (budget).
subroutine interpolate_neighbor_budget_scalar(IPOPT, grid_in, grid_out, MI, MO, KM, IBI, LI, GI, NO, RLAT, RLON, IBO, LO, GO, IRET)
Interpolate scalar fields (budget).
Make multiple pole scalar values consistent.
subroutine, public polfixs(NM, NX, KM, RLAT, IB, LO, GO)
Make multiple pole scalar values consistent.
subroutine, public polfixv(NM, NX, KM, RLAT, RLON, IB, LO, UO, VO)
Make multiple pole vector values consistent,.