-
Notifications
You must be signed in to change notification settings - Fork 141
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
Adds a new member routine allocate_diag_field_output_buffers() to fmsDiagObject_type #1194
Conversation
…F90 files within FMS/diag_manager
|
||
! 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
diag_manager/fms_diag_object.F90
Outdated
ndims = ndims + 1 !< Add one more dimension for the diurnal axis | ||
endif | ||
|
||
! Allocate diag_buffer_obj, if it is not allocated. |
There was a problem hiding this comment.
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 ...) "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comment
do j = 1, ndims | ||
axes_length(j) = this%fms_get_axis_length(axis_ids(j)) | ||
enddo |
There was a problem hiding this comment.
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 ...
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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:
make distcheck
passes