Uninitialized variable inf remap_restart
Closed this issue · 0 comments
Describe the bug
The model crashes when trying to read data from a restart file that has a different number of vertical levels than you
want to use in the run. More specifically, when npz .ne. npz_rst
. The cause of this is the use of the uninitialized variable
n
used here before it is assigned:
GFDL_atmos_cubed_sphere/tools/fv_io.F90
Lines 668 to 673 in 69d97bc
To Reproduce
Perform a run and set npz_rst
to a value that is different from npz
in fv_core_nml
.
Expected behavior
The model should not crash, and be able to remap the restart data to correct number of vertical levels.
System Environment
It' caused by undefined compiler behavior, so I'd expect to see it on all systems.
Additional context
It can be solved by setting n = 1
.