vertical integral in biogeochemical model

25 views
Skip to first unread message

Mattias Cape

unread,
Nov 20, 2021, 11:43:41 AM11/20/21
to FABM-users
Hi,

I'm new to FABM after working with GOTM for a couple of years. I'm looking to develop a new biogeochemical model to couple to GOTM, specifically that of Davis and co-authors:

Davis, K. A. et al. Estuary‐enhanced upwelling of marine nutrients fuels coastal productivity in the U.S. Pacific Northwest. J Geophys Res Oceans 119, 8778–8799 (2014).

In the model, PAR (E) at a particular depth is in part a function of integrated phytoplankton concentration above:
Screen Shot 2021-11-20 at 8.09.14 AM.png
I'm wondering how to include such a vertical integral in my model.

I've been reading through the FABM wiki, using existing models as examples, and if I understand them correctly the examples presented seem to allow for different components to contribute to total light attenuation but in a local sense (at a particular depth; e.g. the get_light_extinction routine in ergom, or discussion of aggregate quantities). I've found examples of vertical integrals in nonlocal.F90 and depth_integral.F90 which leverage _VERTICAL_LOOP_BEGIN_ and another in light.F90 which uses _DOWNWARD_LOOP_BEGIN_, but this functionality isn't described in the Wiki.

For specific questions, using the model structure as described in the wiki as a basis:
- can I simply include additional subroutines (e.g. depth_integral_initialize and depth_integral_do_column) in my model to calculate the integral? Or do I also need to define additional submodules (in the sense of what appears in nonlocal.F90, e.g. type_depth_integral)? Or is a function more appropriate?
-How would I pass the value of this integral to the do procedure? by _SET_HORIZONTAL_DIAGNOSTIC_?
-If loops are the appropriate way of calculating the integral, would _DOWNWARD_LOOP_BEGIN_ be more appropriate as I'm looking for integrals from the surface to a particular depth?

Thank you for taking the time to consider my novice questions.

Cheers,

Mattias

Jorn Bruggeman

unread,
Nov 22, 2021, 4:47:42 AM11/22/21
to fabm-...@googlegroups.com

Hi Mattias,

 

As you’ve found, the way to use vertical loops is unfortunately not yet described in the wiki. It only points to the few examples that you mention. I’d take the logic in the gotm/light module as starting point, as you propose. Specific answers:

  • Yes you can add a do_column to an existing model that already has do/do_bottom/do_surface etc. There is a slight benefit in putting it into a separate model type, though, because then you can selectively add only the dependencies of the light routine there. If you add do_column directly to, say, a phytoplankton type, all dependencies of the phytoplankton module (maybe nutrients, temperature) are also potentially needed by do_column, as far as FABM is concerned. That means FABM would have to make those available when calling do_column, which comes with (very slight) overhead.
  • Yes you can make depth-integrated values calculated in do_column available with _SET_HORIZONTAL_DIAGNOSTIC_, which you would then likely call after _DOWNWARD_LOOP_END_
  • Yes _DOWNWARD_LOOP_BEGIN_ sounds like the way to go. _VERTICAL_LOOP_BEGIN_ is currently an alias for that, but in the future it may be changed to loop over the column in the physical model’s “native” direction, which for GOTM would be upward. For completeness, there exists also an _UPWARD_LOOP_BEGIN_

 

Cheers,

 

Jorn

 

From: fabm-...@googlegroups.com <fabm-...@googlegroups.com> On Behalf Of Mattias Cape
Sent: 20 November 2021 16:44
To: FABM-users <fabm-...@googlegroups.com>
Subject: [fabm-users: 856] vertical integral in biogeochemical model

 

Hi,

 

I'm new to FABM after working with GOTM for a couple of years. I'm looking to develop a new biogeochemical model to couple to GOTM, specifically that of Davis and co-authors:

 

Davis, K. A. et al. Estuary‐enhanced upwelling of marine nutrients fuels coastal productivity in the U.S. Pacific Northwest. J Geophys Res Oceans 119, 8778–8799 (2014).

 

In the model, PAR (E) at a particular depth is in part a function of integrated phytoplankton concentration above:

I'm wondering how to include such a vertical integral in my model.

 

I've been reading through the FABM wiki, using existing models as examples, and if I understand them correctly the examples presented seem to allow for different components to contribute to total light attenuation but in a local sense (at a particular depth; e.g. the get_light_extinction routine in ergom, or discussion of aggregate quantities). I've found examples of vertical integrals in nonlocal.F90 and depth_integral.F90 which leverage _VERTICAL_LOOP_BEGIN_ and another in light.F90 which uses _DOWNWARD_LOOP_BEGIN_, but this functionality isn't described in the Wiki.

 

