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

Implement time_none #1347

Merged
merged 35 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0717225
Add tests and checks
uramirez8707 Aug 14, 2023
394b9b4
minor update
uramirez8707 Aug 14, 2023
026c0f9
fixes for halo tests
uramirez8707 Aug 14, 2023
608744f
rename test script to test_time_none
uramirez8707 Aug 15, 2023
65f6541
add min tests
uramirez8707 Aug 15, 2023
80b3897
add tests for time_max
uramirez8707 Aug 15, 2023
da6c92b
forgot to git add the new files
uramirez8707 Aug 15, 2023
2a5067b
Attempt to add a time_sum test. Needs some work as some tests are fai…
uramirez8707 Aug 15, 2023
90ebe46
Merge branch 'dmUpdate' of github.com:NOAA-GFDL/FMS into time_none_tests
uramirez8707 Aug 15, 2023
0b9113a
Revert "Attempt to add a time_sum test. Needs some work as some tests…
uramirez8707 Aug 15, 2023
1f9cc02
rever change to test_diag_update_buffer
uramirez8707 Aug 15, 2023
ad47337
remove test_dm_openmp as it is not necessary anymore
uramirez8707 Aug 15, 2023
675f37a
minor documentation updates
uramirez8707 Aug 15, 2023
c3bc53a
add missing script to DIST
uramirez8707 Aug 15, 2023
d2a9811
pushing for the day, tries to implement time_none
uramirez8707 Aug 15, 2023
00cded4
implement time_none
uramirez8707 Aug 17, 2023
6baf85e
Merge branch 'dmUpdate' of github.com:NOAA-GFDL/FMS into time_none_4_…
uramirez8707 Aug 17, 2023
3d1acc3
push so i can debug on gaea
uramirez8707 Aug 18, 2023
9e4ac3c
finish implement time_none, needs MAJOR clean up
uramirez8707 Aug 18, 2023
560bbfe
some clean up and documentation
uramirez8707 Aug 18, 2023
1982935
more documentation updates to the diag_object and diag_bbox
uramirez8707 Aug 21, 2023
ec707f2
more documentation updates, fix lint
uramirez8707 Aug 21, 2023
686b2b7
move a use statement so that it can compile without yaml
uramirez8707 Aug 21, 2023
086931e
lint fix
uramirez8707 Aug 21, 2023
31c0e8c
Fix some bugs in %rebase_input and don't use pointer remapping
uramirez8707 Aug 21, 2023
2ecb2aa
improve error messages in check_time_none, run all of the tests
uramirez8707 Aug 21, 2023
cfd5fd3
turn off checks
uramirez8707 Aug 21, 2023
a46f325
refactor fms_diag_do_reduction
uramirez8707 Aug 21, 2023
6d6529d
move a line
uramirez8707 Aug 21, 2023
fd034db
renames a variable
uramirez8707 Aug 21, 2023
8f23daf
minor documentation updates
uramirez8707 Aug 23, 2023
b8a83aa
turn the checks back on
uramirez8707 Aug 23, 2023
e0cc678
fix issue when getting subregion
uramirez8707 Aug 23, 2023
be486f7
Add error messages inside the select types, add a function to get the…
uramirez8707 Aug 24, 2023
6ba0be5
add a missing #ifdef use_yaml
uramirez8707 Aug 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions diag_manager/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ libdiag_manager_la_SOURCES = \
fms_diag_bbox.F90 \
fms_diag_reduction_methods.F90 \
include/fms_diag_fieldbuff_update.inc \
include/fms_diag_fieldbuff_update.fh
include/fms_diag_fieldbuff_update.fh \
include/fms_diag_reduction_methods.inc \
include/fms_diag_reduction_methods_r4.fh \
include/fms_diag_reduction_methods_r8.fh

# Some mods are dependant on other mods in this dir.
diag_data_mod.$(FC_MODEXT): fms_diag_bbox_mod.$(FC_MODEXT)
Expand All @@ -68,15 +71,16 @@ fms_diag_yaml_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT)
fms_diag_object_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) fms_diag_file_object_mod.$(FC_MODEXT) fms_diag_field_object_mod.$(FC_MODEXT) fms_diag_yaml_mod.$(FC_MODEXT) \
fms_diag_time_utils_mod.$(FC_MODEXT) \
fms_diag_output_buffer_mod.$(FC_MODEXT) \
fms_diag_reduction_methods_mod.$(FC_MODEXT)
fms_diag_reduction_methods_mod.$(FC_MODEXT) \
fms_diag_bbox_mod.$(FC_MODEXT)
fms_diag_field_object_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) fms_diag_yaml_mod.$(FC_MODEXT) fms_diag_time_utils_mod.$(FC_MODEXT) \
fms_diag_axis_object_mod.$(FC_MODEXT)
fms_diag_file_object_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) fms_diag_yaml_mod.$(FC_MODEXT) fms_diag_field_object_mod.$(FC_MODEXT) fms_diag_time_utils_mod.$(FC_MODEXT) \
fms_diag_axis_object_mod.$(FC_MODEXT) fms_diag_output_buffer_mod.$(FC_MODEXT)
fms_diag_object_container_mod.$(FC_MODEXT): fms_diag_object_mod.$(FC_MODEXT) fms_diag_dlinked_list_mod.$(FC_MODEXT) fms_diag_time_utils_mod.$(FC_MODEXT)
fms_diag_axis_object_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) fms_diag_time_utils_mod.$(FC_MODEXT) fms_diag_yaml_mod.$(FC_MODEXT) \
diag_grid_mod.$(FC_MODEXT)
fms_diag_time_reduction_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT)
fms_diag_time_reduction_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) fms_diag_bbox_mod.$(FC_MODEXT)
fms_diag_elem_weight_procs_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT)
fms_diag_outfield_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) fms_diag_elem_weight_procs_mod.$(FC_MODEXT)
fms_diag_fieldbuff_update_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) diag_util_mod.$(FC_MODEXT) \
Expand All @@ -89,7 +93,8 @@ diag_manager_mod.$(FC_MODEXT): diag_axis_mod.$(FC_MODEXT) diag_data_mod.$(FC_MOD
fms_diag_object_container_mod.$(FC_MODEXT) fms_diag_axis_object_mod.$(FC_MODEXT) \
fms_diag_time_reduction_mod.$(FC_MODEXT) fms_diag_outfield_mod.$(FC_MODEXT) \
fms_diag_fieldbuff_update_mod.$(FC_MODEXT)
fms_diag_output_buffer_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) fms_diag_yaml_mod.$(FC_MODEXT)
fms_diag_output_buffer_mod.$(FC_MODEXT): diag_data_mod.$(FC_MODEXT) fms_diag_yaml_mod.$(FC_MODEXT) \
fms_diag_reduction_methods_mod.$(FC_MODEXT)
fms_diag_reduction_methods_mod.$(FC_MODEXT): fms_diag_bbox_mod.$(FC_MODEXT) fms_diag_output_buffer_mod.$(FC_MODEXT) \
diag_data_mod.$(FC_MODEXT)

Expand Down Expand Up @@ -118,7 +123,9 @@ MODFILES = \
fms_diag_fieldbuff_update_mod.$(FC_MODEXT) \
fms_diag_reduction_methods_mod.$(FC_MODEXT) \
include/fms_diag_fieldbuff_update.inc \
include/fms_diag_fieldbuff_update.fh
include/fms_diag_fieldbuff_update.fh \
include/fms_diag_reduction_methods_r4.fh \
include/fms_diag_reduction_methods_r8.fh

