Skip to content

Update gas list (and gas data) with additional species#27

Open
Harrison Nicholls (nichollsh) wants to merge 15 commits intoMetOffice:mainfrom
FormingWorlds:mo/gaslist
Open

Update gas list (and gas data) with additional species#27
Harrison Nicholls (nichollsh) wants to merge 15 commits intoMetOffice:mainfrom
FormingWorlds:mo/gaslist

Conversation

@nichollsh
Copy link
Copy Markdown

@nichollsh Harrison Nicholls (nichollsh) commented Mar 24, 2026

PR Summary

Sci/Tech Reviewer: James Manners (@mo-jmanners)
Code Reviewer: Yaswant Pradhan (@yaswant)

This pull request adds additional gas species to the standard list of gases in SOCRATES. The additions are aimed to support some ongoing/upcoming science projects, including work on 'lava planets' and sub-Neptunes.

Additionally, I noticed that some of the existing gases were missing references in the code. I have tried to homogenise the syntax and gas ordering throughout. There was also a typo in def_control.f90 where l_ocs was written as l_cocs.

This is related to FormingWorlds#12 in our fork.
Closes #26 in this repo.

I have confirmed that SOCRATES compiles correctly and reproduces previous behaviours, within our existing modelling setup. Benchmarking SOCRATES runtime shows no impact from these changes.

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid undertanding and enhance the
    readability of the code
  • My changes generate no new warnings

Testing

  • If shared files have been modified, I have run the UM and LFRic Apps rose
    stem suites
  • If any tests fail (rose-stem or CI) the reason is understood and
    acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system
    tests, unit tests, etc.)

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)

Performance Impact

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

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance
    of Microsoft Copilot (gpt-5.3-codex) and I have followed the
    Simulation Systems AI policy
    (including attribution labels)

I used Copilot to verify that the lists of gases within the changed files are internally consistent, and consistent with each other.

Documentation

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

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

@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 Mar 24, 2026
@github-actions github-actions bot added cla-signed The CLA has been signed as part of this PR - added by GA and removed cla-required The CLA has not yet been signed by the author of this PR - added by GA labels Mar 24, 2026
@nichollsh Harrison Nicholls (nichollsh) marked this pull request as ready for review March 24, 2026 14:37
@nichollsh Harrison Nicholls (nichollsh) changed the title Update gas list Update gas list (and gas data) with additional species Mar 24, 2026
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi Harrison,

Looks good. I know you have your own fork of this code so it's much appreciated that you've fed these changes back up. I've added some minor comments inline.

Do you use the species flags in the control type (def_control) in your code? These are not needed by the core radiation code and are really only in there as a legacy hangover from the UM. I was thinking of removing them to make one less thing to do when adding gases.

I should also note that if these gases are to be assigned mixing ratios in LFRic (Met Office GCM) or any models using the 'runes' interface then they will also need to be added in socrates_runes and socrates_set_atm in interface_core/. I won't suggest that for this pull request though.

Thanks,
James

! The numbering 1-12 agrees with HITRAN.
!
! Some of the content of this file has been produced with the assistance
! of AI tools (Microsoft Copilot - codex 5.3)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you specify which content. Formatting is OK, but I would like any numbers (molecular weights etc.) to be done by hand.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I agree that we need to be particularly careful with these tools when applying them to 'numerical' aspects of code. Here, I primarily just used Copilot assist with formatting the additional lines, for the new gases. I also used Copilot to ensure that the gas lists are consistent between the different files, since there were multiple places where the code needed to be updated while remaining self-consistent.

@mo-jmanners
Copy link
Copy Markdown
Member

One further point. We currently run tests enforcing the 2018 fortran standard which limits continuation lines to 255. This PR takes it over that limit in gas_list_pcf.F90.

I don't want to mangle things by trying to fit the arrays into 255 lines though. Given the F2023 standard removes the limit, gfortran allows 1000 continuation lines, ifort allows 511 and I think the Cray compiler has no limit, I think the best plan for now is to adjust our compile options in make/Mk_cmd_azure_gfortran12_debug.

Could you please adjust the two instances of -std=f2018 in Mk_cmd_azure_gfortran12_debug to -std=gnu

Once we've moved to a more recent gfortran compiler we can change these to -std=f2023.

Thanks,
James

@nichollsh
Copy link
Copy Markdown
Author

Hi James,

Thank you for reviewing my changes!

Do you use the species flags in the control type (def_control) in your code? T

I don't believe that we use the species-specific flags. However, we do make use of the other generalised values: l_gas, l_continuum, etc.

I should also note that if these gases are to be assigned mixing ratios in LFRic (Met Office GCM) or any models using the 'runes' interface then they will also need to be added in socrates_runes and socrates_set_atm in interface_core/. I won't suggest that for this pull request though.

Understood - I don't use this interface. However, I am happy to add these now if you think it's a good opportunity to do so.

Can you specify which content. Formatting is OK, but I would like any numbers (molecular weights etc.) to be done by hand.

I have now clarified this above. The molecular weights were derived from a Python script which obtains data from NIST or otherwise adds-up atoms. To bring the new changes in line with the prior data, I have now manually checked all the new gases against the NIST Webbook and rounded them to the same number of significant figures.

Could you please adjust the two instances of -std=f2018 in Mk_cmd_azure_gfortran12_debug to -std=gnu

I have now done this.

Thanks again. It is excellent that SOCRATES is now on GitHub, so that we can finally start contributing back. I hope that we can keep iterating on this in the future, too.

Please let me know if you need anything else from me in the meantime. Not sure who would be the most appropriate code reviewer for this PR.

Best,
Harrison

@mo-jmanners
Copy link
Copy Markdown
Member

Revisions look fine, but it seems the 255 continuation line limit is also enforced in UM testing so we'll need to abide by it. I have an idea as to how to do this in a clean way. I'll get back to you with some suggested changes for reformatting things.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right, I've heavily taxed the github 'suggestion' functionality to request a reformatting of the parts of gas_list_pcf that fall foul of the 255 continuation line limit. Hopefully you can accept the blocks I've added and delete the bits manually that the GUI couldn't cope with.

I also hope this new format works OK with your Julia code.

James

@mo-jmanners
Copy link
Copy Markdown
Member

Also, once this reformatting is done, the changes to make/Mk_cmd_azure_gfortran12_debug can be reverted.

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

Labels

cla-signed The CLA has been signed as part of this PR - added by GA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand list of supported gases

3 participants