permamodel / GIPL-BMI-Fortran

This is to develop a BMI for GIPL with FORTRAN.
https://permamodel.github.io/
MIT License
0 stars 2 forks source link
bmi fortran gipl

GIPL_BMI_Fortran

This is to develop a BMI for GIPL with FORTRAN. Original GIPL code is avaiable at this repository.

Test

NOTE: Currently, it is only 1D version. More works are required for the spatial version

The main changes are:

- make a new function to advance the model step-by-step
- modify "initialize" & "update" to ensure passing changes in climatic forcing, soil parameters from BMI to the mode.
- add a new interface on the original model, in order to make as few as changes
- make the BMIs
- make tests and examples
- make cmake files
- modify "filexist". Removing "stop" in order to get a correct running status
- add an option to set write out to file or not, default is not.

1. Compile with cmake

mkdir _build && cd _build
cmake .. -DCMAKE_INSTALL_PREFIX=[install_path]
make install
ctest

2. Current input variables [to be added]

Standard Name Description Unit Type
land_surface_air__temperature SURFACE TEMPERATURE FIELDS (TEMPERATURES FROM THE START TO THE END OF THE INTERVAL) deg.C Real
snowpack__depth SNOW DEPTH m Real
snow__thermal_conductivity SNOW THERMAL CONDUCTIVITY W m-1 K-1 Real
soil_water__volume_fraction Volumetric Water Content m3 m-3 Real
soil_unfrozen_water__a Soil Unfrozen Water Parameter 'a' - Real
soil_unfrozen_water__b Soil Unfrozen Water Parameter 'b' - Real

3. Current output variables [to be added]

Standard Name Description Unit Type
soil__temperature SOIL TEMPERATURE at all Nodes (including snow layers when there are snow covered) deg.C Real
model_soil_layer__count number of all nodes (including snow layers when there are snow covered) - integer

4. Comparison between GIPL-BMI outputs and GIPL outputs.

Screenshot

5. Known issues

5. Examples to use GIPL-BMI

Please see also the souce code file "GIPL/bmi_main.f90"

Here we tested

if (i .eq. 95) then ! change air temperature at the 5th time step.

    s = model%set_value('land_surface_air__temperature', [-10.0])

end if

Screenshot

if (i .eq. 100) then ! change snow depth at the 100th time step.

     s = model%set_value('snowpack__depth', [0.1])

end if

Screenshot

if (i .eq. 110) then ! change snow thermal conductivity at the 110th time step.

     s = model%set_value('snow__thermal_conductivity', [0.01])

end if

Screenshot

if (i .eq. 85) then ! change VWC in first soil layer in 'geo.txt' file.

     s = model%set_value_at_indices('soil_water__volume_fraction', [1], [0.1])

end if

Screenshot

if (i .eq. 92) then ! change UWC_a in first soil layer in 'geo.txt' file.

     s = model%set_value_at_indices('soil_unfrozen_water__a', [1], [0.1])

end if

Screenshot

if (i .eq. 92) then ! change UWC_b in first soil layer in 'geo.txt' file.

    s = model%set_value_at_indices(var_name6, [1], [-0.5])

end if

Screenshot