Git Product home page Git Product logo

fabm-model / fabm Goto Github PK

View Code? Open in Web Editor NEW
72.0 16.0 41.0 18.05 MB

The Framework for Aquatic Biogeochemical Models (FABM): a Fortran 2003 programming framework for biogeochemical models of marine and freshwater systems.

License: GNU General Public License v2.0

C 2.22% Shell 0.07% CMake 1.13% Fortran 85.88% Python 4.71% Batchfile 0.09% Jupyter Notebook 5.70% Cython 0.18%
hydrodynamic-modeling biogeochemical-models coupling

fabm's Introduction

The Framework for Aquatic Biogeochemical Models (FABM)

FABM is a Fortran 2003 programming framework for biogeochemical models of marine and freshwater systems.

Documentation is available at the FABM wiki. For questions about FABM's use or development, visit Discussions.

The latest code is available from FABM's git repository. Stable releases are published with DOI on Zenodo. The latest stable version is:

DOI

FABM is further described in:

Bruggeman, J., Bolding, K., 2014. A general framework for aquatic biogeochemical models. Environmental Modelling & Software 61: 249–265. DOI: 10.1016/j.envsoft.2014.04.002

fabm's People

Contributors

bolding avatar casper-boon avatar dependabot[bot] avatar jornbr avatar kbolding avatar knutaros avatar matthipsey avatar platipodium avatar wathen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fabm's Issues

How to add "spm" into river(GETM)?

Dear Jorn
I am coupling the FABM to the hydrodynamic mode GETM. I tried to add the variable spm to the stream file for the pattern input. But the model results do not show spm from rivers. The following is the matlab code that I added spm in the river nc file.
Thank you for your answer!
4d82a382c71db6100ccf641bedb1bc1

SPHERICAL OPTION NOT IMPLEMENTED IN FABM_ADV

Hello,
While running FVCOM, I get the following error:
FVCOM FATAL ERROR
SPHERICAL OPTION NOT IMPLEMENTED IN FABM_ADV
stopping FVCOM

Could you please help me to find the problem. I have previously tested my mesh and input files in another linux machine and the model was working fine.

ERROR IN TGE DETERMINING ISONB

Hello,
While running FVCOM, I get the following error:
FVCOM Fatal Error!
ERROR IN TGE DETERMINING ISONB
Stopping FVCOM
Could you please help me to find the problem. I have previously tested my mesh and input files in another linux machine and the model was working fine.

additional input for 0d-driver

Hi,
I am using the 0d driver for a phytoplankton model. In addition to light and temperature, I want to read input data for zooplankton and other quantities. I modified the 0d-driver to read this additional non-standart input-data.
Is there another way to deal with it? In the current state my model will not work with the original 0d-driver.

Typo in the Wiki

Hi,

It's just a tiny little thing but in the Wiki, part Developing a new biogeochemical model, section Making the model available, you write the following

To make FABM aware of your new model, two lines must be added to your library, src/models/INSTITUTE/model_library.F90:

while I think the fortran file should be src/models/INSTITUTE/INSTITUTE_model_library.F90.

Nothing much really but I found it confusing at first because I was looking for such a file in examples before realizing it was not needed.

bb_filter_feeder - this is really a mail from Ulf - just want to see how it look in the issue tracker

Hi all,
in a project I need a benthic filter feeder. bb_filter_feeder could do what I want. However, bb_filter_feeder works on the entire water column. Since I only need a do_bottom, how to set up the model.
Should I make a new model in iow or can I do modify bb_filter_feeder and introduce a switch like do_benthic_filter_feeder=[true|false] to switch between do and do_bottom?

A second question is the application of an external clearance rate. How to do that with GETM? Can I simply provide a 2d field through GETM or do I have to set that up from scratch. Or can I recycle the fabm_surface_flux_file infrastructure in getm_fabm.inp?

Best, ulf

P.S. Sorry for mixing FABM/GETM/user/devel stuff.

error when I added "-DFABM_ERSEM_BASE=/path/to/my/ersem/code"

Hi, guys
I could excute "make install" sucessfully when I did not add "ersem"
like this:
cd $HOME/Code/fabm/src
mkdir build
cd build
cmake $HOME/Code/fabm/src -DFABM_HOST=fvcom -DCMAKE_Fortran_COMPILER=$(which mpif90)
make install
It is ok!
however, i got error when I add "-DFABM_ERSEM_BASE=/path/to/my/ersem/code"

