- Timestamp:
- Apr 26, 2016, 5:54:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/module_ForInterpolate.F90
r716 r728 216 216 INTEGER, DIMENSION(Ninpts), INTENT(out) :: newvarinpt 217 217 REAL(r_k), DIMENSION(Ninpts), INTENT(out) :: newvarindiff 218 218 219 ! Local 219 INTEGER :: iv 220 INTEGER :: iv,i,j 221 INTEGER :: ierr 220 222 INTEGER, DIMENSION(2) :: ilonlat 221 223 REAL(r_k) :: mindiffLl … … 223 225 REAL(r_k), DIMENSION(2) :: extremelon, extremelat 224 226 REAL(r_k), ALLOCATABLE, DIMENSION(:,:) :: fractionlon, fractionlat 225 INTEGER :: fracdx, fracdy227 INTEGER :: dfracdx, dfracdy, fracdx, fracdy 226 228 CHARACTER(LEN=50) :: fname 227 229 … … 246 248 extremelat = (/ MINVAL(projlat), MAXVAL(projlat) /) 247 249 250 PRINT *,' ' // TRIM(fname) //' fraction:', dimx, ' ,', dimy, ' %', percen 251 252 dfracdx = INT(1./percen) 253 dfracdy = INT(1./percen) 248 254 fracdx = INT(dimx*percen) 249 255 fracdy = INT(dimy*percen) 250 256 251 257 IF (ALLOCATED(fractionlon)) DEALLOCATE(fractionlon) 252 ALLOCATE(fractionlon(fracdx, fracdy)) 258 ALLOCATE(fractionlon(dfracdx, dfracdy), STAT=ierr) 259 IF (ierr /= 0) THEN 260 PRINT *,TRIM(ErrWarnMsg('err')) 261 PRINT *,' ' // TRIM(fname) //": problem allocating 'fractionlon' !!" 262 STOP 263 END IF 253 264 IF (ALLOCATED(fractionlat)) DEALLOCATE(fractionlat) 254 ALLOCATE(fractionlat(fracdx, fracdy)) 255 256 fractionlon = projlon(::fracdx,::fracdy) 257 fractionlat = projlat(::fracdx,::fracdy) 265 ALLOCATE(fractionlat(dfracdx, dfracdy), STAT=ierr) 266 IF (ierr /= 0) THEN 267 PRINT *,TRIM(ErrWarnMsg('err')) 268 PRINT *,' ' // TRIM(fname) //": problem allocating 'fractionlat' !!" 269 STOP 270 END IF 271 272 DO i=1,dfracdx 273 DO j=1,dfracdy 274 fractionlon(i,j) = projlon(fracdx*(i-1),fracdy*(j-1)) 275 fractionlat(i,j) = projlat(fracdx*(i-1),fracdy*(j-1)) 276 END DO 277 END DO 278 279 PRINT *,' ' // TRIM(fname) // ' fractions of:' 280 PRINT *,' lon _______' 281 PRINT *,fractionlon 282 PRINT *,' lat_______' 283 PRINT *,fractionlat 258 284 259 285 DO iv=1,Ninpts 260 286 IF (newvarinpt(iv) == 0) THEN 261 287 CALL CoarselonlatFind(dimx, dimy, projlon, projlat, extremelon, extremelat, fractionlon, & 262 fractionlat, lonvs(iv), latvs(iv), percen, fracdx,fracdy, ilonlat, mindiffLl)288 fractionlat, lonvs(iv), latvs(iv), percen, dfracdx, dfracdy, ilonlat, mindiffLl) 263 289 264 290 IF (mindiffLl <= mindiff) THEN
Note: See TracChangeset
for help on using the changeset viewer.