Opened 10 years ago

Closed 10 years ago

Last modified 3 years ago

#671 closed Enhancement (fixed)

mbathy(:,:) field is not initialised when going through the zgr_bat_ctl subroutine in partial cells

Reported by: ctlod Owned by: rblod
Priority: low Milestone: Unscheduled
Component: OCE Version: release-3.2
Severity: Keywords: bathymetry initialization
Cc: Review:
MP ready?:


Under specific cases a running time error could occur in domzgr.F90 module:

Case description:

  • partial cells option, (ln_zps=.true.)
  • a bathymetric file in meters is read, (ntopo=1)

The problem occurs:

  • on plateform: SGI ALTIX ICE 8200
  • with compilator: ifort v11.1

the mbathy(:,:) field (bathymetry in levels) is not initialised (in partiall cells) before the call to zgr_bat_ctl subroutine.
Furthermore, mbathy(:,:) is modified in this subroutine and is reset to jpkm1 at the beginning of zgr_zps subroutine called just after zgr_bat_ctl.

2 solutions could be applied:
Firstly: replace the following line (at the end of zgr_bat):
IF( .NOT. lk_c1d ) CALL zgr_bat_ctl ! Bathymetry check !
IF( .NOT. lk_c1d .AND. .NOT. ln_zps ) CALL zgr_bat_ctl ! Bathymetry check !
since the call to zgr_bat_ctl is a useless in partial cells

Secondly: add the initialisation of mbathy(:,:) to zero or jpkm1 for instance just after the read of the bathymetry in meters in zgr_bat::

CALL iom_open( '', inum )
CALL iom_get ( inum, jpdom_data, 'Bathymetry', bathy )
CALL iom_close (inum)
mbathy(:,:) = jpkm1

The module with modifications is attached with this ticket.

Commit History (1)


v3.3beta: #766 & #671 share the deepest ocean level indices: bug correction in domzgr.F90

Attachments (2)

domzgr.F90 (77.6 KB) - added by ctlod 10 years ago.
domzgr.2.F90 (76.4 KB) - added by gm 10 years ago.
corrected domzgr.F90 by Gurvan

Download all attachments as: .zip

Change History (11)

Changed 10 years ago by ctlod

comment:1 Changed 10 years ago by rblod

  • Owner changed from NEMO team to rblod

I'm not so sure the call to bat_ctl is so useless, because it's the only place where we applly a lbc on mbathy. So I would better go to the second solution.


Changed 10 years ago by gm

corrected domzgr.F90 by Gurvan

comment:2 Changed 10 years ago by gm

This problem does not only concerns the bathymetry control (zgr_bat_ctl) but also the subdomain zoom case (zgr_bat_zoom). Both modify mbathy prior to its initialisation. Fortunately, there are both called again at the end of zgr_zps and zgr_sco subroutines, so that there is no error in the simulation its self, just a potential warning or stop if arrays are not initialized to zero by the compiler.

The best solution is to move the call the two routines at the end of domzgr.F90  =⇒ call done only 1 time and at the right place.

This has been done in the v3.3beta (see changeset:2463)

for the consolidation of v3.2.   I put in attachment the corrected domzgr.F90 module


comment:3 Changed 10 years ago by cetlod

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

Done for the consolidation of v3.2, see changeset:2465

comment:4 Changed 4 years ago by nicolasmartin

  • Keywords initialization added; initialisation removed

comment:5 Changed 4 years ago by nicolasmartin

  • Keywords nemo_v3_2* added

comment:6 Changed 4 years ago by nicolasmartin

  • Keywords bathymetry added; mbathy removed

comment:7 Changed 3 years ago by nemo

  • Keywords Misc. added

comment:8 Changed 3 years ago by nemo

  • Keywords nemo_v3_2* removed

comment:9 Changed 3 years ago by nemo

  • Keywords Misc. removed
Note: See TracTickets for help on using tickets.