Hi there,
I would like to incorporate a floating mechanism to the phytoplankton component of the Fennel model, to mimic the behaviour of Microcystis cells. Currently, the model has a constant sinking term and I would like to mirror this for floating, i.e. moving the phytoplankton upwards at some constant speed.
As far as I can tell, I need to augment the following portion of code in fennel.h (line ~1500)
%%%%%%%%%%%%%%%
!
! After this moment reconstruction is considered complete. The next
! stage is to compute vertical advective fluxes, FC. It is expected
! that sinking may occurs relatively fast, the algorithm is designed
! to be free of CFL criterion, which is achieved by allowing
! integration bounds for semi-Lagrangian advective flux to use as
! many grid boxes in upstream direction as necessary.
!
! In the two code segments below, WL is the z-coordinate of the
! departure point for grid box interface z_w with the same indices;
! FC is the finite volume flux; ksource(:,k) is index of vertical
! grid box which contains the departure point (restricted by N(ng)).
! During the search: also add in content of whole grid boxes
! participating in FC.
!
cff=dtdays*ABS(Wbio(isink))
DO k=1,N(ng)
DO i=Istr,Iend
FC(i,k-1)=0.0_r8 !
WL(i,k)=z_w(i,j,k-1)+cff
WR(i,k)=Hz(i,j,k)*qc(i,k)
ksource(i,k)=k
END DO
END DO
DO k=1,N(ng)
DO ks=k,N(ng)-1
DO i=Istr,Iend
IF (WL(i,k).gt.z_w(i,j,ks)) THEN
ksource(i,k)=ks+1
FC(i,k-1)=FC(i,k-1)+WR(i,ks)
END IF
END DO
END DO
END DO
!
! Finalize computation of flux: add fractional part.
DO k=1,N(ng)
DO i=Istr,Iend
ks=ksource(i,k)
cu=MIN(1.0_r8,(WL(i,k)-z_w(i,j,ks-1))*Hz_inv(i,ks))
FC(i,k-1)=FC(i,k-1)+ &
& Hz(i,j,ks)*cu* &
& (bL(i,ks)+ &
& cu*(0.5_r8*(bR(i,ks)-bL(i,ks))- &
& (1.5_r8-cu)* &
& (bR(i,ks)+bL(i,ks)- &
& 2.0_r8*qc(i,ks))))
END DO
END DO
DO k=1,N(ng)
DO i=Istr,Iend
Bio(i,k,ibio)=qc(i,k)+(FC(i,k)-FC(i,k-1))*Hz_inv(i,k)
END DO
END DO
%%%%%%%%%%%%%%%%%%%%%%
Ideally, I would set a negative sinking speed, but this doesn't work as the scheme is 'downward pointing' (I think). When I attempted to make it 'upward pointing', I get conservation problems in the tracer.
Any help would be greatly appreciated!
Best wishes,
Ash
Incorporating phytoplankton floating (Fennel model)
Re: Incorporating phytoplankton floating (Fennel model)
This is way more difficult than you'd think, but we've already done it. See the RED_TIDE ecosystem model code:
https://www.myroms.org/projects/src/ticket/694
It has upward "swimming" tracers.
https://www.myroms.org/projects/src/ticket/694
It has upward "swimming" tracers.
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: Incorporating phytoplankton floating (Fennel model)
You can represent phytoplankton as Lagrangian particles which have biological responses to environmental conditions and active vertical migration behaviors. There is code in the ROMS distribution for oyster larvae which could be converted to phytoplankton with vertical migration. However, this is likely to take a considerable rewrite of the Fennel code to convert a "tracer" variable to a "Lagrangian" variable and have the processes correctly represented.
There might be some ideas on vertical migration in the oyster larvae code which could be used in a "migrating tracer" model.
Good luck with your model development.
There might be some ideas on vertical migration in the oyster larvae code which could be used in a "migrating tracer" model.
Good luck with your model development.
Re: Incorporating phytoplankton floating (Fennel model)
Many thanks for the quick replies, this is very handy indeed!
Thanks again,
Ash
Thanks again,
Ash
- arango
- Site Admin
- Posts: 1367
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
Re: Incorporating phytoplankton floating (Fennel model)
I think that it will be simple. You just need to replace the vertical semi-Lagrangian sinking algorithm in fennel.h with the sinking/ascending one in red_tides.h, which you can use for swimming/floating. However, these algorithms are very sophisticated, and you cannot make changes to them. I recall looking at the details of these algorithms in a 40-pages document of their derivation that Sasha provided. It is not trivial at all. There are a lot of things going on in that compact and optimized piece of code.
Re: Incorporating phytoplankton floating (Fennel model)
Thanks for all your replies!
This is a little bit of a daunting task looking at both codes, since they a structured differently, and a lot of potential places to code this incorrectly.
If anybody has any specific guidance for this, it would be most helpful!
Best wishes,
Ash
This is a little bit of a daunting task looking at both codes, since they a structured differently, and a lot of potential places to code this incorrectly.
If anybody has any specific guidance for this, it would be most helpful!
Best wishes,
Ash
Re: Incorporating phytoplankton floating (Fennel model)
Me again,
So I took a bit of time to go through the upward/downward motions in red_tide.h and merged it into fennel.h. I found that the two codes are essentially identical up until the line starting
wdt=-Wbio(iswim)*dtdays (red_tide.h) or cff=dtdays*ABS(Wbio(isink)) (fennel.h)
I found that I had some success with this. I attach two results, one for constant sinking and one for constant floating. For these simulations, I turn off physics and biological source/sink terms - so my plankton are passive other than vertical movement.
The problem I have now is with the boundary conditions. When they hit the bottom, the total concentration over the volume (right figure) decreases and when they hit the top, it increases. I would like my plankton to be able to sink out of the system into the sediment but not leave through the surface.
So my question is, how should I apply the no flux boundary condition at the surface?
Thanks for your help as always!
Best wishes,
Ash
So I took a bit of time to go through the upward/downward motions in red_tide.h and merged it into fennel.h. I found that the two codes are essentially identical up until the line starting
wdt=-Wbio(iswim)*dtdays (red_tide.h) or cff=dtdays*ABS(Wbio(isink)) (fennel.h)
I found that I had some success with this. I attach two results, one for constant sinking and one for constant floating. For these simulations, I turn off physics and biological source/sink terms - so my plankton are passive other than vertical movement.
The problem I have now is with the boundary conditions. When they hit the bottom, the total concentration over the volume (right figure) decreases and when they hit the top, it increases. I would like my plankton to be able to sink out of the system into the sediment but not leave through the surface.
So my question is, how should I apply the no flux boundary condition at the surface?
Thanks for your help as always!
Best wishes,
Ash