Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0389dfc
Interim Commit while migrating from FCM branch - XML, namelist and ro…
mcdalvi Apr 29, 2026
388b69b
Second commit transferring changes from FCM: Nudging field and file ,…
mcdalvi Apr 29, 2026
8a745da
Compilation fixes, mainly updating other calls to setup_model_data fo…
mcdalvi Apr 30, 2026
e2c6817
Improve trigerring in metadata
mcdalvi Apr 30, 2026
05b457a
include files that were not explicitly 'git add'ed
mcdalvi May 1, 2026
f1f0ddb
First round of fixes from testing: only handle fields and settings th…
mcdalvi May 5, 2026
dd2ed96
Fixes -mostly aligning field definitions; rationalised tests to use 3…
mcdalvi May 12, 2026
de251b0
merge into origin/main at 08455b0
mcdalvi May 13, 2026
8baec12
modify path to point to files containing licence information
mcdalvi May 13, 2026
ea85331
Minor fixes, style fixer, update KGOs
mcdalvi May 13, 2026
d4f3adc
Metadata fiex and re-alignment with configuration variables in modeld…
mcdalvi May 14, 2026
50f08f3
more metadata and style fixes
mcdalvi May 14, 2026
7723834
Changes in response to Code owner review: Remove new fields from xml …
mcdalvi May 15, 2026
d48f524
Rename test group to reflect target system and add to *lfric_atm_azsp…
mcdalvi May 18, 2026
642225b
Changes from review -configure *nudging_era_coarse* test to use coars…
mcdalvi May 19, 2026
3293ee2
Update KGO for *nudging_coarse* test, now reverted back to main mesh …
mcdalvi May 19, 2026
b906772
Changes from Review- mainly consistent naming of fields; remove dupli…
mcdalvi May 29, 2026
6975f0a
Attempt to get away from hardwired numbers in collection declaration.
mcdalvi Jun 5, 2026
344ff27
Revert some changes after review as modeldb may not available in all …
mcdalvi Jun 11, 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
4 changes: 3 additions & 1 deletion applications/lfric_atm/metadata/axis_def_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
<axis id="sw_bands_radiation_levels" name="sw_bands_radiation_levels" />
<axis id="lw_bands_radiation_levels" name="lw_bands_radiation_levels" />
<axis id="photolysis_pathways" name="photolysis_pathways" />
<axis id="photol_species" name="photol_species" />
<axis id="photol_species" name="photol_species" />
Comment thread
mcdalvi marked this conversation as resolved.
Outdated

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.

Only thing to note from me is this rogue space here

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 DanStoneMO . I have fixed that in my copy

<axis id="one_time_axis" name="one_time_axis" n_glo="1" />
<axis id="nudging_time_axis" name="nudging_time_axis" />
<axis id="ecmwf_levels" name="ecmwf_levels" />

