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

Ignore:
Timestamp:
2011-02-18T13:49:27+01:00 (13 years ago)
Author:
trackstand2
Message:

Merge branch 'dynamic_memory' into master-svn-dyn

File:
1 edited

Legend:

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

    r2528 r2590  
    1010   IMPLICIT NONE 
    1111   PRIVATE 
     12 
     13   PUBLIC ldftra_oce_alloc ! called by nemo_init->nemo_alloc, nemogcm.F90 
    1214 
    1315   !!---------------------------------------------------------------------- 
     
    3234 
    3335#if defined key_traldf_c3d 
    34    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   ahtt, ahtu, ahtv, ahtw   !: ** 3D coefficients ** at T-, U-, V-, W-points 
     36   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ahtt, ahtu, ahtv, ahtw   !: ** 3D coefficients ** at T-, U-, V-, W-points 
    3537#elif defined key_traldf_c2d 
    36    REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ahtt, ahtu, ahtv, ahtw   !: ** 2D coefficients ** at T-, U-, V-, W-points 
     38   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ahtt, ahtu, ahtv, ahtw   !: ** 2D coefficients ** at T-, U-, V-, W-points 
    3739#elif defined key_traldf_c1d 
    38    REAL(wp), PUBLIC, DIMENSION(jpk)         ::   ahtt, ahtu, ahtv, ahtw   !: ** 1D coefficients ** at T-, U-, V-, W-points 
     40   REAL(wp), PUBLIC, DIMENSION(jpk)         ::   ahtt, ahtu, ahtv, ahtw   !: ** 1D coefficients ** at T-, U-, V-, W-points ARPDBGjpk 
    3941#else 
    4042   REAL(wp), PUBLIC                         ::   ahtt, ahtu, ahtv, ahtw   !: ** 0D coefficients ** at T-, U-, V-, W-points 
     
    4951       
    5052# if defined key_traldf_c3d 
    51    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   aeiu, aeiv, aeiw  !: ** 3D coefficients ** at U-, V-, W-points  [m2/s] 
     53   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   aeiu, aeiv, aeiw  !: ** 3D coefficients ** at U-, V-, W-points  [m2/s] 
    5254# elif defined key_traldf_c2d 
    53    REAL(wp), PUBLIC, DIMENSION(jpi,jpj)    ::   aeiu, aeiv, aeiw  !: ** 2D coefficients ** at U-, V-, W-points  [m2/s] 
     55   REAL(wp), PUBLIC, ALLOCATABLE, SAVE,   DIMENSION(:,:) ::   aeiu, aeiv, aeiw  !: ** 2D coefficients ** at U-, V-, W-points  [m2/s] 
    5456# elif defined key_traldf_c1d 
    55    REAL(wp), PUBLIC, DIMENSION(jpk)        ::   aeiu, aeiv, aeiw  !: ** 1D coefficients ** at U-, V-, W-points  [m2/s] 
     57   REAL(wp), PUBLIC, ALLOCATABLE, SAVE,     DIMENSION(:) ::   aeiu, aeiv, aeiw  !: ** 1D coefficients ** at U-, V-, W-points  [m2/s] 
    5658# else 
    5759   REAL(wp), PUBLIC                         ::   aeiu, aeiv, aeiw  !: ** 0D coefficients ** at U-, V-, W-points  [m2/s] 
    5860# endif 
    5961# if defined key_diaeiv 
    60    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   u_eiv, v_eiv, w_eiv   !: eddy induced velocity [m/s] 
     62   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   u_eiv, v_eiv, w_eiv   !: eddy induced velocity [m/s] 
    6163# endif 
    6264 
     
    7476   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    7577   !!===================================================================== 
     78CONTAINS 
     79 
     80   FUNCTION ldftra_oce_alloc() 
     81     !!---------------------------------------------------------------------- 
     82     !!---------------------------------------------------------------------- 
     83     IMPLICIT None 
     84     INTEGER               :: ldftra_oce_alloc 
     85     INTEGER, DIMENSION(3) :: ierr 
     86     !!---------------------------------------------------------------------- 
     87     ierr(:) = 0 
     88 
     89#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)) 
     92#elif defined key_traldf_c2d 
     93     ALLOCATE(ahtt(jpi,jpj), ahtu(jpi,jpj), ahtv(jpi,jpj), & 
     94              ahtw(jpi,jpj), Stat=ierr(1)) 
     95#elif defined key_traldf_c1d 
     96     ! No need to allocate arrays where extent only depends on jpk ARPDBGjpk 
     97#endif 
     98 
     99#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)) 
     108#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 
     119   END FUNCTION ldftra_oce_alloc 
     120 
     121   !!---------------------------------------------------------------------- 
     122 
    76123END MODULE ldftra_oce 
Note: See TracChangeset for help on using the changeset viewer.