Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cam6_4_080: Derive new geopotential fields whenever water species are updated (not just water vapor) #1288

Merged

Conversation

jimmielin
Copy link
Member

Fixes #1286.

@jimmielin jimmielin added the bug-fix This PR was created to fix a specific bug. label Mar 24, 2025
@jimmielin jimmielin self-assigned this Mar 24, 2025
@jimmielin jimmielin marked this pull request as draft March 24, 2025 18:07
Copy link
Collaborator

@PeterHjortLauritzen PeterHjortLauritzen left a comment

Choose a reason for hiding this comment

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

Looks good (just a little suggestion but either way is fine with me) thanks!

derive_new_geopotential = .true.
exit const_water_loop
endif
endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you could also do:

const_water_loop: do m = dry_air_species_num + 1, thermodynamic_active_species_num
   if(ptend%lq(m)) then
                ! is water species?
                derive_new_geopotential = .true.
                exit const_water_loop
  end if
end do

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @PeterHjortLauritzen, that makes more sense, updated!

I will update with the regression tests results when they're available to see which compsets need a closer science check...

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like I had to change

if(ptend%lq(m)) then

to

if(ptend%lq(thermodynamic_active_species_idx(m))) then

as otherwise the m indexing is not correctly translated to the constituent indices. I got a CAM6 test failure when finalizing the regression tests and realized that the indexing had to be fixed. I am rerunning the tests now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

good catch!

@jimmielin jimmielin marked this pull request as ready for review March 24, 2025 19:51
@jimmielin
Copy link
Member Author

I ran the Derecho Intel and Izumi NAG regression tests to check which compsets are affected by this change. This should only change answers if physics schemes accumulate tendencies, depend on geopotential height, and have intermediate tendencies that do not update water vapor but update other water species.

The good news is that it seems like only the CAM4 physics are affected because of the issue impacting RK (detrainment of convective condensate into cloud liquid water has a tendency update and the following cldwat call uses zi). So it might not affect other compsets after all:

Izumi nag shows only CAM4 physics

aux_cam_nag_20250324131103: 34 tests
  ERC_D_Ln9.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
    FAIL ERC_D_Ln9.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_4_079_nag: DIFF
  ERC_D_Ln9.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details:
    FAIL ERC_D_Ln9.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_4_079_nag: DIFF
  SMS_D_Ln3.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
    FAIL SMS_D_Ln3.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_4_079_nag: DIFF
  SMS_D_Ln6.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
    FAIL SMS_D_Ln6.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem BASELINE /fs/cgd/csm/models/atm/cam/pretag_bl/cam6_4_079_nag: DIFF

Derecho Intel shows CAM4 (QPX2000) and the others are expected failures:

aux_cam_intel_20250324131610: 53 tests
  ERP_D_Ln9.ne30pg3_ne30pg3_mt232.QPC7.derecho_intel.cam-outfrq3s_cosp (Overall: FAIL) details:
    FAIL ERP_D_Ln9.ne30pg3_ne30pg3_mt232.QPC7.derecho_intel.cam-outfrq3s_cosp COMPARE_base_rest
  ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
    FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s COMPARE_base_rest
    FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_079_intel: DIFF
  ERS_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
    FAIL ERS_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s COMPARE_base_rest
  SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s_amie (Overall: DIFF) details:
    FAIL SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s_amie BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_079_intel: DIFF
  SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
    FAIL SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s RUN time=44
  SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
    FAIL SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s SETUP

@cacraigucar cacraigucar self-requested a review March 25, 2025 15:37
@cacraigucar cacraigucar changed the title Derive new geopotential fields whenever water species are updated (not just water vapor) cam6_4_080: Derive new geopotential fields whenever water species are updated (not just water vapor) Mar 25, 2025
@jimmielin jimmielin merged commit c40556c into ESCOMP:cam_development Mar 25, 2025
2 checks passed
cacraigucar added a commit to peverwhee/CAM that referenced this pull request Mar 25, 2025
Merge pull request ESCOMP#1288 from jimmielin/hplin/geopotential_t_water_species
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix This PR was created to fix a specific bug.
Projects
Status: Tag
Development

Successfully merging this pull request may close these issues.

3 participants