Skip to content

Commit

Permalink
ensure that fms_diag_accept_data is set + fix send_data call for a st…
Browse files Browse the repository at this point in the history
…atic field
  • Loading branch information
uramirez8707 committed Oct 30, 2024
1 parent bd9cbeb commit e7dcb18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
6 changes: 1 addition & 5 deletions diag_manager/fms_diag_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,6 @@ logical function fms_diag_accept_data (this, diag_field_id, field_data, mask, rm
!$omp end critical
call this%FMS_diag_fields(diag_field_id)%set_data_buffer(field_data, oor_mask, field_weight, &
is, js, ks, ie, je, ke)
fms_diag_accept_data = .TRUE.
return
else

!< At this point if we are no longer in an openmp region or running with 1 thread
Expand Down Expand Up @@ -709,11 +707,9 @@ logical function fms_diag_accept_data (this, diag_field_id, field_data, mask, rm
if(.not. this%FMS_diag_fields(diag_field_id)%has_mask_allocated()) &
call this%FMS_diag_fields(diag_field_id)%allocate_mask(oor_mask)
call this%FMS_diag_fields(diag_field_id)%set_mask(oor_mask, field_info)
return
end if main_if
!> Return false if nothing is done
fms_diag_accept_data = .FALSE.
return
fms_diag_accept_data = .TRUE.
#endif
end function fms_diag_accept_data

Expand Down
4 changes: 2 additions & 2 deletions test_fms/diag_manager/test_diag_manager2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ diag_files:
kind: r4
- module: atm_mod
var_name: var7
reduction: average
reduction: none
kind: r4
- file_name: file4
freq: 6 hours
Expand Down Expand Up @@ -1050,7 +1050,7 @@ diag_files:
dimensions: time grid_index
- module: atm_mod
var_name: var7
reduction: average
reduction: none
kind: r4
output_name:
long_name:
Expand Down
4 changes: 1 addition & 3 deletions test_fms/diag_manager/test_modern_diag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ program test_modern_diag

call allocate_dummy_data(var_data, domain, Domain_cube_sph, land_domain, nz)
Time_step = set_time (3600,0) !< 1 hour
used = send_data(id_var8, var_data%var6, Time)
do i=1,23
Time = Time + Time_step
call set_dummy_data(var_data, i)
Expand All @@ -210,9 +211,6 @@ program test_modern_diag
used = send_data(id_var6, var_data%var6, Time)
used = send_data(id_var7, var_data%var6, Time)

!TODO I don't know about this (scalar field) or how this is suppose to work #WUT
used = send_data(id_var8, var_data%var6, Time)

call diag_send_complete(Time_step)
enddo
call deallocate_dummy_data(var_data)
Expand Down

0 comments on commit e7dcb18

Please sign in to comment.