Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions applications/lfric_atm/metadata/axis_def_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
<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="nudging_time_axis" name="nudging_time_axis" />
<axis id="ecmwf_levels" name="ecmwf_levels" />
<axis id="one_time_axis" name="one_time_axis" n_glo="1" />

<axis id="random_seed_size" name="random_seed_size" />
Expand Down
5 changes: 3 additions & 2 deletions applications/lfric_atm/metadata/field_def_diags.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
<field id="w_in_w3_star" name="w_in_w3_star" long_name="physics_predictor_upward_air_velocity_at_cell_centres" unit="ms-1" grid_ref="half_level_face_grid" />
<field id="height_w3" name="height_w3" long_name="height_of_cell_centres_above_earth_radius" standard_name="height_above_mean_sea_level" unit="m" grid_ref="half_level_face_grid" />
<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
29 changes: 29 additions & 0 deletions applications/lfric_atm/metadata/grid_def_nudging.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- Nudging ancillary grid definitions - on prime mesh-->
<!-- Grid for reading input fields -->
<grid_definition>
<grid id="nudging_ref_input_grid">
<domain domain_ref="face"/>
<axis axis_ref="nudging_time_axis"/>
<axis axis_ref="ecmwf_levels"/>
</grid>

<grid id="nudging_ref_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="vert_axis_full_levels"/>
</grid>

<grid id="nudging_ref_half_grid">
<domain domain_ref="face"/>
<axis axis_ref="vert_axis_half_levels"/>
</grid>

<grid id="nudging_ref_2D_grid">
<domain domain_ref="face"/>
</grid>
</grid_definition>
29 changes: 29 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,29 @@
<!-- Spectral nudging ancillary grid definitions - on coarse mesh-->
<!-- Grid for reading input fields -->
<grid_definition>
<grid id="nudging_ref_input_grid">
<domain domain_ref="multigrid_l2_face"/>
<axis axis_ref="nudging_time_axis"/>
<axis axis_ref="ecmwf_levels"/>
</grid>

<grid id="nudging_ref_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="vert_axis_full_levels"/>
</grid>

<grid id="nudging_ref_half_grid">
<domain domain_ref="multigrid_l2_face"/>
<axis axis_ref="vert_axis_half_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
Original file line number Diff line number Diff line change
Expand Up @@ -393,5 +393,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 regridded from Nudging file data" unit="m s-1" grid_ref="nudging_ref_half_grid" />
<field id="v_nudging_ext_ref" name="v_nudging_ext_ref" long_name="Northward wind component regridded from Nudging file data" unit="m s-1" grid_ref="nudging_ref_half_grid" />
<field id="temperature_nudging_ext_ref" name="temperature_nudging_ext_ref" long_name="Air temperature regridded from Nudging file data" unit="K" grid_ref="nudging_ref_half_grid" />
<field id="surface_pressure_nudging_ext_ref" name="surface_pressure_nudging_ext_ref" long_name="Surface air pressure regridded from Nudging file data" unit="Pa" grid_ref="nudging_ref_2D_grid" />

</field_group>
</field_definition>
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 @@ -102,18 +106,23 @@ 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( namelist_type ), pointer :: base_mesh_nml
type( namelist_type ), pointer :: multires_coupling_nml
type( namelist_type ), pointer :: initialization_nml
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 )
nullify( base_mesh_nml, multires_coupling_nml, initialization_nml )

! 1. Initialise modeldb field collections, configuration and mpi.
Expand Down Expand Up @@ -161,16 +170,19 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb, atl_si_
mesh => mesh_collection%get_mesh(prime_mesh_name)
twod_mesh => mesh_collection%get_mesh(mesh, TWOD)

! Get aerosol ancillary configuration logical
! Get aerosol and nudging ancillary configuration logical
initialization_nml => modeldb%configuration%get_namelist('initialization')
call initialization_nml%get_value( 'coarse_aerosol_ancil', &
coarse_aerosol_ancil )
call initialization_nml%get_value( 'coarse_ozone_ancil', &
coarse_ozone_ancil )
multires_coupling_nml => &
modeldb%configuration%get_namelist('multires_coupling')
call multires_coupling_nml%get_value( 'coarse_nudging', &
coarse_nudging )

if (coarse_aerosol_ancil .or. coarse_ozone_ancil) then
! For now use the coarsest mesh
multires_coupling_nml => &
modeldb%configuration%get_namelist('multires_coupling')
call multires_coupling_nml%get_value( 'aerosol_mesh_name', &
aerosol_mesh_name )
aerosol_mesh => mesh_collection%get_mesh(aerosol_mesh_name)
Expand All @@ -183,12 +195,28 @@ subroutine initialise_modeldb( modeldb_name, filename, mpi_obj, modeldb, atl_si_
aerosol_twod_mesh => twod_mesh
end if

! If nudging data is on a different mesh, get this
if (coarse_nudging) then
! For now use the coarsest mesh
call multires_coupling_nml%get_value( 'nudging_mesh_name', &
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 )
else
nudging_mesh => mesh
nudging_twod_mesh => twod_mesh
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
24 changes: 24 additions & 0 deletions rose-stem/app/lfric_atm/file/file_def_diags_nudging.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<file_definition>

<!-- Diagnostic fields - Daily - mean/min/max -->
<file id="lfric_diagnostics" name="lfric_diagnostics" output_freq="1h" convention="UGRID" enabled=".TRUE.">

<!-- Full model level diagnostics - not being interpolated to pressure levels -->
<field_group operation="average" freq_op="1ts" prec="4">
<field field_ref="theta"/>
<field field_ref="theta_nudging_ref"/>
<field field_ref="forcing__dtheta_force"/>
</field_group>

<!-- Half model level diagnostics - not being interpolated to pressure levels -->
<field_group operation="average" freq_op="1ts" prec="4">
<field field_ref="u_in_w3"/>
<field field_ref="v_in_w3"/>
<field field_ref="u_in_w3_nudging_ref"/>
<field field_ref="v_in_w3_nudging_ref"/>
<field field_ref="forcing__du_force"/>
<field field_ref="forcing__dv_force"/>
</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_ref_input_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_ref_input_grid" operation="instant" />
<field id="temperature_nudging_ext_ref_data" name="T" long_name="Air temperature for Nudging" unit="K" grid_ref="nudging_ref_input_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_ref_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"/>

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