Changeset 993 for XIOS/trunk/src/test


Ignore:
Timestamp:
11/18/16 11:41:40 (7 years ago)
Author:
oabramkina
Message:

Minor corrections for UGRID.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/test/test_regular.f90

    r924 r993  
    1818  INTEGER :: comm   
    1919  INTEGER :: ierr 
    20   INTEGER :: size, rank 
     20  INTEGER :: sizeComm, rank    ! SIZE is a fortran function 
    2121 
    22   INTEGER :: nlon = 100  
    23   INTEGER :: nlat = 100 
     22  INTEGER :: nlon = 5 !100  
     23  INTEGER :: nlat = 5 !100 
    2424  INTEGER :: ncell  
    2525  INTEGER :: ilat, ilon, ind 
     
    9494 
    9595  CALL MPI_COMM_RANK(comm,rank,ierr) 
    96   CALL MPI_COMM_SIZE(comm,size,ierr) 
     96  CALL MPI_COMM_SIZE(comm,sizeComm,ierr) 
    9797 
    98   IF (MOD(ncell, size) == 0) THEN 
    99     ni = ncell/size 
     98  IF (MOD(ncell, sizeComm) == 0) THEN 
     99    ni = ncell/sizeComm 
    100100    ibegin = rank*ni 
    101101  ELSE 
    102     IF (rank < MOD(ncell, size)) THEN 
    103       ni = ncell/size + 1 
    104       ibegin = rank*(ncell/size + 1) 
     102    IF (rank < MOD(ncell, sizeComm)) THEN 
     103      ni = ncell/sizeComm + 1 
     104      ibegin = rank*(ncell/sizeComm + 1) 
    105105    ELSE 
    106       ni = ncell/size 
    107       IF (rank == MOD(ncell, size)) THEN 
    108         ibegin = rank*(ncell/size + 1) 
     106      ni = ncell/sizeComm 
     107      IF (rank == MOD(ncell, sizeComm)) THEN 
     108        ibegin = rank*(ncell/sizeComm + 1) 
    109109      ELSE 
    110         ibegin = MOD(ncell,size)*(ncell/size + 1) + (rank-MOD(ncell,size))*ncell/size 
     110        ibegin = MOD(ncell,sizeComm)*(ncell/sizeComm + 1) + (rank-MOD(ncell,sizeComm))*ncell/sizeComm 
    111111      END IF 
    112112    END IF 
     
    118118  ALLOCATE(bounds_lat(4,ni)) 
    119119  ALLOCATE(field_temp(ni,ntime))  
    120   lon = lon_glo(1+ibegin:1+ibegin+ni) 
    121   lat = lat_glo(1+ibegin:1+ibegin+ni) 
    122   bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:1+ibegin+ni) 
    123   bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:1+ibegin+ni) 
     120  lon = lon_glo(1+ibegin:ibegin+ni) 
     121  lat = lat_glo(1+ibegin:ibegin+ni) 
     122  bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:ibegin+ni) 
     123  bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:ibegin+ni) 
    124124  field_temp(:,:) = rank 
    125125 
Note: See TracChangeset for help on using the changeset viewer.