Skip to content

Cosp add diag - #40

Open
Dr Stephan Havemann (Petzi1) wants to merge 6 commits into
MetOffice:mainfrom
Petzi1:cosp_add_diag
Open

Dr Stephan Havemann (Petzi1) wants to merge 6 commits into
MetOffice:mainfrom
Petzi1:cosp_add_diag

Conversation

@Petzi1

@Petzi1 Dr Stephan Havemann (Petzi1) commented Sep 24, 2026 •

Copy link
Copy Markdown

PR Summary

Sci/Tech Reviewer: Alejandro Bodas-Salcedo (Alejandro Bodas (@mo-abodas))
Code Reviewer: Erica Neininger (@ericaneininger)

The changes in this PR are to add these extra secondary COSP diagnostics.
Level dependent diagnostics on model LEVELS and on the standard 40 "Cloudsat" levels
2331 ISCCP WEIGHTED CLOUD ALBEDO
2333 ISCCP WEIGHTED CLOUD TOP PRESSURE
2334 ISCCP TOTAL CLOUD AREA
2340 CALIPSO MOLECULAR BACKSCATTER (Note this is output on driving (LFRic) model levels)
2353 GRIDBOX-MEAN CLOUDSAT Ze model LEVELS
2354 GRIDBOX-MEAN CLOUDSAT Ze 40 LEVELS
2355 GRIDBOX-MEAN CALIPSO ATB model LEVELS
2356 GRIDBOX-MEAN CALIPSO ATB 40 LEVELS
2357 CALIPSO MOLECULAR ATB 40 LEVELS
2358 (goes with 2326 for its MASK) CALIPSO / CLOUDSAT CLOUD model LEVELS
2359 (goes with 2327 for its MASK) CALIPSO/CLOUDSAT CLOUD 40 LEVELS
2371 CALIPSO CLOUD AREA 40 LEVELS
2372 CLOUDSAT CFAD Ze 40 LEVELS

In example/cosp there is a script called run_me which generates the diagnostic output for selected profiles
in ASCII and compares this with known good output (gfortran12 and ifort19).

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

Results of quicktests
Testing code compiled in /home/users/stephan.havemann/work_fork/socrates_cosp_add_diag/bin
Testing simple calls to the runes interface:
Files output.txt and gfortran_8_1_0.txt differ
Matched ifort 19.0.0 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.
Files cdl_trop_xsw_photol_g1_13.hrts and gfortran_trop_xsw_photol_g1_13.hrts differ
Files cdl_trop_xsw_photol_sg_g1_13.hrts and gfortran_trop_xsw_photol_sg_g1_13.hrts differ
Files cdl_trop_xsw_photol_sg_g3_no.ph_rate_8 and gfortran_trop_xsw_photol_sg_g3_no.ph_rate_8 differ
Files cdl_trop_xsw_photol_sg_g4_no.ph_rate_8 and gfortran_trop_xsw_photol_sg_g4_no.ph_rate_8 differ
Files cdl_trop_xsw_photol_ch.ph_rate_2 and gfortran_trop_xsw_photol_ch.ph_rate_2 differ
Files cdl_trop_320_sg_ch.ph_rate_2 and gfortran_trop_320_sg_ch.ph_rate_2 differ
Matched ifort 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...
Files sp_with_aer and sp_gfortran12 differ
Matched ifort19 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:
Files rc3_ref.radn and rc3.radn differ
Matched ifort19 output
OK
Testing Ccorr_k to generate correlated-k coefficients:
Files sp_lw_300_gfortran12 and sp_lw_300_dev differ
Matched ifort19 output
OK
Testing flexchem chemistry:
Files output.txt and kgo_output.txt differ
Matched ifort19 output
OK
Testing CDL scripts:
OK
All passed.

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

@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 Sep 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 Sep 24, 2026
cosp_qb_bpm(n_hydro),cosp_qb_rho(n_hydro), cosp_qb_p1(n_hydro), &
cosp_qb_p2(n_hydro),cosp_qb_p3(n_hydro)
!- Inputs related to lidar simulations
real(wp) :: cosp_sr_cloud = 3.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this not read in from a namelist?

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.

Thank you Alexandro. I noticed that cosp_sr_cloud has always been used with a value of 3. This is the reason why I did not add it to the namelist. At this stage I would like to suggest to resolve this in a follow on ticket.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

An option to use 3 or 5 is available in the COSP1 implementation in the UM. I agree, better to deal with this later in a different issue.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The changes look good to me. I have a comment about the SR threshold.

@Petzi1 Dr Stephan Havemann (Petzi1) added the Linked Apps This PR is linked to a MetOffice/lfric_apps PR label Sep 24, 2026
37 0.0000000000000000
38 0.0000000000000000
39 0.0000000000000000
40 -1.0000000150474662E+028

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks suspicious.

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.

Thanks ! I will have a closer look. (Standard cloudsat level 40 is below the surface of the given profile)

37 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
38 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
40***************************************************************************

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Level 40 looks suspicious.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If I understand the test outputs correctly, they have some suspicious values that I believe need investigating.

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 Linked Apps This PR is linked to a MetOffice/lfric_apps PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants