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.
#1862 (ierr not initialised correctly in case with no lateral diffusion) – NEMO

Opened 7 years ago

Closed 7 years ago

#1862 closed Bug (fixed)

ierr not initialised correctly in case with no lateral diffusion

Reported by: timgraham Owned by: timgraham
Priority: lowest Milestone:
Component: OCE Version: trunk
Severity: Keywords: LDF
Cc:

Description

Context

In traldf.F90 ierr is used as an error flag but in the case with no diffusion is used it doesn't get initialised because the initialisation is inside an IF statement. As the check on ierr is outside of the IF statement it can lead to an error if the compiler sets ierr=1.

Analysis

      IF( nldf /= np_no_ldf ) THEN        ! direction ==>> type of operator  
         ioptio = 0
         IF( ln_traldf_lev )   ioptio = ioptio + 1
         IF( ln_traldf_hor )   ioptio = ioptio + 1
         IF( ln_traldf_iso )   ioptio = ioptio + 1
         IF( ioptio >  1 )   CALL ctl_stop( 'tra_ldf_init: use only ONE direction (level/hor/iso)' )
         !
         !                                ! defined the type of lateral diffusion from ln_traldf_... logicals
         ierr = 0

         ...Lots more code here deleted to keep description short...         

      ENDIF

Fix

Move the check on ierr to inside the IF statement.

Commit History (1)

ChangesetAuthorTimeChangeLog
7765timgraham2017-03-07T13:45:51+01:00

Fix for #1862

Change History (1)

comment:1 Changed 7 years ago by timgraham

  • Resolution set to fixed
  • Status changed from new to closed

Fixed at r7765

Note: See TracTickets for help on using tickets.