NOAA-GFDL/MOM6

MLE% wackiness in input files

Opened this issue · 3 comments

If one uses MLE%USE_BODNER23, things behave as expected. Instead, the parameter_doc.short file lists it as:

MLE%
USE_BODNER23 = True
%MLE

with some other stuff in there. The problem is that the register_restarts routine for this only allocates some of the work arrays if MLE%UES_BODNER23 is True. This second check isn't checking for the MLE environment. Things then fail when the work arrays are used if not allocated.

I tried fixing the register_restart routine, but it still doesn't correctly parse the:

MLE%
USE_BODNER23 = True
%MLE

The bug I had heard a rumor of is not this bug but something deeper.

Just a note: openParameterBlock and closeParameterBlock don't now have a donotlog sort of option - it might be nice when used with parameter calls that are not logged.

I think that I can reproduce something relevant in .testing/tc2.a. This works:

MLE%USE_BODNER23 = True
MLE%BLD_DECAYING_TFILTER = 86400.
MLE%MLD_DECAYING_TFILTER = 259200.
MLE%BLD_GROWING_TFILTER = 300.
MLE%MLD_GROWING_TFILTER = 3600.

but if I use this:

MLE%
USE_BODNER23 = True
BLD_DECAYING_TFILTER = 86400.
MLD_DECAYING_TFILTER = 259200.
BLD_GROWING_TFILTER = 300.
MLD_GROWING_TFILTER = 3600.
%MLE

then I get the following error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7fae4e966b4f in ???
#1  0xab9c84 in rmean2ts
	at ../../../src/parameterizations/lateral/MOM_mixed_layer_restrat.F90:1162
#2  0xabba53 in mixedlayer_restrat_bodner
	at ../../../src/parameterizations/lateral/MOM_mixed_layer_restrat.F90:886
#3  0xacbc12 in __mom_mixed_layer_restrat_MOD_mixedlayer_restrat
	at ../../../src/parameterizations/lateral/MOM_mixed_layer_restrat.F90:155
#4  0x4738e1 in step_mom_dynamics
	at ../../../src/core/MOM.F90:1330
#5  0x477fd5 in __mom_MOD_step_mom
	at ../../../src/core/MOM.F90:912
#6  0x7bffc4 in mom6
	at ../../../config_src/drivers/solo_driver/MOM_driver.F90:485
#7  0x7c1530 in main
	at ../../../config_src/drivers/solo_driver/MOM_driver.F90:27

I am unsure if this is related to your error, which seems related to restart files, but it's certainly a rather serious error.

Looks like use_bodner is set to false, despite the parameter being set to true.

p cs%mixedlayer_restrat_csp
$1 = ( ... , use_bodner = .FALSE., ..., mld_filtered = <not allocated>, mld_filtered_slow = <not allocated>, ...)

and explains why MLD_filtered is unallocated, which is causing the SIGSEGV.

This is probably a file parser error, that is probably the next place to look.