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.
#496 (Fix output state following an error state trapped by stpctl.F90) – NEMO

Opened 15 years ago

Last modified 15 years ago

#496 closed Bug

Fix output state following an error state trapped by stpctl.F90 — at Initial Version

Reported by: acc Owned by: nemo
Priority: low Milestone:
Component: OCE Version: trunk
Severity: Keywords:
Cc:

Description

The recent rearrangement of step has placed the main call to dia_wri at the top to the time step loop. If error conditions (large U, negative salinity etc.) are detected in stp_ctl (called at the
bottom of the loop), then dia_wri is again called in an attempt to
flush and close the mean files. This now raises a fatal error in
histcom.f90:

FATAL ERROR FROM ROUTINE histwrite

--> This variable as already been analysed at the present
--> time step

and the code aborts before creating the expected output.abort files.

A solution is to split the dual-purpose test at the bottom of dia_wri:

! 3. Close all files
! ---------------------------------------
IF( kt == nitend .OR. kindic < 0 ) THEN

CALL histclo( nid_T )
CALL histclo( nid_U )
CALL histclo( nid_V )
CALL histclo( nid_W )

ENDIF

making this test simply:

! 3. Close all files
! ---------------------------------------
IF( kt == nitend ) THEN

CALL histclo( nid_T )
CALL histclo( nid_U )
CALL histclo( nid_V )
CALL histclo( nid_W )

ENDIF

and placing the following before the IF(kt == nit000 ) test at the
top of dia_wri:

! Close all files and return if an error has been detected
! --------------------------------------------------------
IF( kindic < 0 ) THEN

CALL histclo( nid_T )
CALL histclo( nid_U )
CALL histclo( nid_V )
CALL histclo( nid_W )
RETURN

ENDIF

Commit History (2)

ChangesetAuthorTimeChangeLog
1567ctlod2009-07-31T16:39:55+02:00

DIMG: remove kindic argument from dia_wri call subroutine, see ticket: #509 & #496

1561ctlod2009-07-30T10:50:07+02:00

Fix output state following an error state trapped by stpctl.F90, see ticket: #496

Change History (0)

Note: See TracTickets for help on using tickets.