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.
#2562 (Debug mode on HEAD v4 failed) – NEMO

Opened 3 years ago

Closed 3 years ago

#2562 closed Defect (fixed)

Debug mode on HEAD v4 failed

Reported by: mathiot Owned by: systeam
Priority: low Milestone:
Component: MULTIPLE Version: v4.0.*
Severity: minor Keywords:
Cc: pierre.mathiot@…

Description

Context

Before looking for an issue appearing in my eORCA025 config poping up after my upgrade to NEMO 4.0.4, I decided to run the HEAT of v4 in debug mode on the UGA cluster, and I failed to run ORCA2_ICE_PISCES.

Compilation options used are: -i4 -r8 -O0 -fpe0 -g -traceback -fp-model precise -fno-alias -CB -ftrapuv -check uninit -debug -init=arrays,snan,huge

Analysis

  • Some partially initialised variables (level jpk not intialised) lead to an error in lbcnfd.f90 or in p4zsed.F90
error (182): floating invalid - possible uninitialized real/complex variable.

This affect: zwz in dynvor.F90, ze3divh in sbcwave.F90 and nitrpot in p4zsed.F90

  • numrtr is not initialised to -1, which lead to an out of bound when try to call iom_varid
  • divu_i not initialised if ln_icedyn is off in icewri

Recommendation

  • for unitialized variables dynvor.F90, sbcwave.F90 and p4zsed.F90, we can simply intitialised the jpk value to 0._wp.
  • numrtr should be set to -1 in trc.F90
  • divu_i should only be printout if ln_icedyn is set to true

Extra information:

  • not tested in the trunk (need to be checked)
  • other sette configurations not tested
  • ICE/icewri.F90

     
    252252      CALL iom_rstput( 0, 0, kid, 'snwpre', sprecip      )   ! Snow precipitation 
    253253      CALL iom_rstput( 0, 0, kid, 'sisali', sm_i         )   ! Ice salinity 
    254254      CALL iom_rstput( 0, 0, kid, 'sivolu', vt_i         )   ! Ice volume 
    255       CALL iom_rstput( 0, 0, kid, 'sidive', divu_i*1.0e8 )   ! Ice divergence 
    256255      CALL iom_rstput( 0, 0, kid, 'si_amp', at_ip        )   ! Melt pond fraction 
    257256      CALL iom_rstput( 0, 0, kid, 'si_vmp', vt_ip        )   ! Melt pond volume 
    258257      CALL iom_rstput( 0, 0, kid, 'sithicat', h_i        )   ! Ice thickness 
     
    259258      CALL iom_rstput( 0, 0, kid, 'siconcat', a_i        )   ! Ice concentration 
    260259      CALL iom_rstput( 0, 0, kid, 'sisalcat', s_i        )   ! Ice salinity 
    261260      CALL iom_rstput( 0, 0, kid, 'snthicat', h_s        )   ! Snw thickness 
     261      IF ( ln_icedyn )  CALL iom_rstput( 0, 0, kid, 'sidive', divu_i*1.0e8 )   ! Ice divergence 
    262262 
    263263    END SUBROUTINE ice_wri_state 
    264264 
  • OCE/DYN/dynvor.F90

     
    221221         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
    222222      ENDIF 
    223223      ! 
     224      zwz(:,:,jpk) = 0._wp 
    224225      ! 
    225226      SELECT CASE( kvor )                 !==  volume weighted vorticity considered  ==! 
    226227      CASE ( np_RVO )                           !* relative vorticity 
     
    573574         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
    574575      ENDIF 
    575576      ! 
     577      zwz(:,:,jpk) = 0._wp 
    576578      !                                                ! =============== 
    577579      DO jk = 1, jpkm1                                 ! Horizontal slab 
    578580         !                                             ! =============== 
  • OCE/SBC/sbcwave.F90

     
    219219      ! 
    220220      !                       !==  vertical Stokes Drift 3D velocity  ==! 
    221221      ! 
     222      ze3divh(:,:,jpk) = 0._wp 
    222223      DO jk = 1, jpkm1               ! Horizontal e3*divergence 
    223224         DO jj = 2, jpj 
    224225            DO ji = fs_2, jpi 
  • TOP/PISCES/P4Z/p4zsed.F90

     
    491491      ! 
    492492      IF( p4z_sed_alloc /= 0 )   CALL ctl_stop( 'STOP', 'p4z_sed_alloc: failed to allocate arrays' ) 
    493493      ! 
     494      ! initialisation 
     495      nitrpot(:,:,jpk) = 0._wp 
     496      ! 
    494497   END FUNCTION p4z_sed_alloc 
    495498 
    496499   !!====================================================================== 
  • TOP/trc.F90

     
    2424   INTEGER, PUBLIC ::   numtrc_cfg = -1   !: reference passive tracer namelist_top_cfg 
    2525   INTEGER, PUBLIC ::   numonr     = -1   !: reference passive tracer namelist output output.namelist.top 
    2626   INTEGER, PUBLIC ::   numstr            !: tracer statistics 
    27    INTEGER, PUBLIC ::   numrtr            !: trc restart (read ) 
     27   INTEGER, PUBLIC ::   numrtr     = -1   !: trc restart (read ) 
    2828   INTEGER, PUBLIC ::   numrtw            !: trc restart ( write ) 
    2929 
    3030   !! passive tracers fields (before,now,after) 

Commit History (1)

ChangesetAuthorTimeChangeLog
14588clem2021-03-05T08:42:07+01:00

solve ticket #2562

Change History (5)

comment:1 Changed 3 years ago by mathiot

  • Cc pierre.mathiot@… added

Part of these issue has already been reported in the trunk in 13526, 13527, 13546, 13558. These commit has to be carefully check to see if they apply into NEMO4.

comment:2 Changed 3 years ago by mathiot

Fix has been done in the trunk but not implemented in the trunk. It correspond to commit 13526, 13527, 13546, 13558 (from personal discussion with Seb).

comment:3 Changed 3 years ago by nemo

  • Version changed from v4.0 to v4.0.*

comment:4 Changed 3 years ago by clem

In 14588:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:5 Changed 3 years ago by clem

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