Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -12,3 +12,4 @@
| yaswant | Yaswant Pradhan | Met Office | 2026-07-17 |
| RobWatersMet | Rob Waters | NCAS & University of Cambridge | 2026-07-06 |
| alanjhewitt | Alan J Hewitt | Met Office | 2026-07-12 |
| mn416 | Matthew Naylor | University of Cambridge | 2026-07-24 |
1 change: 1 addition & 0 deletions CONTRIBUTORS_LIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Florent Malavelle Met Office
Andy Malcolm Met Office
Cameron McErlich University of Canterbury
Jane Mulcahy Met Office
Matthew Naylor University of Cambridge
Charlotte Norris Met Office
Amy Peace Met Office
Leighton Regayre Met Office and University of Leeds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ MODULE ukca_config_specification_mod
! (2-50, 3 recommended)
INTEGER :: ukca_chem_seg_size ! Grid points per segment for the
! column-based chemical solver
INTEGER :: ukca_chem_full_chunk_size(3) ! Grid points per 3D chunk in the
! full-domain-based chemical solver
REAL :: max_z_for_offline_chem ! Maximum height at which to integrate
! chemistry with the explicit B-E
! Offline Oxidants scheme
Expand Down Expand Up @@ -874,6 +876,7 @@ SUBROUTINE init_ukca_configuration()
ukca_config%i_ukca_quasinewton_start = imdi
ukca_config%i_ukca_quasinewton_end = imdi
ukca_config%ukca_chem_seg_size = imdi
ukca_config%ukca_chem_full_chunk_size(:) = [-1, -1, -1]
ukca_config%max_z_for_offline_chem = rmdi
ukca_config%nlev_above_trop_o3_env = imdi
ukca_config%nlev_ch4_stratloss = imdi
Expand Down Expand Up @@ -1090,6 +1093,7 @@ SUBROUTINE ukca_get_config( &
dts0, nit, &
i_ukca_quasinewton_start, i_ukca_quasinewton_end, &
ukca_chem_seg_size, &
ukca_chem_full_chunk_size, &
nlev_above_trop_o3_env, &
nlev_ch4_stratloss, &
i_ukca_topboundary, &
Expand Down Expand Up @@ -1284,6 +1288,7 @@ SUBROUTINE ukca_get_config( &
INTEGER, OPTIONAL, INTENT(OUT) :: i_ukca_quasinewton_start
INTEGER, OPTIONAL, INTENT(OUT) :: i_ukca_quasinewton_end
INTEGER, OPTIONAL, INTENT(OUT) :: ukca_chem_seg_size
INTEGER, OPTIONAL, INTENT(OUT) :: ukca_chem_full_chunk_size(3)
INTEGER, OPTIONAL, INTENT(OUT) :: nlev_above_trop_o3_env
INTEGER, OPTIONAL, INTENT(OUT) :: nlev_ch4_stratloss
INTEGER, OPTIONAL, INTENT(OUT) :: i_ukca_topboundary
Expand Down Expand Up @@ -1572,6 +1577,8 @@ SUBROUTINE ukca_get_config( &
i_ukca_quasinewton_end = ukca_config%i_ukca_quasinewton_end
IF (PRESENT(ukca_chem_seg_size)) &
ukca_chem_seg_size = ukca_config%ukca_chem_seg_size
IF (PRESENT(ukca_chem_full_chunk_size)) &
ukca_chem_full_chunk_size = ukca_config%ukca_chem_full_chunk_size
IF (PRESENT(max_z_for_offline_chem)) &
max_z_for_offline_chem = ukca_config%max_z_for_offline_chem
IF (PRESENT(nlev_above_trop_o3_env)) &
Expand Down
15 changes: 14 additions & 1 deletion src/control/core/top_level/ukca_main1-ukca_main1.F90
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ SUBROUTINE ukca_main1(error_code_ptr, timestep_number, current_time, &
TYPE(autotune_type), ALLOCATABLE, SAVE :: autotune_state
#endif

! Full-domain chunk size in each dimension
INTEGER :: full_chunk_x, full_chunk_y, full_chunk_z

CHARACTER(LEN=*), PARAMETER :: RoutineName='UKCA_MAIN1'

!- End of header
Expand All @@ -604,7 +607,16 @@ SUBROUTINE ukca_main1(error_code_ptr, timestep_number, current_time, &
theta_field_size = row_length * rows
tot_n_pnts = theta_field_size * model_levels
IF (ukca_config%l_ukca_asad_full) THEN
n_pnts = tot_n_pnts
! Determine chunk size for full-domain 3D chunking
full_chunk_x = ukca_config%ukca_chem_full_chunk_size(1)
full_chunk_y = ukca_config%ukca_chem_full_chunk_size(2)
full_chunk_z = ukca_config%ukca_chem_full_chunk_size(3)
IF (full_chunk_x <= 0 .OR. full_chunk_x > row_length) &
full_chunk_x = row_length
IF (full_chunk_y <= 0 .OR. full_chunk_y > rows) full_chunk_y = rows
IF (full_chunk_z <= 0 .OR. full_chunk_z > model_levels) &
full_chunk_z = model_levels

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.

I would suggest printing a warning here within each IF to say that the value of the chunk has been reset to row_length / rows / model_levels, otherwise the code is changing something without the user being informed. The metadata for this namelist entry does say that this will be happening, but I'd also put a warning message here that it's been done

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks Luke Abraham (@theabro), done in commit 1304838.

n_pnts = full_chunk_x * full_chunk_y * full_chunk_z
ELSE IF (ukca_config%l_ukca_asad_columns) THEN
n_pnts = ukca_config%ukca_chem_seg_size
ELSE
Expand Down Expand Up @@ -2340,6 +2352,7 @@ SUBROUTINE ukca_main1(error_code_ptr, timestep_number, current_time, &
CALL ukca_chemistry_ctl_full( &
row_length, rows, model_levels, &
theta_field_size, tot_n_pnts, &
full_chunk_x, full_chunk_y, full_chunk_z, &
n_chem_tracers+n_aero_tracers, &
istore_h2so4, &
p_theta_levels, &
Expand Down
9 changes: 9 additions & 0 deletions src/control/core/top_level/ukca_setup_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ SUBROUTINE ukca_setup(error_code, &
i_ukca_quasinewton_start, &
i_ukca_quasinewton_end, &
ukca_chem_seg_size, &
ukca_chem_full_chunk_size, &
nlev_above_trop_o3_env, &
nlev_ch4_stratloss, &
i_ukca_topboundary, &
Expand Down Expand Up @@ -414,6 +415,7 @@ SUBROUTINE ukca_setup(error_code, &
INTEGER, OPTIONAL, INTENT(IN) :: i_ukca_quasinewton_start
INTEGER, OPTIONAL, INTENT(IN) :: i_ukca_quasinewton_end
INTEGER, OPTIONAL, INTENT(IN) :: ukca_chem_seg_size
INTEGER, OPTIONAL, INTENT(IN) :: ukca_chem_full_chunk_size(3)
INTEGER, OPTIONAL, INTENT(IN) :: nlev_above_trop_o3_env
INTEGER, OPTIONAL, INTENT(IN) :: nlev_ch4_stratloss
INTEGER, OPTIONAL, INTENT(IN) :: i_ukca_topboundary
Expand Down Expand Up @@ -838,6 +840,13 @@ SUBROUTINE ukca_setup(error_code, &

END IF

! Full-domain-based run configuration
IF (ukca_config%l_ukca_asad_full) THEN
ukca_config%ukca_chem_full_chunk_size(:) = [-1, -1, -1]
IF (PRESENT(ukca_chem_full_chunk_size)) &
ukca_config%ukca_chem_full_chunk_size(:) = ukca_chem_full_chunk_size(:)
END IF
Comment on lines +844 to +849

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.

If an END IF and THEN statement could be added here to keep styling consistent that would be great.

Suggested change
IF (ukca_config%l_ukca_asad_full) THEN
ukca_config%ukca_chem_full_chunk_size(:) = [-1, -1, -1]
IF (PRESENT(ukca_chem_full_chunk_size)) &
ukca_config%ukca_chem_full_chunk_size(:) = ukca_chem_full_chunk_size(:)
END IF
IF (ukca_config%l_ukca_asad_full) THEN
ukca_config%ukca_chem_full_chunk_size(:) = [-1, -1, -1]
IF (PRESENT(ukca_chem_full_chunk_size)) THEN &
ukca_config%ukca_chem_full_chunk_size(:) = ukca_chem_full_chunk_size(:)
END IF
END IF

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks Pierre Siddall (@Pierre-siddall), done in commit c78ab29.

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.

Thanks Pierre Siddall (Pierre Siddall (@Pierre-siddall)), done in commit c78ab29.

No problem mn416 and thanks for responding to the feedback quickly.


! Configuration specific to explicit B-E Offline Oxidants scheme
IF (ukca_config%i_ukca_chem == i_ukca_chem_offline_be) THEN
IF (PRESENT(max_z_for_offline_chem)) &
Expand Down
Loading
Loading