Skip to content

Hughes and Jablonowski baroclinic topo test#9

Open
mt5555 wants to merge 2 commits into
masterfrom
baro-topo-test
Open

Hughes and Jablonowski baroclinic topo test#9
mt5555 wants to merge 2 commits into
masterfrom
baro-topo-test

Conversation

@mt5555

@mt5555 mt5555 commented Jul 25, 2022

Copy link
Copy Markdown
Owner

No description provided.

@mt5555 mt5555 changed the title Baro topo test Hughes and Jablonowski baroclinic topo test Jul 25, 2022
@mt5555 mt5555 changed the base branch from master to classic_makefile July 25, 2022 02:50
@mt5555 mt5555 changed the base branch from classic_makefile to master July 25, 2022 02:50
fix nlevp overflow
fix bug in pressure init ( signficiant )
make w_i continuous at element edges
add namelist for this test
  pressure init bug also required turning on theta_advect_form=1
shift longitude of mountains to be over CONUS
mt5555 pushed a commit that referenced this pull request Jan 16, 2026
…t#7866)

This is changing code that is widely used and has been unchanged for a
very long time, so I'm adding a lot of reviewers. Feel free to add
more.

I stumbled across this code when trying to debug a weird eamxx failure:

I observed the following symtoms:

If you look at components/elm/src/main/reweightMod.F90, you'll see the line SHR_ASSERT(bounds%level == BOUNDS_LEVEL_CLUMP, errMsg(__FILE__, __LINE__)) which causes this error:

1: free(): invalid pointer
...
0: #8  0x4c7e3ab in __shr_log_mod_MOD_shr_log_errmsg
0:      at /pscratch/sd/a/acmetest/E3SM/share/util/shr_log_mod.F90:78
0: #9  0x914149 in __reweightmod_MOD_reweight_wrapup
0:      at /pscratch/sd/a/acmetest/E3SM/components/elm/src/main/reweightMod.F90:48
0: E3SM-Project#10  0x17bda7d in __dynsubgriddrivermod_MOD_dynsubgrid_wrapup_weight_changes
0:      at /pscratch/sd/a/acmetest/E3SM/components/elm/src/dyn_subgrid/dynSubgridDriverMod.F90:403
0: E3SM-Project#11  0x17bf256 in __dynsubgriddrivermod_MOD_dynsubgrid_init._omp_fn.0
0:      at /pscratch/sd/a/acmetest/E3SM/components/elm/src/dyn_subgrid/dynSubgridDriverMod.F90:150

I thought this was because the SHR_ASSERT was failing, but that's not
the case (both bounds%level and BOUNDS_LEVEL_CLUMP are always 2). If I
just comment this SHR_ASSERT out entirely, the test PASSES!

The lowest line of code that triggers the free(): invalid pointer error is:
shr_log_errMsg = 'ERROR in '//trim(file)//' at line '//toString(line)

What I think is happening is that there is some memory corruption that
is causing the freeing of the allocation done by toString to fail. So,
this PR kind of sweeps that issue under the rug, but I do think it's
better not to do dynamic allocations if you don't have to. The test
PASSes with the changes in this PR.

[BFB]
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.

1 participant