Changeset 2301 in lmdz_wrf for trunk/tools
- Timestamp:
- Jan 30, 2019, 2:26:02 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/module_scientific.f90
r2300 r2301 6255 6255 END SUBROUTINE coincident_list_2Dcoords 6256 6256 6257 SUBROUTINE coincident_gridsin2D (dxA, dyA, dxyA, NpointsA, pointsA, dxB, dyB, dxyB, NpointsB, &6257 SUBROUTINE coincident_gridsin2D_old(dxA, dyA, dxyA, NpointsA, pointsA, dxB, dyB, dxyB, NpointsB, & 6258 6258 pointsB, Npoints, points, inpointsA, inpointsB) 6259 6259 ! Subroutine to determine which lists of 2D gridsin points of an A list are also found in a B list … … 6292 6292 ! inpointsB: coincident points list B 6293 6293 6294 fname = 'coincident_gridsin2D '6294 fname = 'coincident_gridsin2D_old' 6295 6295 6296 6296 Npoints = 0 … … 6327 6327 END DO 6328 6328 6329 END SUBROUTINE coincident_gridsin2D_old 6330 6331 SUBROUTINE coincident_gridsin2D(dxA, dyA, dxyA, NpointsA, pointsA, dxB, dyB, dxyB, NpointsB, & 6332 pointsB, Npoints, points, inpointsA, inpointsB) 6333 ! Subroutine to determine which lists of 2D gridsin points of an A list are also found in a B list 6334 6335 IMPLICIT NONE 6336 6337 INTEGER, INTENT(in) :: dxA, dyA, dxyA 6338 INTEGER, INTENT(in) :: dxB, dyB, dxyB 6339 INTEGER, DIMENSION(dxA, dyA), INTENT(in) :: NpointsA 6340 INTEGER, DIMENSION(dxB, dyB), INTENT(in) :: NpointsB 6341 INTEGER, DIMENSION(dxA, dyA, dxyA, 2), INTENT(in) :: pointsA 6342 INTEGER, DIMENSION(dxB, dyB, dxyB, 2), INTENT(in) :: pointsB 6343 INTEGER, DIMENSION(dxA, dyA, dxB, dyB), INTENT(out) :: Npoints 6344 INTEGER, DIMENSION(dxA, dyA, dxB, dyB, dxyA, 2), & 6345 INTENT(out) :: points 6346 INTEGER, DIMENSION(dxA, dyA, dxyA), INTENT(out) :: inpointsA 6347 INTEGER, DIMENSION(dxB, dyB, dxyA), INTENT(out) :: inpointsB 6348 6349 ! Local 6350 INTEGER :: ixA, iyA, ixB, iyB, iv, iv1, iv2 6351 INTEGER :: NA, NB 6352 INTEGER, DIMENSION(dxyA) :: ptsA, ptsB 6353 INTEGER, DIMENSION(dxyA, 2) :: pts 6354 6355 6356 !!!!!!! Variables 6357 ! dxA, dyA: 2D shape of the list A 6358 ! NpointsA: 2D Number of points of the list A 6359 ! pointsA: points of the list A 6360 ! dxB, dyB: 2D shape of the list B 6361 ! NpointsB: 2D Number of points of the list B 6362 ! pointsB: points of the list B 6363 ! Npoints: Number of coincident points 6364 ! points: coincident points 6365 ! inpointsA: coincident points list A 6366 ! inpointsB: coincident points list B 6367 6368 fname = 'coincident_gridsin2D' 6369 6370 Npoints = 0 6371 points = 0 6372 inpointsA = 0 6373 inpointsB = 0 6374 6375 DO ixA=1, dxA 6376 DO iyA=1, dyA 6377 NA = NpointsA(ixA,iyA) 6378 DO ixB=1, dxB 6379 DO iyB=1, dyB 6380 NB = NpointsB(ixB,iyB) 6381 iv = 0 6382 DO iv1=1, NA 6383 DO iv2=1, NB 6384 IF ( (pointsA(ixA,iyA,iv1,1) == pointsB(ixB,iyB,iv2,1)) .AND. & 6385 (pointsA(ixA,iyA,iv1,2) == pointsB(ixB,iyB,iv2,2)) ) THEN 6386 iv = iv + 1 6387 points(ixA,iyA,ixB,iyB,iv,1) = pointsA(ixA,iyA,iv1,1) 6388 points(ixA,iyA,ixB,iyB,iv,2) = pointsA(ixA,iyA,iv1,2) 6389 inpointsA(ixA,iyA,iv) = iv1 6390 inpointsB(ixB,iyB,iv) = iv2 6391 END IF 6392 END DO 6393 END DO 6394 Npoints(ixA,iyA,ixB,iyB) = iv 6395 END DO 6396 END DO 6397 END DO 6398 END DO 6399 6329 6400 END SUBROUTINE coincident_gridsin2D 6330 6401
Note: See TracChangeset
for help on using the changeset viewer.