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 2611 – NEMO

Changeset 2611


Ignore:
Timestamp:
2011-02-23T10:50:10+01:00 (13 years ago)
Author:
trackstand2
Message:

Merged ldfslp.F90 bug fix (duplicate allocation of Madec arrays)

File:
1 edited

Legend:

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

    r2590 r2611  
    4242   LOGICAL , PUBLIC, PARAMETER ::   lk_ldfslp = .TRUE.     !: slopes flag 
    4343   !                                                                             !! Madec operator 
     44   !  Arrays allocated in ldf_slp_init() routine once we know whether we're using the Griffies or Madec operator 
    4445   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)     ::   uslp, wslpi          !: i_slope at U- and W-points 
    4546   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)     ::   vslp, wslpj          !: j-slope at V- and W-points 
     
    5051 
    5152   !                                                              !! Madec operator 
     53   !  Arrays allocated in ldf_slp_init() routine once we know whether we're using the Griffies or Madec operator 
    5254   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   omlmask           ! mask of the surface mixed layer at T-pt 
    5355   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   uslpml, wslpiml   ! i_slope at U- and W-points just below the mixed layer 
     
    7880      !!              ***  ROUTINE ldf_slp_alloc  *** 
    7981      !!---------------------------------------------------------------------- 
    80       IMPLICIT none 
    81       INTEGER               :: ldf_slp_alloc 
    82       INTEGER, DIMENSION(3) :: ierr 
    83       !!---------------------------------------------------------------------- 
    84  
    85       ALLOCATE(uslp(jpi,jpj,jpk), wslpi(jpi,jpj,jpk), & 
    86                vslp(jpi,jpj,jpk), wslpj(jpi,jpj,jpk), Stat=ierr(1)) 
    87       ! 
    88       ALLOCATE(omlmask(jpi,jpj,jpk),                  & 
    89                uslpml(jpi,jpj), wslpiml(jpi,jpj),     & 
    90                vslpml(jpi,jpj), wslpjml(jpi,jpj), Stat=ierr(2)) 
     82      INTEGER :: ldf_slp_alloc 
     83      !!---------------------------------------------------------------------- 
    9184      ! 
    9285      ALLOCATE(zdzrho(jpi,jpj,jpk,0:1),  zdyrho(jpi,jpj,jpk,0:1),  & 
    9386               zdxrho(jpi,jpj,jpk,0:1),  zti_mlb(jpi,jpj,0:1,0:1), & 
    94                ztj_mlb(jpi,jpj,0:1,0:1), Stat=ierr(3)) 
    95  
    96       ldf_slp_alloc = MAXVAL(ierr) 
     87               ztj_mlb(jpi,jpj,0:1,0:1), Stat=ldf_slp_alloc) 
     88 
     89      IF(ldf_slp_alloc /= 0)THEN 
     90         CALL ctl_warn('ldf_slp_alloc : failed to allocate arrays.') 
     91      END IF 
    9792 
    9893   END FUNCTION ldf_slp_alloc 
Note: See TracChangeset for help on using the changeset viewer.