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

Changeset 12493


Ignore:
Timestamp:
2020-03-02T08:56:31+01:00 (4 years ago)
Author:
smasson
Message:

trunk: minor optimisation in diawri, see #2392

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/DIA/diawri.F90

    r12489 r12493  
    366366      INTEGER, DIMENSION(2) :: ierr 
    367367      !!---------------------------------------------------------------------- 
    368       ierr = 0 
    369       ALLOCATE( ndex_hT(jpi*jpj) , ndex_T(jpi*jpj*jpk) ,     & 
    370          &      ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) ,     & 
    371          &      ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) ) 
     368      IF( nn_write == -1 ) THEN 
     369         dia_wri_alloc = 0 
     370      ELSE     
     371         ierr = 0 
     372         ALLOCATE( ndex_hT(jpi*jpj) , ndex_T(jpi*jpj*jpk) ,     & 
     373            &      ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) ,     & 
     374            &      ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) ) 
    372375         ! 
    373      dia_wri_alloc = MAXVAL(ierr) 
    374       CALL mpp_sum( 'diawri', dia_wri_alloc ) 
     376         dia_wri_alloc = MAXVAL(ierr) 
     377         CALL mpp_sum( 'diawri', dia_wri_alloc ) 
     378         ! 
     379      ENDIF 
    375380      ! 
    376381   END FUNCTION dia_wri_alloc 
Note: See TracChangeset for help on using the changeset viewer.