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

Seg fault when adding budget of rs, rh or rg in turb #47

Closed
QuentinRodier opened this issue Dec 22, 2023 · 0 comments
Closed

Seg fault when adding budget of rs, rh or rg in turb #47

QuentinRodier opened this issue Dec 22, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@QuentinRodier
Copy link
Collaborator

QuentinRodier commented Dec 22, 2023

At the integration of changes from mesonh 5.6->5.7 a new process changes the some mixing ratio in turb.F90, so budgets are added around turb_ver such as :
IF( BUCONF%LBUDGET_RR ) CALL BUDGET_STORE_INIT_PHY(D, TBUDGETS(NBUDGET_RR), 'VTURB', PRRS (:,:, 3) )
IF( BUCONF%LBUDGET_RS ) CALL BUDGET_STORE_INIT_PHY(D, TBUDGETS(NBUDGET_RS), 'VTURB', PRRS (:,:, 5) )
IF( BUCONF%LBUDGET_RG ) CALL BUDGET_STORE_INIT_PHY(D, TBUDGETS(NBUDGET_RG), 'VTURB', PRRS (:,:, 6) )
IF( BUCONF%LBUDGET_RH .AND. KRR==7 ) CALL BUDGET_STORE_INIT_PHY(D, TBUDGETS(NBUDGET_RH), 'VTURB', PRRS (:,:, 7) )
and call budget_store_end_phy.

(Budgets on ri, PRRS(:,:,4) was already present).

At the call of BUDGET_STORE_INIT_PHY, the default test case of arome raise at first timestep the error on call of budget of RS
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
[EC_DRHOOK:sxphynh:4:1:26619:26619] [20231222:115855:2.594] [LinuxTraceBack] [03]: MASTER() [0x136de72] : __mode_budget_phy_MOD_budget_ddh() at mode_budget_phy.F90:173
[EC_DRHOOK:sxphynh:4:1:26619:26619] [20231222:115855:2.594] [LinuxTraceBack] [04]: MASTER() [0x136ee10] : __mode_budget_phy_MOD_budget_store_end() at mode_budget_phy.F90:30 (discriminator 4)
[EC_DRHOOK:sxphynh:4:1:26619:26619] [20231222:115855:2.594] [LinuxTraceBack] [05]: MASTER() [0x136eef6] : mode_budget_phy_MOD_budget_store_end_phy() at mode_budget_phy.F90:39
[EC_DRHOOK:sxphynh:4:1:26619:26619] [20231222:115855:2.594] [LinuxTraceBack] [06]: MASTER() [0x150cac7] : turb
() at turb.F90:1131 (discriminator 1)
[EC_DRHOOK:sxphynh:4:1:26619:26619] [20231222:115855:2.594] [LinuxTraceBack] [07]: MASTER() [0x121f49e] : aro_turb_mnh
() at aro_turb_mnh.F90:389

In mesonh and testprogs, there is no problem.
If the new budgets of RS is commented, the error triggs on the call of budget or RG.
The call budget on RR is fine.

The problem does not come from the changes in mesonh 5.6 : I tried in the master branch of PHYEX at commit 7c3b2cb (20/12, before merging changes from mesonh) to add the call of BUDGET_STORE_INIT_PHY in turb : the error is the same.
On 7c3b2cb, I tried :

  • to add a call of init/end budget on r_s at the end of rain_ice.F90 : it works
  • to add the call budget_init on r_s at the first line of turb.F90 : same error

It looks like a problem of the shape of PRRS at entering of turb. I checked apl_arome and aro_turb_mnh without sucess.

Workaround : in commit 32e554f , I controled the call BUDGET_STORE_INIT/END_PHY on r_s and the others impacted new mxing ratios by the namelist key LTURB_PRECIP (False by default in AROME) that` is responsible of the changes (and the budget term).
But using LTURB_PRECIP in AROME would then not work for now

@QuentinRodier QuentinRodier added the bug Something isn't working label Dec 22, 2023
@QuentinRodier QuentinRodier changed the title Seg fault when adding budget in turb Seg fault when adding budget of rs, rh or rg in turb Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant