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:
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.
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
To view this discussion on the web visit https://groups.google.com/d/msgid/fabm-users/53ca0a31-efe8-41c0-ab38-5161b8f26000n%40googlegroups.com.
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.