Update gas list (and gas data) with additional species#27
Update gas list (and gas data) with additional species#27Harrison Nicholls (nichollsh) wants to merge 15 commits intoMetOffice:mainfrom
Conversation
James Manners (mo-jmanners)
left a comment
There was a problem hiding this comment.
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
src/radiance_core/gas_list_pcf.F90
Outdated
| ! 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) |
There was a problem hiding this comment.
Can you specify which content. Formatting is OK, but I would like any numbers (molecular weights etc.) to be done by hand.
There was a problem hiding this comment.
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.
…tting and whitespace. Add species numbers to comments. Add HITRAN number for S2.
|
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, |
|
Hi James, Thank you for reviewing my changes!
I don't believe that we use the species-specific flags. However, we do make use of the other generalised values:
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.
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.
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, |
|
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. |
James Manners (mo-jmanners)
left a comment
There was a problem hiding this comment.
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
|
Also, once this reformatting is done, the changes to make/Mk_cmd_azure_gfortran12_debug can be reverted. |
Co-authored-by: James Manners <[email protected]>
Co-authored-by: James Manners <[email protected]>
Co-authored-by: James Manners <[email protected]>
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.f90wherel_ocswas written asl_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)
readability of the code
Testing
stem suites
acceptable (eg. kgo changes)
tests, unit tests, etc.)
trac.log
Security Considerations
Performance Impact
performance measurements have been conducted
AI Assistance and Attribution
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
confirmed that it builds correctly
Sci/Tech Review
Please alert the code reviewer via a tag when you have approved the SR
Code Review