-
Notifications
You must be signed in to change notification settings - Fork 138
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
dmUpdate: add time_average reduction method and test #1421
Conversation
…a has not been recived for that time
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.
Needs more documentation
class(fmsDiagField_type), intent(in) :: this | ||
class(*), allocatable, intent(out) :: missing_val | ||
real(r8_kind) :: res |
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.
needs documentation
!! this just indicates whether the mask array itself has been alloc'd | ||
!! this is different from @ref has_mask_variant, which is set earlier for whether a mask is being used at all | ||
pure logical function has_mask_allocated(this) | ||
class(fmsDiagField_type),intent(in) :: this |
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.
needs documentation
!> \brief Gets the buffer_id list from the file object | ||
pure function get_buffer_ids (this) | ||
class(fmsDiagFile_type), intent(in) :: this !< The file object | ||
integer, allocatable :: get_buffer_ids(:) |
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.
needs documentation
|
||
pure function get_number_of_buffers(this) | ||
class(fmsDiagFile_type), intent(in) :: this !< file object | ||
integer :: get_number_of_buffers |
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.
needs documentation
@@ -654,7 +663,7 @@ subroutine fms_diag_send_complete(this, time_step) | |||
character(len=128) :: error_string | |||
type(fmsDiagIbounds_type) :: bounds | |||
integer, dimension(:), allocatable :: file_ids !< Array of file IDs for a field | |||
logical, parameter :: DEBUG_SC = .true. !< turn on output for debugging | |||
logical, parameter :: DEBUG_SC = .false. !< turn on output for debugging |
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.
You can't turn this on if it's a parameter
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.
For the debug output they are just local parameters for if your working on the code so I figured they would be changed manually.
If we want to make them more accessible we could do a CPP macro or namelist option instead but I think this should be a parameter either way since it's value shouldn't change over the course of this routine.
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.
If it's a parameter, then it can't be a namelist option. It would be good to make it a namelist option. This can be a TODO
diag_manager/fms_diag_object.F90
Outdated
TYPE (time_type), pointer :: model_time!< The current model time | ||
|
||
integer, allocatable :: buff_ids(:) !< ids for output buffers to loop through | ||
integer :: ibuff, mask_zbounds(2), mask_shape(4) |
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.
needs documentation. Should probably all be on separate lines for documentation purposes
diag_manager/fms_diag_object.F90
Outdated
logical :: force_write, is_writing, has_mask | ||
logical, parameter :: DEBUG_REDUCT = .false. | ||
class(*), allocatable :: missing_val | ||
real(r8_kind) :: mval | ||
character(len=128) :: error_string |
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.
needs documentation
!logical, intent(in) :: is_subregional !< if subregional output | ||
!logical, intent(in) :: has_halo !< true if halo region is being used | ||
!logical, optional, intent(in) :: mask(:,:,:,:) !< whether a mask variant reduction | ||
!logical, allocatable :: mask_tmp(:,:,:,:) | ||
!integer :: is, ie, js, je, ks, ke, zs, ze | ||
!integer :: i, halo_size(4) |
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.
Can this all be removed?
The PR failed the CI |
* add tests and routines from other branch * move weight check to output buffer, more comments + cleanup * simplify reduction done * update avg test for send_data_r4 * Add time to the buffer object so the counter is only increased if data has not been recived for that time --------- Co-authored-by: rem1776 <[email protected]> Co-authored-by: Uriel Ramirez <[email protected]>
* add tests and routines from other branch * move weight check to output buffer, more comments + cleanup * simplify reduction done * update avg test for send_data_r4 * Add time to the buffer object so the counter is only increased if data has not been recived for that time --------- Co-authored-by: rem1776 <[email protected]> Co-authored-by: Uriel Ramirez <[email protected]>
Description
adds the time average reduction method and some other (basically getters/setters) routines that were needed for it to work properly along with a unit test for it.
Just getting an error with the modern end to end test, but that might be related to the reductions we haven't added yet.
draft for now, still some TODO's to clean up after some discussion
How Has This Been Tested?
amd box with the latest oneapi. Also compiled with all the runtime checks while working on this so that one test might still pass in the ci.
Checklist:
make distcheck
passes