nodist_include_HEADERS = $(MODFILES)
BUILT_SOURCES = $(MODFILES)
Expand Down
49 changes: 36 additions & 13 deletions diag_manager/diag_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1676,9 +1676,9 @@ LOGICAL FUNCTION diag_send_data(diag_field_id, field, time, is_in, js_in, ks_in,
CHARACTER(len=128) :: error_string, error_string1

REAL, ALLOCATABLE, DIMENSION(:,:,:) :: field_out !< Local copy of field
class(*), pointer, dimension(:,:,:,:) :: field_remap !< 4d remapped pointer
logical, pointer, dimension(:,:,:,:) :: mask_remap !< 4d remapped pointer
class(*), pointer, dimension(:,:,:,:) :: rmask_remap !< 4d remapped pointer
class(*), allocatable, dimension(:,:,:,:) :: field_remap !< 4d remapped pointer
logical, allocatable, dimension(:,:,:,:) :: mask_remap !< 4d remapped pointer
class(*), allocatable, dimension(:,:,:,:) :: rmask_remap !< 4d remapped pointer
uramirez8707 marked this conversation as resolved.
Show resolved Hide resolved
REAL(kind=r4_kind), POINTER, DIMENSION(:,:,:) :: rmask_ptr_r4 !< A pointer to r4 type of rmask
REAL(kind=r8_kind), POINTER, DIMENSION(:,:,:) :: rmask_ptr_r8 !<A pointer to r8 type of rmask

Expand Down Expand Up @@ -1719,15 +1719,13 @@ LOGICAL FUNCTION diag_send_data(diag_field_id, field, time, is_in, js_in, ks_in,
IF ( fms_error_handler('diag_manager_mod::send_data_3d', err_msg_local, err_msg) ) RETURN
END IF
if (use_modern_diag) then !> Set up array lengths for remapping
field_remap => null()
mask_remap => null()
rmask_remap => null()
ie = SIZE(field,1)
je = SIZE(field,2)
ke = SIZE(field,3)
field_remap(1:ie,1:je,1:ke,1:1) => field
if (present(mask)) mask_remap(1:ie,1:je,1:ke,1:1) => mask
if (present(rmask)) rmask_remap(1:ie,1:je,1:ke,1:1) => rmask

field_remap = copy_3d_to_4d(field)
if (present(rmask)) rmask_remap = copy_3d_to_4d(rmask)
if (present(mask)) then
allocate(mask_remap(1:size(mask,1), 1:size(mask,2), 1:size(mask,3), 1))
mask_remap(:,:,:,1) = mask
endif
endif
SELECT TYPE (field)
TYPE IS (real(kind=r4_kind))
Expand All @@ -1744,7 +1742,9 @@ LOGICAL FUNCTION diag_send_data(diag_field_id, field, time, is_in, js_in, ks_in,
diag_send_data = fms_diag_object%fms_diag_accept_data(diag_field_id, field_remap, mask_remap, rmask_remap, &
time, is_in, js_in, ks_in, ie_in, je_in, ke_in, weight, &
err_msg)
nullify (field_remap)
deallocate (field_remap)
if (allocated(mask_remap)) deallocate(mask_remap)
if (allocated(rmask_remap)) deallocate(rmask_remap)
elSE ! modern_if
! oor_mask is only used for checking out of range values.
ALLOCATE(oor_mask(SIZE(field,1),SIZE(field,2),SIZE(field,3)), STAT=status)
Expand Down Expand Up @@ -4480,6 +4480,29 @@ SUBROUTINE diag_field_add_cell_measures(diag_field_id, area, volume)
END IF
END SUBROUTINE diag_field_add_cell_measures

!> @brief Copies a 3d buffer to a 4d buffer
!> @return a 4d buffer
function copy_3d_to_4d(data_in) &
result(data_out)
class (*), intent(in) :: data_in(:,:,:) !< Data to copy
class (*), allocatable :: data_out(:,:,:,:)

select type(data_in)
type is (real(kind=r8_kind))
allocate(real(kind=r8_kind) :: data_out(1:size(data_in,1), 1:size(data_in,2), 1:size(data_in,3), 1))
select type (data_out)
type is (real(kind=r8_kind))
data_out(:,:,:,1) = data_in
end select
type is (real(kind=r4_kind))
allocate(real(kind=r4_kind) :: data_out(1:size(data_in,1), 1:size(data_in,2), 1:size(data_in,3), 1))
select type (data_out)
type is (real(kind=r4_kind))
data_out(:,:,:,1) = data_in
end select
end select
rem1776 marked this conversation as resolved.
Show resolved Hide resolved
end function

END MODULE diag_manager_mod
!> @}
! close documentation grouping
Loading
Loading