<axis id="random_seed_size" name="random_seed_size" />
<axis id="stph_spectral_dimensions" name="stph_spectral_dimensions" />
Expand Down
3 changes: 3 additions & 0 deletions applications/lfric_atm/metadata/field_def_diags.xml
Comment thread
mcdalvi marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<field id="height_wth" name="height_wth" long_name="height_of_cell_interfaces_above_earth_radius" standard_name="height_above_mean_sea_level" unit="m" grid_ref="full_level_face_grid" />
<field id="height_w2h" name="height_w2h" long_name="height_of_cell_faces_above_earth_radius" standard_name="height_above_mean_sea_level" unit="m" grid_ref="half_level_edge_grid" />
<field id="height_w0" name="height_w0" long_name="height_of_cell_vertices_above_earth_radius" standard_name="height_above_mean_sea_level" unit="m" grid_ref="node_grid" />
<field id="theta_nudging_ref" name="theta_nudging_ref" long_name="nudging_reference_air_potential_temperature" unit="K" grid_ref="nudging_ref_full_grid" />
<field id="u_in_w3_nudging_ref" name="u_in_w3_nudging_ref" long_name="nudging_reference_eastward_wind_at_cell_centres" unit="ms-1" grid_ref="nudging_ref_half_grid" />
<field id="v_in_w3_nudging_ref" name="v_in_w3_nudging_ref" long_name="nudging_reference_northward_wind_at_cell_centres" unit="ms-1" grid_ref="nudging_ref_half_grid" />
<!-- First line extracts level 0, second line removes vertical coordinate, cannot do as one -->
<field id="zoomed__orography" field_ref="height_wth" grid_ref="full_level_0_face_zoom" />
<field id="orography" name="orography" long_name="surface_altitude" standard_name="surface_altitude" unit="m" domain_ref="face" > zoomed__orography </field>
Expand Down
24 changes: 24 additions & 0 deletions applications/lfric_atm/metadata/grid_def_nudging.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Nudging ancillary grid definitions - on prime mesh-->
<!-- Grid for reading input fields -->
<grid_definition>
<grid id="nudging_input_full_grid">
<domain domain_ref="face"/>
<axis axis_ref="nudging_time_axis"/>
<axis axis_ref="ecmwf_levels"/>
</grid>

<grid id="nudging_input_2D_grid">
<domain domain_ref="face"/>
<axis axis_ref="nudging_time_axis"/>
</grid>

<!-- Grids for outputting diagnostics -->
<grid id="nudging_ref_full_grid">
<domain domain_ref="face"/>
<axis axis_ref="ecmwf_levels"/>
</grid>

<grid id="nudging_ref_2D_grid">
<domain domain_ref="face"/>
</grid>
</grid_definition>
24 changes: 24 additions & 0 deletions applications/lfric_atm/metadata/grid_def_nudging_coarse.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Nudging ancillary grid definitions - on coarse mesh-->
<!-- Grid for reading input fields -->
<grid_definition>
<grid id="nudging_input_full_grid">
<domain domain_ref="multigrid_l2_face"/>
<axis axis_ref="nudging_time_axis"/>
<axis axis_ref="ecmwf_levels"/>
</grid>

<grid id="nudging_input_2D_grid">
<domain domain_ref="multigrid_l2_face"/>
<axis axis_ref="nudging_time_axis"/>
</grid>

<!-- Grids for outputting diagnostics -->
<grid id="nudging_ref_full_grid">
<domain domain_ref="multigrid_l2_face"/>
<axis axis_ref="ecmwf_levels"/>
</grid>

<grid id="nudging_ref_2D_grid">
<domain domain_ref="multigrid_l2_face"/>
</grid>
</grid_definition>
6 changes: 6 additions & 0 deletions applications/lfric_atm/metadata/lfric_dictionary.xml
Comment thread
mcdalvi marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -399,5 +399,11 @@
<field id="frozen_soil_moisture" name="frozen_soil_moisture" long_name="mass_fraction_of_frozen_water_in_saturated_soil_moisture" unit="1" domain_ref="face" axis_ref="soil_levels" />
<!-- energy correction -->
<field id="temperature_correction_rate" name="temperature_correction_rate" long_name="temperature_rate_for_energy_correction" unit="K s-1" axis_ref="scalar_axis" />
<!-- Nudging reference fields -->
<field id="u_nudging_ext_ref" name="u_nudging_ext_ref" long_name="Eastward wind component from Nudging file" unit="m s-1" grid_ref="nudging_ref_full_grid" />
<field id="v_nudging_ext_ref" name="v_nudging_ext_ref" long_name="Northward wind component from Nudging file" unit="m s-1" grid_ref="nudging_ref_full_grid" />
<field id="temperature_nudging_ext_ref" name="temperature_nudging_ext_ref" long_name="Air temperature from Nudging file" unit="K" grid_ref="nudging_ref_full_grid" />
<field id="surface_pressure_nudging_ext_ref" name="surface_pressure_nudging_ext_ref" long_name="Surface air pressure from Nudging file" unit="Pa" grid_ref="nudging_ref_2D_grid" />

</field_group>
</field_definition>
4 changes: 2 additions & 2 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ lfric_apps:
ref:

lfric_core:
source: git@github.com:MetOffice/lfric_core.git
ref: 70405b50bda5a86c8711a2cceae0ea69dd04c2bc
source: git@github.com:mcdalvi/lfric_core.git
ref: vn3.1_read_coarse_2d

moci:
source: git@github.com:MetOffice/moci.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ module jedi_lfric_linear_modeldb_driver_mod
use constants_mod, only : r_def, l_def, str_def
use driver_config_mod, only : init_config
use driver_time_mod, only : init_time, final_time
use external_forcing_config_mod, only : theta_forcing, &
theta_forcing_nudging, &
wind_forcing, &
wind_forcing_nudging
use extrusion_mod, only : TWOD
use gungho_init_fields_mod, only : create_model_data, &
finalise_model_data
Expand Down Expand Up @@ -101,15 +105,20 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb, atl_si_
type( mesh_type ), pointer :: twod_mesh
type( mesh_type ), pointer :: aerosol_mesh
type( mesh_type ), pointer :: aerosol_twod_mesh
type( mesh_type ), pointer :: nudging_mesh
type( mesh_type ), pointer :: nudging_twod_mesh
type( lfric_xios_context_type ), pointer :: io_context
character( len=str_def ) :: prime_mesh_name
character( len=str_def ) :: aerosol_mesh_name
character( len=str_def ) :: nudging_mesh_name
logical( kind=l_def ) :: coarse_aerosol_ancil
logical( kind=l_def ) :: coarse_ozone_ancil
logical( kind=l_def ) :: coarse_nudging

character(len=*), parameter :: io_context_name = "gungho_atm"

nullify( mesh, twod_mesh, aerosol_mesh, aerosol_twod_mesh )
nullify( nudging_mesh, nudging_twod_mesh )

! 1. Initialise modeldb field collections, configuration and mpi.
modeldb%mpi => mpi_obj
Expand Down Expand Up @@ -171,12 +180,30 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb, atl_si_
aerosol_twod_mesh => twod_mesh
end if

! Get information on nudging and if data is on a different mesh, get this
! Use prime mesh by default
nudging_mesh => mesh
nudging_twod_mesh => twod_mesh
if ( modeldb%config%formulation%use_multires_coupling() ) then
coarse_nudging = modeldb%config%multires_coupling%coarse_nudging()
if (coarse_nudging) then
! For now use the coarsest mesh
nudging_mesh_name = modeldb%config%multires_coupling%nudging_mesh_name()
nudging_mesh => mesh_collection%get_mesh(nudging_mesh_name)
nudging_twod_mesh => mesh_collection%get_mesh(nudging_mesh, TWOD)
write( log_scratch_space,'(A,A)' ) "nudging mesh name:", nudging_mesh%get_mesh_name()
call log_event( log_scratch_space, LOG_LEVEL_TRACE )
end if
end if

! Instantiate the fields stored in model_data
call create_model_data( modeldb, &
mesh, &
twod_mesh, &
aerosol_mesh, &
aerosol_twod_mesh )
aerosol_twod_mesh, &
nudging_mesh, &
nudging_twod_mesh )

! Instantiate the linearisation state
call linear_create_ls_analytic( modeldb, mesh, twod_mesh )
Expand Down
189 changes: 189 additions & 0 deletions rose-stem/app/lfric_atm/file/file_def_diags_gal_nwp_nudging.xml
Comment thread
mcdalvi marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
<file_definition>

