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

Slightly improve lightning flash rates #270

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

mmanyin
Copy link
Contributor

@mmanyin mmanyin commented Dec 19, 2023

LFR improved for LOPEZ and MOIST schemes; GMI uses LFR for NOx calculation, but PCHEM does not.
So this PR is zero-diff for PCHEM .
Must be compiled with GEOSgcm_GridComp develop branch (as of 12/12/23) or later.

@mmanyin mmanyin added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Dec 19, 2023
@mmanyin mmanyin requested review from a team as code owners December 19, 2023 22:49
@@ -1517,20 +1573,21 @@ subroutine LOPEZ_FlashRate(IM, JM, LM, FRLAND, ZKBCON, CAPE, &
real, dimension(1:lm) :: q_graup,q_snow,rho


!!! DEBUGGING
! print*, ""
Copy link
Member

Choose a reason for hiding this comment

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

This might be a good place to use pFlogger if you'd like to keep these around. @tclune or myself (or @JulesKouatchou, but he's on leave for a while) could help with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, if there's a better way to do that, I will. Is there a wiki, or example in GEOS? I'm not familiar with pFlogger.

Copy link
Member

Choose a reason for hiding this comment

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

@JulesKouatchou has been working on a wiki for pFlogger directly, but it's still in draft and more "general". We were looking for a good place for him to work on a place to test and document its use in GEOS.

A good place to look at it would be the sun code in MAPL which is pretty simple. If you search for lgr you can get a flavor of it a la:

  use pflogger, only: logging, Logger
...
      class(Logger), pointer :: lgr
      lgr => logging%get_logger('MAPL.SUN')
...
            call lgr%debug('  tsi at end of table: %F8.3', tsi(numlines))
...
            call lgr%debug('Off the end of table, moving into last complete cycle')
            call lgr%debug('  Original Year-Mon-Day to Find: %i0.4~-%i0.2~-%i0.2', originalYear,originalMon,originalDay)
...

So you can see things like %f8.3 is a float in Fortran style, same for %i and %a

Now, the interesting part which we might need @tclune's help on is the get_logger statement. Technically, I think the logger for Chem GC would be CAP.GCM.AGCM.PHYSICS.CHEMISTRY. But I'm not sure what the "right" way to it is to delineate it in Shared/Chem_Shared/Lightning_mod.F90. CAP.GCM.AGCM.PHYSICS.CHEMISTRY.SHARED.LIGHTNING?

I suppose maybe we can get your code in now, and then when @JulesKouatchou returns, we can maybe use this component as a first example of using pFlogger in GEOS

@mathomp4 mathomp4 self-requested a review December 20, 2023 00:22
Copy link
Member

@mathomp4 mathomp4 left a comment

Choose a reason for hiding this comment

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

All that said, I'll approve so we don't keep you from getting work done!

@mathomp4
Copy link
Member

Must be compiled with GEOSgcm_GridComp develop branch (as of 12/12/23) or later.

Oh. Just saw this. To me this seems like @sdrabenh and myself might want to work toward a tag of GEOSgcm_GridComp!

@mmanyin
Copy link
Contributor Author

mmanyin commented Dec 20, 2023

@mathomp4 I can work with @JulesKouatchou when he returns, to see if this is a good test case for pFlogger. For now I will go ahead and merge into Develop.
Regarding the dependency on GEOSgcm_GridComp, I will wait for a release before moving ahead with main<-dev in GEOSchem_GridCom, unless @sdrabenh advises differently.

@mmanyin mmanyin merged commit f56ecb7 into develop Dec 20, 2023
11 checks passed
@mmanyin mmanyin deleted the feature/mmanyin/cape_from_moist branch December 20, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants