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 2618 for branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_oce.F90 – NEMO

Ignore:
Timestamp:
2011-02-26T13:31:38+01:00 (13 years ago)
Author:
gm
Message:

dynamic mem: #785 ; move dyn allocation from nemogcm to module when possible (continuation)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_oce.F90

    r2590 r2618  
    44   !! Ocean physics :  lateral tracer mixing coefficient defined in memory  
    55   !!===================================================================== 
    6    !! History :  9.0  !  02-11  (G. Madec)  Original code 
     6   !! History :  9.0  !  2002-11  (G. Madec)  Original code 
    77   !!---------------------------------------------------------------------- 
    8    USE par_oce         ! ocean parameters 
     8   USE par_oce        ! ocean parameters 
     9   USE in_out_manager ! I/O manager 
    910 
    1011   IMPLICIT NONE 
     
    3435 
    3536#if defined key_traldf_c3d 
    36    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ahtt, ahtu, ahtv, ahtw   !: ** 3D coefficients ** at T-, U-, V-, W-points 
     37   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ahtt, ahtu, ahtv, ahtw   !: ** 3D coefficients ** at T-,U-,V-,W-points 
    3738#elif defined key_traldf_c2d 
    38    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ahtt, ahtu, ahtv, ahtw   !: ** 2D coefficients ** at T-, U-, V-, W-points 
     39   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ahtt, ahtu, ahtv, ahtw   !: ** 2D coefficients ** at T-,U-,V-,W-points 
    3940#elif defined key_traldf_c1d 
    40    REAL(wp), PUBLIC, DIMENSION(jpk)         ::   ahtt, ahtu, ahtv, ahtw   !: ** 1D coefficients ** at T-, U-, V-, W-points ARPDBGjpk 
     41   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   ahtt, ahtu, ahtv, ahtw   !: ** 1D coefficients ** at T-,U-,V-,W-points 
    4142#else 
    42    REAL(wp), PUBLIC                         ::   ahtt, ahtu, ahtv, ahtw   !: ** 0D coefficients ** at T-, U-, V-, W-points 
     43   REAL(wp), PUBLIC                                      ::   ahtt, ahtu, ahtv, ahtw   !: ** 0D coefficients ** at T-,U-,V-,W-points 
    4344#endif 
    44  
    4545 
    4646#if defined key_traldf_eiv 
     
    4949   !!---------------------------------------------------------------------- 
    5050   LOGICAL, PUBLIC, PARAMETER               ::   lk_traldf_eiv   = .TRUE.   !: eddy induced velocity flag 
    51        
     51    
     52   !                                                                              !!! eddy coefficients at U-, V-, W-points  [m2/s] 
    5253# if defined key_traldf_c3d 
    53    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   aeiu, aeiv, aeiw  !: ** 3D coefficients ** at U-, V-, W-points  [m2/s] 
     54   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   aeiu , aeiv , aeiw   !: ** 3D coefficients ** 
    5455# elif defined key_traldf_c2d 
    55    REAL(wp), PUBLIC, ALLOCATABLE, SAVE,   DIMENSION(:,:) ::   aeiu, aeiv, aeiw  !: ** 2D coefficients ** at U-, V-, W-points  [m2/s] 
     56   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   aeiu , aeiv , aeiw   !: ** 2D coefficients ** 
    5657# elif defined key_traldf_c1d 
    57    REAL(wp), PUBLIC, ALLOCATABLE, SAVE,     DIMENSION(:) ::   aeiu, aeiv, aeiw  !: ** 1D coefficients ** at U-, V-, W-points  [m2/s] 
     58   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   aeiu , aeiv , aeiw   !: ** 1D coefficients ** 
    5859# else 
    59    REAL(wp), PUBLIC                         ::   aeiu, aeiv, aeiw  !: ** 0D coefficients ** at U-, V-, W-points  [m2/s] 
     60   REAL(wp), PUBLIC                                      ::   aeiu , aeiv , aeiw   !: ** 0D coefficients ** 
    6061# endif 
    6162# if defined key_diaeiv 
     
    7576   !! $Id$  
    7677   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    77    !!===================================================================== 
     78   !!---------------------------------------------------------------------- 
    7879CONTAINS 
    7980 
    80    FUNCTION ldftra_oce_alloc() 
     81   INTEGER FUNCTION ldftra_oce_alloc() 
    8182     !!---------------------------------------------------------------------- 
     83      !!                 ***  FUNCTION ldftra_oce_alloc  *** 
    8284     !!---------------------------------------------------------------------- 
    83      IMPLICIT None 
    84      INTEGER               :: ldftra_oce_alloc 
    8585     INTEGER, DIMENSION(3) :: ierr 
    8686     !!---------------------------------------------------------------------- 
     
    8888 
    8989#if defined key_traldf_c3d 
    90      ALLOCATE(ahtt(jpi,jpj,jpk), ahtu(jpi,jpj,jpk), ahtv(jpi,jpj,jpk), & 
    91               ahtw(jpi,jpj,jpk), Stat=ierr(1)) 
     90      ALLOCATE( ahtt(jpi,jpj,jpk) , ahtu(jpi,jpj,jpk) , ahtv(jpi,jpj,jpk) , ahtw(jpi,jpj,jpk) , STAT=ierr(1) ) 
    9291#elif defined key_traldf_c2d 
    93      ALLOCATE(ahtt(jpi,jpj), ahtu(jpi,jpj), ahtv(jpi,jpj), & 
    94               ahtw(jpi,jpj), Stat=ierr(1)) 
     92      ALLOCATE( ahtt(jpi,jpj     ), ahtu(jpi,jpj)     , ahtv(jpi,jpj    ) , ahtw(jpi,jpj    ) , STAT=ierr(1) ) 
    9593#elif defined key_traldf_c1d 
    96      ! No need to allocate arrays where extent only depends on jpk ARPDBGjpk 
     94      ALLOCATE( ahtt(         jpk) , ahtu(       jpk) , ahtv(        jpk) , ahtw(        jpk) , STAT=ierr(1) ) 
    9795#endif 
    98  
     96      ! 
    9997#if defined key_traldf_eiv 
    100  
    101 #if defined key_traldf_c3d 
    102      ALLOCATE(aeiu(jpi,jpj,jpk), aeiv(jpi,jpj,jpk), aeiw(jpi,jpj,jpk), &  
    103               Stat=ierr(2)) 
    104 #elif defined key_traldf_c2d 
    105      ALLOCATE(aeiu(jpi,jpj), aeiv(jpi,jpj), aeiw(jpi,jpj), Stat=ierr(2)) 
    106 #elif defined key_traldf_c1d 
    107      ALLOCATE(aeiu(jpk), aeiv(jpk), aeiw(jpk), Stat=ierr(2)) 
     98# if defined key_traldf_c3d 
     99      ALLOCATE( aeiu(jpi,jpj,jpk) , aeiv(jpi,jpj,jpk) , aeiw(jpi,jpj,jpk) , STAT=ierr(2) ) 
     100# elif defined key_traldf_c2d 
     101      ALLOCATE( aeiu(jpi,jpj    ) , aeiv(jpi,jpj    ) , aeiw(jpi,jpj    ) , STAT=ierr(2) ) 
     102# elif defined key_traldf_c1d 
     103      ALLOCATE( aeiu(        jpk) , aeiv(        jpk) , aeiw(        jpk) , STAT=ierr(2) ) 
     104# endif 
     105# if defined key_diaeiv 
     106      ALLOCATE( u_eiv(jpi,jpj,jpk), v_eiv(jpi,jpj,jpk), w_eiv(jpi,jpj,jpk), STAT=ierr(3)) 
     107# endif 
    108108#endif 
    109  
    110 # if defined key_diaeiv 
    111      ALLOCATE(u_eiv(jpi,jpj,jpk), v_eiv(jpi,jpj,jpk), w_eiv(jpi,jpj,jpk), & 
    112               Stat=ierr(3)) 
    113 # endif 
    114  
    115 #endif 
    116       
    117      ldftra_oce_alloc = MAXVAL(ierr) 
    118  
     109      ldftra_oce_alloc = MAXVAL( ierr ) 
     110      IF( ldftra_oce_alloc /= 0 )   CALL ctl_warn('ldftra_oce_alloc: failed to allocate arrays') 
     111      ! 
    119112   END FUNCTION ldftra_oce_alloc 
    120113 
    121    !!---------------------------------------------------------------------- 
    122  
     114   !!===================================================================== 
    123115END MODULE ldftra_oce 
Note: See TracChangeset for help on using the changeset viewer.