From 04ae392671682e31695d715b7eacff38fe5e2892 Mon Sep 17 00:00:00 2001 From: Maggie Hendry Date: Sun, 12 Jul 2026 18:50:31 +0100 Subject: [PATCH 1/3] * All pftparm subroutine calls moved into `jules_pftparm_init`. * Call JULES repo map namelist instance to tile number routine instead. --- dependencies.yaml | 4 +- .../source/support/jules_pftparm_init_mod.f90 | 45 +++++-------------- .../source/support/jules_physics_init_mod.f90 | 7 --- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index 6e03afa856..1e3258e453 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -22,8 +22,8 @@ casim: ref: 2026.03.2 jules: - source: git@github.com:MetOffice/jules.git - ref: 3647a42962613d1f50d02d7660c86dece056f87c + source: cazldf00009S.spice.sc.metoffice.gov.uk:/home/users/margaret.hendry/jules_fork/jules + ref: d5372299347b5b1a8807fecb3c3e8073db8e2291 lfric_apps: source: diff --git a/interfaces/jules_interface/source/support/jules_pftparm_init_mod.f90 b/interfaces/jules_interface/source/support/jules_pftparm_init_mod.f90 index f657ee2038..ed52b867ec 100644 --- a/interfaces/jules_interface/source/support/jules_pftparm_init_mod.f90 +++ b/interfaces/jules_interface/source/support/jules_pftparm_init_mod.f90 @@ -39,10 +39,13 @@ subroutine jules_pftparm_init(config) psi_open, q10_leaf, r_grow, rootd_ft, sigl, sox_a, sox_p50, sox_rp_min, & sug_g0, sug_grec, sug_yg, tef, tleaf_of, tlow, tupp, vint, vsl, z0v + use pftparm, only: pftparm_alloc, print_nlist_jules_pftparm, & + check_jules_pftparm + use jules_pftparm_nml_iterator_mod, only: jules_pftparm_nml_iterator_type use jules_pftparm_nml_mod, only: jules_pftparm_nml_type - use jules_surface_types_mod, only: npft, brd_leaf, ndl_leaf, c3_grass, & - c4_grass, shrub + use jules_surface_types_mod, only: npft, map_nml_instance_to_tile_number + use log_mod, only: log_event, log_scratch_space, log_level_error @@ -58,42 +61,15 @@ subroutine jules_pftparm_init(config) character(len=*), parameter :: RoutineName='JULES_PFTPARM_INIT' + call pftparm_alloc(npft) + n = 0 call iter%initialise( config%jules_pftparm ) do while ( iter%has_next() ) n = n + 1 jules_pftparm => iter%next() - ! For now add mapping from instance to jules_surface_types - select case ( trim( jules_pftparm%pft_name_io() ) ) - case ( 'brd_leaf' ) - i = brd_leaf - case ( 'ndl_leaf' ) - i = ndl_leaf - case ( 'c3_grass' ) - i = c3_grass - case ( 'c4_grass' ) - i = c4_grass - case ( 'shrub' ) - i = shrub - case DEFAULT - write(log_scratch_space,'(A)') & - 'PFT name not recognised: ' // jules_pftparm%pft_name_io() - call log_event( & - RoutineName//': '//trim(log_scratch_space), log_level_error & - ) - end select - - ! Range of specified types (1:npft) checked by check_jules_surface_types - if ( i < 1 ) then - write(log_scratch_space,'(A)') & - 'jules_pftparm and jules_surface_types inputs are inconsistent; '// & - trim(jules_pftparm%pft_name_io()) // & - ' is not specified in jules_surface_types' - call log_event( & - RoutineName//': '//trim(log_scratch_space), log_level_error & - ) - end if - + i = map_nml_instance_to_tile_number ( 'jules_pftparm', & + jules_pftparm%pft_name_io() ) ! c3_io would make more sense as a logical ! (see MetOffice/jules/issues/106) select case ( jules_pftparm%c3_io() ) @@ -235,6 +211,9 @@ subroutine jules_pftparm_init(config) ) end if + call print_nlist_jules_pftparm() + call check_jules_pftparm() + end subroutine jules_pftparm_init end module jules_pftparm_init_mod diff --git a/interfaces/jules_interface/source/support/jules_physics_init_mod.f90 b/interfaces/jules_interface/source/support/jules_physics_init_mod.f90 index 9736bfddd5..aea683a82a 100644 --- a/interfaces/jules_interface/source/support/jules_physics_init_mod.f90 +++ b/interfaces/jules_interface/source/support/jules_physics_init_mod.f90 @@ -57,7 +57,6 @@ module jules_physics_init_mod use jules_irrig_mod, only: irrig_vars_alloc use metstats_mod, only: metstats_allocate use nvegparm, only: nvegparm_alloc - use pftparm, only: pftparm_alloc use trif, only: trif_alloc use veg3_parm_mod, only: veg3_parm_allocate use veg3_field_mod, only: veg3_field_allocate @@ -177,8 +176,6 @@ subroutine jules_physics_init(config) albsnc_nvg, albsnf_nvgu, albsnf_nvg, albsnf_nvgl, catch_nvg, & ch_nvg, emis_nvg, gs_nvg, infil_nvg, vf_nvg, z0_nvg, & check_jules_nvegparm, print_nlist_jules_nvegparm - use pftparm, only: & - print_nlist_jules_pftparm, check_jules_pftparm use jules_pftparm_init_mod, only: jules_pftparm_init use check_compatible_options_mod, only: check_compatible_options @@ -595,8 +592,6 @@ subroutine jules_physics_init(config) call nvegparm_alloc(nnvg) - call pftparm_alloc(npft) - call trif_alloc(npft, l_triffid, l_phenol) call veg3_parm_allocate(land_pts,nsurft,nnpft,npft) @@ -651,12 +646,10 @@ subroutine jules_physics_init(config) ! Settings which are specified on all surface tiles at once ! - contained in module c_z0h_z0m ! ---------------------------------------------------------------- - call print_nlist_jules_pftparm() call print_nlist_jules_nvegparm() call c_z0h_z0m_print() ! This routine checks that the options set are actually compatible - call check_jules_pftparm(npft,nnpft) call check_jules_nvegparm(nnvg) call c_z0h_z0m_check(ntype) call check_compatible_options() From b2c4e4806a3506f8f309bb69826930a73dc343d8 Mon Sep 17 00:00:00 2001 From: Maggie Hendry Date: Mon, 24 Aug 2026 17:00:16 +0100 Subject: [PATCH 2/3] Update of JULES branch. --- dependencies.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.yaml b/dependencies.yaml index 9e169f341d..31f79ec831 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -23,7 +23,7 @@ casim: jules: source: cazldf00009S.spice.sc.metoffice.gov.uk:/home/users/margaret.hendry/jules_fork/jules - ref: d5372299347b5b1a8807fecb3c3e8073db8e2291 + ref: 7170d515223c8366ee0467d631dc117a30beb797 lfric_apps: source: From b2e7a1078d9a2b8937d3e2ab7c85134c6c3f0a97 Mon Sep 17 00:00:00 2001 From: Maggie Hendry Date: Fri, 11 Sep 2026 14:16:06 +0100 Subject: [PATCH 3/3] Upgrade macro added to ensure metadata changes are picked up and JULES source updated. --- dependencies.yaml | 4 ++-- .../jules_interface/rose-meta/jules-lsm/versions.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index 31f79ec831..ed39c165c1 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -22,8 +22,8 @@ casim: ref: 2026.07.1 jules: - source: cazldf00009S.spice.sc.metoffice.gov.uk:/home/users/margaret.hendry/jules_fork/jules - ref: 7170d515223c8366ee0467d631dc117a30beb797 + source: git@github.com:maggiehendry/jules.git + ref: 115-convert-jules_pftparm-to-a-duplicate-namelist lfric_apps: source: diff --git a/interfaces/jules_interface/rose-meta/jules-lsm/versions.py b/interfaces/jules_interface/rose-meta/jules-lsm/versions.py index 01e65a2b91..6bf46b4b33 100644 --- a/interfaces/jules_interface/rose-meta/jules-lsm/versions.py +++ b/interfaces/jules_interface/rose-meta/jules-lsm/versions.py @@ -31,3 +31,13 @@ def upgrade(self, config, meta_config=None): # Add settings return config, self.reports """ + +class vn32_t775(MacroUpgrade): + # Upgrade macro for 775 by Maggie Hendry + + BEFORE_TAG = "vn3.2" + AFTER_TAG = "vn3.2_t775" + + def upgrade(self, config, meta_config=None): + # Bump tag to pick up metadata changes + return config, self.reports