like this
cd $HOME/Code/fabm/src
mkdir build
cd build
cmake $HOME/Code/fabm/src -DFABM_HOST=fvcom -DFABM_ERSEM_BASE=$HOME/Code/ersem -DCMAKE_Fortran_COMPILER=$(which mpif90)
make install

ERROR
/ersem/src/benthic_column_dissolved_matter.F90(96): error #8486: There is no matching specific subroutine for this type bound generic subroutine call. [REGISTER_STATE_DEPENDENCY]
call self%register_state_dependency(self%id_layer,'layer','m','depth of bottom interface of final layer', &
-------------------^
compilation aborted for benthic_column_dissolved_matter.F90 (code 1)
make[3]: *** [models/ersem/src/CMakeFiles/fabm_models_ersem.dir/benthic_column_dissolved_matter.F90.o] Error 1
make[2]: *** [models/ersem/src/CMakeFiles/fabm_models_ersem.dir/benthic_column_dissolved_matter.F90.o.provides] Error 2
make[1]: *** [models/ersem/src/CMakeFiles/fabm_models_ersem.dir/all] Error 2
make: *** [all] Error 2

Thank you very much for your help in advance!

Possible short berifing about FABM history and current status

Hi @jornbr and @bolding

I hope you are doing well. As a part of our effort to move toward coupling modular components and taking FABM as a good and successful example, I was wondering if you would be able to provide a briefing to our team (1520 minutes) at our next governance meeting. We are an international set of scientists/developers from agencies/academia. Please see more information here: https://github.com/oceanmodeling .

Our next meeting will be:

Ocean Modeling Collaboration Bi-monthly Meeting
Thursday, October 6 · 09:00 – 10:30 EDT
Google Meet joining info
Video call link: https://meet.google.com/eyy-zqbd-ppr
Or dial: ‪(US) +1 208-715-5331‬ PIN: ‪260 201 088‬#
More phone numbers: https://tel.meet/eyy-zqbd-ppr?pin=9418066551126

Let us know what you think.

Thanks,
@saeed-moghimi-noaa and @brey

how to use FABM+GOTM

HI guys:
I am trying to FABM+GOTM, and I followed the instruction to install FABM, After the command "make install", the instruction ends. I now gave both FABM files and GOTM files in $HOME> Both FABM and GOTM files have src folder, where should I compile, what is the command for compiling and after compiling where should I run it. Is it same with GOTM? Go to testcase folder and link it to compiler "gotm", then run it with ./gotm? I have tried many times, but totally no idea how to make it work. Please give me the basic introduction of how to using FABM+GOTM.

Sincerely
Ale

pyfabm linking problem on ubuntu

When using pyfabm, I get a runtime link error.

Installing and compiling on ubuntu 2022/04 with gfortran GNU Fortran (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 and python 3.9.7

$> cmake -B $(CWD)/build-python $(FABMDIR)/src/drivers/python
$> make -C $(CWD)/build-python -j4
$> make -C $(CWD)/build-python install

Then running (any) fabm application, .e.g. fabm_describe_model, I get

Traceback (most recent call last):
  File "~/.local/bin/fabm_describe_model", line 5, in <module>
    from pyfabm.utils.fabm_describe_model import main
  File "~/.local/lib/python3.9/site-packages/pyfabm/__init__.py", line 49, in <module>
    fabm = ctypes.CDLL(str(dllpath))
  File "/opt/miniforge/lib/python3.9/ctypes/__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: ~/.local/lib/python3.9/site-packages/pyfabm/libfabm_c.so: undefined symbol: signa_

fabm_particle

@jornbr
Hi Jorn!I m a new fabm user.I left you a message on Researchgate, I would like to ask you if there is a way to treat the plankton in the npzd model as a particle, I have tried applying fabm_particle but in the .nc file (output result) there is no difference with not applying fabm_particle. I am using the getm model.
Cheers!

Originally posted by @RuoLinCunJi in #22 (comment)

Allowing different DEFAULT_PREFIX (install directory)

Would it be possible to allow for a specified install directory, to avoid always using the default $HOME/local/fabm?
e.g., modifying src/CMakeLists.txt to check for a defined FABM_HOME?

... ~/GitHub/fabm]$ git diff src/CMakeLists.txt
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0a0a720..338466f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -160,7 +160,11 @@ if(WIN32)
     set(DEFAULT_PREFIX "$ENV{APPDATA}/fabm/${FABM_HOST}")
   endif()
 else()
-  set(DEFAULT_PREFIX "$ENV{HOME}/local/fabm/${FABM_HOST}")
+  if(DEFINED ENV{FABM_HOME})
+    set(DEFAULT_PREFIX "$ENV{FABM_HOME}")
+  else()
+    set(DEFAULT_PREFIX "$ENV{HOME}/local/fabm/${FABM_HOST}")
+  endif()
 endif()

deprecate gfortran < 5, cmake < 3.12, python < 3.7

To simplify the FABM code, we propose to drop support for older versions of gfortran, cmake and python:

  • For gfortran will will require version 5.1 and up, which was first released in 2015. This is the first gfortran version with support for allocatable character variables, which is required by the latest fortran-yaml, which in turn underpins a recent overhaul of fabm.yaml parsing.
  • For cmake we will require version 3.12 and up, which was first released in 2018. This is the first cmake version that supports calling target_link_libraries with OBJECT libraries. This will simplify our current handling of institute-specific object libraries, and also makes it easier if these introduce custom dependencies (e.g., on shared/static libraries)
  • For Python we will require 3.7 and up, which was first released in 2018. This is also the oldest version still supported by the Python community (planned end of life: 2023-06-27). By requiring 3.7 and up, we can drop support for Python 2.x, which helps simplifying parts of pyfabm.

Error: Derived type ‘type_model’ at (1) is being used before it is defined

Hi

When I compiled FVCOM-FABM-ERSEM, I find an error like this:

mod_fabm_data.f90:23:19:

TYPE (type_model), PUBLIC :: model
1
Error: Derived type ‘type_model’ at (1) is being used before it is defined
makefile:42: recipe for target 'mod_fabm_data.o' failed
make: *** [mod_fabm_data.o] Error 1

How I can solve this error from mod_fabm_data.f:

MODULE MOD_FABM_DATA
# if defined(FABM)

  USE fabm
  USE MOD_PREC
  
  IMPLICIT NONE

  PRIVATE 

  TYPE (type_model), PUBLIC :: model

  REAL(SP), ALLOCATABLE, PUBLIC, TARGET ::  FABM_ALL(:,:,:)    ! 3D FABM state variables
  REAL(SP), ALLOCATABLE, PUBLIC, TARGET ::  FABM_ALL_BT(:,:)   ! 2D FABM bottom-attached state variables
  REAL(SP), ALLOCATABLE, PUBLIC, TARGET ::  FABM_ALL_SF(:,:)   ! 2D FABM surface-attached state variables
  REAL(DP), ALLOCATABLE, PUBLIC, TARGET ::  FABM_TOTALS(:)     ! Domain integrals of conserved quantities
  CHARACTER(LEN=80), PUBLIC :: STARTUP_FABM_TYPE  ! Initialization method ("constant" for spatially homogeneous, "set values" for read from restart)
  LOGICAL, PUBLIC :: FABM_DIAG_OUT
  LOGICAL, PUBLIC, ALLOCATABLE :: DISABLE_TRANSPORT(:)
  INTEGER, PUBLIC :: IFABMadv ! value of number of variables to advect
  INTEGER, PUBLIC, ALLOCATABLE :: IFABMadv_idx(:)
  INTEGER, PUBLIC :: IFABMnest ! value of number of variables in nesting file
  INTEGER, PUBLIC, ALLOCATABLE :: IFABMnest_idx(:) ! map of nesting variables to advectable variables
#   if defined (OFFLINE_FABM)
  CHARACTER(LEN=80), PUBLIC :: OFFLINE_FABM_FILE  ! File with physics forcing for offline biogeochemistry simulation
#   endif
# endif

END MODULE

For this case, I'm using FABM-ERSEM_v43 from UK-FVCOM.
Anyone can help me how to solve this problem? Thanks.

improved support/documentation for BGC variable access from the host

Based on user feedback:

Several users would like to see improvements that make it easier and more flexible to get hold of specific biogeochemical variables for use within the physics model.

In tandem, documentation on this topic could be improved/expanded: it is not very clear how to get/couple dependency from a physical model – especially if the dependency is not on FABM’s list of standard variables.

Compile error FABM-V1.0.0

I encountered a compilation error, the previous version of FABM could be successfully complie, but the V1.0.0 encountered the following error:
ERSEM-master/src/benthic_column_dissolved_matter.F90(96): error #8486: There is no matching specific subroutine for this type bound generic subroutine c all. [REGISTER_STATE_DEPENDENCY]
call self%register_state_dependency(self%id_layer,'layer','m','depth of bottom interface of final layer', &
Does anybody know how to solve it?

compile fvcom

When I compiled fabm-ersem, I used 《uk-fvcom-FABM-ERSEM\uk-fvcom-FABM-ERSEM\FVCOM_source》 to cover the FVCOM4.3/FVCOM_source , and then "make" , the error as follow:

d_fabm_3D.F > mod_fabm_3D.f90

mpif90 -c -O3 -I/usr/local/src/fvcom43-master/FVCOM_source/libs/install/include -I/usr/local/src/fabm-0.96.0/src/build/include mod_fabm_3D.f90

mod_fabm_3D.f90(19): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [YAML_TYPES]

USE yaml_types

------^

mod_fabm_3D.f90(20): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [YAML]

USE yaml,yaml_parse=>parse,yaml_error_length=>error_length

------^

mod_fabm_3D.f90(1907): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [YAML_TYPES]

USE yaml_types

-------^

mod_fabm_3D.f90(1908): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [YAML]

USE yaml,yaml_parse=>parse,yaml_error_length=>error_length

-------^

mod_fabm_3D.f90(1913): error #6463: This is not a derived type name. [TYPE_NODE]

CLASS (type_node), POINTER :: node

----------^

mod_fabm_3D.f90(1915): error #6498: The use-name for this local-name is not defined. [YAML_ERROR_LENGTH]

CHARACTER(LEN=yaml_error_length) :: yaml_error

-----------------^

mod_fabm_3D.f90(1915): error #6223: A specification expression is invalid. [YAML_ERROR_LENGTH]

CHARACTER(LEN=yaml_error_length) :: yaml_error

-----------------^

mod_fabm_3D.f90(1916): error #6457: This derived type name has not been declared. [TYPE_ERROR]

TYPE (type_error), POINTER :: config_error

---------^

mod_fabm_3D.f90(1917): error #6457: This derived type name has not been declared. [TYPE_DICTIONARY]

CLASS (type_dictionary), POINTER :: variablemap

----------^

mod_fabm_3D.f90(1918): error #6457: This derived type name has not been declared. [TYPE_KEY_VALUE_PAIR]

TYPE (type_key_value_pair),POINTER :: pair

---------^

mod_fabm_3D.f90(20): error #6581: Unresolved rename. [YAML_PARSE]

USE yaml,yaml_parse=>parse,yaml_error_length=>error_length

-----------^

mod_fabm_3D.f90(20): error #6581: Unresolved rename. [YAML_ERROR_LENGTH]

USE yaml,yaml_parse=>parse,yaml_error_length=>error_length

-----------------------------^

mod_fabm_3D.f90(1927): error #6404: This name does not have a type, and must have an explicit type. [NODE]

node => yaml_parse(PATH,yaml_unit,yaml_error)

---^

mod_fabm_3D.f90(1927): error #6404: This name does not have a type, and must have an explicit type. [YAML_PARSE]

node => yaml_parse(PATH,yaml_unit,yaml_error)

-----------^

mod_fabm_3D.f90(1927): error #6678: When the target is an expression it must deliver a pointer result. [YAML_PARSE]

node => yaml_parse(PATH,yaml_unit,yaml_error)

-----------^

mod_fabm_3D.f90(1929): error #6106: Not a valid argument for ASSOCIATE or SELECT TYPE. [ASSOCIATED]

IF (.not.ASSOCIATED(node)) CALL FATAL_ERROR('No configuration information found in '//PATH//'.')

-----------------------^

mod_fabm_3D.f90(1938): error #8247: Selector in SELECT TYPE statements must be polymorphic value.

SELECT TYPE (node)

---^

mod_fabm_3D.f90(1939): error #6457: This derived type name has not been declared. [TYPE_DICTIONARY]

CLASS IS (type_dictionary)

-------------^

mod_fabm_3D.f90(1940): error #6404: This name does not have a type, and must have an explicit type. [VARIABLEMAP]

  variablemap => node%get_dictionary('variables',required=.false.,error=config_error)

------^

mod_fabm_3D.f90(1940): error #6460: This is not a field name that is defined in the encompassing structure. [GET_DICTIONARY]

  variablemap => node%get_dictionary('variables',required=.false.,error=config_error)

--------------------------^

mod_fabm_3D.f90(1940): error #6678: When the target is an expression it must deliver a pointer result. [NODE]

  variablemap => node%get_dictionary('variables',required=.false.,error=config_error)

---------------------^

mod_fabm_3D.f90(1941): error #6404: This name does not have a type, and must have an explicit type. [CONFIG_ERROR]

  if (associated(config_error)) CALL FATAL_ERROR(PATH//': '//TRIM(config_error%message))

---------------------^

mod_fabm_3D.f90(1941): error #6106: Not a valid argument for ASSOCIATE or SELECT TYPE. [ASSOCIATED]

  if (associated(config_error)) CALL FATAL_ERROR(PATH//': '//TRIM(config_error%message))

---------------------^

mod_fabm_3D.f90(1941): error #6460: This is not a field name that is defined in the encompassing structure. [MESSAGE]

  if (associated(config_error)) CALL FATAL_ERROR(PATH//': '//TRIM(config_error%message))

-----------------------------------------------------------------------------------^

mod_fabm_3D.f90(1941): error #6362: The data types of the argument(s) are invalid. [TRIM]

  if (associated(config_error)) CALL FATAL_ERROR(PATH//': '//TRIM(config_error%message))

----------------------------------------------------------------------^

mod_fabm_3D.f90(1942): error #6404: This name does not have a type, and must have an explicit type. [PAIR]

  pair => variablemap%first

------^

mod_fabm_3D.f90(1942): error #6460: This is not a field name that is defined in the encompassing structure. [FIRST]

  pair => variablemap%first

--------------------------^

mod_fabm_3D.f90(1942): error #6796: The variable must have the TARGET attribute or be a subobject of an object with the TARGET attribute, or it must have the POINTER attribute. [VARIABLEMAP]

  pair => variablemap%first

--------------^

mod_fabm_3D.f90(1943): error #6106: Not a valid argument for ASSOCIATE or SELECT TYPE. [ASSOCIATED]

  DO WHILE (ASSOCIATED(pair))

---------------------------^

mod_fabm_3D.f90(1944): error #6460: This is not a field name that is defined in the encompassing structure. [VALUE]

     SELECT TYPE (value=>pair%value)

----------------------------------^

mod_fabm_3D.f90(2029): catastrophic error: Too many errors, exiting

compilation aborted for mod_fabm_3D.f90 (code 1)

make: *** [mod_fabm_3D.o] 错误 1

who can help me how to solve this promblems.thanks

Typo in Wiki Text in "Developing a new biogeochemical model"

In the paragraph describing the subroutine _SET_SURFACE_EXCHANGE_(VARIABLEID,RATE) there is the sentence

RATE is the flux across the bottom interface in state variable units [...]

Probably it should read

RATE is the flux across the surface interface in state variable units [...]

Dokumentation of testcases

Please provide a meaningful Readme for the testcases. Which testcase requires which driver and which files need to be copied for which model to where.
This is partially unclear for new users of FABM, since there is no overwiev about the models.

CMake changes to configuring fabm_parameters.F90.in breaks SCHISM compatibility

I am trying to sync current FABM to work with schism. With an updated code, the built is broken:

Building Fortran object Fabm/fabm_src/CMakeFiles/fabm_base.dir/fabm_parameters.F90.o
./Fabm/fabm_src/fabm_parameters.F90:2:39:

    2 |    integer, parameter, public :: rki =
      |                                       1
Error: Expected an initialization expression at (1)
./Fabm/fabm_src/fabm_parameters.F90:3:39:

    3 |    integer, parameter, public :: rke =
      |                                       1
Error: Expected an initialization expression at (1)

Cannot open module file ‘eqstate.mod’ No such file or directory

I successfully installed fabm with host=0d, so there is ~/local/fabm/0d/ directory. But there was no /bin folder and no executable file under this directory.

I proceed to compile it with fabm-0d following this tutorial:

mkdir -p ~/build/fabm-0d && cd ~/build/fabm-0d
cmake ~/src/fabm/src/drivers/0d -DGOTM_BASE=~/src/gotm
make install

During the building process there was an error:

Scanning dependencies of target fabm0d
[ 98%] Building Fortran object CMakeFiles/fabm0d.dir/fabm0d.F90.o
~/src/fabm/src/drivers/0d/fabm0d.F90:17:8:

   17 |    use eqstate,only:rho_feistel
      |        1
Fatal Error: Cannot open module file ‘eqstate.mod’ for reading at (1): No such file or directory
compilation terminated.

Where should eqstate.mod be? During which step should it be generated?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.