a minor suggestion about fennel_mod.h

Discussion about coupled ecosystem models

Moderators: arango, robertson

Post Reply
Message
Author
mjfconan
Posts: 20
Joined: Mon Mar 03, 2014 1:57 pm
Location: SKLEC, ECNU, China

a minor suggestion about fennel_mod.h

#1 Unread post by mjfconan »

Hello,
From line 183 to 223, the fennel_mod.h says:

Code: Select all

#ifdef CARBON
# ifdef OXYGEN
#  if defined PO4 && defined RIVER_DON
      NBT=15
#  elif defined RIVER_DON && !defined PO4
      NBT=14
#  elif defined PO4 && !defined RIVER_DON
      NBT=13
#  else
      NBT=12
#  endif
# else
#  if defined PO4 && defined RIVER_DON
      NBT=14
#  elif defined RIVER_DON && !defined PO4
      NBT=13
#  elif defined PO4 && !defined RIVER_DON
      NBT=12
#  else
      NBT=11
#  endif
# endif
#else
# ifdef OXYGEN
#  if defined PO4 && defined RIVER_DON
      NBT=10
#  elif defined PO4 || defined RIVER_DON
      NBT=9
#  else
      NBT=8
#  endif
# else
#  if defined PO4 && defined RIVER_DON
      NBT=9
#  elif defined PO4 || defined RIVER_DON
      NBT=8
#  else
      NBT=7
#  endif
# endif
#endif
which may be equal to

Code: Select all

NBT=7
#ifdef CARBON
      NBT=NBT+5
#endif
#ifdef OXYGEN
      NBT=NBT+1
#endif
#if defined PO4 
      NBT=NBT+1
#endif
#if defined RIVER_DON
     NBT=NBT+1
#endif
Do I understand it correctly ?
This is a similar code with the end of fennel_mod.h (from line 504 to 526), but why does this end say that CARBON introduced 4 tracers not 5 ?

Code: Select all

# ifdef CARBON
      iLDeC=ic+1
      iSDeC=ic+2
      iTIC_=ic+3
      iTAlk=ic+4
      ic=ic+4
      ...
Thanks.

arnaudlaurent
Posts: 7
Joined: Thu Jun 19, 2008 3:24 am
Location: Oceanography Department, Dalhousie University

Re: a minor suggestion about fennel_mod.h

#2 Unread post by arnaudlaurent »

When you define CARBON you introduce 4 new tracers: TIC, alkalinity, SdetritusC and LdetritusC. However, if you define CARBON+RIVER_DON you introduce an additional tracer: RdetritusC. This is why in fennel_mod.h you add 4 tracers when CARBON is defined and then 1 tracer when RIVER_DON is defined:

Code: Select all

# ifdef CARBON
      iLDeC=ic+1
      iSDeC=ic+2
      iTIC_=ic+3
      iTAlk=ic+4
      ic=ic+4
#  ifdef RIVER_DON
      iRDeC=ic+1
      ic=ic+1
#  endif
# endif

mjfconan
Posts: 20
Joined: Mon Mar 03, 2014 1:57 pm
Location: SKLEC, ECNU, China

Re: a minor suggestion about fennel_mod.h

#3 Unread post by mjfconan »

Yes, I omitted it.
Thank you!

Post Reply