E3SM-Project / v3atm

Fork of E3SM for testing v3 atm changes
Other
0 stars 5 forks source link

MAM5 restart NBFB fix #21

Closed keziming closed 1 year ago

keziming commented 1 year ago

This PR is to solve the non-BFB restart issue when MAM5 is chosen as aerosol model.

MAM5 failed BFB restart tests: ERS and ERT.

In physics/cam/modal_aer_opt.F90 call modal_aero_wateruptake_dr(state, pbuf, list_idx, dgnumdry_m, dgnumwet_m, & qaerwat_m, clear_rh_in=clear_rh)

The dgnumwet_m is the variable cause non-BFB restart. Before this subroutine, dgnumwet_m has no value assigned and updates values at the end of the subroutine. In MAM5 modifications, dgnumwet_m values are needed in the middle of the calculation and obtained by using its pbuf values from previous calculation when the subroutine is called in another place and use the dgnum instead of dgnumwet_m at the first time step. However, due to the special setting in this subroutine, the dgnumwet_m is only called from pbuf only when “list_idx_in” is not presented. The module can not find appropriate values for dgnumwet_m when restart the model at the beginning.

The only correction needed is to call dgnumwet_m from pbuf at all conditions at the beginning of the subroutine. Also, the fix optimized the so4dryvol calculation and let it be calculated locally (no longer need to calculated it in modal_aero_calsize_diag) and removed two variables from pbuf. Then, the modal_aero_calcdry subroutine is removed from modal_aero_calcsize module. Two files are modified modal_aero_calcsize.F90 modal_aero_wateruptake.F90

New codes passed ERS and ERT tests by using 30x64 and 10x64 layout on LCRC. /lcrc/group/e3sm/ac.zke/E3SM_simulations/20221007.strat_AOD_fix13.1920.NGD-v3atm.M5-UCI.restart.t1 /lcrc/group/e3sm/ac.zke/E3SM_simulations/20221007.strat_AOD_fix13.640.NGD-v3atm.M5-UCI.restart.t1

keziming commented 1 year ago

Hi Mingxuan

I found this issue too. Thanks for this kind remind. I Still need more practice on GitHub.

Ziming

From: Mingxuan Wu @.> Date: Thursday, October 13, 2022 at 10:18 AM To: E3SM-Project/v3atm @.> Cc: Ke, Ziming @.>, Mention @.> Subject: Re: [E3SM-Project/v3atm] Mam5 bfb fix (PR #21)

@mingxuanwupnnl requested changes on this pull request.

@keziminghttps://urldefense.us/v3/__https:/github.com/keziming__;!!G2kpM7uM-TzIFchu!lXheUU-8HigVWmA4YEYk4yE4k5kf_q5flz0qFN3ddYWt-E1GpohsuK_srSXJ3Q$ Thanks for fixing this issue. As you can see, there are a lot of conflicts. There are so many files changed in this PR. Could you rebase your branch to the latest NGD_v3atm or merge the latest NGD_v3atm to your branch, so we can have a clean merge?

I believe we probably only need to modify one or two F90 files.

— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https:/github.com/E3SM-Project/v3atm/pull/21*pullrequestreview-1141211387__;Iw!!G2kpM7uM-TzIFchu!lXheUU-8HigVWmA4YEYk4yE4k5kf_q5flz0qFN3ddYWt-E1GpohsuK_Wh52JWA$, or unsubscribehttps://urldefense.us/v3/__https:/github.com/notifications/unsubscribe-auth/ALOX7CMKFQWSWYUAZYCKFNTWDA757ANCNFSM6AAAAAAREPPMF4__;!!G2kpM7uM-TzIFchu!lXheUU-8HigVWmA4YEYk4yE4k5kf_q5flz0qFN3ddYWt-E1GpohsuK9-AVSdrw$. You are receiving this because you were mentioned.Message ID: @.***>

keziming commented 1 year ago

By using aerosol dry diameter for the stratosphere wateruptake calculation solve both non-BFB and unreasonable AOD issue. 5-day and 10-day tests are performed on LCRC and the restart is BFB 1-year simulation has been conducted on LCRC and the AOD is reasonable, which solve the issue caused the fix a week ago. Now the codes are ready to merge @crterai

wlin7 commented 1 year ago

@keziming , will this PR affect simulation results of NGD_v3atmif merged, with default settings? If not, I can merge it shortly.

keziming commented 1 year ago

Hi Wuyin

If we activate MAM5 in the planned all-feature simulation, this PR fix the non-BFB in MAM5 feature. I think it is a necessary one.

Thanks!

-Ziming

From: wlin7 @.> Date: Friday, October 21, 2022 at 3:01 PM To: E3SM-Project/v3atm @.> Cc: Ke, Ziming @.>, Mention @.> Subject: Re: [E3SM-Project/v3atm] Mam5 bfb fix (PR #21)

@keziminghttps://urldefense.us/v3/__https:/github.com/keziming__;!!G2kpM7uM-TzIFchu!ntLQMMaBRIdUJSVawk7_4inZzvgL5OTulCKIy2uH3Th_bDMxmQvsSodcytW-cg$ , will this PR affect simulation results of NGD_v3atmif merged, with default settings? If not, I can merge it shortly.

— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https:/github.com/E3SM-Project/v3atm/pull/21*issuecomment-1287478090__;Iw!!G2kpM7uM-TzIFchu!ntLQMMaBRIdUJSVawk7_4inZzvgL5OTulCKIy2uH3Th_bDMxmQvsSodQzShPWw$, or unsubscribehttps://urldefense.us/v3/__https:/github.com/notifications/unsubscribe-auth/ALOX7CO4AZSLV36FG56K4I3WEMHC5ANCNFSM6AAAAAAREPPMF4__;!!G2kpM7uM-TzIFchu!ntLQMMaBRIdUJSVawk7_4inZzvgL5OTulCKIy2uH3Th_bDMxmQvsSodV2d-isQ$. You are receiving this because you were mentioned.Message ID: @.***>

wlin7 commented 1 year ago

If we activate MAM5 in the planned all-feature simulation, this PR fix the non-BFB in MAM5 feature. I think it is a necessary one.

Thanks, @keziming . So if not activating MAM5, this PR does not change simulation results? I realize I should still wait little on merging this PR, because the merged #14 is causing an unexpected NBFB.

keziming commented 1 year ago

@wlin7 Yes, If not activating MAM5, no changes in simulation. All changes are confined within MAM5 feature.

I also tested MAM4 in this version, it is BFB for restart. My NGD_v3atm base version is 2ec68418dc7ff1197e932068e2b6f5c866c7e274, which is PR#12 (P3) merged.

wlin7 commented 1 year ago

Merged to NGD_v3atm.