Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
28d07aa
rsync in FCM version of this branch
DanCopsey Feb 9, 2026
c902936
Merged in stable
DanCopsey Feb 9, 2026
726ed5a
Fix initialisation and remove zero ancil
DanCopsey Mar 26, 2026
83bbe0e
merged in main up to vn3.1
DanCopsey Mar 26, 2026
e7de852
Add my name to CONTRIBUTORS.md
DanCopsey Mar 27, 2026
96e2dd5
Addressed suggestions by Ian Boutle
DanCopsey Mar 27, 2026
021e478
Initialised inland outflow to zero
DanCopsey Mar 27, 2026
c98ab10
Corrected checksums for coupled model
DanCopsey Apr 2, 2026
c3cdc1d
Removed docstring as it was interfering with upgrade
DanCopsey Apr 2, 2026
df71126
Finished the move of inland_basin_flow from surface_fields to soil_fi…
DanCopsey Apr 2, 2026
a5a79c3
Change surface__inland_basin_flow to soil__inland_basin_flow
DanCopsey Apr 2, 2026
cdd0fb5
Apply reviewer comment
DanCopsey Apr 27, 2026
9bbe2f0
Update tag to the associated JULES PR macro, as requested by reviewer
DanCopsey Apr 28, 2026
7492fbd
Merged in head of trunk
DanCopsey May 14, 2026
820c6d7
Add new KGOs
DanCopsey May 14, 2026
0851f3c
Turn off inland basin flow coupling from the rose-stem app. This will…
DanCopsey May 19, 2026
fd97d92
Updated KGOs for coupled model as this change is expected to change r…
DanCopsey May 20, 2026
c8f7509
Add lf_inland_flow to lfric_dictionary as this will be needed once pu…
DanCopsey May 20, 2026
1b344a1
Moved upgrade macro from jules-lfric to jules-lsm after suggestion fr…
DanCopsey Jun 3, 2026
6c4f748
merged in main
DanCopsey Jun 3, 2026
b8e46ff
Moved upgrade macro to the end - after everything else
DanCopsey Jun 3, 2026
e6e3960
Corrected indent
DanCopsey Jun 3, 2026
07b3415
Remove l_inland_in
DanCopsey Jun 3, 2026
b26d85c
Rename units to unit
DanCopsey Jun 3, 2026
b16e78b
Update KGOs
DanCopsey Jun 3, 2026
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 applications/lfric_atm/example/configuration.nml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ write_minmax_tseries=.false.,
&jules_hydrology
l_var_rainfrac=.true.,
l_hydrology=.true.,
l_inland=.false.,
/
&jules_model_environment_lfric
l_jules_parent='lfric',
Expand Down
1 change: 1 addition & 0 deletions applications/lfric_atm/metadata/field_def_diags.xml
Comment thread
DanCopsey marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@
<field id="surface__disp" name="urbdisp" long_name="Urban displacement height" unit="m" domain_ref="face" />
<field id="surface__albwl" name="urbalbwl" long_name="Urban wall abedo" unit="1" domain_ref="face" />
<field id="surface__albrd" name="urbalbrd" long_name="Urban road abedo" unit="1" domain_ref="face" />
<field id="surface__inland_basin_flow" name="inland_basin_flow" long_name="Inland basin flow" unit="kg m-2 s-1" domain_ref="face" />
<!-- GBM surface diagnostics derived from BL turbulence diagnostics -->
<!-- First line extracts level 1, second line removes vertical coordinate, cannot do as one -->
<field id="zoomed__sh" field_ref="turbulence__heat_flux_bl" grid_ref="half_level_1_face_zoom" />
Expand Down
1 change: 1 addition & 0 deletions applications/lfric_coupled/example/configuration.nml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ write_minmax_tseries=.false.,
/
&jules_hydrology
l_hydrology=.true.,
l_inland=.false.,
l_var_rainfrac=.false.
/
&jules_model_environment_lfric
Expand Down
4 changes: 2 additions & 2 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ casim:
ref: 2026.03.2

jules:
source: git@github.com:MetOffice/jules.git
ref: 2026.03.2
source: git@github.com:DanCopsey/jules.git
ref: inland_flow

