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

Adds a new member routine allocate_diag_field_output_buffers() to fmsDiagObject_type #1194

Conversation

ganganoaa
Copy link
Contributor

Description
Update relates to a new addition of member routine, allocate_diag_field_output_buffer, to the type fmsDiagObject_type in the fms_diag_object_mod. The routine fms_diag_output_buffer_create_container in the module, fms_diag_output_buffer_mod, is declared public for visibility issue. The dependency of module, fms_diag_output_buffer_mod, is inserted in /diag_manager/Makefile.am. The use statement for the fms_diag_yaml_mod is also updated to include the DiagYamlFilesVar_type.

Fixes # (issue)
CI

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note
any relevant details for your test configuration (e.g. compiler, OS). Include
enough information so someone can reproduce your tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes


! Loop over a number of fields/buffers where this variable occurs
do i = 1, size(this%FMS_diag_fields(field_id)%buffer_ids)
buffer_id = this%FMS_diag_fields(field_id)%buffer_ids(i)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are buffer_ids going to be set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am going to allocate and set it inside fms_register_diag_field_obj() using get_diag_field_ids() which is in the PR #1186.

ndims = ndims + 1 !< Add one more dimension for the diurnal axis
endif

! Allocate diag_buffer_obj, if it is not allocated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Change comment to something like:
"Allocates diag_buffer_obj to the correct outputBuffer type based on the dimension (i.e outputBuffer0d_type, outputBuffer1d_type, etc ...) "

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment

Comment on lines +886 to +888
do j = 1, ndims
axes_length(j) = this%fms_get_axis_length(axis_ids(j))
enddo
Copy link
Contributor

Choose a reason for hiding this comment

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

Add "!TODO This is going to require more work for when we have subRegion variables "

We will figure this out later ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the line

select type (ptr_diag_buffer_obj)
type is (outputBuffer0d_type) !< Scalar buffer
if (allocated(ptr_diag_buffer_obj%buffer)) cycle !< If allocated, loop back
call ptr_diag_buffer_obj%allocate_buffer(field_data(1, 1, 1, 1), & !< If scalar field variable
Copy link
Contributor

Choose a reason for hiding this comment

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

@rem1776 can we initialize the buffer to the FillValue?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah should be able to use initialize_buffer right after its allocated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I will update it soon.

@ganganoaa ganganoaa closed this Apr 25, 2023
@ganganoaa ganganoaa deleted the buffer_allocation_routine_dmUpdate branch April 25, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants