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/LIM_SRC_2/thd_ice_2.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/LIM_SRC_2/thd_ice_2.F90

    r2528 r2715  
    1212   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    1313   !!---------------------------------------------------------------------- 
    14    !! * Modules used 
    1514   USE par_ice_2 
    1615 
    1716   IMPLICIT NONE 
    1817   PRIVATE 
     18 
     19   PUBLIC thd_ice_alloc_2 ! Routine called by nemogcm.F90 
    1920 
    2021   !! * Share Module variables 
     
    4344      cnscg                  !: ratio  rcpsn/rcpic 
    4445 
    45    INTEGER , PUBLIC, DIMENSION(jpij) ::   &  !: 
     46   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   &  !: 
    4647      npb     ,   &   !: number of points where computations has to be done 
    4748      npac            !: correspondance between the points 
    4849 
    49    REAL(wp), PUBLIC, DIMENSION(jpij) ::   &  !:  
     50   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   &  !:  
    5051      qldif_1d    ,     &  !: corresponding to the 2D var  qldif 
    5152      qcmif_1d    ,     &  !: corresponding to the 2D var  qcmif 
     
    8081      dqla_ice_1d          !:    "                  "      dqla_ice 
    8182 
    82    REAL(wp), PUBLIC, DIMENSION(jpij,jplayersp1) ::   &  !: 
     83   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   &  !: 
    8384      tbif_1d              !: corresponding to the 2D var  tbif 
    8485 
     86   !!---------------------------------------------------------------------- 
     87   !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010) 
     88   !! $Id$ 
     89   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     90   !!---------------------------------------------------------------------- 
     91 CONTAINS 
     92 
     93   INTEGER FUNCTION thd_ice_alloc_2() 
     94      !!---------------------------------------------------------------------- 
     95      USE lib_mpp        ! MPP library 
     96      INTEGER :: ierr(4) 
     97      !!---------------------------------------------------------------------- 
     98      ! 
     99      ierr(:) = 0 
     100      ! 
     101      ALLOCATE( npb(jpij), npac(jpij),                             & 
     102         &      qldif_1d(jpij), qcmif_1d(jpij), thcm_1d(jpij),     & 
     103         &      fstbif_1d(jpij), fltbif_1d(jpij), fscbq_1d(jpij),  & 
     104         &      qsr_ice_1d(jpij),fr1_i0_1d(jpij), fr2_i0_1d(jpij), Stat=ierr(1)) 
     105         ! 
     106      ALLOCATE( qns_ice_1d(jpij), qfvbq_1d(jpij), sist_1d(jpij), tfu_1d(jpij), & 
     107         &      sprecip_1d(jpij), h_snow_1d(jpij),h_ice_1d(jpij),frld_1d(jpij),& 
     108         &      qstbif_1d(jpij),  fbif_1d(jpij),  Stat=ierr(2)) 
     109         ! 
     110      ALLOCATE( rdmicif_1d(jpij), rdmsnif_1d(jpij), qlbbq_1d(jpij),   & 
     111         &      dmgwi_1d(jpij)  , dvsbq_1d(jpij)  , rdvomif_1d(jpij), & 
     112         &      dvbbq_1d(jpij)  , dvlbq_1d(jpij)  , dvnbq_1d(jpij)  , & 
     113         &      Stat=ierr(3)) 
     114         ! 
     115      ALLOCATE( dqns_ice_1d(jpij) ,qla_ice_1d(jpij), dqla_ice_1d(jpij), & 
     116         &      tbif_1d(jpij, jplayersp1), Stat=ierr(4)) 
     117         ! 
     118      thd_ice_alloc_2 = MAXVAL(ierr) 
     119      IF( thd_ice_alloc_2 /= 0 )   CALL ctl_warn('thd_ice_alloc_2: failed to allocate arrays') 
     120      ! 
     121   END FUNCTION thd_ice_alloc_2 
     122 
     123#endif 
    85124   !!====================================================================== 
    86 #endif 
    87125END MODULE thd_ice_2 
Note: See TracChangeset for help on using the changeset viewer.