Skip to content

Add semi-Lagrangian sedimentation of rain to Thompson MP as an option#727

Merged
climbfuji merged 11 commits into
NCAR:mainfrom
RuiyuSun:Thompson_semi_lag_rain
Oct 28, 2021
Merged

Add semi-Lagrangian sedimentation of rain to Thompson MP as an option#727
climbfuji merged 11 commits into
NCAR:mainfrom
RuiyuSun:Thompson_semi_lag_rain

Conversation

@RuiyuSun
Copy link
Copy Markdown
Contributor

@RuiyuSun RuiyuSun commented Sep 9, 2021

This is to add the semi-Lagrangian sedimentation of rain to Thompson MP as an option.

Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

I only did a quick, high-level review and will look more closely over the next days. I am going to add additional reviewers, too.

Comment thread physics/mp_thompson.F90 Outdated
Comment thread physics/mp_thompson.meta
@yangfanglin
Copy link
Copy Markdown

Dom, could you please add Songyou Hong and Shrinivas Moorthi as reviewers as well ? Thanks.

@climbfuji
Copy link
Copy Markdown
Collaborator

Dom, could you please add Songyou Hong and Shrinivas Moorthi as reviewers as well ? Thanks.

I added Moorthi. I do not have Songyou's GitHub ID. I will need that information and add him as a collaborator so that I can make him a reviewer.

@dudhia
Copy link
Copy Markdown
Collaborator

dudhia commented Sep 9, 2021 via email

@Songyou184
Copy link
Copy Markdown

Can you see me ? Songyou

@jianwenbao
Copy link
Copy Markdown

jianwenbao commented Sep 9, 2021 via email

@dudhia
Copy link
Copy Markdown
Collaborator

dudhia commented Sep 9, 2021 via email

@climbfuji
Copy link
Copy Markdown
Collaborator

@Songyou184 Thanks for sharing! I am going to add you as collaborator, please watch out for an invite to "collaborate on ccpp-physcs". Once that is done, I can formally request a review from you, but of course you can look at the code changes beforehand.

@climbfuji
Copy link
Copy Markdown
Collaborator

@Songyou184 @gthompsnWRF did you have a chance to look at the suggested changes (Add semi-Lagrangian sedimentation of rain to Thompson MP as an option)?

@Songyou184
Copy link
Copy Markdown

Songyou184 commented Sep 22, 2021 via email

Comment thread physics/module_mp_thompson.F90 Outdated
Copy link
Copy Markdown
Contributor

@SMoorthi-emc SMoorthi-emc left a comment

Choose a reason for hiding this comment

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

I do not pretend to understand this code. However, as this code is based on SongYou's version and he has approved it it must be good to go.

@RuiyuSun
Copy link
Copy Markdown
Contributor Author

RuiyuSun commented Sep 23, 2021 via email

@climbfuji
Copy link
Copy Markdown
Collaborator

@gthompsnWRF We are hoping to merge this, if acceptable, on 10/15. Would you mind taking a look and approve/suggest changes/reject? Thanks in advance!

Copy link
Copy Markdown
Contributor

@gthompsnWRF gthompsnWRF left a comment

Choose a reason for hiding this comment

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

I made many change requests, but most of it is related to coding standards, particularly removal of unused variables and the declaration for INTENT for subroutine arguments to protect against troubles.

Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
Comment thread physics/module_mp_thompson.F90 Outdated
qrten(k) = qrten(k) + (rr(k) - rr_tmp(k))/rho(k)/dt
nrten(k) = nrten(k) + (nr(k) - nr_tmp(k))/rho(k)/dt
enddo
pptrain = pptrain + precip
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since I believe using a minimum mixing ratio of R1, the precip variable may have a tiny amount, which is why I added in my code a line like this...

         if (rr(kts).gt.R1*10.) &
         pptrain = pptrain + (new rain amount)

therefore please add it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

'if (rr(kts).gt.R1*10.) &' is added. @Songyou184 Could you confirm this? Thanks!

@Songyou184
Copy link
Copy Markdown

Songyou184 commented Oct 11, 2021 via email

@RuiyuSun
Copy link
Copy Markdown
Contributor Author

RuiyuSun commented Oct 12, 2021 via email

@Songyou184
Copy link
Copy Markdown

In semi-Lagrangian, we don't need the additional vertical laye (kte+1)r. Thus vtrk_tmp, vtrnk_tmp (kts:kte) are correct.

@Songyou184
Copy link
Copy Markdown

Songyou184 commented Oct 12, 2021 via email

@RuiyuSun
Copy link
Copy Markdown
Contributor Author