For specific questions, using the model structure as described in the wiki as a basis:

- can I simply include additional subroutines (e.g. depth_integral_initialize and depth_integral_do_column) in my model to calculate the integral? Or do I also need to define additional submodules (in the sense of what appears in nonlocal.F90, e.g. type_depth_integral)? Or is a function more appropriate?

-How would I pass the value of this integral to the do procedure? by _SET_HORIZONTAL_DIAGNOSTIC_?

-If loops are the appropriate way of calculating the integral, would _DOWNWARD_LOOP_BEGIN_ be more appropriate as I'm looking for integrals from the surface to a particular depth?

 

Thank you for taking the time to consider my novice questions.

 

Cheers,

 

Mattias

 

--
You received this message because you are subscribed to the Google Groups "FABM-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabm-users/a2cd86c8-fc82-42d4-a3c3-c1b1f52f2431n%40googlegroups.com.

image001.png

Mattias Cape

unread,
Nov 24, 2021, 11:02:30 AM11/24/21
to FABM-users
Hi Jorn,

Thank you for your quick reply and explanation - glad I was on the right path. Knowing how to calculate the integral I wonder next how to best set variables / parameters to calculate PAR (E(z)) as a whole. 

My first thought was to simply calculate E(z) directly in my model and somehow override the physical model's PAR with this computed quantity. However, if I understand this discussion in fabm-devel, bgc models typically impact the light field, which are computed in my case on the GOTM end of things, by providing attenuation coefficients components for included constituents. I've seen such an implementation in the med_ergom gotm case, which has a dedicated get_light_extinction subroutine and contributions from many biological groups + detritus via _SET_EXTINCTION_

In light.F90 it seems the implementation of light field calculation in gotm (if up to date) is very similar to the equation I provided above:

par = swr0 * (1.0_rk - self%a) * exp(-z / self%g2 - bioext) 

GOTM allows you to specify g2 as a parameter in gotm.yaml, presumably when setting the light extinction method to custom, and if I understand things correctly FABM would in turn allow you to control relevant quantities going into bioext (e.g. attenuation coefficient for self shading). In my case the functional form is very similar, but it's not clear that I can simply pass attenuation coefficients given the functional form (attenuation of seawater varies with salinity, and attenuation by phytoplankton scaled by an integral).

Best,

Mattias

Jorn Bruggeman

unread,
Nov 24, 2021, 11:41:33 AM11/24/21
to fabm-...@googlegroups.com

Hi Mattias,

 

The simplest option would be to implement your own light model in FABM as you’ve been doing – there you are completely free to do as you like, with one or move wavebands, dependencies on salinity, etc. But if you want the attenuation by plankton and other constituents to feed back to the temperature equation in GOTM, you are restricted by the type of feedback that GOTM recognizes. That is currently via the attenuation of the visible fraction (“PAR”) of the downwelling shortwave flux. To make that work, you can within FABM add terms to the total attenuation (1/m) like this: https://github.com/fabm-model/fabm/wiki/Developing-a-new-biogeochemical-model#contributing-to-aggregate-quantities (the very last bit of that section). There is no need anymore to implement get_light_extinction or use _SET_EXTINCTION_.

 

It is in principle possible to do both, by the way – to set up an attenuation term (in FABM) used by GOTM for heating, and still run your own light model within FABM for the benefit of the biogeochemistry (typically phytoplankton). However, you then in effect run two light models – one for physics, one for biogeochemistry, which isn’t entirely consistent…

 

NB for GOTM to actually apply that attenuation term, you will additionally need to set fabm/feedbacks/shade: true in gotm.yaml.

 

Finally, it is worth noting that the gotm/light.F90 model that comes with FABM is a re-implementation of the two-band GOTM light model, typically used only in other physical models that do not have their own mechanism for providing light within the pelagic to FABM. It is not the code actually used by GOTM, which has its implementation in <GOTMDIR>/src/meanflow/temperature.F90

Mattias Cape

unread,
Nov 24, 2021, 7:19:15 PM11/24/21
to fabm-...@googlegroups.com
Thank you Jorn, this gives me plenty to go on!

Best,

Mattias

You received this message because you are subscribed to a topic in the Google Groups "FABM-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fabm-users/Dfu6Ww3YO8o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fabm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabm-users/015201d7e152%2421d39040%24657ab0c0%24%40bolding-bruggeman.com.
Reply all
Reply to author
Forward
0 new messages