Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diag_field_not_found #1301

Merged
merged 2 commits into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions diag_manager/fms_diag_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ end subroutine fms_diag_object_end

!> @brief Registers a field.
!! @description This to avoid having duplicate code in each of the _scalar, _array and _static register calls
!! @return field index for subsequent call to send_data.
!! @return field index to be used in subsequent calls to send_data or DIAG_FIELD_NOT_FOUND if the field is not
!! in the diag_table.yaml
integer function fms_register_diag_field_obj &
(this, modname, varname, axes, init_time, &
longname, units, missing_value, varRange, mask_variant, standname, &
Expand Down Expand Up @@ -206,8 +207,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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doxygen \return needs to be updated to reflect this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deallocate(diag_field_indices)
return
endif
Expand Down Expand Up @@ -280,8 +281,9 @@ integer function fms_register_diag_field_obj &
#endif
end function fms_register_diag_field_obj

!> @brief Registers a scalar field
!! @return field index for subsequent call to send_data.
!> @brief Registers a scalar field
!! @return field index to be used in subsequent calls to send_data or DIAG_FIELD_NOT_FOUND if the field is not
!! in the diag_table.yaml
INTEGER FUNCTION fms_register_diag_field_scalar(this,module_name, field_name, init_time, &
& long_name, units, missing_value, var_range, standard_name, do_not_log, err_msg,&
& area, volume, realm)
Expand All @@ -300,7 +302,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 All @@ -311,8 +313,9 @@ INTEGER FUNCTION fms_register_diag_field_scalar(this,module_name, field_name, in
#endif
end function fms_register_diag_field_scalar

!> @brief Registers an array field
!> @return field index for subsequent call to send_data.
!> @brief Registers an array field
!! @return field index to be used in subsequent calls to send_data or DIAG_FIELD_NOT_FOUND if the field is not
!! in the diag_table.yaml
INTEGER FUNCTION fms_register_diag_field_array(this, module_name, field_name, axes, init_time, &
& long_name, units, missing_value, var_range, mask_variant, standard_name, verbose,&
& do_not_log, err_msg, interp_method, tile_count, area, volume, realm)
Expand Down Expand Up @@ -340,7 +343,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 All @@ -352,7 +355,8 @@ INTEGER FUNCTION fms_register_diag_field_array(this, module_name, field_name, ax
end function fms_register_diag_field_array

!> @brief Return field index for subsequent call to send_data.
!! @return field index for subsequent call to send_data.
!! @return field index to be used in subsequent calls to send_data or DIAG_FIELD_NOT_FOUND if the field is not
!! in the diag_table.yaml
INTEGER FUNCTION fms_register_static_field(this, module_name, field_name, axes, long_name, units,&
& missing_value, range, mask_variant, standard_name, DYNAMIC, do_not_log, interp_method,&
& tile_count, area, volume, realm)
Expand Down Expand Up @@ -382,7 +386,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
Loading