256 IGDTNUMO,IGDTMPLO,IGDTLENO, &
258 NO,RLAT,RLON,IBO,LO,GO,IRET)
259 INTEGER,
INTENT(IN ) :: IGDTNUMI, IGDTLENI
260 INTEGER,
INTENT(IN ) :: IGDTMPLI(IGDTLENI)
261 INTEGER,
INTENT(IN ) :: IGDTNUMO, IGDTLENO
262 INTEGER,
INTENT(IN ) :: IGDTMPLO(IGDTLENO)
263 INTEGER,
INTENT(IN ) :: IPOPT(20)
264 INTEGER,
INTENT(IN ) :: MI, MO
265 INTEGER,
INTENT(IN ) :: IBI(KM), KM
266 INTEGER,
INTENT( OUT) :: IBO(KM), IRET, NO
268 LOGICAL*1,
INTENT( OUT) :: LO(MO,KM)
270 REAL,
INTENT(IN ) :: GI(MI,KM)
271 REAL,
INTENT(INOUT) :: RLAT(MO),RLON(MO)
272 REAL,
INTENT( OUT) :: GO(MO,KM)
274 REAL,
PARAMETER :: FILL=-9999.
275 REAL,
PARAMETER :: PI=3.14159265358979
276 REAL,
PARAMETER :: DPR=180./pi
278 INTEGER :: IDRTI, IDRTO, IG, JG, IM, JM
279 INTEGER :: IGO, JGO, IMO, JMO
280 INTEGER :: ISCAN, JSCAN, NSCAN
281 INTEGER :: ISCANO, JSCANO, NSCANO
282 INTEGER :: ISKIPI, JSKIPI, ISCALE
283 INTEGER :: IMAXI, JMAXI, ISPEC
284 INTEGER :: IP, IPRIME, IPROJ, IROMB, K
285 INTEGER :: MAXWV, N, NI, NJ, NPS
288 REAL :: DLAT, DLON, DLATO, DLONO
289 REAL :: GO2(MO,KM), H, HI, HJ
290 REAL :: ORIENT, SLAT, RERTH, E2
291 REAL :: RLAT1, RLON1, RLAT2, RLON2, RLATI
292 REAL :: XMESH, XP, YP
293 REAL :: XPTS(MO), YPTS(MO)
296 class(
ip_grid),
allocatable :: grid_in, grid_out
306 IF(igdtnumo.GE.0)
THEN
308 CALL gdswzd(grid_out, 0,mo,fill,xpts,ypts,rlon,rlat,no)
318 IF(idrti==40) idrti=4
319 IF(idrti==0.OR.idrti==4)
THEN
322 iscale=igdtmpli(10)*igdtmpli(11)
323 IF(iscale==0) iscale=10**6
324 rlon1=float(igdtmpli(13))/float(iscale)
325 rlon2=float(igdtmpli(16))/float(iscale)
326 iscan=mod(igdtmpli(19)/128,2)
327 jscan=mod(igdtmpli(19)/64,2)
328 nscan=mod(igdtmpli(19)/32,2)
333 IF(ibi(k).NE.0) iret=41
337 dlon=(mod(rlon2-rlon1-1+3600,360.)+1)/(im-1)
339 dlon=-(mod(rlon1-rlon2-1+3600,360.)+1)/(im-1)
341 ig=nint(360/abs(dlon))
342 iprime=1+mod(-nint(rlon1/dlon)+ig,ig)
345 IF(mod(ig,2).NE.0.OR.im.LT.ig) iret=41
347 IF(iret.EQ.0.AND.idrti.EQ.0)
THEN
348 iscale=igdtmpli(10)*igdtmpli(11)
349 IF(iscale==0) iscale=10**6
350 rlat1=float(igdtmpli(12))/float(iscale)
351 rlat2=float(igdtmpli(15))/float(iscale)
352 dlat=(rlat2-rlat1)/(jm-1)
353 jg=nint(180/abs(dlat))
354 IF(jm.EQ.jg) idrti=256
355 IF(jm.NE.jg.AND.jm.NE.jg+1) iret=41
356 ELSEIF(iret.EQ.0.AND.idrti.EQ.4)
THEN
366 IF(iromb.EQ.0.AND.idrti.EQ.4) maxwv=(jmaxi-1)
367 IF(iromb.EQ.1.AND.idrti.EQ.4) maxwv=(jmaxi-1)/2
368 IF(iromb.EQ.0.AND.idrti.EQ.0) maxwv=(jmaxi-3)/2
369 IF(iromb.EQ.1.AND.idrti.EQ.0) maxwv=(jmaxi-3)/4
370 IF(iromb.EQ.0.AND.idrti.EQ.256) maxwv=(jmaxi-1)/2
371 IF(iromb.EQ.1.AND.idrti.EQ.256) maxwv=(jmaxi-1)/4
373 IF((iromb.NE.0.AND.iromb.NE.1).OR.maxwv.LT.0) iret=42
385 IF(iscan.EQ.1) iskipi=-iskipi
386 IF(jscan.EQ.0) jskipi=-jskipi
389 IF((igdtnumo.EQ.0.OR.igdtnumo.EQ.40).AND. &
390 mod(igdtmplo(8),2).EQ.0.AND.igdtmplo(13).EQ.0.AND.igdtmplo(19).EQ.0)
THEN
395 iscale=igdtmplo(10)*igdtmplo(11)
396 IF(iscale==0) iscale=10**6
397 rlon2=float(igdtmplo(16))/float(iscale)
398 dlono=(mod(rlon2-1+3600,360.)+1)/(imo-1)
399 igo=nint(360/abs(dlono))
400 IF(imo.EQ.igo.AND.idrto.EQ.0)
THEN
401 rlat1=float(igdtmplo(12))/float(iscale)
402 rlat2=float(igdtmplo(15))/float(iscale)
403 dlat=(rlat2-rlat1)/(jmo-1)
404 jgo=nint(180/abs(dlat))
405 IF(jmo.EQ.jgo) idrto=256
406 IF(jmo.EQ.jgo.OR.jmo.EQ.jgo+1) ispec=1
407 ELSEIF(imo.EQ.igo.AND.idrto.EQ.4)
THEN
409 IF(jmo.EQ.jgo) ispec=1
412 CALL sptrun(iromb,maxwv,idrti,imaxi,jmaxi,idrto,imo,jmo, &
413 km,iprime,iskipi,jskipi,mi,0,0,mo,0,gi,go)
416 ELSEIF(igdtnumo.EQ.20.AND. &
417 igdtmplo(8).EQ.igdtmplo(9).AND.mod(igdtmplo(8),2).EQ.1.AND. &
418 igdtmplo(15).EQ.igdtmplo(16).AND.igdtmplo(18).EQ.64)
THEN
420 rlat1=float(igdtmplo(10))*1.e-6
421 rlon1=float(igdtmplo(11))*1.e-6
422 orient=float(igdtmplo(14))*1.e-6
423 xmesh=float(igdtmplo(15))*1.e-3
424 iproj=mod(igdtmplo(17)/128,2)
427 slat=float(abs(igdtmplo(13)))*1.e-6
429 de=(1.+sin(slat/dpr))*rerth
430 dr=de*cos(rlat1/dpr)/(1+h*sin(rlat1/dpr))
431 xp=1-h*sin((rlon1-orient)/dpr)*dr/xmesh
432 yp=1+cos((rlon1-orient)/dpr)*dr/xmesh
433 IF(nint(xp).EQ.ip.AND.nint(yp).EQ.ip)
THEN
435 CALL sptruns(iromb,maxwv,idrti,imaxi,jmaxi,km,nps, &
436 iprime,iskipi,jskipi,mi,mo,0,0,0, &
437 slat,xmesh,orient,gi,go,go2)
439 CALL sptruns(iromb,maxwv,idrti,imaxi,jmaxi,km,nps, &
440 iprime,iskipi,jskipi,mi,mo,0,0,0, &
441 slat,xmesh,orient,gi,go2,go)
446 ELSEIF(igdtnumo.EQ.10)
THEN
449 rlat1=float(igdtmplo(10))*1.0e-6
450 rlon1=float(igdtmplo(11))*1.0e-6
451 rlon2=float(igdtmplo(15))*1.0e-6
452 rlati=float(igdtmplo(13))*1.0e-6
453 iscano=mod(igdtmplo(16)/128,2)
454 jscano=mod(igdtmplo(16)/64,2)
455 nscano=mod(igdtmplo(16)/32,2)
456 dy=float(igdtmplo(19))*1.0e-3
460 dlono=hi*(mod(hi*(rlon2-rlon1)-1+3600,360.)+1)/(ni-1)
461 dlato=hj*dy/(rerth*cos(rlati/dpr))*dpr
463 CALL sptrunm(iromb,maxwv,idrti,imaxi,jmaxi,km,ni,nj, &
464 iprime,iskipi,jskipi,mi,mo,0,0,0, &
465 rlat1,rlon1,dlato,dlono,gi,go)
471 CALL sptrung(iromb,maxwv,idrti,imaxi,jmaxi,km,no, &
472 iprime,iskipi,jskipi,mi,mo,0,0,0,rlat,rlon,gi,go)
561 NO,RLAT,RLON,IBO,LO,GO,IRET)
562 INTEGER,
INTENT(IN ) :: IPOPT(20), KGDSI(200)
563 INTEGER,
INTENT(IN ) :: KGDSO(200), MI, MO
564 INTEGER,
INTENT(IN ) :: IBI(KM), KM
565 INTEGER,
INTENT( OUT) :: IBO(KM), IRET
567 LOGICAL*1,
INTENT( OUT) :: LO(MO,KM)
569 REAL,
INTENT(IN ) :: GI(MI,KM)
570 REAL,
INTENT(INOUT) :: RLAT(MO),RLON(MO)
571 REAL,
INTENT( OUT) :: GO(MO,KM)
573 REAL,
PARAMETER :: FILL=-9999.
574 REAL,
PARAMETER :: RERTH=6.3712e6
575 REAL,
PARAMETER :: PI=3.14159265358979
576 REAL,
PARAMETER :: DPR=180./pi
578 INTEGER :: IDRTI, IDRTO, IG, JG, IM, JM
579 INTEGER :: IGO, JGO, IMO, JMO
580 INTEGER :: ISCAN, JSCAN, NSCAN
581 INTEGER :: ISCANO, JSCANO, NSCANO
582 INTEGER :: ISKIPI, JSKIPI
583 INTEGER :: IMAXI, JMAXI, ISPEC
584 INTEGER :: IP, IPRIME, IPROJ, IROMB, K
585 INTEGER :: MAXWV, N, NI, NJ, NPS, NO
588 REAL :: DLAT, DLON, DLATO, DLONO
589 REAL :: GO2(MO,KM), H, HI, HJ
591 REAL :: RLAT1, RLON1, RLAT2, RLON2, RLATI
592 REAL :: XMESH, XP, YP
593 REAL :: XPTS(MO), YPTS(MO)
596 class(
ip_grid),
allocatable :: grid_in, grid_out
607 IF(kgdso(1).GE.0)
THEN
608 CALL gdswzd(grid_out, 0,mo,fill,xpts,ypts,rlon,rlat,no)
622 iscan=mod(kgdsi(11)/128,2)
623 jscan=mod(kgdsi(11)/64,2)
624 nscan=mod(kgdsi(11)/32,2)
625 IF(idrti.NE.0.AND.idrti.NE.4) iret=41
627 IF(ibi(k).NE.0) iret=41
631 dlon=(mod(rlon2-rlon1-1+3600,360.)+1)/(im-1)
633 dlon=-(mod(rlon1-rlon2-1+3600,360.)+1)/(im-1)
635 ig=nint(360/abs(dlon))
636 iprime=1+mod(-nint(rlon1/dlon)+ig,ig)
639 IF(mod(ig,2).NE.0.OR.im.LT.ig) iret=41
641 IF(iret.EQ.0.AND.idrti.EQ.0)
THEN
644 dlat=(rlat2-rlat1)/(jm-1)
645 jg=nint(180/abs(dlat))
646 IF(jm.EQ.jg) idrti=256
647 IF(jm.NE.jg.AND.jm.NE.jg+1) iret=41
648 ELSEIF(iret.EQ.0.AND.idrti.EQ.4)
THEN
658 IF(iromb.EQ.0.AND.idrti.EQ.4) maxwv=(jmaxi-1)
659 IF(iromb.EQ.1.AND.idrti.EQ.4) maxwv=(jmaxi-1)/2
660 IF(iromb.EQ.0.AND.idrti.EQ.0) maxwv=(jmaxi-3)/2
661 IF(iromb.EQ.1.AND.idrti.EQ.0) maxwv=(jmaxi-3)/4
662 IF(iromb.EQ.0.AND.idrti.EQ.256) maxwv=(jmaxi-1)/2
663 IF(iromb.EQ.1.AND.idrti.EQ.256) maxwv=(jmaxi-1)/4
665 IF((iromb.NE.0.AND.iromb.NE.1).OR.maxwv.LT.0) iret=42
677 IF(iscan.EQ.1) iskipi=-iskipi
678 IF(jscan.EQ.0) jskipi=-jskipi
681 IF((kgdso(1).EQ.0.OR.kgdso(1).EQ.4).AND. &
682 mod(kgdso(2),2).EQ.0.AND.kgdso(5).EQ.0.AND.kgdso(11).EQ.0)
THEN
687 dlono=(mod(rlon2-1+3600,360.)+1)/(imo-1)
688 igo=nint(360/abs(dlono))
689 IF(imo.EQ.igo.AND.idrto.EQ.0)
THEN
692 dlat=(rlat2-rlat1)/(jmo-1)
693 jgo=nint(180/abs(dlat))
694 IF(jmo.EQ.jgo) idrto=256
695 IF(jmo.EQ.jgo.OR.jmo.EQ.jgo+1) ispec=1
696 ELSEIF(imo.EQ.igo.AND.idrto.EQ.4)
THEN
698 IF(jmo.EQ.jgo) ispec=1
701 CALL sptrun(iromb,maxwv,idrti,imaxi,jmaxi,idrto,imo,jmo, &
702 km,iprime,iskipi,jskipi,mi,0,0,mo,0,gi,go)
705 ELSEIF(kgdso(1).EQ.5.AND. &
706 kgdso(2).EQ.kgdso(3).AND.mod(kgdso(2),2).EQ.1.AND. &
707 kgdso(8).EQ.kgdso(9).AND.kgdso(11).EQ.64)
THEN
711 orient=kgdso(7)*1.e-3
713 iproj=mod(kgdso(10)/128,2)
716 de=(1.+sin(60./dpr))*rerth
717 dr=de*cos(rlat1/dpr)/(1+h*sin(rlat1/dpr))
718 xp=1-h*sin((rlon1-orient)/dpr)*dr/xmesh
719 yp=1+cos((rlon1-orient)/dpr)*dr/xmesh
720 IF(nint(xp).EQ.ip.AND.nint(yp).EQ.ip)
THEN
722 CALL sptruns(iromb,maxwv,idrti,imaxi,jmaxi,km,nps, &
723 iprime,iskipi,jskipi,mi,mo,0,0,0, &
724 60.,xmesh,orient,gi,go,go2)
726 CALL sptruns(iromb,maxwv,idrti,imaxi,jmaxi,km,nps, &
727 iprime,iskipi,jskipi,mi,mo,0,0,0, &
728 60.,xmesh,orient,gi,go2,go)
733 ELSEIF(kgdso(1).EQ.1)
THEN
740 iscano=mod(kgdso(11)/128,2)
741 jscano=mod(kgdso(11)/64,2)
742 nscano=mod(kgdso(11)/32,2)
746 dlono=hi*(mod(hi*(rlon2-rlon1)-1+3600,360.)+1)/(ni-1)
747 dlato=hj*dy/(rerth*cos(rlati/dpr))*dpr
749 CALL sptrunm(iromb,maxwv,idrti,imaxi,jmaxi,km,ni,nj, &
750 iprime,iskipi,jskipi,mi,mo,0,0,0, &
751 rlat1,rlon1,dlato,dlono,gi,go)
757 CALL sptrung(iromb,maxwv,idrti,imaxi,jmaxi,km,no, &
758 iprime,iskipi,jskipi,mi,mo,0,0,0,rlat,rlon,gi,go)
889 IGDTNUMO,IGDTMPLO,IGDTLENO, &
890 MI,MO,KM,IBI,UI,VI, &
891 NO,RLAT,RLON,CROT,SROT,IBO,LO,UO,VO,IRET)
892 INTEGER,
INTENT(IN ) :: IPOPT(20), IBI(KM)
893 INTEGER,
INTENT(IN ) :: KM, MI, MO
894 INTEGER,
INTENT( OUT) :: IRET, IBO(KM), NO
895 INTEGER,
INTENT(IN ) :: IGDTNUMI, IGDTLENI
896 INTEGER,
INTENT(IN ) :: IGDTMPLI(IGDTLENI)
897 INTEGER,
INTENT(IN ) :: IGDTNUMO, IGDTLENO
898 INTEGER,
INTENT(IN ) :: IGDTMPLO(IGDTLENO)
900 LOGICAL*1,
INTENT( OUT) :: LO(MO,KM)
902 REAL,
INTENT(IN ) :: UI(MI,KM),VI(MI,KM)
903 REAL,
INTENT( OUT) :: UO(MO,KM),VO(MO,KM)
904 REAL,
INTENT(INOUT) :: RLAT(MO),RLON(MO)
905 REAL,
INTENT( OUT) :: CROT(MO),SROT(MO)
907 REAL,
PARAMETER :: FILL=-9999.
908 REAL,
PARAMETER :: PI=3.14159265358979
909 REAL,
PARAMETER :: DPR=180./pi
911 INTEGER :: IDRTO, IROMB, ISKIPI, ISPEC
912 INTEGER :: IDRTI, IMAXI, JMAXI, IM, JM
913 INTEGER :: IPRIME, IG, IMO, JMO, IGO, JGO
914 INTEGER :: ISCAN, JSCAN, NSCAN
915 INTEGER :: ISCANO, JSCANO, NSCANO
916 INTEGER :: ISCALE, IP, IPROJ, JSKIPI, JG
917 INTEGER :: K, MAXWV, N, NI, NJ, NPS
919 REAL :: DLAT, DLON, DLATO, DLONO, DE, DR, DY
920 REAL :: E2, H, HI, HJ, DUMM(1)
921 REAL :: ORIENT, RERTH, SLAT
922 REAL :: RLAT1, RLON1, RLAT2, RLON2, RLATI
923 REAL :: UROT, VROT, UO2(MO,KM),VO2(MO,KM)
924 REAL :: XMESH, XP, YP, XPTS(MO),YPTS(MO)
927 class(
ip_grid),
allocatable :: grid_in, grid_out
938 IF(igdtnumo.GE.0)
THEN
939 CALL gdswzd(grid_out, 0,mo,fill,xpts,ypts, &
940 rlon,rlat,no,crot,srot)
950 IF(idrti==40) idrti=4
951 IF(idrti==0.OR.idrti==4)
THEN
954 iscale=igdtmpli(10)*igdtmpli(11)
955 IF(iscale==0) iscale=10**6
956 rlon1=float(igdtmpli(13))/float(iscale)
957 rlon2=float(igdtmpli(16))/float(iscale)
958 iscan=mod(igdtmpli(19)/128,2)
959 jscan=mod(igdtmpli(19)/64,2)
960 nscan=mod(igdtmpli(19)/32,2)
965 IF(ibi(k).NE.0) iret=41
969 dlon=(mod(rlon2-rlon1-1+3600,360.)+1)/(im-1)
971 dlon=-(mod(rlon1-rlon2-1+3600,360.)+1)/(im-1)
973 ig=nint(360/abs(dlon))
974 iprime=1+mod(-nint(rlon1/dlon)+ig,ig)
977 IF(mod(ig,2).NE.0.OR.im.LT.ig) iret=41
979 IF(iret.EQ.0.AND.idrti.EQ.0)
THEN
980 iscale=igdtmpli(10)*igdtmpli(11)
981 IF(iscale==0) iscale=10**6
982 rlat1=float(igdtmpli(12))/float(iscale)
983 rlat2=float(igdtmpli(15))/float(iscale)
984 dlat=(rlat2-rlat1)/(jm-1)
985 jg=nint(180/abs(dlat))
986 IF(jm.EQ.jg) idrti=256
987 IF(jm.NE.jg.AND.jm.NE.jg+1) iret=41
988 ELSEIF(iret.EQ.0.AND.idrti.EQ.4)
THEN
998 IF(iromb.EQ.0.AND.idrti.EQ.4) maxwv=(jmaxi-1)
999 IF(iromb.EQ.1.AND.idrti.EQ.4) maxwv=(jmaxi-1)/2
1000 IF(iromb.EQ.0.AND.idrti.EQ.0) maxwv=(jmaxi-3)/2
1001 IF(iromb.EQ.1.AND.idrti.EQ.0) maxwv=(jmaxi-3)/4
1002 IF(iromb.EQ.0.AND.idrti.EQ.256) maxwv=(jmaxi-1)/2
1003 IF(iromb.EQ.1.AND.idrti.EQ.256) maxwv=(jmaxi-1)/4
1005 IF((iromb.NE.0.AND.iromb.NE.1).OR.maxwv.LT.0) iret=42
1017 IF(iscan.EQ.1) iskipi=-iskipi
1018 IF(jscan.EQ.0) jskipi=-jskipi
1021 IF((igdtnumo.EQ.0.OR.igdtnumo.EQ.40).AND. &
1022 mod(igdtmplo(8),2).EQ.0.AND.igdtmplo(13).EQ.0.AND. &
1023 igdtmplo(19).EQ.0)
THEN
1025 IF(idrto==40)idrto=4
1028 iscale=igdtmplo(10)*igdtmplo(11)
1029 IF(iscale==0) iscale=10**6
1030 rlon2=float(igdtmplo(16))/float(iscale)
1031 dlono=(mod(rlon2-1+3600,360.)+1)/(imo-1)
1032 igo=nint(360/abs(dlono))
1033 IF(imo.EQ.igo.AND.idrto.EQ.0)
THEN
1034 rlat1=float(igdtmplo(12))/float(iscale)
1035 rlat2=float(igdtmplo(15))/float(iscale)
1036 dlat=(rlat2-rlat1)/(jmo-1)
1037 jgo=nint(180/abs(dlat))
1038 IF(jmo.EQ.jgo) idrto=256
1039 IF(jmo.EQ.jgo.OR.jmo.EQ.jgo+1) ispec=1
1040 ELSEIF(imo.EQ.igo.AND.idrto.EQ.4)
THEN
1042 IF(jmo.EQ.jgo) ispec=1
1045 CALL sptrunv(iromb,maxwv,idrti,imaxi,jmaxi,idrto,imo,jmo, &
1046 km,iprime,iskipi,jskipi,mi,0,0,mo,0,ui,vi, &
1047 .true.,uo,vo,.false.,dumm,dumm,.false.,dumm,dumm)
1050 ELSEIF(igdtnumo.EQ.20.AND. &
1051 igdtmplo(8).EQ.igdtmplo(9).AND.mod(igdtmplo(8),2).EQ.1.AND. &
1052 igdtmplo(15).EQ.igdtmplo(16).AND.igdtmplo(18).EQ.64.AND. &
1053 mod(igdtmplo(12)/8,2).EQ.1)
THEN
1055 rlat1=float(igdtmplo(10))*1.e-6
1056 rlon1=float(igdtmplo(11))*1.e-6
1057 orient=float(igdtmplo(14))*1.e-6
1058 xmesh=float(igdtmplo(15))*1.e-3
1059 iproj=mod(igdtmplo(17)/128,2)
1062 slat=float(abs(igdtmplo(13)))*1.e-6
1064 de=(1.+sin(slat/dpr))*rerth
1065 dr=de*cos(rlat1/dpr)/(1+h*sin(rlat1/dpr))
1066 xp=1-h*sin((rlon1-orient)/dpr)*dr/xmesh
1067 yp=1+cos((rlon1-orient)/dpr)*dr/xmesh
1068 IF(nint(xp).EQ.ip.AND.nint(yp).EQ.ip)
THEN
1070 CALL sptrunsv(iromb,maxwv,idrti,imaxi,jmaxi,km,nps, &
1071 iprime,iskipi,jskipi,mi,mo,0,0,0, &
1072 slat,xmesh,orient,ui,vi,.true.,uo,vo,uo2,vo2, &
1073 .false.,dumm,dumm,dumm,dumm, &
1074 .false.,dumm,dumm,dumm,dumm)
1076 CALL sptrunsv(iromb,maxwv,idrti,imaxi,jmaxi,km,nps, &
1077 iprime,iskipi,jskipi,mi,mo,0,0,0, &
1078 slat,xmesh,orient,ui,vi,.true.,uo2,vo2,uo,vo, &
1079 .false.,dumm,dumm,dumm,dumm, &
1080 .false.,dumm,dumm,dumm,dumm)
1085 ELSEIF(igdtnumo.EQ.10)
THEN
1088 rlat1=float(igdtmplo(10))*1.0e-6
1089 rlon1=float(igdtmplo(11))*1.0e-6
1090 rlon2=float(igdtmplo(15))*1.0e-6
1091 rlati=float(igdtmplo(13))*1.0e-6
1092 iscano=mod(igdtmplo(16)/128,2)
1093 jscano=mod(igdtmplo(16)/64,2)
1094 nscano=mod(igdtmplo(16)/32,2)
1095 dy=float(igdtmplo(19))*1.0e-3
1097 hj=(-1.)**(1-jscano)
1099 dlono=hi*(mod(hi*(rlon2-rlon1)-1+3600,360.)+1)/(ni-1)
1100 dlato=hj*dy/(rerth*cos(rlati/dpr))*dpr
1101 IF(nscano.EQ.0)
THEN
1102 CALL sptrunmv(iromb,maxwv,idrti,imaxi,jmaxi,km,ni,nj, &
1103 iprime,iskipi,jskipi,mi,mo,0,0,0, &
1104 rlat1,rlon1,dlato,dlono,ui,vi, &
1105 .true.,uo,vo,.false.,dumm,dumm,.false.,dumm,dumm)
1111 CALL sptrungv(iromb,maxwv,idrti,imaxi,jmaxi,km,no, &
1112 iprime,iskipi,jskipi,mi,mo,0,0,0,rlat,rlon, &
1113 ui,vi,.true.,uo,vo,.false.,dumm,dumm,.false.,dumm,dumm)
1118 urot=crot(n)*uo(n,k)-srot(n)*vo(n,k)
1119 vrot=srot(n)*uo(n,k)+crot(n)*vo(n,k)
1223 NO,RLAT,RLON,CROT,SROT,IBO,LO,UO,VO,IRET)
1224 INTEGER,
INTENT(IN ) :: IPOPT(20), IBI(KM)
1225 INTEGER,
INTENT(IN ) :: KM, MI, MO
1226 INTEGER,
INTENT( OUT) :: IRET, IBO(KM)
1227 INTEGER,
INTENT(IN) :: KGDSI(200),KGDSO(200)
1229 LOGICAL*1,
INTENT( OUT) :: LO(MO,KM)
1231 REAL,
INTENT(IN ) :: UI(MI,KM),VI(MI,KM)
1232 REAL,
INTENT( OUT) :: UO(MO,KM),VO(MO,KM)
1233 REAL,
INTENT(INOUT) :: RLAT(MO),RLON(MO)
1234 REAL,
INTENT( OUT) :: CROT(MO),SROT(MO)
1236 REAL,
PARAMETER :: FILL=-9999.
1237 REAL,
PARAMETER :: RERTH=6.3712e6
1238 REAL,
PARAMETER :: PI=3.14159265358979
1239 REAL,
PARAMETER :: DPR=180./pi
1241 INTEGER :: IDRTO, IROMB, ISKIPI, ISPEC
1242 INTEGER :: IDRTI, IMAXI, JMAXI, IM, JM
1243 INTEGER :: IPRIME, IG, IMO, JMO, IGO, JGO
1244 INTEGER :: ISCAN, JSCAN, NSCAN
1245 INTEGER :: ISCANO, JSCANO, NSCANO
1246 INTEGER :: IP, IPROJ, JSKIPI, JG
1247 INTEGER :: K, MAXWV, N, NI, NJ, NO, NPS
1249 REAL :: DLAT, DLON, DLATO, DLONO, DE, DR, DY
1250 REAL :: H, HI, HJ, DUMM(1)
1252 REAL :: RLAT1, RLON1, RLAT2, RLON2, RLATI
1253 REAL :: UROT, VROT, UO2(MO,KM),VO2(MO,KM)
1254 REAL :: XMESH, XP, YP, XPTS(MO),YPTS(MO)
1257 class(
ip_grid),
allocatable :: grid_in, grid_out
1267 IF(kgdso(1).GE.0)
THEN
1268 CALL gdswzd(grid_out, 0,mo,fill,xpts,ypts,rlon,rlat,no,crot,srot)
1280 rlon1=kgdsi(5)*1.e-3
1281 rlon2=kgdsi(8)*1.e-3
1282 iscan=mod(kgdsi(11)/128,2)
1283 jscan=mod(kgdsi(11)/64,2)
1284 nscan=mod(kgdsi(11)/32,2)
1285 IF(idrti.NE.0.AND.idrti.NE.4) iret=41
1287 IF(ibi(k).NE.0) iret=41
1291 dlon=(mod(rlon2-rlon1-1+3600,360.)+1)/(im-1)
1293 dlon=-(mod(rlon1-rlon2-1+3600,360.)+1)/(im-1)
1295 ig=nint(360/abs(dlon))
1296 iprime=1+mod(-nint(rlon1/dlon)+ig,ig)
1299 IF(mod(ig,2).NE.0.OR.im.LT.ig) iret=41
1301 IF(iret.EQ.0.AND.idrti.EQ.0)
THEN
1302 rlat1=kgdsi(4)*1.e-3
1303 rlat2=kgdsi(7)*1.e-3
1304 dlat=(rlat2-rlat1)/(jm-1)
1305 jg=nint(180/abs(dlat))
1306 IF(jm.EQ.jg) idrti=256
1307 IF(jm.NE.jg.AND.jm.NE.jg+1) iret=41
1308 ELSEIF(iret.EQ.0.AND.idrti.EQ.4)
THEN
1310 IF(jm.NE.jg) iret=41
1317 IF(maxwv.EQ.-1)
THEN
1318 IF(iromb.EQ.0.AND.idrti.EQ.4) maxwv=(jmaxi-1)
1319 IF(iromb.EQ.1.AND.idrti.EQ.4) maxwv=(jmaxi-1)/2
1320 IF(iromb.EQ.0.AND.idrti.EQ.0) maxwv=(jmaxi-3)/2
1321 IF(iromb.EQ.1.AND.idrti.EQ.0) maxwv=(jmaxi-3)/4
1322 IF(iromb.EQ.0.AND.idrti.EQ.256) maxwv=(jmaxi-1)/2
1323 IF(iromb.EQ.1.AND.idrti.EQ.256) maxwv=(jmaxi-1)/4
1325 IF((iromb.NE.0.AND.iromb.NE.1).OR.maxwv.LT.0) iret=42
1337 IF(iscan.EQ.1) iskipi=-iskipi
1338 IF(jscan.EQ.0) jskipi=-jskipi
1341 IF((kgdso(1).EQ.0.OR.kgdso(1).EQ.4).AND. &
1342 mod(kgdso(2),2).EQ.0.AND.kgdso(5).EQ.0.AND. &
1343 kgdso(11).EQ.0)
THEN
1347 rlon2=kgdso(8)*1.e-3
1348 dlono=(mod(rlon2-1+3600,360.)+1)/(imo-1)
1349 igo=nint(360/abs(dlono))
1350 IF(imo.EQ.igo.AND.idrto.EQ.0)
THEN
1351 rlat1=kgdso(4)*1.e-3
1352 rlat2=kgdso(7)*1.e-3
1353 dlat=(rlat2-rlat1)/(jmo-1)
1354 jgo=nint(180/abs(dlat))
1355 IF(jmo.EQ.jgo) idrto=256
1356 IF(jmo.EQ.jgo.OR.jmo.EQ.jgo+1) ispec=1
1357 ELSEIF(imo.EQ.igo.AND.idrto.EQ.4)
THEN
1359 IF(jmo.EQ.jgo) ispec=1
1362 CALL sptrunv(iromb,maxwv,idrti,imaxi,jmaxi,idrto,imo,jmo, &
1363 km,iprime,iskipi,jskipi,mi,0,0,mo,0,ui,vi, &
1364 .true.,uo,vo,.false.,dumm,dumm,.false.,dumm,dumm)
1367 ELSEIF(kgdso(1).EQ.5.AND. &
1368 kgdso(2).EQ.kgdso(3).AND.mod(kgdso(2),2).EQ.1.AND. &
1369 kgdso(8).EQ.kgdso(9).AND.kgdso(11).EQ.64.AND. &
1370 mod(kgdso(6)/8,2).EQ.1)
THEN
1372 rlat1=kgdso(4)*1.e-3
1373 rlon1=kgdso(5)*1.e-3
1374 orient=kgdso(7)*1.e-3
1376 iproj=mod(kgdso(10)/128,2)
1379 de=(1.+sin(60./dpr))*rerth
1380 dr=de*cos(rlat1/dpr)/(1+h*sin(rlat1/dpr))
1381 xp=1-h*sin((rlon1-orient)/dpr)*dr/xmesh
1382 yp=1+cos((rlon1-orient)/dpr)*dr/xmesh
1383 IF(nint(xp).EQ.ip.AND.nint(yp).EQ.ip)
THEN
1385 CALL sptrunsv(iromb,maxwv,idrti,imaxi,jmaxi,km,nps, &
1386 iprime,iskipi,jskipi,mi,mo,0,0,0, &
1387 60.,xmesh,orient,ui,vi,.true.,uo,vo,uo2,vo2, &
1388 .false.,dumm,dumm,dumm,dumm, &
1389 .false.,dumm,dumm,dumm,dumm)
1391 CALL sptrunsv(iromb,maxwv,idrti,imaxi,jmaxi,km,nps, &
1392 iprime,iskipi,jskipi,mi,mo,0,0,0, &
1393 60.,xmesh,orient,ui,vi,.true.,uo2,vo2,uo,vo, &
1394 .false.,dumm,dumm,dumm,dumm, &
1395 .false.,dumm,dumm,dumm,dumm)
1400 ELSEIF(kgdso(1).EQ.1)
THEN
1403 rlat1=kgdso(4)*1.e-3
1404 rlon1=kgdso(5)*1.e-3
1405 rlon2=kgdso(8)*1.e-3
1406 rlati=kgdso(9)*1.e-3
1407 iscano=mod(kgdso(11)/128,2)
1408 jscano=mod(kgdso(11)/64,2)
1409 nscano=mod(kgdso(11)/32,2)
1412 hj=(-1.)**(1-jscano)
1413 dlono=hi*(mod(hi*(rlon2-rlon1)-1+3600,360.)+1)/(ni-1)
1414 dlato=hj*dy/(rerth*cos(rlati/dpr))*dpr
1415 IF(nscano.EQ.0)
THEN
1416 CALL sptrunmv(iromb,maxwv,idrti,imaxi,jmaxi,km,ni,nj, &
1417 iprime,iskipi,jskipi,mi,mo,0,0,0, &
1418 rlat1,rlon1,dlato,dlono,ui,vi, &
1419 .true.,uo,vo,.false.,dumm,dumm,.false.,dumm,dumm)
1425 CALL sptrungv(iromb,maxwv,idrti,imaxi,jmaxi,km,no, &
1426 iprime,iskipi,jskipi,mi,mo,0,0,0,rlat,rlon, &
1427 ui,vi,.true.,uo,vo,.false.,dumm,dumm,.false.,dumm,dumm)
1432 urot=crot(n)*uo(n,k)-srot(n)*vo(n,k)
1433 vrot=srot(n)*uo(n,k)+crot(n)*vo(n,k)