From 4c222112df11e67c590c4983c97f2535c038b948 Mon Sep 17 00:00:00 2001 From: Mohit Dalvi Date: Thu, 15 Jan 2026 12:28:28 +0000 Subject: [PATCH 1/2] Re-apply lost changes after incorrect sync --- CONTRIBUTORS.md | 3 ++- .../legacy/ukca_interface/ukca_volcanic_so2.F90 | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 50ca66db0..94183474c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,4 +7,5 @@ | mo-marqh | mark Hedley | Met Office | 2025-12-11 | | yaswant | Yaswant Pradhan | Met Office | 2025-12-16 | | oakleybrunt | Oakley Brunt | Met Office | 2025-12-19 | -| harry-shepherd | Harry Shepherd | Met Office | 2026-01-08 | \ No newline at end of file +| harry-shepherd | Harry Shepherd | Met Office | 2026-01-08 | +| mcdalvi | Mohit Dalvi | Met Office | 2026-01-15 | diff --git a/interfaces/physics_schemes_interface/source/legacy/ukca_interface/ukca_volcanic_so2.F90 b/interfaces/physics_schemes_interface/source/legacy/ukca_interface/ukca_volcanic_so2.F90 index 05f319418..36933597a 100644 --- a/interfaces/physics_schemes_interface/source/legacy/ukca_interface/ukca_volcanic_so2.F90 +++ b/interfaces/physics_schemes_interface/source/legacy/ukca_interface/ukca_volcanic_so2.F90 @@ -150,6 +150,18 @@ subroutine ukca_volcanic_so2 & if (lhook) call dr_hook(ModuleName//':'//RoutineName,zhook_in,zhook_handle) +! Functionality is not currently implemented in LFRic. +errcode = 1 +call ereport(RoutineName, errcode, & + 'Functionality not available -'//RoutineName//' should not be called') + +! Allocate true_latitude, true_longitude arrays and initialise temporarily. +! These should be subsequently populated from LFRic w3 fields. +if ( .not. allocated(true_latitude)) allocate(true_latitude(row_length,rows)) +if ( .not. allocated(true_longitude)) allocate(true_longitude(row_length,rows)) +true_latitude(:,:) = 0.0 +true_longitude(:,:) = 0.0 + ! On first call, determine locations on the UM grid where volcanos are located. ! The method assumes that the grid is a regular latitude-longitude grid with ! latitude constant on each row and equally-spaced between rows and @@ -334,6 +346,7 @@ subroutine ukca_volcanic_so2 & l2 = l2 - 1 end do if (l2 < l1) l1 = l2 + allocate(weight_volc_vertdist(l2-l1+1)) ! express emission as increase in average increase in mass mixing ratio weight_volc_vertdist = (abs(r_theta_levels(i,j,l1+1:l2+1) - & r_theta_levels(i,j,l1-1:l2-1))/2) * & @@ -343,10 +356,14 @@ subroutine ukca_volcanic_so2 & so2_mmr(i,j,l1:l2) = so2_mmr(i,j,l1:l2) + emission(k) * & (weight_volc_vertdist/sum(weight_volc_vertdist)) / & mass(i,j,l1:l2) + deallocate(weight_volc_vertdist) end if end if end do +if (allocated(true_latitude)) deallocate(true_latitude) +if (allocated(true_longitude)) deallocate(true_longitude) + if (lhook) call dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) return end subroutine ukca_volcanic_so2 From 49a8a2d61714bffd4834d33bef24b4f58839beee Mon Sep 17 00:00:00 2001 From: Mohit Dalvi Date: Mon, 19 Jan 2026 09:57:24 +0000 Subject: [PATCH 2/2] Improve error message after review --- .../source/legacy/ukca_interface/ukca_volcanic_so2.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interfaces/physics_schemes_interface/source/legacy/ukca_interface/ukca_volcanic_so2.F90 b/interfaces/physics_schemes_interface/source/legacy/ukca_interface/ukca_volcanic_so2.F90 index 36933597a..da5d22651 100644 --- a/interfaces/physics_schemes_interface/source/legacy/ukca_interface/ukca_volcanic_so2.F90 +++ b/interfaces/physics_schemes_interface/source/legacy/ukca_interface/ukca_volcanic_so2.F90 @@ -152,8 +152,9 @@ subroutine ukca_volcanic_so2 & ! Functionality is not currently implemented in LFRic. errcode = 1 -call ereport(RoutineName, errcode, & - 'Functionality not available -'//RoutineName//' should not be called') +cmessage = 'Volcanic SO2 emissions not yet implemented.' // & + 'Logical l_ukca_so2ems_expvolc should be set to .false.' +call ereport(RoutineName, errcode, cmessage) ! Allocate true_latitude, true_longitude arrays and initialise temporarily. ! These should be subsequently populated from LFRic w3 fields.