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

Make sure FORTRAN code properly aborts when fire-emission is asked for and it can't be provided #2844

Open
wants to merge 41 commits into
base: cesm3_0_beta04_changes
Choose a base branch
from

Conversation

ekluzek
Copy link
Collaborator

@ekluzek ekluzek commented Oct 23, 2024

Description of changes

Changes in the FORTRAN code to properly abort when fire-emission is asked for it can't be provided.

To develop this a PF unit test for CNFireFactoryMod is added in.

Specific notes

Contributors other than yourself, if any:

CTSM Issues Fixed (include github issue #):
Fixes #2762
CTSM namelist checking for: NGEET/fates#1356
Some work on #2643

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? No

Does this create a need to change or add documentation? Did you do so? No

Testing performed, if any: Currently just the PF unit tests will run regular testing when done.

@ekluzek ekluzek added enhancement new capability or improved behavior of existing capability code health improving internal code structure to make easier to maintain (sustainability) bfb bit-for-bit usability Improve or clarify user-facing options labels Oct 23, 2024
@ekluzek ekluzek added this to the cesm3_0_beta05 milestone Oct 23, 2024
@ekluzek ekluzek self-assigned this Oct 23, 2024
@ekluzek ekluzek marked this pull request as draft October 23, 2024 17:12
@ekluzek ekluzek marked this pull request as ready for review March 13, 2025 06:33
ekluzek added 3 commits March 13, 2025 14:33
This also helps with ESCOMP#2643

[ Description of the changes in this commit. It should be enough
information for someone not following this development to understand.
Lines should be wrapped at about 72 characters. ]
<!--- All versions with CAM - turn off sending test drv_flds_in namelists from CTSM -->
<value compset="CAM[^_]*_CLM[^_]*%SP" >--bgc sp --no-megan --no-drydep --no-fire_emiss</value>
<value compset="CAM[^_]*_CLM[^_]*BGC" >--bgc bgc --no-megan --no-drydep --no-fire_emiss</value>
<value compset="CAM[^_]*_CLM[^_]*BGC-CROP" >--bgc bgc --crop --no-megan --no-drydep --no-fire_emiss</value>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make a note about what issue this resolves.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also remove the extra "s" at the end of "fire-emiss"

Comment on lines 4076 to 4078
} elsif ( ! &value_is_true( $nl_flags->{'use_cn'} ) ) {
$log->fatal_error("Fire emission option $var can NOT be on BGC SP Satellite Phenology.\n" .
" DON'T use the '--fire_emis' option when '--bgc sp' is activated");
Copy link
Collaborator Author

@ekluzek ekluzek Mar 24, 2025

Choose a reason for hiding this comment

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

Is this doing the right thing here? Is this for both fire_emis on and off?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On review this looks correct.

But, I see a slight tweak of wording that would be useful.

@@ -103,7 +107,6 @@ subroutine create_cnfire_method( NLFilename, cnfire_method )
class(fire_method_type), allocatable, intent(inout) :: cnfire_method
!
! !LOCAL VARIABLES:
character(len=*), parameter :: subname = 'create_cnfire_method'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is implementing the modernization asked for in #1452


end select
end select
end if
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For now we also need to add a check for FATES turned on at all, because until we bring in changes it can't handle fire-emis with FATES.


do i = scalar_lightning, noptions
if ( i == successful_ignitions ) then
cycle
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make sure there is a test for this fail?

Copy link
Collaborator Author

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

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

@slevis-lmwg and I went over this and realized some changes that should come in. Overall it's fine, but some details need to be handled.

Copy link
Contributor

@slevis-lmwg slevis-lmwg left a comment

Choose a reason for hiding this comment

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

@ekluzek and I went over and discussed various points in this PR. Erik posted our notes.

@github-project-automation github-project-automation bot moved this to Ready to start (or start again) in CTSM: Upcoming tags Mar 27, 2025
@wwieder wwieder moved this from Ready to start (or start again) to In progress - master/b4b-dev in CTSM: Upcoming tags Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bfb bit-for-bit code health improving internal code structure to make easier to maintain (sustainability) enhancement new capability or improved behavior of existing capability usability Improve or clarify user-facing options
Projects
Status: In progress - master/b4b-dev
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Don't allow SP, fates, or nofire tests to turn fire_emis on (and make sure our tests don't do this either)
3 participants