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/FLO/flo_oce.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/FLO/flo_oce.F90

    r2528 r2715  
    1212   !!---------------------------------------------------------------------- 
    1313   USE par_oce         ! ocean parameters 
     14   USE in_out_manager  ! I/O manager 
     15   USE lib_mpp         ! MPP library 
    1416 
    1517   IMPLICIT NONE 
    1618   PUBLIC 
     19 
     20   PUBLIC   flo_oce_alloc   ! Routine called in floats.F90 
    1721 
    1822   LOGICAL, PUBLIC, PARAMETER ::   lk_floats = .TRUE.    !: float flag 
     
    3236   REAL(wp), PUBLIC, DIMENSION(jpnfl) ::   tpifl, tpjfl, tpkfl   !: (i,j,k) indices of float position 
    3337 
    34    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   wb              !: vertical velocity at previous time step (m s-1). 
     38   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   wb   !: vertical velocity at previous time step (m s-1). 
    3539    
    3640   !                                            !!! * namelist namflo : langrangian floats * 
     
    4145   INTEGER, PUBLIC  ::   nn_stockfl = 450        !: frequency of float restart file 
    4246 
     47   !!---------------------------------------------------------------------- 
     48   !! NEMO/OPA 4.0 , NEMO Consortium (2011) 
     49   !! $Id$  
     50   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     51   !!---------------------------------------------------------------------- 
     52CONTAINS 
     53 
     54   INTEGER FUNCTION flo_oce_alloc() 
     55      !!---------------------------------------------------------------------- 
     56      !!                 ***  FUNCTION flo_oce_alloc  *** 
     57      !!---------------------------------------------------------------------- 
     58      ALLOCATE( wb(jpi,jpj,jpk)   , STAT=flo_oce_alloc ) 
     59      ! 
     60      IF( lk_mpp             )   CALL mpp_sum ( flo_oce_alloc ) 
     61      IF( flo_oce_alloc /= 0 )   CALL ctl_warn('flo_oce_alloc: failed to allocate arrays') 
     62   END FUNCTION flo_oce_alloc 
     63 
    4364#else 
    4465   !!---------------------------------------------------------------------- 
     
    4869#endif 
    4970 
    50    !!---------------------------------------------------------------------- 
    51    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    52    !! $Id$  
    53    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    5471   !!====================================================================== 
    5572END MODULE flo_oce 
Note: See TracChangeset for help on using the changeset viewer.