Makes the weight_sum an array instead of a scalar:
If the mask changes over time (i.e mask_variant is set to .true. in the register_diag_field call), weight_sum is set to be the size of the compute domain, otherwise it is set to to (1,1,1,1)
The weight sum is increased at every grid point only if it is not masked at that grid point
If a grid point is masked at every time step, the output buffer will be set to the fill_value
This is different from old behavior where the output buffer will be set to 0 instead of the fill value!
Adds a unit to test to test the mask_variant=.true. case
Since the allocate_buffer interface was changed, the unit tests were also updated to account for this
Updates the logic in update_buffer_time so that if send_data has not been called, it still counts as a new model time. This was added because if send_data was called at initialization new_time was set to .false. so the counter was off by one
Fixes # (issue)
How Has This Been Tested?
CI, included added tests
1 year long run of c96L33_am4p0_cmip6Diag
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] Any dependent changes have been merged and published in downstream modules
Description
weight_sum
an array instead of a scalar:mask_variant=.true.
caseallocate_buffer
interface was changed, the unit tests were also updated to account for thisupdate_buffer_time
so that if send_data has not been called, it still counts as a new model time. This was added because if send_data was called at initializationnew_time
was set to .false. so the counter was off by oneFixes # (issue)
How Has This Been Tested? CI, included added tests 1 year long run of
c96L33_am4p0_cmip6Diag
Checklist:
make distcheck
passes