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 7074 – NEMO

Changeset 7074


Ignore:
Timestamp:
2016-10-24T12:38:05+02:00 (8 years ago)
Author:
jenniewaters
Message:

Bug fix to prevent a memory error when a large number of observations are used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r4650_general_vert_coord_obsoper/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90

    r6406 r7074  
    9898      ! 
    9999      INTEGER :: ierr  
    100       INTEGER, DIMENSION(kno) ::   ivals 
    101       ! 
    102 INCLUDE 'mpif.h' 
    103       !!---------------------------------------------------------------------- 
     100      INTEGER, DIMENSION(:), ALLOCATABLE ::   ivals 
     101      ! 
     102INCLUDE 'mpif.h' 
     103      !!---------------------------------------------------------------------- 
     104 
     105      ALLOCATE( ivals(kno) ) 
    104106 
    105107      ! Call the MPI library to find the maximum across processors 
     
    107109         &                mpi_max, mpi_comm_opa, ierr ) 
    108110      kvals(:) = ivals(:) 
     111 
     112      DEALLOCATE( ivals ) 
    109113#else 
    110114      ! no MPI: empty routine 
     
    138142      ! 
    139143      INTEGER :: ji, isum 
    140       INTEGER, DIMENSION(kno) ::   iobsp 
    141       !! 
    142       !! 
    143  
    144       iobsp=kobsp 
     144      INTEGER, DIMENSION(:), ALLOCATABLE ::   iobsp 
     145      !! 
     146      !! 
     147 
     148      ALLOCATE( iobsp(kno) ) 
     149 
     150      iobsp(:)=kobsp(:) 
    145151 
    146152      WHERE( iobsp(:) == -1 ) 
     
    148154      END WHERE 
    149155 
    150       iobsp=-1*iobsp 
     156      iobsp(:)=-1*iobsp(:) 
    151157 
    152158      CALL obs_mpp_max_integer( iobsp, kno ) 
    153159 
    154       kobsp=-1*iobsp 
     160      kobsp(:)=-1*iobsp(:) 
    155161 
    156162      isum=0 
     
    168174      ENDIF 
    169175 
     176      DEALLOCATE( iobsp ) 
     177 
    170178#else 
    171179      ! no MPI: empty routine 
Note: See TracChangeset for help on using the changeset viewer.