CESR-lab / ucla-roms

GNU General Public License v3.0
3 stars 8 forks source link

"tracer" array not initialized properly with NCycle_SY defined #21

Open sdbachman opened 1 month ago

sdbachman commented 1 month ago

Got the following backtrace:


Fortran runtime error: Index '29' of dimension 4 of array 'tracer' above upper bound of 26

Error termination. Backtrace:
#3  0x4f41aa in ecosys_bec2_tile_
    at /global/homes/s/sbachman/C-Star/setup_cstar/externals/ucla-roms/Work/Iceland4_BGC_Ulla/Compile/bgc_ecosys_bec2.f:127

The arrays "tracer" and "DTRACER_MODULE" are being allocated as follows in bgc_ecosys_vars.f:

      allocate( tracer(GLOBAL_2D_ARRAY,N,ntrc_bio) )
      allocate( DTRACER_MODULE(GLOBAL_2D_ARRAY,N,ntrc_bio) )

Dimenson 4 is not the correct size if the Ncycle_SY tracers are included; one way to address this would be to make the fix I suggested in Issue #20 and change the above line to


allocate( tracer(-1:Lm+2,-1:Mm+2,N,ntrc_bio+ntrc_Ncycle) )
allocate( DTRACER_MODULE(GLOBAL_2D_ARRAY,N,ntrc_bio+ntrc_Ncycle) )

P.S. There is another array "STF" in bgc_ecosys_bec2.F that has the same problem.

nmolem commented 1 month ago

Our fix to issue #20 should fix this too.