Skip to content

Commit

Permalink
Return diag_field_not_found if a field is not in the diag_table.yaml …
Browse files Browse the repository at this point in the history
…when registering fields
  • Loading branch information
uramirez8707 committed Jul 26, 2023
1 parent a6bc9a5 commit 44d75b0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions diag_manager/fms_diag_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ integer function fms_register_diag_field_obj &
#else
diag_field_indices = find_diag_field(varname, modname)
if (diag_field_indices(1) .eq. diag_null) then
!< The field was not found in the table, so return diag_null
fms_register_diag_field_obj = diag_null
!< The field was not found in the table, so return DIAG_FIELD_NOT_FOUND
fms_register_diag_field_obj = DIAG_FIELD_NOT_FOUND
deallocate(diag_field_indices)
return
endif
Expand Down Expand Up @@ -300,7 +300,7 @@ INTEGER FUNCTION fms_register_diag_field_scalar(this,module_name, field_name, in
INTEGER, OPTIONAL, INTENT(in) :: volume !< Id of the volume field
CHARACTER(len=*), OPTIONAL, INTENT(in) :: realm !< String to set as the modeling_realm attribute
#ifndef use_yaml
fms_register_diag_field_scalar=diag_null
fms_register_diag_field_scalar=DIAG_FIELD_NOT_FOUND
CALL MPP_ERROR(FATAL,"You can not use the modern diag manager without compiling with -Duse_yaml")
#else
fms_register_diag_field_scalar = this%register(&
Expand Down Expand Up @@ -340,7 +340,7 @@ INTEGER FUNCTION fms_register_diag_field_array(this, module_name, field_name, ax
CHARACTER(len=*), OPTIONAL, INTENT(in) :: realm !< String to set as the modeling_realm attribute

#ifndef use_yaml
fms_register_diag_field_array=diag_null
fms_register_diag_field_array=DIAG_FIELD_NOT_FOUND
CALL MPP_ERROR(FATAL,"You can not use the modern diag manager without compiling with -Duse_yaml")
#else
fms_register_diag_field_array = this%register( &
Expand Down Expand Up @@ -382,7 +382,7 @@ INTEGER FUNCTION fms_register_static_field(this, module_name, field_name, axes,
!! modeling_realm attribute

#ifndef use_yaml
fms_register_static_field=diag_null
fms_register_static_field=DIAG_FIELD_NOT_FOUND
CALL MPP_ERROR(FATAL,"You can not use the modern diag manager without compiling with -Duse_yaml")
#else
!TODO The register_static_field interface does not have the capabiliy to register a variable as a "scalar"
Expand Down

0 comments on commit 44d75b0

Please sign in to comment.