This error may have been identified before, but I did not see anything in the ecosystem discussion. Depending on how folks develop other ecosystem models, this error might have migrated to other ecosystem codes.
At the end of the sinking code in fennel.h, there are statements to remineralize phytoplankton nitrogen from cells that hit the bottom. The code is given below.
! add code from Fennel.h to account for phyto reaching the bottom
! based on remineralization of phyto nitrogen
if (ibio.eq. iPhyN) THEN
DO i=Istr,Iend
cff1=FC(i,0)*Hz_inv(i,1)
Bio(i,i,iOxyg)=Bio(i,i,iOxyg)-cff1*(115.0_r8/16.0_r8)
Bio(i,i,iNH4_)=Bio(i,i,iNH4_)+cff1
END DO
END IF
The problem is in the references to the Bio array which should be i,1 not i,i so that the the bottom concentrations are changed. Depending on the tiling and the number of vertical levels, this could do interesting damage to a calculation.
The correct lines are
Bio(i,1,iOxyg)=Bio(i,1,iOxyg)-cff1*(115.0_r8/16.0_r8)
Bio(i,1,iNH4_)=Bio(i,1,iNH4_)+cff1
John
Correction to fennel.h
Re: Correction to fennel.h
What's the provenance of the version of fennel.h you are working with? I can't find lines matching those you describe.
Can you give line numbers in a fresh version of fennel.h from the trunk code, or from browsing at
https://www.myroms.org/projects/src/bro ... y/fennel.h
Can you give line numbers in a fresh version of fennel.h from the trunk code, or from browsing at
https://www.myroms.org/projects/src/bro ... y/fennel.h
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
Re: Correction to fennel.h
I think this is an error that I created (sorry to add confusion).
I started with the spect_fennel.h model (svn 2232 2012-01-03) in the COAWST distribution (svn 1000, distributed Dec 15, 2014). I changed the spectral light representation in hte code based on GRASSLIGHT (a shallow water optical/vegitation model) which I am using in shallow turbid water in Chesapeake Bay (part of an EPA study of shallow water processes).
The bio_sediment section of fennel.h in svn 1000 distribution from COAWST has a bottom remineralization code; I used parts of in constructing the code in my first message which remineralized phytoplankton that sink to the bottom.
This code is causing a lack of conservation of phosphorus and nitrogen which is why I am looking at this part of the code.
It seems that the error is my own creation.
Sorry again for the confusion.
John
I started with the spect_fennel.h model (svn 2232 2012-01-03) in the COAWST distribution (svn 1000, distributed Dec 15, 2014). I changed the spectral light representation in hte code based on GRASSLIGHT (a shallow water optical/vegitation model) which I am using in shallow turbid water in Chesapeake Bay (part of an EPA study of shallow water processes).
The bio_sediment section of fennel.h in svn 1000 distribution from COAWST has a bottom remineralization code; I used parts of in constructing the code in my first message which remineralized phytoplankton that sink to the bottom.
This code is causing a lack of conservation of phosphorus and nitrogen which is why I am looking at this part of the code.
It seems that the error is my own creation.
Sorry again for the confusion.
John