lfric_apps:
source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ module coupler_update_prognostics_mod
'Ocean surface v from coupler', fld )
call depository%get_field('sea_v_current', fld_ptr1)
call invoke(setval_x(fld_ptr1, fld))
case ("lf_inland_flow")
call log_field_minmax( LOG_LEVEL_DEBUG, &
'Inland basin flow from coupler', fld)
call depository%get_field('inland_basin_flow', fld_ptr1)
call invoke(setval_X( fld_ptr1, fld ))
fld_ptr1 => null()

case default
write(log_scratch_space, '(3A)' ) &
"PROBLEM coupler_update_prognostics variable ", &
Expand Down
4 changes: 4 additions & 0 deletions interfaces/coupled_interface/source/coupler_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ subroutine create_coupling_fields( mesh, &
call add_cpl_field(depository, prognostic_fields, &
'lf_svnocean', vector_space, checkpoint_restart_flag)

! From TRIP river model
call add_cpl_field(depository, prognostic_fields, &
'lf_inland_flow', vector_space, checkpoint_restart_flag)

end subroutine create_coupling_fields


Expand Down
1 change: 1 addition & 0 deletions interfaces/jules_interface/build/extract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jules:
- src/control/shared/wtrac_extra_mod.F90
- src/initialisation/shared/calc_urban_aero_fields_mod.F90
- src/initialisation/shared/check_compatible_options_mod.F90
- src/initialisation/shared/check_compatible_options_rivers_mod.F90
- src/initialisation/shared/freeze_soil.F90
- src/initialisation/shared/wtrac_check_options_mod.F90
- src/science/deposition/deposition_check_species_mod.F90
Expand Down
10 changes: 10 additions & 0 deletions interfaces/jules_interface/rose-meta/jules-lfric/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ def __repr__(self):

__str__ = __repr__

class vn21_t148(MacroUpgrade):
Comment thread
iboutle marked this conversation as resolved.
Outdated
# Upgrade macro for #148 by Dan Copsey
Comment thread
iboutle marked this conversation as resolved.
Outdated

BEFORE_TAG = "vn2.1"
Comment thread
iboutle marked this conversation as resolved.
Outdated
AFTER_TAG = "vn2.1_t148"
Comment thread
iboutle marked this conversation as resolved.
Outdated

def upgrade(self, config, meta_config=None):
# Add settings
self.add_setting(config, ["namelist:jules_hydrology", "l_inland"], ".false.")
return config, self.reports

"""
Copy this template and complete to add your macro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ trigger=namelist:jules_hydrology=l_var_rainfrac: .true.;
type=logical
url=http://jules-lsm.github.io/latest/namelists/jules_hydrology.nml.html#JULES_HYDROLOGY::l_hydrology

[namelist:jules_hydrology=l_inland]
compulsory=true
description=Apply inland basin water correction to soil moisture
sort-key=Panel-G06
type=logical
url=http://jules-lsm.github.io/latest/namelists/jules_hydrology.nml.html#JULES_HYDROLOGY::l_inland
Comment thread
DanCopsey marked this conversation as resolved.
Outdated

[namelist:jules_hydrology=l_var_rainfrac]
compulsory=true
description=Enable variable large scale and convective rain fractions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ contains
type( field_type ), pointer :: sea_u_current => null()
type( field_type ), pointer :: sea_v_current => null()
type( field_type ), pointer :: sea_current_w2 => null()
type( field_type ), pointer :: inland_basin_flow => null()
type( field_type ), pointer :: wspd10m => null()
type( integer_field_type ), pointer :: ocn_cpl_point => null()

Expand Down Expand Up @@ -127,6 +128,7 @@ contains
call surface_fields%get_field('sea_v_current',sea_v_current)
call surface_fields%get_field('sea_current_w2',sea_current_w2)
call surface_fields%get_field('ocn_cpl_point',ocn_cpl_point)
call surface_fields%get_field('inland_basin_flow',inland_basin_flow)
call surface_fields%get_field('wspd10m', wspd10m)

call invoke( &
Expand Down Expand Up @@ -165,6 +167,8 @@ contains
setval_c(sea_v_current, 0.0_r_def ), &
setval_c(sea_current_w2, 0.0_r_def ), &
int_setval_c(ocn_cpl_point, 0_i_def ), &
! Initialise inland basin flow to zero
setval_c(inland_basin_flow, 0.0_r_def ), &
! Set 10m wind speed to zero
setval_c(wspd10m, 0.0_r_def) )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ contains
type( field_type ), pointer :: snowice_melt => null()
type( field_type ), pointer :: snowice_sublimation => null()
type( field_type ), pointer :: urbztm => null()
type( field_type ), pointer :: inland_basin_flow => null()

! Sea ice fields
type( field_type ), pointer :: sea_ice_thickness => null()
Expand Down Expand Up @@ -171,6 +172,7 @@ contains
call surface_fields%get_field('snowice_melt', snowice_melt)
call surface_fields%get_field('snowice_sublimation', snowice_sublimation)
call surface_fields%get_field('urbztm', urbztm)
call surface_fields%get_field('inland_basin_flow', inland_basin_flow)

! Sea ice fields
call surface_fields%get_field('sea_ice_thickness', sea_ice_thickness)
Expand Down Expand Up @@ -247,6 +249,7 @@ contains
mean_topog_index, a_sat_frac, c_sat_frac, &
a_wet_frac, c_wet_frac, tile_temperature, &
net_prim_prod, snowice_sublimation, surf_heat_flux, &
inland_basin_flow, &
canopy_evap, water_extraction, &
thermal_cond_wet_soil, urbztm, &
soil_temperature, soil_moisture, &
Expand Down Expand Up @@ -298,6 +301,9 @@ contains
sea_ice_pensolar, melt_pond_fraction, &
melt_pond_depth)

! Output extra coupling diagnostics
call inland_basin_flow%write_field('surface__inland_basin_flow')
Comment thread
iboutle marked this conversation as resolved.
Outdated

end if

end subroutine jules_extra_alg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module jules_extra_kernel_mod
!>
type, public, extends(kernel_type) :: jules_extra_kernel_type
private
type(arg_type) :: meta_args(58) = (/ &
type(arg_type) :: meta_args(59) = (/ &
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_1), & ! ls_rain
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_1), & ! conv_rain
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_1), & ! ls_snow
Expand Down Expand Up @@ -62,6 +62,7 @@ module jules_extra_kernel_mod
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_1), & ! net_prim_prod
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_2), & ! snowice_sublimation
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_2), & ! surf_heat_flux
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_1), & ! inland_basin_flow
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_2), & ! canopy_evap
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_4), & ! water_extraction
arg_type(GH_FIELD, GH_REAL, GH_READ, ANY_DISCONTINUOUS_SPACE_1), & ! thermal_cond_wet_soil
Expand Down Expand Up @@ -137,6 +138,7 @@ module jules_extra_kernel_mod
!> @param[in] net_prim_prod Net Primary Productivity (kg m-2 s-1)
!> @param[in] snowice_sublimation Sublimation of snow and ice (kg m-2 s-1)
!> @param[in] surf_heat_flux Surface heat flux (W m-2)
!> @param[in] inland_basin_flow Inland flow of water from rivers to soil (kg m-2 s-1)
!> @param[in] canopy_evap Canopy evaporation from land tiles (kg m-2 s-1)
!> @param[in] water_extraction Extraction of water from each soil layer (kg m-2 s-1)
!> @param[in] thermal_cond_wet_soil Thermal conductivity of soil (W m-1 K-1)
Expand Down Expand Up @@ -212,6 +214,7 @@ subroutine jules_extra_code( &
net_prim_prod, &
snowice_sublimation, &
surf_heat_flux, &
inland_basin_flow, &
canopy_evap, &
water_extraction, &
thermal_cond_wet_soil, &
Expand Down Expand Up @@ -421,6 +424,7 @@ subroutine jules_extra_code( &
real(kind=r_def), intent(in) :: net_prim_prod(undf_2d)
real(kind=r_def), intent(in) :: thermal_cond_wet_soil(undf_2d)
real(kind=r_def), intent(in) :: urbztm(undf_2d)
real(kind=r_def), intent(in) :: inland_basin_flow(undf_2d)

real(kind=r_def), intent(inout) :: canopy_water(undf_tile)
real(kind=r_def), intent(inout) :: tile_snow_mass(undf_tile)
Expand Down Expand Up @@ -902,13 +906,16 @@ subroutine jules_extra_code( &
allocate(fsat_soilt(land_pts, nsoilt))
allocate(zw_soilt(land_pts, nsoilt))
allocate(sthzw_soilt(land_pts, nsoilt))
allocate(inlandout_atm_gb(land_pts))
do l = 1, land_pts
! Soil saturated fraction
fsat_soilt(l,1) = real(soil_sat_frac(map_2d(1,ainfo%land_index(l))), r_um)
! Water table depth
zw_soilt(l,1) = real(water_table(map_2d(1,ainfo%land_index(l))), r_um)
! Soil wetness below soil column
sthzw_soilt(l,1) = real(wetness_under_soil(map_2d(1,ainfo%land_index(l))), r_um)
! Inland basin flow
inlandout_atm_gb(l) = real(inland_basin_flow(map_2d(1,ainfo%land_index(l))), r_um)
end do

!----------------------------------------------------------------------------
Expand All @@ -929,7 +936,6 @@ subroutine jules_extra_code( &
allocate(dhf_surf_minus_soil(land_pts))
allocate(tot_surf_runoff(land_pts))
allocate(tot_sub_runoff(land_pts))
allocate(inlandout_atm_gb(land_pts))

call surf_couple_extra( &
!Driving data and associated INTENT(IN)
Expand Down Expand Up @@ -1049,8 +1055,10 @@ subroutine jules_extra_code( &
! Wetness below soil column
wetness_under_soil(map_2d(1,ainfo%land_index(l))) = real(sthzw_soilt(l,1), r_def)
! River runoffs
surface_runoff(map_2d(1,ainfo%land_index(l))) = real(fluxes%surf_roff_gb(l), r_def)
sub_surface_runoff(map_2d(1,ainfo%land_index(l))) = real(fluxes%sub_surf_roff_gb(l), r_def)
surface_runoff(map_2d(1,ainfo%land_index(l))) = real(fluxes%surf_roff_gb(l), r_def) * &
flandg(ainfo%land_index(l), 1)
sub_surface_runoff(map_2d(1,ainfo%land_index(l))) = real(fluxes%sub_surf_roff_gb(l), r_def) * &
flandg(ainfo%land_index(l), 1)
end do

if (.not. associated(soil_moisture_content, empty_real_data) ) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module jules_physics_init_mod
use jules_control_init_mod, only : n_sea_ice_tile, n_land_tile
use jules_hydrology_config_mod, only : &
l_hydrology_in => l_hydrology, &
l_inland_in => l_inland, &
l_var_rainfrac_in => l_var_rainfrac
use jules_nvegparm_config_mod, only : &
albsnc_nvg_io, albsnf_nvg_io, albsnf_nvgl_io, &
Expand Down Expand Up @@ -193,7 +194,7 @@ subroutine jules_physics_init()
use c_z0h_z0m, only: z0h_z0m
use jules_hydrology_mod, only: l_hydrology, check_jules_hydrology, &
l_top, l_var_rainfrac, nfita, ti_max, &
ti_wetl, zw_max
ti_wetl, zw_max, l_inland
use jules_irrig_mod, only: l_irrig_dmd
use jules_radiation_mod, only: i_sea_alb_method, &
l_embedded_snow, l_mask_snow_orog, &
Expand Down Expand Up @@ -562,6 +563,7 @@ subroutine jules_physics_init()
l_point_data = l_point_data_in
orog_drag_param = real(orog_drag_param_in, r_um)
lake_water_conserve_method = use_elake_surft
l_inland = l_inland_in

! The minimum sea ice fraction
! This is 0.0 for coupled models and 0.1 for atmosphere only models
Expand Down
2 changes: 2 additions & 0 deletions rose-stem/app/lfric_coupled/file/mydef.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<field id="lf_pond_depth" name="lf_pond_depth" long_name="lf_pond_depth" unit="m" domain_ref="face" axis_ref="sea_ice_categories" />
<field id="lf_sunocean" name="lf_sunocean" long_name="lf_sunocean" unit="ms-1" domain_ref="face" />
<field id="lf_svnocean" name="lf_svnocean" long_name="lf_svnocean" unit="ms-1" domain_ref="face" />
<field id="lf_inland_flow" name="lf_inland_flow" long_name="lf_inland_flow" unit="kg m-2 s-1" domain_ref="face" />
</field_group>

</field_definition>
Expand Down Expand Up @@ -203,6 +204,7 @@
<field id="soil__soilm_change_lakes" />
<field id="soil__soil_moisture" />
<field id="soil__unfrozen_soil_moisture" />
<field id="surface__inland_basin_flow" />
Comment thread
iboutle marked this conversation as resolved.
Outdated
</file>

<file id="lfric_averages" name="lfric_averages" output_freq="12h" convention="UGRID" enabled=".TRUE.">
Expand Down
Loading
Loading