From 5bbe34009d4ee0af5032b510d31d7277667ab743 Mon Sep 17 00:00:00 2001 From: Ganga P Purja Pun Date: Thu, 6 Apr 2023 14:27:02 -0400 Subject: [PATCH 1/7] Adds routine get_output_buffer_ids --- diag_manager/fms_diag_yaml.F90 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/diag_manager/fms_diag_yaml.F90 b/diag_manager/fms_diag_yaml.F90 index f934fb640c..ae3f38de85 100644 --- a/diag_manager/fms_diag_yaml.F90 +++ b/diag_manager/fms_diag_yaml.F90 @@ -1457,6 +1457,22 @@ function get_diag_fields_entries(indices) & end function get_diag_fields_entries +!> @brief Gets the output buffer ids corresponding to the indicies in the sorted variable_list +!! @return Array of indicies of the output buffers +function get_output_buffer_ids(indices) result(buffer_ids) + + integer, intent(in) :: indices(:) !< Indicies of the fields in the sorted variable_list array + integer, allocatable :: buffer_ids(:) + integer :: i !< For do loop + + allocate(buffer_ids(size(indices))) + + do i = 1, size(indices) + buffer_ids(i) = variable_list%diag_field_indices(indices(i)) + end do + +end function get_output_buffer_ids + !> @brief Finds the indices of the diag_yaml%diag_files(:) corresponding to fields in variable_list(indices) !! @return indices of the diag_yaml%diag_files(:) function get_diag_files_id(indices) & From 8c4b47d013bdb0991be81da2f7de84c3e7ab8249 Mon Sep 17 00:00:00 2001 From: Ganga P Purja Pun Date: Thu, 6 Apr 2023 14:34:38 -0400 Subject: [PATCH 2/7] Corrects typos in comments --- diag_manager/fms_diag_yaml.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diag_manager/fms_diag_yaml.F90 b/diag_manager/fms_diag_yaml.F90 index ae3f38de85..22a22244d6 100644 --- a/diag_manager/fms_diag_yaml.F90 +++ b/diag_manager/fms_diag_yaml.F90 @@ -1457,11 +1457,11 @@ function get_diag_fields_entries(indices) & end function get_diag_fields_entries -!> @brief Gets the output buffer ids corresponding to the indicies in the sorted variable_list -!! @return Array of indicies of the output buffers +!> @brief Gets the output buffer ids corresponding to the indices in the sorted variable_list +!! @return Array of indices of the output buffers function get_output_buffer_ids(indices) result(buffer_ids) - integer, intent(in) :: indices(:) !< Indicies of the fields in the sorted variable_list array + integer, intent(in) :: indices(:) !< Indices of the fields in the sorted variable_list array integer, allocatable :: buffer_ids(:) integer :: i !< For do loop From 2893021d40e66c806c6964ae606500c84bcd3242 Mon Sep 17 00:00:00 2001 From: Ganga P Purja Pun Date: Thu, 6 Apr 2023 14:44:41 -0400 Subject: [PATCH 3/7] Adds public declaration of the routine --- diag_manager/fms_diag_yaml.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/diag_manager/fms_diag_yaml.F90 b/diag_manager/fms_diag_yaml.F90 index 22a22244d6..05fabc733b 100644 --- a/diag_manager/fms_diag_yaml.F90 +++ b/diag_manager/fms_diag_yaml.F90 @@ -51,6 +51,7 @@ module fms_diag_yaml_mod public :: diagYamlObject_type, get_diag_yaml_obj, subRegion_type public :: diagYamlFiles_type, diagYamlFilesVar_type public :: get_num_unique_fields, find_diag_field, get_diag_fields_entries, get_diag_files_id +public :: get_output_buffer_ids public :: dump_diag_yaml_obj !> @} From 26e3fed0565a70d2330c579838fadc2bc427a202 Mon Sep 17 00:00:00 2001 From: ganganoaa <121043264+ganganoaa@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:30:33 -0400 Subject: [PATCH 4/7] Update fms_diag_yaml.F90 Change get_output_buffer_ids to get_diag_field_ids and update comments. --- diag_manager/fms_diag_yaml.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/diag_manager/fms_diag_yaml.F90 b/diag_manager/fms_diag_yaml.F90 index 05fabc733b..5bd8ffde1c 100644 --- a/diag_manager/fms_diag_yaml.F90 +++ b/diag_manager/fms_diag_yaml.F90 @@ -51,7 +51,7 @@ module fms_diag_yaml_mod public :: diagYamlObject_type, get_diag_yaml_obj, subRegion_type public :: diagYamlFiles_type, diagYamlFilesVar_type public :: get_num_unique_fields, find_diag_field, get_diag_fields_entries, get_diag_files_id -public :: get_output_buffer_ids +public :: get_diag_field_ids public :: dump_diag_yaml_obj !> @} @@ -1458,9 +1458,9 @@ function get_diag_fields_entries(indices) & end function get_diag_fields_entries -!> @brief Gets the output buffer ids corresponding to the indices in the sorted variable_list -!! @return Array of indices of the output buffers -function get_output_buffer_ids(indices) result(buffer_ids) +!> @brief Gets the field indices from the sorted variable_list +!! @return Array of field indices +function get_diag_field_ids(indices) result(buffer_ids) integer, intent(in) :: indices(:) !< Indices of the fields in the sorted variable_list array integer, allocatable :: buffer_ids(:) @@ -1472,7 +1472,7 @@ function get_output_buffer_ids(indices) result(buffer_ids) buffer_ids(i) = variable_list%diag_field_indices(indices(i)) end do -end function get_output_buffer_ids +end function get_diag_field_ids !> @brief Finds the indices of the diag_yaml%diag_files(:) corresponding to fields in variable_list(indices) !! @return indices of the diag_yaml%diag_files(:) From 8454f585f1ea5e2d2f20c8c0d46694bc652c89b2 Mon Sep 17 00:00:00 2001 From: ganganoaa <121043264+ganganoaa@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:49:01 -0400 Subject: [PATCH 5/7] Update fms_diag_yaml.F90 Update comment --- diag_manager/fms_diag_yaml.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diag_manager/fms_diag_yaml.F90 b/diag_manager/fms_diag_yaml.F90 index 5bd8ffde1c..9f090e9e2b 100644 --- a/diag_manager/fms_diag_yaml.F90 +++ b/diag_manager/fms_diag_yaml.F90 @@ -1458,7 +1458,7 @@ function get_diag_fields_entries(indices) & end function get_diag_fields_entries -!> @brief Gets the field indices from the sorted variable_list +!> @brief Gets field indices corresponding to the indices (input argument) in the sorted variable_list !! @return Array of field indices function get_diag_field_ids(indices) result(buffer_ids) From 804c112b3e0376b8fa76ba757033b4478aca175f Mon Sep 17 00:00:00 2001 From: ganganoaa <121043264+ganganoaa@users.noreply.github.com> Date: Mon, 10 Apr 2023 15:35:23 -0400 Subject: [PATCH 6/7] Update fms_diag_yaml.F90 Replace buffer_ids with field_ids. --- diag_manager/fms_diag_yaml.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/diag_manager/fms_diag_yaml.F90 b/diag_manager/fms_diag_yaml.F90 index 9f090e9e2b..71241257e9 100644 --- a/diag_manager/fms_diag_yaml.F90 +++ b/diag_manager/fms_diag_yaml.F90 @@ -1460,16 +1460,16 @@ end function get_diag_fields_entries !> @brief Gets field indices corresponding to the indices (input argument) in the sorted variable_list !! @return Array of field indices -function get_diag_field_ids(indices) result(buffer_ids) +function get_diag_field_ids(indices) result(field_ids) integer, intent(in) :: indices(:) !< Indices of the fields in the sorted variable_list array - integer, allocatable :: buffer_ids(:) + integer, allocatable :: field_ids(:) integer :: i !< For do loop - allocate(buffer_ids(size(indices))) + allocate(field_ids(size(indices))) do i = 1, size(indices) - buffer_ids(i) = variable_list%diag_field_indices(indices(i)) + field_ids(i) = variable_list%diag_field_indices(indices(i)) end do end function get_diag_field_ids From d68b2ea149082885bd11bc5171542cef3168014e Mon Sep 17 00:00:00 2001 From: ganganoaa <121043264+ganganoaa@users.noreply.github.com> Date: Fri, 21 Apr 2023 11:02:15 -0400 Subject: [PATCH 7/7] Update fms_diag_yaml.F90 Update comment for return --- diag_manager/fms_diag_yaml.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diag_manager/fms_diag_yaml.F90 b/diag_manager/fms_diag_yaml.F90 index 71241257e9..f26b0ee187 100644 --- a/diag_manager/fms_diag_yaml.F90 +++ b/diag_manager/fms_diag_yaml.F90 @@ -1459,7 +1459,7 @@ function get_diag_fields_entries(indices) & end function get_diag_fields_entries !> @brief Gets field indices corresponding to the indices (input argument) in the sorted variable_list -!! @return Array of field indices +!! @return Copy of array of field indices function get_diag_field_ids(indices) result(field_ids) integer, intent(in) :: indices(:) !< Indices of the fields in the sorted variable_list array