Skip to content

Compute, rather than read from input, deformation_coef_* fields at model startup#1419

Open
mgduda wants to merge 2 commits intoMPAS-Dev:developfrom
mgduda:atmosphere/move_deformation_coef_computation
Open

Compute, rather than read from input, deformation_coef_* fields at model startup#1419
mgduda wants to merge 2 commits intoMPAS-Dev:developfrom
mgduda:atmosphere/move_deformation_coef_computation

Conversation

@mgduda
Copy link
Contributor

@mgduda mgduda commented Mar 12, 2026

This PR modifies both the init_atmosphere and atmosphere cores so that the deformation_coef_{c2,s2,cs,c,s} fields are computed by the model during its initialization rather than being read from a netCDF input file (either an invariant file, an initial conditions file, or a restart file).

The changes in this PR may be logically viewed as occurring in three steps:

  1. Add code to the atmosphere core to compute the deformation_coef_{c2,s2,cs,c,s} fields at model start up using identical code to that which is found in the init_atmosphere core
  2. Remove the deformation_coef_{c2,s2,cs,c,s} fields from the atmosphere core's 'invariant' stream (effectively removing these fields from the 'input' and 'restart' streams as well) so the fields are no longer read from netCDF input files.
  3. Remove the deformation_coef_{c2,s2,cs,c,s} fields and their computation from the init_atmosphere core.

mgduda added 2 commits March 12, 2026 23:16
…del startup

This commit removes the deformation_coef_{c2,s2,cs,c,s} fields from the
definition of the 'invariant' stream in the atmosphere core's Registry.xml file
(effectively removing them from the 'input' and 'restart' streams as well), and
adds a new routine, atm_initialize_deformation_weights, to the atm_core module
to compute these fields at model start-up.
…sphere core

This commit removes the deformation_coef_{c2,s2,cs,c,s} fields from the
init_atmosphere core, including the removal of these fields from the
init_atmosphere core's Registry.xml file as well as the removal of code
in the atm_advection module for computing these fields.
@mgduda mgduda changed the title Atmosphere/move deformation coef computation Compute, rather than read from input, deformation_coef_* fields at model startup Mar 13, 2026
@mgduda mgduda marked this pull request as ready for review March 13, 2026 20:37
@mgduda mgduda requested a review from abishekg7 March 13, 2026 20:38
@mgduda
Copy link
Contributor Author

mgduda commented Mar 17, 2026

Note that the code in mpas_atm_advection.F has essentially been reverted to its state before the computation of the deformation_coef_* fields was introduced by PR #1404 .

logical, pointer :: on_a_sphere
real (kind=RKIND), pointer :: sphere_radius


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the extra newline here required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using two blank lines after local variable declarations is something that we do in other parts of the code. See, e.g., lines 1658 - 1659 in this same file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other examples, see mpas_halo.F and the subroutines therein.

@abishekg7
Copy link
Collaborator

I've tested the PR with a real global case and also the LES case - and get bit identical results with the current develop HEAD. Code changes look good - checked the current PR against the develop branch prior to the merge of the LES PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants