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 2715 for trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90 – NEMO

Ignore:
Timestamp:
2011-03-30T17:58:35+02:00 (13 years ago)
Author:
rblod
Message:

First attempt to put dynamic allocation on the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90

    r2528 r2715  
    4040   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    4141   !! $Id$  
    42    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    43    !!---------------------------------------------------------------------- 
    44  
     42   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     43   !!---------------------------------------------------------------------- 
    4544CONTAINS 
    4645 
     
    320319      !! 
    321320      INTEGER  ::   ji, jk   ! dummy loop indices 
    322       INTEGER  ::   iloc     ! temporary integers 
    323       REAL(wp), DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) ::   ztab   ! 2D workspace 
    324       !!---------------------------------------------------------------------- 
    325  
     321      INTEGER  ::   iloc     ! local integers 
     322      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ztab   ! workspace allocated one for all 
     323      !!---------------------------------------------------------------------- 
     324 
     325      IF( .NOT. ALLOCATED( ztab ) ) THEN 
     326         ALLOCATE( ztab(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4), STAT=iloc ) 
     327         IF( lk_mpp    )   CALL mpp_sum ( iloc ) 
     328         IF( iloc /= 0 )   CALL ctl_stop('STOP', 'sol_exd: failed to allocate array') 
     329      ENDIF 
     330       
    326331      ztab = pt3d 
    327332 
Note: See TracChangeset for help on using the changeset viewer.