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/trcdta.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/trcdta.F90

    r2528 r2715  
    2323   PRIVATE 
    2424 
    25    PUBLIC trc_dta   ! called in trcini.F90 and trcdmp.F90 
     25   PUBLIC   trc_dta         ! called in trcini.F90 and trcdmp.F90 
     26   PUBLIC   trc_dta_alloc   ! called in nemogcm.F90 
    2627 
    2728   LOGICAL , PUBLIC, PARAMETER ::   lk_dtatrc = .TRUE.   !: temperature data flag 
    28    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk,jptra) ::   trdta   !: tracer data at given time-step 
    29  
    30    REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,2) ::   tracdta            ! tracer data at two consecutive times 
    31    INTEGER , DIMENSION(jptra) ::   nlectr      !: switch for reading once 
    32    INTEGER , DIMENSION(jptra) ::   ntrc1       !: number of first month when reading 12 monthly value 
    33    INTEGER , DIMENSION(jptra) ::   ntrc2       !: number of second month when reading 12 monthly value 
     29   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   trdta   !: tracer data at given time-step 
     30 
     31   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:) ::   tracdta       ! tracer data at two consecutive times 
     32   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) ::   nlectr      !: switch for reading once 
     33   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) ::   ntrc1       !: number of 1st month when reading 12 monthly value 
     34   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) ::   ntrc2       !: number of 2nd month when reading 12 monthly value 
    3435 
    3536   !! * Substitutions 
     
    3839   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    3940   !! $Id$  
    40    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     41   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    4142   !!---------------------------------------------------------------------- 
    4243CONTAINS 
     
    5556      !!      two monthly values. 
    5657      !!---------------------------------------------------------------------- 
    57       INTEGER, INTENT( in ) ::   kt     ! ocean time-step 
     58      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
    5859      !! 
    5960      CHARACTER (len=39) ::   clname(jptra) 
     
    198199   END SUBROUTINE trc_dta 
    199200 
     201 
     202   INTEGER FUNCTION trc_dta_alloc() 
     203      !!---------------------------------------------------------------------- 
     204      !!                   ***  ROUTINE trc_dta_alloc  *** 
     205      !!---------------------------------------------------------------------- 
     206      ALLOCATE( trdta  (jpi,jpj,jpk,jptra  ) ,                    & 
     207         &      tracdta(jpi,jpj,jpk,jptra,2) ,                    & 
     208         &      nlectr(jptra) , ntrc1(jptra) , ntrc2(jptra) , STAT=trc_dta_alloc) 
     209         ! 
     210      IF( trc_dta_alloc /= 0 )   CALL ctl_warn('trc_dta_alloc : failed to allocate arrays') 
     211      ! 
     212   END FUNCTION trc_dta_alloc 
     213 
    200214#else 
    201215   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.