Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
| alanjhewitt | Alan J Hewitt | Met Office | 2026-07-12 |
| mn416 | Matthew Naylor | University of Cambridge | 2026-07-24 |
| t00sa | Sam Clarke-Green | Met Office | 2026-09-10 |
| mcdalvi | Mohit Dalvi | Met Office | 2026-10-06 |
7 changes: 2 additions & 5 deletions src/control/core/interface/ukca_diagnostics_output_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ SUBROUTINE output_diag_status(error_code_ptr, group, diagnostics, &
IF (PRESENT(error_message)) error_message = ''
IF (PRESENT(error_routine)) error_routine = ''

IF (ALLOCATED(diagnostics%requests_ptr(dgroup_flat_real)%varnames)) THEN
IF (ALLOCATED(diagnostics%requests_ptr(group)%varnames)) THEN
n_req = diagnostics%n_request(group)
IF (SIZE(status_flags) /= n_req) THEN
error_code_ptr = errcode_diag_mismatch
Expand All @@ -710,10 +710,7 @@ SUBROUTINE output_diag_status(error_code_ptr, group, diagnostics, &
'diagnostics (group ', group, ')'
END IF
ELSE
error_code_ptr = errcode_diag_mismatch
WRITE(message_txt,'(A,I0,A)') &
'Status flag array present but diagnostic requests are not set ' // &
'(group ', group, ')'
n_req = 0
END IF

IF (error_code_ptr > 0) THEN
Expand Down
68 changes: 10 additions & 58 deletions src/control/core/interface/ukca_diagnostics_set_ptrs_mod.F90

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,8 @@ SUBROUTINE set_diag_ptrs_1d_domain(error_code_ptr, ukca_config, diagnostics, &
ELSE

! No request array set up for this group

diagnostics%n_request(dgroup_flat_real) = 0

! Check data array is absent
IF (PRESENT(data_flat_real)) THEN
error_code_ptr = errcode_diag_mismatch
IF (ASSOCIATED(diag2d_copy_out)) THEN
message_txt = message_txt_data_array_redundant // ' (flat real group)'
ELSE
message_txt = &
'Array present for unrequested diagnostic output (flat real group)'
END IF
END IF

END IF

IF (error_code_ptr > 0) THEN
Expand Down Expand Up @@ -235,22 +223,8 @@ SUBROUTINE set_diag_ptrs_1d_domain(error_code_ptr, ukca_config, diagnostics, &
ELSE

! No request array set up for this group

diagnostics%n_request(dgroup_fullht_real) = 0

! Check data array is absent
IF (PRESENT(data_fullht_real)) THEN
error_code_ptr = errcode_diag_mismatch
IF (ASSOCIATED(diag3d_copy_out)) THEN
message_txt = message_txt_data_array_redundant // &
' (full height real group)'
ELSE
message_txt = &
'Array present for unrequested diagnostic output ' // &
'(full height real group)'
END IF
END IF

END IF

IF (error_code_ptr > 0) THEN
Expand All @@ -261,7 +235,7 @@ SUBROUTINE set_diag_ptrs_1d_domain(error_code_ptr, ukca_config, diagnostics, &
END IF

! Record number of spatial dimensions in use for each diagnostic group
! and set pointers
! and set pointers only if any diagnostics are requested in this call.

IF (ASSOCIATED(diag2d_copy_out)) THEN
diagnostics%dimension_out(dgroup_flat_real) = imdi
Expand All @@ -275,13 +249,15 @@ SUBROUTINE set_diag_ptrs_1d_domain(error_code_ptr, ukca_config, diagnostics, &
diagnostics%dimension_out(dgroup_fullht_real) = 1
END IF

IF (PRESENT(data_flat_real)) THEN
IF ( PRESENT(data_flat_real) .AND. &
diagnostics%n_request(dgroup_flat_real) > 0 ) THEN
diagnostics%value_0d_real_ptr => data_flat_real
ELSE
NULLIFY(diagnostics%value_0d_real_ptr)
END IF

IF (PRESENT(data_fullht_real)) THEN
IF ( PRESENT(data_fullht_real) .AND. &
diagnostics%n_request(dgroup_fullht_real) > 0 ) THEN
diagnostics%value_1d_real_ptr => data_fullht_real
ELSE
NULLIFY(diagnostics%value_1d_real_ptr)
Expand Down Expand Up @@ -408,20 +384,8 @@ SUBROUTINE set_diag_ptrs_3d_domain(error_code_ptr, ukca_config, diagnostics, &
ELSE

! No request array set up for this group

diagnostics%n_request(dgroup_flat_real) = 0

! Check data array is absent
IF (PRESENT(data_flat_real)) THEN
error_code_ptr = errcode_diag_mismatch
IF (ASSOCIATED(diag2d_copy_out)) THEN
message_txt = message_txt_data_array_redundant // ' (flat real group)'
ELSE
message_txt = &
'Array present for unrequested diagnostic output (flat real group)'
END IF
END IF

END IF

IF (error_code_ptr > 0) THEN
Expand Down Expand Up @@ -476,22 +440,8 @@ SUBROUTINE set_diag_ptrs_3d_domain(error_code_ptr, ukca_config, diagnostics, &
ELSE

! No request array set up for this group

diagnostics%n_request(dgroup_fullht_real) = 0

! Check data array is absent
IF (PRESENT(data_fullht_real)) THEN
error_code_ptr = errcode_diag_mismatch
IF (ASSOCIATED(diag3d_copy_out)) THEN
message_txt = message_txt_data_array_redundant // &
' (full height real group)'
ELSE
message_txt = &
'Array present for unrequested diagnostic output ' // &
'(full height real group)'
END IF
END IF

END IF

IF (error_code_ptr > 0) THEN
Expand All @@ -502,7 +452,7 @@ SUBROUTINE set_diag_ptrs_3d_domain(error_code_ptr, ukca_config, diagnostics, &
END IF

! Record number of spatial dimensions in use for each diagnostic group
! and set pointers
! and set pointers only if any diagnostics are requested in this call.

IF (ASSOCIATED(diag2d_copy_out)) THEN
diagnostics%dimension_out(dgroup_flat_real) = imdi
Expand All @@ -516,13 +466,15 @@ SUBROUTINE set_diag_ptrs_3d_domain(error_code_ptr, ukca_config, diagnostics, &
diagnostics%dimension_out(dgroup_fullht_real) = 3
END IF

IF (PRESENT(data_flat_real)) THEN
IF (PRESENT(data_flat_real) .AND. &
diagnostics%n_request(dgroup_flat_real) > 0 ) THEN
diagnostics%value_2d_real_ptr => data_flat_real
ELSE
NULLIFY(diagnostics%value_2d_real_ptr)
END IF

IF (PRESENT(data_fullht_real)) THEN
IF (PRESENT(data_fullht_real) .AND. &
diagnostics%n_request(dgroup_fullht_real) > 0 ) THEN
diagnostics%value_3d_real_ptr => data_fullht_real
ELSE
NULLIFY(diagnostics%value_3d_real_ptr)
Expand Down
Loading