New URL for NEMO forge!

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.
#1246 (Bug in TOP_SRC/TRP/trdmld_trc.F90 Allocation problem.) – NEMO

Opened 10 years ago

Closed 10 years ago

#1246 closed Bug (fixed)

Bug in TOP_SRC/TRP/trdmld_trc.F90 Allocation problem.

Reported by: molines Owned by: nemo
Priority: normal Milestone:
Component: TOP Version: v3.4
Severity: Keywords:


  • From Aurelie Albert : bug in the routine trd_mld_bio_zint in module TOP_SRC/TRP/trdmld_trc.F90 : No deallocation at the end of the routine but a new allocation ==> memory leakage and eventual crash on memory fault...
   SUBROUTINE trd_mld_bio_zint( ptrc_trdmld, ktrd )
      !!                  ***  ROUTINE trd_mld_bio_zint  ***
      !! ** Purpose :   Compute the vertical average of the 3D fields given as arguments
      !!                to the subroutine. This vertical average is performed from ocean
      !!                surface down to a chosen control surface.
      !! ** Method/usage :
      !!      The control surface can be either a mixed layer depth (time varying)
      !!      or a fixed surface (jk level or bowl).
      !!      Choose control surface with nctls in namelist NAMTRD :
      !!        nctls_trc = 0  : use mixed layer with density criterion
      !!        nctls_trc = 1  : read index from file 'ctlsurf_idx'
      !!        nctls_trc > 1  : use fixed level surface jk = nctls_trc
      !!      Note: in the remainder of the routine, the volume between the
      !!            surface and the control surface is called "mixed-layer"
      INTEGER                         , INTENT(in) ::   ktrd          ! bio trend index
      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   ptrc_trdmld   ! passive trc trend
#if defined key_pisces_reduced
      INTEGER ::   ji, jj, jk, isum
      REAL(wp), POINTER, DIMENSION(:,:) :: zvlmsk

      CALL wrk_alloc( jpi, jpj, zvlmsk )

..... core of the routine

      CALL wrk_alloc( jpi, jpj, zvlmsk )
   END SUBROUTINE trd_mld_bio_zint
  • found in 3.4, 3.5beta and 3.6...
  • obvious fix ; --> CALL wrk_dealloc( jpi, jpj, zvlmsk )

Commit History (3)


trunk: bugfix in trdmld_trc.F90, see ticket #1246


v3.4 stable: bugfix in trdmld_trc.F90, see ticket #1246


v3.6alpha: bugfix in trdmld_trc.F90, see ticket #1246

Change History (1)

comment:1 Changed 10 years ago by cetlod

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.