Opened 7 years ago

Closed 6 years ago

#1302 closed Bug (fixed)

Missing error message in XMLIO

Reported by: timgraham Owned by: timgraham
Priority: low Milestone:
Component: OCE Version: release-3.4
Severity: Keywords:
Cc:

Description

There is a missing error message in branches/2012/dev_v3_4_STABLE_2012/NEMOGCM/EXTERNAL/XMLIO_SERVER/src/XMLIO/mod_context.f90.

In the subroutine context_swap_id(id):

CALL contextget(Id,Pt_context)
IF (.NOT. ASSOCIATED(Pt_context)) THEN   
  !!      error message   
ENDIF

Some sort of error message needs to be printed here so that users know why the code is crashing.

Commit History (1)

ChangesetAuthorTimeChangeLog
4660timgraham2014-06-06T15:12:36+02:00

Fixes described in ticket #1302 to XMLIO Added in an error message in subroutine mod_context.f90 Changed mod_error_msg.f90 so that it prints "Error" instead of "Warning" before stopping.

Change History (3)

comment:1 Changed 6 years ago by timgraham

  • Owner changed from NEMO team to timgraham
  • Status changed from new to assigned

I think I have been able to implement a simple fix for this by adding:

USE mod_error_msg

at the top of the module and changing the loop above to:

CALL context__get(Id,Pt_context)
IF (.NOT. ASSOCIATED(Pt_context)) THEN
    error("Unable to get context for id '<id>'", 'context__swap_id')
ENDIF

I'm just waiting for a colleague to test whether this error handling works correctly and then I will be able to commit this back to the vn3.4_stable branch.

comment:2 Changed 6 years ago by timgraham

The code snippet above is incorrect. It should be:

      CALL context__get(Id,Pt_context)
      IF (.NOT. ASSOCIATED(Pt_context)) THEN
          WRITE (message,*) "Error: Unable to get context for Id '<Id>'"
          CALL error('context__swap_id')
      ENDIF

I have also modified the mod_error_msg.f90 so that it prints "Error" instead of "Warning" when the error subroutine is used.

I have tested this in ORCA025 and the error is now printed correctly if required. I think the error is caused by a problem in the iodef.xml file. If there is no error the change has no effect and the model runs normally.

I'll commit the changes to the 3.4 stable branch and close the ticket.

comment:3 Changed 6 years ago by timgraham

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