Changeset 10665
- Timestamp:
- 2019-02-13T11:40:04+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/OCE/LBC/mpp_loc_generic.h90
r10425 r10665 17 17 # define MPI_OPERATION mpi_maxloc 18 18 # define LOC_OPERATION MAXLOC 19 # define ERRVAL -HUGE 19 20 # endif 20 21 # if defined OPERATION_MINLOC 21 22 # define MPI_OPERATION mpi_minloc 22 23 # define LOC_OPERATION MINLOC 24 # define ERRVAL HUGE 23 25 # endif 24 26 … … 42 44 ! 43 45 idim = SIZE(kindex) 44 ALLOCATE ( ilocs(idim) )45 46 ! 46 ilocs = LOC_OPERATION( ARRAY_IN(:,:,:) , mask= MASK_IN(:,:,:) == 1._wp ) 47 zmin = ARRAY_IN(ilocs(1),ilocs(2),ilocs(3)) 48 ! 49 kindex(1) = ilocs(1) + nimpp - 1 47 IF ( ALL(MASK_IN(:,:,:) /= 1._wp) ) THEN 48 ! special case for land processors 49 zmin = ERRVAL(zmin) 50 index0 = 0 51 ELSE 52 ALLOCATE ( ilocs(idim) ) 53 ! 54 ilocs = LOC_OPERATION( ARRAY_IN(:,:,:) , mask= MASK_IN(:,:,:) == 1._wp ) 55 zmin = ARRAY_IN(ilocs(1),ilocs(2),ilocs(3)) 56 ! 57 kindex(1) = mig( ilocs(1) ) 50 58 # if defined DIM_2d || defined DIM_3d /* avoid warning when kindex has 1 element */ 51 kindex(2) = ilocs(2) + njmpp - 159 kindex(2) = mjg( ilocs(2) ) 52 60 # endif 53 61 # if defined DIM_3d /* avoid warning when kindex has 2 elements */ 54 kindex(3) = ilocs(3)62 kindex(3) = ilocs(3) 55 63 # endif 56 !57 DEALLOCATE (ilocs)58 !59 index0 = kindex(1)-1 ! 1d index starting at 064 ! 65 DEALLOCATE (ilocs) 66 ! 67 index0 = kindex(1)-1 ! 1d index starting at 0 60 68 # if defined DIM_2d || defined DIM_3d /* avoid warning when kindex has 1 element */ 61 index0 = index0 + jpiglo * (kindex(2)-1)69 index0 = index0 + jpiglo * (kindex(2)-1) 62 70 # endif 63 71 # if defined DIM_3d /* avoid warning when kindex has 2 elements */ 64 index0 = index0 + jpiglo * jpjglo * (kindex(3)-1)72 index0 = index0 + jpiglo * jpjglo * (kindex(3)-1) 65 73 # endif 74 END IF 66 75 zain(1,:) = zmin 67 76 zain(2,:) = REAL(index0, wp)
Note: See TracChangeset
for help on using the changeset viewer.