RuiyuSun commented Oct 13, 2021 via email

@RuiyuSun
Copy link
Copy Markdown
Contributor Author

RuiyuSun commented Oct 13, 2021 via email

@RuiyuSun
Copy link
Copy Markdown
Contributor Author

RuiyuSun commented Oct 13, 2021 via email

@climbfuji
Copy link
Copy Markdown
Collaborator

@Songyou184 @RuiyuSun @gthompsnWRF I am on leave but trying to organize the commit of this PR. I see that three items from the code review have not been addressed yet:

  • @SMoorthi-emc saying that proper indentation should be used
  • @climbfuji saying that the order of arguments in the call to mp_thompson_run in mp_thompson.F90 should be different (in the Fortran subroutine call as well as in the metadata)
  • @gthompsnWRF asking about renaming the variable precip in line 1911 of module_mp_thompson.F90

Is that all that is missing? Can this be addressed please? Thanks!

Copy link
Copy Markdown
Contributor

@gthompsnWRF gthompsnWRF left a comment

Choose a reason for hiding this comment

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

Only remaining request is to clean up the left over comment/question to Songyou.

While using the name precip as a variable could be confusing, I do not have a specific solution that I can suggest.

Comment thread physics/module_mp_thompson.F90 Outdated
qrten(k) = qrten(k) + (rr(k) - rr_tmp(k))/rho(k)/dt
nrten(k) = nrten(k) + (nr(k) - nr_tmp(k))/rho(k)/dt
enddo
if (rr(kts).gt.R1*10.) & !Songyou: is this needed?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Upon removing this question to Songyou, I am otherwise approving this PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok, this is the only thing left.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The comment is removed.

Comment thread physics/mp_thompson.meta Outdated
@Songyou184
Copy link
Copy Markdown

Songyou184 commented Oct 14, 2021 via email

@RuiyuSun
Copy link
Copy Markdown
Contributor Author

if (rr(kts).gt.R110.) & !Songyou: is this needed? No, we do not need this condition since rainfall at sfc is the summation of falling rainfall below the surface in SEMI-LAG. songyou

On Thu, Oct 14, 2021 at 10:56 AM Dom Heinzeller @.
> wrote: @.** commented on this pull request. ------------------------------ In physics/module_mp_thompson.F90 <#727 (comment)>: > + niter = 1 + dtcfl = dt + if(sedi_semi_decfl) then + niter = int(nstep/decfl) + 1 + dtcfl = dt/niter + endif + do n = 1, niter + rr_tmp(:) = rr(:) + nr_tmp(:) = nr(:) + call nislfv_rain_ppm(kte,dzq,vtrk,rr,precip,dtcfl,R1) + call nislfv_rain_ppm(kte,dzq,vtnrk,nr,vtr,dtcfl,R2) + do k = kts, kte + qrten(k) = qrten(k) + (rr(k) - rr_tmp(k))/rho(k)/dt + nrten(k) = nrten(k) + (nr(k) - nr_tmp(k))/rho(k)/dt + enddo + if (rr(kts).gt.R1*10.) & !Songyou: is this needed? Ok, this is the only thing left. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#727 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVR3U6XKUZTIK7IYTYTUW5DUG4DRXANCNFSM5DW2NDVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

The if condition is removed.

Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

I am ok with this, thanks for making all the changes.

call nislfv_rain_ppm(kte,dzq,vtrk,rr,rainsfc,dtcfl,R1)
call nislfv_rain_ppm(kte,dzq,vtnrk,nr,vtr,dtcfl,R2)
do k = kts, kte
qrten(k) = qrten(k) + (rr(k) - rr_tmp(k))/rho(k)/dt
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If rho(k) is constant through the n iterations, since division is slower than multiplication, it would be more computationally efficient to define a variable of 1/(rho*dt) to multiply here instead of the repeated division.

Copy link
Copy Markdown
Collaborator

@grantfirl grantfirl left a comment

Choose a reason for hiding this comment

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

Looks fine from a CCPP point-of-view. There is probably room for some computational speed-up by paying close attention to divisions (and using multiplication times the reciprocal when possible), but perhaps at the expense of more temporary memory usage.

@SMoorthi-emc
Copy link
Copy Markdown
Contributor

SMoorthi-emc commented Oct 18, 2021 via email

@climbfuji climbfuji merged commit 530f597 into NCAR:main Oct 28, 2021
JohanaRomeroAlvarez pushed a commit to JohanaRomeroAlvarez/ccpp-physics that referenced this pull request Sep 8, 2025
* Code update for HR4_roughness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants