NOAA-GFDL/FMS

Modern diag_manager:: diag_send_complete_instant has not been implemented

Opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
Diag_send_complete_instant has not been implemented in the modern diag_manager, so it will do nothing and cause failures

!> @brief The subroutine 'diag_send_complete_instant' allows the user to
!! save diagnostic data on variable intervals (user defined in code logic)
!! to the same file. The argument (time_type) will be written to the
!! time axis correspondingly.
!!
!> The user is responsible for any averaging of accumulated data
!! as this routine is not designed for instantaneous values. This routine
!! works only for send_data calls within OpenMP regions as they are buffered
!! until the complete signal is given.
SUBROUTINE diag_send_complete_instant(time)
TYPE (time_type), INTENT(in) :: time
!--- local variables
integer :: file, j, freq, in_num, file_num, out_num
DO file = 1, num_files
freq = files(file)%output_freq
IF (freq == 0) then
DO j = 1, files(file)%num_fields
out_num = files(file)%fields(j)
in_num = output_fields(out_num)%input_field
IF ( (input_fields(in_num)%numthreads == 1) .AND.&
& (input_fields(in_num)%active_omp_level.LE.1) ) CYCLE
file_num = output_fields(out_num)%output_file
CALL diag_data_out(file_num, out_num, &
& output_fields(out_num)%buffer, time)
END DO
END IF
END DO
END SUBROUTINE diag_send_complete_instant

Describe the solution you'd like
Diag_send_complete_instant needs to be implemented as it is used in SHiELD
https://github.com/NOAA-GFDL/atmos_drivers/blob/113a25fe6fea86bb5dce8fee064740b4b96237b9/SHiELD/atmos_model.F90#L738

Describe alternatives you've considered
N/A

Additional context
N/A

@laurenchilutti I think this is the cause of the full SHiELD test

FATAL from PE    17: atmos_4xdaily: diag_manager_mod: You skipped a time_step. Be sure that diag_send_complete is called at every time_step needed by the file.

fyi @bensonr

@uramirez8707 - do you think there is a way to set the variables in the diag_table[.yaml] to get around having to implement this function?