Skip to content

Further formatting fixes to the PC2 and boundary-layer scheme docs ported from the UMDPs.#523

Open
MichaelWhitall wants to merge 113 commits into
MetOffice:mainfrom
MichaelWhitall:umdp_format_fixes
Open

Further formatting fixes to the PC2 and boundary-layer scheme docs ported from the UMDPs.#523
MichaelWhitall wants to merge 113 commits into
MetOffice:mainfrom
MichaelWhitall:umdp_format_fixes

Conversation

@MichaelWhitall
Copy link
Copy Markdown
Contributor

@MichaelWhitall MichaelWhitall commented May 28, 2026

PR Summary

Sci/Tech Reviewer: Paul Barrett (@paul-barrett)
Code Reviewer: Yaswant Pradhan (@yaswant)

#450 and #465 made an initial port of the UM Documentation Papers describing the PC2 cloud-scheme and the Boundary-Layer scheme into the lfric_apps science guide. This involved fixing many formatting errors when converting the source from latex to Sphinx / ReStructureText. Subsequent to those PRs being lodged, further formatting problems have been found. This PR attempts to fix these problems:

  • The two docs merged together expose an equation label clash (both try to use the same label "dz_param" for one of their equations). So we just change the name of the label in the PC2 doc.
  • Non-ASCII characters are removed / converted to ASCII in the PC2 doc (already done in the BL doc in Port boundary-layer scheme documentation into lfric_apps #465). Most common change is unicode fancy apostrophes and quotation marks changed to basic ones.
  • Stray trailing white-spaces and blank lines removed.
  • Various aligned math regions reinstated in the PC2 doc. I had previously split these up into multiple separate math blocks as ReST doesn't allow labeling individual equations within a single aligned math block. But my scripting to do this was overzealous and had split-up aligned blocks that were already meant to be labeled and referenced as a group. I've now regrouped various instances into single aligned math regions and moved the label to apply to the whole region.
  • Fix in-line math inside emphasis. ReST doesn't render equations placed inside italic (* *) or bold (** **); to get these equations to display I needed to close the enclosing ** or * before the math, then open it again afterwards. Where math was inside a bold (** **) region, I've used latex \boldsymbol to make it render bold as intended.
  • Replaced latex math \rm, \cal, \bf with \mathrm{}, \mathcal{}, \mathbf. This was requested by code reviewer for the BL doc in Port boundary-layer scheme documentation into lfric_apps #465 but ought to be done consistently in the PC2 doc too. I also found my script had missed a number of instances in the BL doc due to failing to process in-line math split over multiple lines, and math on the declaration line of display math blocks.
  • Reinstate closing brackets following equation cross-references (accidentally deleted by my scripts due to a parsing error).
  • Corrected citations of papers with authors whose names contained codes for special characters in the latex source. These were parsed incorrectly in my script to import the references from the bibtex file. e.g. \\"u (for a u with double-dots above) fooled my script as the " was interpreted as the end of the field string, so author names containing this character were spuriously truncated.
  • Stray curly brackets removed from the references sections (these had been accidentally imported from the latex bibtex file).
  • Changed paragraph underline style to """""", as per the style guide (accidentally missed this previously!)
  • Footnotes giving author affiliations are reinstated (converting from latex to ReST using pandoc lost these).
  • Placeholders for inter-doc cross-referencing added (where there had been inter-UMDP references in the latex). To be changed to proper cross-references using a script once more of the docs have been ported.

Copy of the built docs: science_guide/index.html#science-guide-index

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code *
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully **

* Only documentation is edited; the doc source should speak for itself without needing explanatory comments, but feel free to suggest if you'd like any clarifying comments in the source?

** check_cr_approved won't pass until code review is approved.

Testing

  • I have tested this change locally, using the LFRic Apps rose-stem suite *
  • If any tests fail (rose-stem or CI) the reason is understood and acceptable (e.g. kgo changes) *
  • I have added tests to cover new functionality as appropriate (e.g. system tests, unit tests, etc.) *
  • Any new tests have been assigned an appropriate amount of compute resource and have been allocated to an appropriate testing group (i.e. the developer tests are for jobs which use a small amount of compute resource and complete in a matter of minutes) *

* Only modified documentation; rose-stem not applicable.

To test the changes, I have built the lfric_apps docs from the branch source. The build now gives no errors or warnings.

trac.log

Security Considerations

  • I have reviewed my changes for potential security issues *
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

* I'm not aware of any security issues with the docs. Does anyone know if there are license implications though? The latex UMDPs that I'm porting from are private, whereas the lfric_apps docs that I'm porting to are open-access?

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable performance measurements have been conducted

NA

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

I got M365 copilot to help update the python scripts which I'm using to automate the format corrections applied to the doc ReST source after running pandoc (and the scripts were largely written by copilot in the first place).

Documentation

  • Where appropriate I have updated documentation related to this change and confirmed that it builds correctly

This is a documentation-only PR

PSyclone Approval

  • If you have edited any PSyclone-related code (e.g. PSyKAl-lite, Kernel interface, optimisation scripts, LFRic data structure code) then please contact the TCD Team

NA

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

…CloudScheme.tex to convert the latex source to .rst format.
… extension! Updated syntax to use this for the first few equations.
…eferecing, and re-applied the corrections using an automatic script (most things stay the same, but my tweaks to reduce line-lengths have been reveretd).
…s possible to label and reference the individual equations in sphynx.
…'t converted to .rst correctly) with correctly-formatted display-mode equations.
…erical application', (b) Corrected a stray wrong indent, (c) Remove colon from appendix section titles (messes-up when used in the label).
…pply automated changes from scratch. Needed to apply corrections to section references in tables.
…tomating the corrections to figures and figure cross-referencing (then re-applied the manual fixes from 8 April 2026 using git apply).
…igure caption, and remaining instances of latex math \rm (meant to replace with \mathrm).
…) Restored aligned math regions where the contained equations are meant to be labeled as a group, (b) Deleted spurious trailing whitespace, (c) Changed format of UMDP cross-reference placeholders to avoid lint warnings.
…gions, removed stray curly brackets in bibtex entries.
…math inside emphasis regions, reinstate closing brackets after equation references).
…e this in manual corrections where appropriate.
…h the same equation label used in the BL doc.
@MichaelWhitall MichaelWhitall added this to the Autumn 2026 milestone May 28, 2026
@MichaelWhitall MichaelWhitall self-assigned this May 28, 2026
@MichaelWhitall MichaelWhitall added the documentation Improvements or additions to documentation label May 28, 2026
@github-actions github-actions Bot added the cla-required The CLA has not yet been signed by the author of this PR - added by GA label May 28, 2026
… from the CONTRIBUTORS.md file, causing the check-cla task to fail, but just reinstated in last commit to main).
@github-actions github-actions Bot removed the cla-required The CLA has not yet been signed by the author of this PR - added by GA label May 28, 2026
@MichaelWhitall MichaelWhitall marked this pull request as ready for review May 28, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants