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 12494 for NEMO/releases/release-4.0-HEAD/src/OCE/DIA/diawri.F90 – NEMO

Ignore:
Timestamp:
2020-03-02T09:04:06+01:00 (4 years ago)
Author:
smasson
Message:

release-4.0-HEAD: minor optimisation in diawri, see #2393

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/releases/release-4.0-HEAD/src/OCE/DIA/diawri.F90

    r12206 r12494  
    406406      INTEGER, DIMENSION(2) :: ierr 
    407407      !!---------------------------------------------------------------------- 
    408       ierr = 0 
    409       ALLOCATE( ndex_hT(jpi*jpj) , ndex_T(jpi*jpj*jpk) ,     & 
    410          &      ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) ,     & 
    411          &      ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) ) 
     408      IF( nn_write == -1 ) THEN 
     409         dia_wri_alloc = 0 
     410      ELSE     
     411         ierr = 0 
     412         ALLOCATE( ndex_hT(jpi*jpj) , ndex_T(jpi*jpj*jpk) ,     & 
     413            &      ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) ,     & 
     414            &      ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) ) 
    412415         ! 
    413       dia_wri_alloc = MAXVAL(ierr) 
    414       CALL mpp_sum( 'diawri', dia_wri_alloc ) 
     416         dia_wri_alloc = MAXVAL(ierr) 
     417         CALL mpp_sum( 'diawri', dia_wri_alloc ) 
     418         ! 
     419      ENDIF 
    415420      ! 
    416421   END FUNCTION dia_wri_alloc 
Note: See TracChangeset for help on using the changeset viewer.