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/TOP_SRC/TRP/trcnxt.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/TOP_SRC/TRP/trcnxt.F90

    r2528 r2715  
    33   !!                       ***  MODULE  trcnxt  *** 
    44   !! Ocean passive tracers:  time stepping on passives tracers 
    5    !!====================================================================== 
    65   !!====================================================================== 
    76   !! History :  7.0  !  1991-11  (G. Madec)  Original code 
     
    2726   !!   trc_nxt     : time stepping on passive tracers 
    2827   !!---------------------------------------------------------------------- 
    29    !! * Modules used 
    3028   USE oce_trc         ! ocean dynamics and tracers variables 
    3129   USE trc             ! ocean passive tracers variables 
     
    4341   PRIVATE 
    4442 
    45    !! * Routine accessibility 
    46    PUBLIC trc_nxt          ! routine called by step.F90 
     43   PUBLIC   trc_nxt          ! routine called by step.F90 
     44   PUBLIC   trc_nxt_alloc    ! routine called by nemogcm.F90 
    4745 
    48   REAL(wp), DIMENSION(jpk) ::   r2dt 
     46   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   r2dt 
     47 
    4948   !!---------------------------------------------------------------------- 
    5049   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    5150   !! $Id$  
    52    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     51   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    5352   !!---------------------------------------------------------------------- 
     53CONTAINS 
    5454 
    55 CONTAINS 
     55   INTEGER FUNCTION trc_nxt_alloc() 
     56      !!---------------------------------------------------------------------- 
     57      !!                   ***  ROUTINE trc_nxt_alloc  *** 
     58      !!---------------------------------------------------------------------- 
     59      ALLOCATE( r2dt(jpk), STAT=trc_nxt_alloc ) 
     60      ! 
     61      IF( trc_nxt_alloc /= 0 )   CALL ctl_warn('trc_nxt_alloc : failed to allocate array') 
     62      ! 
     63   END FUNCTION trc_nxt_alloc 
     64 
    5665 
    5766   SUBROUTINE trc_nxt( kt ) 
     
    7988      !! ** Action  : - update trb, trn 
    8089      !!---------------------------------------------------------------------- 
    81       !! * Arguments 
    8290      INTEGER, INTENT( in ) ::   kt     ! ocean time-step index 
    83       !! * Local declarations 
     91      ! 
    8492      INTEGER  ::   jk, jn   ! dummy loop indices 
    8593      REAL(wp) ::   zfact            ! temporary scalar 
Note: See TracChangeset for help on using the changeset viewer.