NCEPLIBS-ip 5.2.0
Loading...
Searching...
No Matches
ipxetas.F90
Go to the documentation of this file.
1
4
40
44
89! @author Iredell @date 96-04-10
90 SUBROUTINE ipxetas(IDIR, IGDTNUMI, IGDTLEN, IGDTMPLI, NPTS_INPUT, &
91 BITMAP_INPUT, DATA_INPUT, IGDTNUMO, IGDTMPLO, &
92 NPTS_OUTPUT, BITMAP_OUTPUT, DATA_OUTPUT, IRET)
93 USE ipolates_mod
94 IMPLICIT NONE
95!
96 INTEGER, INTENT(IN ) :: IDIR
97 INTEGER, INTENT(IN ) :: IGDTNUMI, IGDTLEN
98 INTEGER, INTENT(IN ) :: IGDTMPLI(IGDTLEN)
99 INTEGER, INTENT(IN ) :: NPTS_INPUT, NPTS_OUTPUT
100 INTEGER, INTENT( OUT) :: IGDTNUMO
101 INTEGER, INTENT( OUT) :: IGDTMPLO(IGDTLEN)
102 INTEGER, INTENT( OUT) :: IRET
103
104 LOGICAL(KIND=1), INTENT(IN ) :: BITMAP_INPUT(NPTS_INPUT)
105 LOGICAL(KIND=1), INTENT( OUT) :: BITMAP_OUTPUT(NPTS_OUTPUT)
106
107 REAL, INTENT(IN ) :: DATA_INPUT(NPTS_INPUT)
108 REAL, INTENT( OUT) :: DATA_OUTPUT(NPTS_OUTPUT)
109
110 INTEGER :: SCAN_MODE, ISCALE, IP, IPOPT(20)
111 INTEGER :: IBI, IBO, J, KM, NO
112
113 REAL :: DLONS
114 REAL, ALLOCATABLE :: OUTPUT_RLAT(:), OUTPUT_RLON(:)
115! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
116 iret = 0
117! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
118! ROUTINE ONLY WORKS FOR ROTATED LAT/LON GRIDS.
119 IF (igdtnumi/=1) THEN
120 iret=1
121 RETURN
122 ENDIF
123!
124 scan_mode=igdtmpli(19)
125 IF((scan_mode==68.OR.scan_mode==72).AND.(idir<-2.OR.idir>-1))THEN
126 igdtnumo=igdtnumi
127 igdtmplo=igdtmpli
128 igdtmplo(19)=64
129 igdtmplo(8)=igdtmplo(8)*2-1
130 IF((igdtmplo(8)*igdtmplo(9))/=npts_output)THEN
131 iret=3
132 RETURN
133 ENDIF
134 iscale=igdtmplo(10)*igdtmplo(11)
135 IF(iscale==0) iscale=10**6
136 dlons=float(igdtmplo(17))/float(iscale)
137 dlons=dlons*0.5
138 igdtmplo(17)=nint(dlons*float(iscale))
139 ELSEIF(scan_mode==64.AND.idir==-1)THEN ! FULL TO H-GRID
140 igdtnumo=igdtnumi
141 igdtmplo=igdtmpli
142 igdtmplo(19)=68
143 igdtmplo(8)=(igdtmplo(8)+1)/2
144 IF((igdtmplo(8)*igdtmplo(9))/=npts_output)THEN
145 iret=3
146 RETURN
147 ENDIF
148 iscale=igdtmplo(10)*igdtmplo(11)
149 IF(iscale==0) iscale=10**6
150 dlons=float(igdtmplo(17))/float(iscale)
151 dlons=dlons*2.0
152 igdtmplo(17)=nint(dlons*float(iscale))
153 ELSEIF(scan_mode==64.AND.idir==-2)THEN ! FULL TO V-GRID
154 igdtnumo=igdtnumi
155 igdtmplo=igdtmpli
156 igdtmplo(19)=72
157 igdtmplo(8)=(igdtmplo(8)+1)/2
158 IF((igdtmplo(8)*igdtmplo(9))/=npts_output)THEN
159 iret=3
160 RETURN
161 ENDIF
162 iscale=igdtmplo(10)*igdtmplo(11)
163 IF(iscale==0) iscale=10**6
164 dlons=float(igdtmplo(17))/float(iscale)
165 dlons=dlons*2.0
166 igdtmplo(17)=nint(dlons*float(iscale))
167 ELSE
168 iret=2
169 RETURN
170 ENDIF
171
172 km=1
173 ip=0
174 ipopt=0
175 ibi=1
176 ibo=0
177
178 ALLOCATE(output_rlat(npts_output))
179 ALLOCATE(output_rlon(npts_output))
180
181 CALL ipolates(ip, ipopt, igdtnumi, igdtmpli, igdtlen, &
182 igdtnumo, igdtmplo, igdtlen, &
183 npts_input, npts_output, km, ibi, bitmap_input, data_input, &
184 no, output_rlat, output_rlon, ibo, bitmap_output, data_output, iret)
185
186 DEALLOCATE(output_rlat, output_rlon)
187
188 IF(iret /= 0)THEN
189 print*,'- PROBLEM IN IPOLATES: ', iret
190 RETURN
191 ENDIF
192
193! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
194! REPLACE ANY UNDEFINED POINTS ALONG THE LEFT AND RIGHT EDGES.
195 DO j=1, igdtmplo(9)
196 bitmap_output(j*igdtmplo(8))=bitmap_output(j*igdtmplo(8)-1)
197 data_output(j*igdtmplo(8))=data_output(j*igdtmplo(8)-1)
198 bitmap_output((j-1)*igdtmplo(8)+1)=bitmap_output((j-1)*igdtmplo(8)+2)
199 data_output((j-1)*igdtmplo(8)+1)=data_output((j-1)*igdtmplo(8)+2)
200 ENDDO
201
202 RETURN
203! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
204 END SUBROUTINE ipxetas
subroutine ipxetas(idir, igdtnumi, igdtlen, igdtmpli, npts_input, bitmap_input, data_input, igdtnumo, igdtmplo, npts_output, bitmap_output, data_output, iret)
Expand or contract eta grids using linear interpolation.
Definition ipxetas.F90:93
Top-level driver for scalar interpolation interpolation routine ipolates().
Definition ipolates.F90:12