New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 6018 for branches – NEMO

Changeset 6018 for branches


Ignore:
Timestamp:
2015-12-08T11:39:37+01:00 (8 years ago)
Author:
jenniewaters
Message:

Changes suggested by reviewers.

Location:
branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/CONFIG/SHARED/namelist_ref

    r5857 r6018  
    12151215   ln_velhradcp = .false.  ! Logical switch for velocity high freq. ADCP 
    12161216   ln_velfb   = .false.    ! Logical switch for feedback velocity data 
    1217    ln_grid_global = .false. ! Global distribtion of observations 
     1217   ln_grid_global = .true. ! Global distribtion of observations 
    12181218   ln_grid_search_lookup = .false. !  Logical switch for obs grid search w/lookup table 
    12191219   grid_search_file = 'grid_search'  !  Grid search lookup file header 
  • branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90

    r5857 r6018  
    463463         RETURN 
    464464      ENDIF 
     465       
     466      IF ( ln_grid_global ) THEN 
     467         CALL ctl_warn( 'ln_grid_global=T may cause memory issues when used with a large number of processors' ) 
     468      ENDIF 
    465469 
    466470      CALL obs_typ_init 
  • branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_grd_bruteforce.h90

    r5857 r6018  
    325325         CALL obs_mpp_max_integer( kobsj, kobs ) 
    326326      ELSE 
    327          CALL obs_mpp_find_obs_proc_local( kproc, kobs ) 
     327         CALL obs_mpp_find_obs_proc( kproc, kobs ) 
    328328      ENDIF 
    329329 
  • branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_grid.F90

    r5857 r6018  
    2121   USE dom_oce                     ! Ocean space and time domain variables 
    2222   USE obs_mpp, ONLY : &           ! MPP support routines for observation diagnostics 
    23       & obs_mpp_find_obs_proc_local, & 
     23      & obs_mpp_find_obs_proc, & 
    2424      & mpp_global_max,        & 
    2525      & obs_mpp_max_integer 
     
    613613         CALL obs_mpp_max_integer( kobsj, kobs ) 
    614614      ELSE 
    615          CALL obs_mpp_find_obs_proc_local( kproc, kobs ) 
     615         CALL obs_mpp_find_obs_proc( kproc, kobs ) 
    616616      ENDIF 
    617617 
  • branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90

    r5943 r6018  
    77   !!             -   ! 2006-05  (K. Mogensen)  Reformatted 
    88   !!             -   ! 2008-01  (K. Mogensen)  add mpp_global_max 
     9   !!            3.6  ! 2015-01  (J. Waters) obs_mpp_find_obs_proc  
     10   !!                            rewritten to avoid global arrays 
    911   !!---------------------------------------------------------------------- 
    1012#  define mpivar mpi_double_precision 
     
    1214   !! obs_mpp_bcast_integer : Broadcast an integer array from a processor to all processors 
    1315   !! obs_mpp_max_integer   : Find maximum on all processors of each value in an integer on all processors 
    14    !! obs_mpp_find_obs_proc : Find processors which should hold the observations 
    15    !! obs_mpp_find_obs_proc_local : Find processors which should hold the observations, avoiding global arrays 
     16   !! obs_mpp_find_obs_proc : Find processors which should hold the observations, avoiding global arrays 
    1617   !! obs_mpp_sum_integers  : Sum an integer array from all processors 
    1718   !! obs_mpp_sum_integer   : Sum an integer from all processors 
     
    2930      &   obs_mpp_max_integer,   & !: Find maximum across processors in an integer array 
    3031      &   obs_mpp_find_obs_proc, & !: Find processors which should hold the observations 
    31       &   obs_mpp_find_obs_proc_local, & !: Find processors which should hold the observations 
    3232      &   obs_mpp_sum_integers,  & !: Sum an integer array from all processors 
    3333      &   obs_mpp_sum_integer,   & !: Sum an integer from all processors 
     
    113113 
    114114 
    115    SUBROUTINE obs_mpp_find_obs_proc( kobsp, kobsi, kobsj, kno ) 
    116       !!---------------------------------------------------------------------- 
    117       !!               ***  ROUTINE obs_mpp_find_obs_proc *** 
    118       !!           
    119       !! ** Purpose : From the array kobsp containing the results of the grid 
    120       !!              grid search on each processor the processor return a 
    121       !!              decision of which processors should hold the observation. 
    122       !! 
    123       !! ** Method  : A temporary 2D array holding all the decisions is 
    124       !!              constructed using mpi_allgather on each processor. 
    125       !!              If more than one processor has found the observation 
    126       !!              with the observation in the inner domain gets it 
    127       !! 
    128       !! ** Action  : This does only work for MPI.  
    129       !!              It does not work for SHMEM. 
    130       !! 
    131       !! References : http://www.mpi-forum.org 
    132       !!---------------------------------------------------------------------- 
    133       INTEGER                , INTENT(in   ) ::   kno 
    134       INTEGER, DIMENSION(kno), INTENT(in   ) ::   kobsi, kobsj 
    135       INTEGER, DIMENSION(kno), INTENT(inout) ::   kobsp 
    136       ! 
    137 #if defined key_mpp_mpi 
    138       ! 
    139       INTEGER :: ji 
    140       INTEGER :: jj 
    141       INTEGER :: size 
    142       INTEGER :: ierr 
    143       INTEGER :: iobsip 
    144       INTEGER :: iobsjp 
    145       INTEGER :: num_sus_obs 
    146       INTEGER, DIMENSION(kno) ::   iobsig, iobsjg 
    147       INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   iobsp, iobsi, iobsj 
    148       !! 
    149 INCLUDE 'mpif.h' 
    150       !!---------------------------------------------------------------------- 
    151  
    152       !----------------------------------------------------------------------- 
    153       ! Call the MPI library to find the maximum accross processors 
    154       !----------------------------------------------------------------------- 
    155       CALL mpi_comm_size( mpi_comm_opa, size, ierr ) 
    156       !----------------------------------------------------------------------- 
    157       ! Convert local grids points to global grid points 
    158       !----------------------------------------------------------------------- 
    159       DO ji = 1, kno 
    160          IF ( ( kobsi(ji) >= 1 ) .AND. ( kobsi(ji) <= jpi ) .AND. & 
    161             & ( kobsj(ji) >= 1 ) .AND. ( kobsj(ji) <= jpj ) ) THEN 
    162             iobsig(ji) = mig( kobsi(ji) ) 
    163             iobsjg(ji) = mjg( kobsj(ji) ) 
    164          ELSE 
    165             iobsig(ji) = -1 
    166             iobsjg(ji) = -1 
    167          ENDIF 
    168       END DO 
    169       !----------------------------------------------------------------------- 
    170       ! Get the decisions from all processors 
    171       !----------------------------------------------------------------------- 
    172       ALLOCATE( iobsp(kno,size) ) 
    173       ALLOCATE( iobsi(kno,size) ) 
    174       ALLOCATE( iobsj(kno,size) ) 
    175       CALL mpi_allgather( kobsp, kno, mpi_integer, & 
    176          &                iobsp, kno, mpi_integer, & 
    177          &                mpi_comm_opa, ierr ) 
    178       CALL mpi_allgather( iobsig, kno, mpi_integer, & 
    179          &                iobsi, kno, mpi_integer, & 
    180          &                mpi_comm_opa, ierr ) 
    181       CALL mpi_allgather( iobsjg, kno, mpi_integer, & 
    182          &                iobsj, kno, mpi_integer, & 
    183          &                mpi_comm_opa, ierr ) 
    184  
    185       !----------------------------------------------------------------------- 
    186       ! Find the processor with observations from the lowest processor  
    187       ! number among processors holding the observation. 
    188       !----------------------------------------------------------------------- 
    189       kobsp(:) = -1 
    190       num_sus_obs = 0 
    191       DO ji = 1, kno 
    192          DO jj = 1, size 
    193             IF ( ( kobsp(ji) == -1 ) .AND. ( iobsp(ji,jj) /= -1 ) ) THEN 
    194                kobsp(ji) = iobsp(ji,jj) 
    195                iobsip = iobsi(ji,jj) 
    196                iobsjp = iobsj(ji,jj) 
    197             ENDIF 
    198             IF ( ( kobsp(ji) /= -1 ) .AND. ( iobsp(ji,jj) /= -1 ) ) THEN 
    199                IF ( ( iobsip /= iobsi(ji,jj) ) .OR. & 
    200                   & ( iobsjp /= iobsj(ji,jj) ) ) THEN 
    201                   IF ( ( kobsp(ji) < 1000000 ) .AND. & 
    202                      & ( iobsp(ji,jj) < 1000000 ) ) THEN 
    203                      num_sus_obs=num_sus_obs+1 
    204                   ENDIF 
    205                ENDIF 
    206                IF ( mppmap(iobsip,iobsjp) /= ( kobsp(ji)+1 ) ) THEN 
    207                   IF ( ( iobsi(ji,jj) /= -1 ) .AND. & 
    208                      & ( iobsj(ji,jj) /= -1 ) ) THEN 
    209                      IF ((mppmap(iobsi(ji,jj),iobsj(ji,jj)) == (iobsp(ji,jj)+1))& 
    210                         & .OR. ( iobsp(ji,jj) < kobsp(ji) ) ) THEN 
    211                         kobsp(ji) = iobsp(ji,jj) 
    212                         iobsip = iobsi(ji,jj) 
    213                         iobsjp = iobsj(ji,jj) 
    214                      ENDIF 
    215                   ENDIF 
    216                ENDIF 
    217             ENDIF 
    218          END DO 
    219       END DO 
    220       IF (lwp) WRITE(numout,*) 'Number of suspicious observations: ',num_sus_obs 
    221  
    222       DEALLOCATE( iobsj ) 
    223       DEALLOCATE( iobsi ) 
    224       DEALLOCATE( iobsp ) 
    225 #else 
    226       ! no MPI: empty routine 
    227 #endif 
    228       ! 
    229    END SUBROUTINE obs_mpp_find_obs_proc 
    230  
    231    SUBROUTINE obs_mpp_find_obs_proc_local( kobsp,kno ) 
    232       !!---------------------------------------------------------------------- 
    233       !!               ***  ROUTINE obs_mpp_find_obs_proc_local *** 
     115   SUBROUTINE obs_mpp_find_obs_proc( kobsp,kno ) 
     116      !!---------------------------------------------------------------------- 
     117      !!               ***  ROUTINE obs_mpp_find_obs_proc  *** 
    234118      !!          
    235119      !! ** Purpose : From the array kobsp containing the results of the grid 
     
    256140      INTEGER, DIMENSION(kno) ::   iobsp 
    257141      !! 
    258 INCLUDE 'mpif.h' 
    259142      !! 
    260143 
     
    289172#endif      
    290173       
    291    END SUBROUTINE obs_mpp_find_obs_proc_local 
     174   END SUBROUTINE obs_mpp_find_obs_proc 
    292175 
    293176 
Note: See TracChangeset for help on using the changeset viewer.