<!-- Diagnostic fields - Daily - mean/min/max -->
<file id="lfric_diagnostics" name="results/lfric_gal_diagnostics" output_freq="6h" convention="UGRID" enabled=".TRUE.">
<!-- 2D fields averaged every timestep -->
<field_group operation="average" freq_op="1ts" prec="4">
<field field_ref="processed__pstar"/>
<field field_ref="processed__tot_col_dry_air_mass"/>
<field field_ref="processed__tot_col_wetplusdry_mass"/>
<field field_ref="processed__tot_col_m_v"/>
<field field_ref="processed__tot_col_m_cl"/>
<field field_ref="processed__tot_col_m_cf"/>
<field field_ref="processed__tot_col_m_r"/>
<field field_ref="processed__total_rain"/>
<field field_ref="processed__total_snow"/>
<field field_ref="processed__total_prec"/>
<field field_ref="microphysics__ls_rain"/>
<field field_ref="microphysics__ls_snow"/>
<field field_ref="microphysics__ls_prec"/>
<field field_ref="convection__conv_rain"/>
<field field_ref="convection__conv_snow"/>
<field field_ref="convection__conv_prec"/>
<field field_ref="turbulence__bl_type_ind"/>
<field field_ref="turbulence__zh"/>
<field field_ref="turbulence__zht"/>
<field field_ref="turbulence__rib"/>
<field field_ref="turbulence__cumulus"/>
<field field_ref="convection__pres_cv_base"/>
<field field_ref="convection__pres_cv_top"/>
<field field_ref="convection__mid_cfl_limited"/>
<field field_ref="convection__mid_prec"/>
<field field_ref="convection__mid_in_col"/>
<field field_ref="convection__shallow_prec"/>
<field field_ref="convection__shallow_in_col"/>
<field field_ref="soil__soil_moisture_content"/>
<field field_ref="soil__soil_moisture"/>
<field field_ref="soil__soil_temperature"/>
<field field_ref="soil__unfrozen_soil_moisture"/>
<field field_ref="soil__frozen_soil_moisture"/>
<field field_ref="soil__surface_runoff"/>
<field field_ref="soil__sub_surface_runoff"/>
<field field_ref="cloud__cloud_amount_rnd"/>
<field field_ref="cloud__cloud_amount_maxrnd"/>
<field field_ref="cloud__very_low_type_cloud_amount"/>
<field field_ref="cloud__low_type_cloud_amount"/>
<field field_ref="cloud__medium_type_cloud_amount"/>
<field field_ref="cloud__high_type_cloud_amount"/>
<field field_ref="cloud__very_high_type_cloud_amount"/>
<field field_ref="surface__grid_sensible_heat"/>
<field field_ref="surface__grid_moisture_flux"/>
<field field_ref="surface__surface_taux"/>
<field field_ref="surface__surface_tauy"/>
<field field_ref="surface__grid_latent_heat"/>
<field field_ref="surface__grid_canopy_water"/>
<field field_ref="surface__grid_surface_temperature"/>
<field field_ref="surface__u10m"/>
<field field_ref="surface__v10m"/>
<field field_ref="surface__wspd10m"/>
<field field_ref="surface__t1p5m"/>
<field field_ref="surface__q1p5m"/>
<field field_ref="surface__rh1p5m"/>
<field field_ref="surface__z0m"/>
<field field_ref="snow__grid_snow_mass"/>
</field_group>

<!-- 2D fields, minimum over sampling period -->
<field_group operation="minimum" freq_op="1ts" prec="4">
<field field_ref="surface__t1p5m" name="t1p5m_minimum"/>
<field field_ref="surface__grid_surface_temperature" name="tstar_minimum"/>
</field_group>

<!-- 2D fields, maximum over sampling period -->
<field_group operation="maximum" freq_op="1ts" prec="4">
<field field_ref="turbulence__zh" name="zh_maximum"/>
<field field_ref="surface__t1p5m" name="t1p5m_maximum"/>
<field field_ref="surface__grid_surface_temperature" name="tstar_maximum"/>
</field_group>

