CESR-lab / ucla-roms

GNU General Public License v3.0
5 stars 11 forks source link

need new parameter to account for 3 NCycle tracers? #20

Open sdbachman opened 6 months ago

sdbachman commented 6 months ago

Got the following traceback when using BEC:


#3   0x773e09 in __tracers_MOD_init_tracers
    at /global/homes/s/sbachman/C-Star/setup_cstar/externals/ucla-roms/Work/Iceland4_BGC_Ulla/Compile/tracers.f:359

Line 359 of tracers.f points here, which is where the code starts referring to the tracers associated with the NCycle_SY cppkey:

      itot=itot+1;                iNO2=itot
      wrt_t  (itot)=.True.;       wrt_t_avg(itot)=.True.
      t_vname(itot)='NO2';        t_units  (itot)='mMol N m-3'
      t_tname(itot)='';           t_ana_frc(itot)=1
      t_lname(itot)='Nitrite'

The problem is that the wrt_t and wrt_t_avg arrays are initialized as follows:

tracers.f:      logical, dimension(nt), public      :: wrt_t
tracers.f:      logical, dimension(nt), public      :: wrt_t_avg

and the variable "nt" does not account for the three NCycle tracers:


 # ifdef BIOLOGY_BEC2
     &       ,  ntrc_bio_base=26
     &       ,  ntrc_bio=26
 # elif defined MARBL
     &       , ntrc_bio_base=32
     &       , ntrc_bio=32
 # else
     &       , ntrc_bio_base=0
     &       , ntrc_bio=0
 # endif
 #ifdef SALINITY
     &       , ntrc_salt=1
 #else
     &       , ntrc_salt=0
 #endif

      integer, parameter :: nt=1+nt_passive+ntrc_bio+ntrc_salt

I'd suggest additional lines in param.opt that looks something like

 #ifdef Ncycle_SY
     &.       , ntrc_Ncycle = 3
 #endif
       integer, parameter :: nt=1+nt_passive+ntrc_bio+ntrc_Ncycle+ntrc_salt
nmolem commented 6 months ago

Those extra lines used to be in the param.opt but appear to have disappeared in the big MARBL pull request. We made some changes in param.opt that should take care of things.