Skip to content

Commit

Permalink
Merge branch 'is_scalar' of github.com:uramirez8707/FMS into dmUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
uramirez8707 committed Apr 3, 2023
2 parents cb9cac9 + 18a0bbf commit 8cd9d4c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion diag_manager/fms_diag_field_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module fms_diag_field_object_mod
type(fmsDiagAttribute_type), allocatable :: attributes(:) !< attributes for the variable
integer, private :: num_attributes !< Number of attributes currently added
logical, allocatable, private :: static !< true if this is a static var
logical, allocatable, private :: scalar !< .True. if the variable is a scalar
logical, allocatable, private :: registered !< true when registered
logical, allocatable, private :: mask_variant !< If there is a mask variant
logical, allocatable, private :: do_not_log !< .true. if no need to log the diag_field
Expand Down Expand Up @@ -89,6 +90,7 @@ module fms_diag_field_object_mod
procedure :: vartype_inq => what_is_vartype
! Check functions
procedure :: is_static => diag_obj_is_static
procedure :: is_scalar
procedure :: is_registered => get_registered
procedure :: is_registeredB => diag_obj_is_registered
procedure :: is_mask_variant => get_mask_variant
Expand Down Expand Up @@ -230,10 +232,12 @@ subroutine fms_register_diag_field_obj &

!> Add axis and domain information
if (present(axes)) then
this%scalar = .false.
this%axis_ids = axes
call get_domain_and_domain_type(diag_axis, this%axis_ids, this%type_of_domain, this%domain, this%varname)
else
!> The variable is a scalar
!> The variable is a scalar
this%scalar = .true.
this%type_of_domain = NO_DOMAIN
this%domain => null()
endif
Expand Down Expand Up @@ -612,6 +616,14 @@ function diag_obj_is_static (this) result (rslt)
rslt = this%static
end function diag_obj_is_static

!> @brief Determine if the field is a scalar
!! @return .True. if the field is a scalar
function is_scalar (this) result (rslt)
class(fmsDiagField_type), intent(in) :: this !< diag_field object
logical :: rslt
rslt = this%scalar
end function is_scalar

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Get functions

Expand Down

0 comments on commit 8cd9d4c

Please sign in to comment.