<!-- Model timestep radiation diagnostics ("corrected") -->
<field_group operation="average" freq_op="1ts" prec="4">
<field field_ref="radiation__lw_net_surf"/>
<field field_ref="radiation__lw_down_surf"/>
<field field_ref="radiation__lw_up_surf"/>
<field field_ref="radiation__lw_up_toa"/>
<field field_ref="radiation__sw_net_surf"/>
<field field_ref="radiation__sw_down_surf"/>
<field field_ref="radiation__sw_up_surf"/>
<field field_ref="radiation__sw_up_toa"/>
<field field_ref="radiation__sw_direct_toa"/>
</field_group>

<!-- Radiation timestep radiation diagnostics -->
<field_group operation="average" freq_op="1h" freq_offset="0ts" prec="4">
<field field_ref="radiation__cloud_cover_rts"/>
<field field_ref="radiation__lw_net_surf_rts"/>
<field field_ref="radiation__lw_down_surf_rts"/>
<field field_ref="radiation__lw_up_surf_rts"/>
<field field_ref="radiation__lw_up_toa_rts"/>
<field field_ref="radiation__sw_net_surf_rts"/>
<field field_ref="radiation__sw_down_surf_rts"/>
<field field_ref="radiation__sw_up_surf_rts"/>
<field field_ref="radiation__sw_up_toa_rts"/>
<field field_ref="radiation__sw_direct_toa_rts"/>
<field field_ref="radiation__sw_down_uv_surf_rts"/>
<field field_ref="radiation__sw_direct_uv_surf_rts"/>
<field field_ref="radiation__sw_up_uv_surf_rts"/>
<field field_ref="radiation__sw_down_uv_clear_surf_rts"/>
<field field_ref="radiation__sw_direct_uv_clear_surf_rts"/>
<field field_ref="radiation__sw_up_uv_clear_surf_rts"/>
<field field_ref="radiation__lw_down_clear_surf_rts"/>
<field field_ref="radiation__lw_up_clear_surf_rts"/>
<field field_ref="radiation__lw_up_clear_toa_rts"/>
<field field_ref="radiation__sw_down_clear_surf_rts"/>
<field field_ref="radiation__sw_up_clear_surf_rts"/>
<field field_ref="radiation__sw_up_clear_toa_rts"/>
<field field_ref="radiation__warm_cloud_top_weight_rts"/>
<field field_ref="radiation__warm_cloud_top_re_microns_rts"/>
<field field_ref="processed__sw_aer_optical_depth_rts"/>
<field field_ref="processed__lw_aer_optical_depth_rts"/>
<field field_ref="aerosol__aod_ukca_ait_sol"/>
<field field_ref="aerosol__aaod_ukca_ait_sol"/>
<field field_ref="aerosol__aod_ukca_acc_sol"/>
<field field_ref="aerosol__aaod_ukca_acc_sol"/>
<field field_ref="aerosol__aod_ukca_cor_sol"/>
<field field_ref="aerosol__aaod_ukca_cor_sol"/>
<field field_ref="aerosol__aod_ukca_ait_ins"/>
<field field_ref="aerosol__aaod_ukca_ait_ins"/>
<field field_ref="aerosol__aod_ukca_acc_ins"/>
<field field_ref="aerosol__aaod_ukca_acc_ins"/>
<field field_ref="aerosol__aod_ukca_cor_ins"/>
<field field_ref="aerosol__aaod_ukca_cor_ins"/>
</field_group>

