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

Uninitialized value in bgcsklclim and bgczclim restart tests #512

Open
phil-blain opened this issue Aug 26, 2020 · 2 comments
Open

Uninitialized value in bgcsklclim and bgczclim restart tests #512

phil-blain opened this issue Aug 26, 2020 · 2 comments
Assignees

Comments

@phil-blain
Copy link
Member

phil-blain commented Aug 26, 2020

I've stumbled upon an uninitialized value in the forcing code. I'm creating a test with

./cice.setup -m daley -e intel --tdir ~/cice-dirs/tests/bgc-debug/ --test restart -g gx1 \
-p 4x2 -s bgcsklclim,debug,medium --testid 0

to replicate the bgc test in the base_suite, but in debug mode. I'm compiling with these flags: (Macros.daley_intel)

FFLAGS     := -fp-model source -convert big_endian -assume byterecl -ftz -traceback
# ---- >8 ----
FFLAGS     += -O0 -g -check -fpe0 -ftrapuv -fp-model except -check noarg_temp_created

and I get a "floating invalid". Here is the backtrace from the core dump:

$ gdb cice core
Reading symbols from cice...
[New LWP 18341]
Core was generated by `./cice'.
Program terminated with signal SIGABRT, Aborted.
#0  raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x0000000001dc5151 in abort () at abort.c:79
#2  0x0000000001cf28c1 in for.signal_handler ()
#3  <signal handler called>
#4  0x00000000009ddce2 in ice_forcing::interp_coeff_monthly (recslot=2)
    at /fs/homeu1/eccc/cmd/cmde/phb001/code/cice/cicecore/cicedynB/general/ice_forcing.F90:1238
#5  0x0000000000aa6680 in ice_forcing_bgc::get_forcing_bgc () at /fs/homeu1/eccc/cmd/cmde/phb001/code/cice/cicecore/cicedynB/general/ice_forcing_bgc.F90:184
#6  0x000000000104b191 in ice_init_column::init_bgc () at /fs/homeu1/eccc/cmd/cmde/phb001/code/cice/cicecore/shared/ice_init_column.F90:876
#7  0x0000000000407c91 in cice_initmod::init_restart () at /fs/homeu1/eccc/cmd/cmde/phb001/code/cice/cicecore/drivers/standalone/cice/CICE_InitMod.F90:437
#8  0x00000000004027b9 in cice_initmod::cice_init () at /fs/homeu1/eccc/cmd/cmde/phb001/code/cice/cicecore/drivers/standalone/cice/CICE_InitMod.F90:172
#9  0x0000000000401403 in cice_initmod::cice_initialize () at /fs/homeu1/eccc/cmd/cmde/phb001/code/cice/cicecore/drivers/standalone/cice/CICE_InitMod.F90:52
#10 0x0000000000400bf1 in icemodel () at /fs/homeu1/eccc/cmd/cmde/phb001/code/cice/cicecore/drivers/standalone/cice/CICE.F90:43
#11 0x0000000000400b72 in main ()
#12 0x0000000001dbe88f in __libc_start_main (main=0x400b40 <main>, argc=1, argv=0x7ffc522a41a8, init=0x1dbef40 <__libc_csu_init>, 
    fini=0x1dbefe0 <__libc_csu_fini>, rtld_fini=0x0, stack_end=0x7ffc522a4198) at ../csu/libc-start.c:308
#13 0x0000000000400a5a in _start () at ../sysdeps/x86_64/start.S:120

The error is due to this line:

! make time cyclic
tt = mod(ftime/secday,dayyr)

and ftime has a value of NaN in the core dump. I think this variable is used before it is defined in subroutine get_forcing_atmo, since get_forcing_atmo is called after init_restart in cice_init and init_restart calls init_bgc which calls interp_coeff_monthly.

CC: @njeffery @eclare108213

@phil-blain
Copy link
Member Author

Note that this also happens in serial (-p 1x1).

@eclare108213
Copy link
Contributor

Good catch @phil-blain ! I might have created this problem when we created and/or changed the Icepack interfaces -- the BGC code was difficult to isolate, and we've never had comprehensive tests for it. I wonder if it is possible to move the BGC initialization later in the code, after the parameter has been defined... or it might make more sense to define ftime earlier, since it's being used more generally and not just for atmo forcing.

@eclare108213 eclare108213 self-assigned this Nov 10, 2020
@eclare108213 eclare108213 added Icepack and removed BGC labels Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants