Skip to content

Implement hybrid SW scattering allowing direct flux only calculations for specific k-terms - #47

Open
James Manners (mo-jmanners) wants to merge 7 commits into
MetOffice:mainfrom
mo-jmanners:46_hybrid_scatter_sw
Open

James Manners (mo-jmanners) wants to merge 7 commits into
MetOffice:mainfrom
mo-jmanners:46_hybrid_scatter_sw

Conversation

@mo-jmanners

Copy link
Copy Markdown
Member

PR Summary

Implement hybrid SW scattering allowing direct flux only calculations for specific k-terms

Sci/Tech Reviewer: Dr Stephan Havemann (@Petzi1)
Code Reviewer:

  • Add hybrid scattering scheme for the SW allowing strong gas k-terms to use a simple direct flux calculation with no scattering or clouds.
  • Update technical guide for SW hybrid scattering.
  • Improve selection of major absorber in tidy_90 (allow up to 3 gas layers).
  • Use socrates_ereport in place of stop statements in tidy_90 (following code reviewer request in Improve treatment of solar spectrum #39).
  • Update Socrates stand-alone testing for the new schemes:
    • Add test for hybrid SW scattering and new method to select major gas in sp_uv example.
    • Update RFMIP KGO due to inclusion of optimisation flag l_grey_single (numerically insignificant difference). Note this will not affect the UM or LFRic (which already uses this flag).
    • Remove calculation of spherical ice from slow_tests as this duplicates the droplets test case.

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 understanding 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.)

Stand-alone Socrates testing

[~/git/socrates_admin/examples](46_hybrid_scatter_sw %=):$ ./quick_tests 
Testing code compiled in /home/users/james.manners/git/socrates_admin/bin
---
Testing simple calls to the runes interface:
Matched gfortran output
OK
---
Testing the runes_nc driver using LFRic diagnostic input:
Matched SW output
Matched LW output
OK
---
Testing raw_input to convert column data into input files:
OK
---
Testing Cl_run_cdl for ICRCCM case 27 (LW) on AER profiles:
OK
---
Testing Cl_run_cdf on multiple profiles:
OK
---
Test Cl_run_cdf for CIRC case 6
(HadGEM, GA7, SES and 300/260 band spectral files):
OK
---
Testing pseudo-spherical geometry code:
Calculating zenith angles:  75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
OK
---
Testing photolysis and non-LTE code:
Mapping sub-bands to channels.
Matched gfortran output
OK
---
Test McICA code (create mcica_data file and run on CRM profile):
OK
---
Testing creation of aerosol properties for a spectral file:
Running scatter_90...
Running scatter_average_90...
Running prep_spec...
Matched gfortran12 output
OK
---
Testing generating and running with prescribed optical properties:
Running raw_input...
Running Cscatter... please wait...
Running Cscatter... please wait...
Running Cscatter_average...
Running Cscatter_average...
Running prep_opt_profile...
Running Cl_run_cdl...
All done.
OK
---
Testing Crun_mono to calculate radiances:
Matched ref output
OK
---
Testing Ccorr_k to generate correlated-k coefficients:
Matched gfortran12 output
OK
---
Testing flexchem chemistry:
Matched KGO output
OK
---
Testing CDL scripts:
OK
---
All passed.

UM trac.log

Test Suite Results - um - um_socrates46_hybrid_scatter_sw/run1

Suite Information

Item Value
Suite Name um_socrates46_hybrid_scatter_sw/run1
Suite User james.manners
Workflow Start 2026-11-04T17:45:27
Groups Run developer
Dependency Reference Main Like
casim MetOffice/casim@4a94869 True
jules MetOffice/jules@1fbe60f True
moci MetOffice/moci@2026.07.1 True
mule MetOffice/mule@2026.07.1 True
shumlib MetOffice/shumlib@2026.07.1 True
socrates mo-jmanners/socrates@46_hybrid_scatter_sw True
SimSys_Scripts MetOffice/SimSys_Scripts@393eddb True
ukca MetOffice/ukca@7be5459 True
um mo-jmanners/um@451fa60 True
um_aux MetOffice/um_aux@2026.07.1 True
um_meta MetOffice/um_meta@2026.07.1 True

Approvals

Code Owners

  • No UM Code Owners Required

Config Owners

No UM Config Owners Required

Task Information

✅ succeeded tasks - 895

LFRic Apps trac.log

Test Suite Results - lfric_apps - lfric_apps_socrates46_hybrid_scatter_sw/run1

Suite Information

Item Value
Suite Name lfric_apps_socrates46_hybrid_scatter_sw/run1
Suite User james.manners
Workflow Start 2026-11-04T17:48:36
Groups Run developer
Dependency Reference Main Like
casim MetOffice/casim@996db30 True
jules MetOffice/jules@1fbe60f True
lfric_apps mo-jmanners/lfric_apps@35aefc0 True
lfric_core MetOffice/lfric_core@f45cece True
moci MetOffice/moci@2026.07.1 True
SimSys_Scripts MetOffice/SimSys_Scripts@77a5166 True
socrates mo-jmanners/socrates@46_hybrid_scatter_sw True
socrates-spectral MetOffice/socrates-spectral@2026.07.1 True
ukca MetOffice/ukca@7be5459 True

Task Information

✅ succeeded tasks - 1256

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 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)

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

… gas k-terms to use a simple direct flux calculation with no scattering or clouds. Improve selection of major absorber in tidy_90 (allow up to 3 gas layers). Update RFMIP KGO due to use of l_grey_single. Remove overkill calculation of spherical ice from slow_tests.
…ect major gas in sp_uv example. Small fix to tidy_90 to cope with very optically thick gas in EUV. Update technical guide for SW hybrid scattering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hybrid SW scattering allowing direct flux only calculations for specific k-terms

1 participant