<!-- Full model level diagnostics - not being interpolated to pressure levels -->
<field_group operation="average" freq_op="1ts" prec="4">
<field field_ref="processed__pressure_in_wth"/>
<field field_ref="theta"/>
<field field_ref="w_in_wth"/>
<field field_ref="m_v"/>
<field field_ref="m_cl"/>
<field field_ref="m_cf"/>
<field field_ref="m_r"/>
<field field_ref="processed__temperature"/>
<field field_ref="cloud__frozen_fraction"/>
<field field_ref="cloud__liquid_fraction"/>
<field field_ref="cloud__bulk_fraction"/>
<field field_ref="cloud__area_fraction"/>
<field field_ref="convection__cca"/>
<field field_ref="convection__massflux_up"/>
<field field_ref="convection__massflux_down"/>
<field field_ref="orographic_drag__taux_orographic_drag"/>
<field field_ref="orographic_drag__tauy_orographic_drag"/>
</field_group>

<!-- Half model level diagnostics - not being interpolated to pressure levels -->
<field_group operation="average" freq_op="1ts" prec="4">
<field field_ref="processed__pressure_in_w3"/>
<field field_ref="u_in_w3"/>
<field field_ref="v_in_w3"/>
<field field_ref="rho"/>
<field field_ref="orographic_drag__dudt_orographic_drag"/>
<field field_ref="orographic_drag__dvdt_orographic_drag"/>
</field_group>

<!-- Full level diagnostics on radiation timesteps -->
<field_group operation="average" freq_op="1h" freq_offset="0ts" prec="4">
<field field_ref="radiation__liq_cloud_mmr_rts"/>
<field field_ref="radiation__ice_cloud_mmr_rts"/>
<field field_ref="radiation__liq_cloud_frac_rts"/>
<field field_ref="radiation__ice_cloud_frac_rts"/>
</field_group>

<!-- Specific quantities For UM comparison -->
<field_group operation="average" freq_op="1ts" prec="4">
<field field_ref="processed__qv"/>
<field field_ref="processed__qcl"/>
<field field_ref="processed__qcf"/>
</field_group>

<!-- Nudging reference fields -->
<field_group operation="average" freq_op="1ts" prec="4">
<field field_ref="temperature_nudging_ext_ref"/>
<field field_ref="u_nudging_ext_ref"/>
<field field_ref="v_nudging_ext_ref"/>
</field_group>

</file>

</file_definition>
12 changes: 12 additions & 0 deletions rose-stem/app/lfric_atm/file/file_def_nudging.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<file_definition>

<!-- Nudging reference data files -->
<file id="nudging" name="nudging" mode="read" output_freq="6h" convention="UGRID" cyclic="true" enabled=".FALSE.">
<field id="nudging_time" name="time" unit="hours" operation="once" axis_ref="nudging_time_axis" />
<field id="u_nudging_ext_ref_data" name="U" long_name="Eastward wind component for Nudging" unit="m s-1" grid_ref="nudging_input_full_grid" operation="instant" />
<field id="v_nudging_ext_ref_data" name="V" long_name="Northward wind component for Nudging" unit="m s-1" grid_ref="nudging_input_full_grid" operation="instant" />
<field id="temperature_nudging_ext_ref_data" name="T" long_name="Air temperature for Nudging" unit="K" grid_ref="nudging_input_full_grid" operation="instant" />
<field id="surface_pressure_nudging_ext_ref_data" name="LNSP" long_name="Log surface pressure for Nudging" unit="Pa" grid_ref="nudging_input_2D_grid" operation="instant" />
</file>

</file_definition>
1 change: 1 addition & 0 deletions rose-stem/app/lfric_atm/file/iodef_gal_nwp_coarse_aero.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<grid_definition src="$METADATA/grid_def_main.xml"/>
<grid_definition src="$METADATA/grid_def_aero_coarse.xml"/>
<grid_definition src="$METADATA/grid_def_radaer_coarse.xml"/>
<grid_definition src="$METADATA/grid_def_nudging_coarse.xml"/>
Comment thread
mcdalvi marked this conversation as resolved.
Outdated

<!-- Include field definitions -->
<field_definition src="$METADATA/lfric_dictionary.xml"/>
Expand Down
Loading