Skip to content
Snippets Groups Projects
Commit e15ab885 authored by Jérémy AUCLAIR's avatar Jérémy AUCLAIR
Browse files

Compiled samir_daily() function with numba, added various simplifications on other functions.

parent 5f2bdc5c
Branches PIRATA
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ tests.py ...@@ -3,6 +3,7 @@ tests.py
test_samir_dask.py test_samir_dask.py
test_samir.py test_samir.py
dev_samir_xarray.ipynb dev_samir_xarray.ipynb
main_run_samir_dev.py
dev_weather.ipynb dev_weather.ipynb
main_prepare_inputs_custom.py main_prepare_inputs_custom.py
config/config_modspa.json config/config_modspa.json
......
No preview for this file type
...@@ -55,7 +55,7 @@ __version__ = "2.0" ...@@ -55,7 +55,7 @@ __version__ = "2.0"
if __name__ == '__main__': if __name__ == '__main__':
print('\nImporting modules and compiling model functions') print('\nImporting modules and functions and compiling model functions, can take some time at first execution...')
import sys, os # system management import sys, os # system management
currentdir = os.path.dirname(os.path.realpath(__file__)) currentdir = os.path.dirname(os.path.realpath(__file__))
......
...@@ -13,7 +13,7 @@ Ze,1,500 ...@@ -13,7 +13,7 @@ Ze,1,500
Init_RU,0,1 Init_RU,0,1
DiffE,0,30 DiffE,0,30
DiffR,0,30 DiffR,0,30
REW,0,1000 REW,-1000,1000
minZr,0,3000 minZr,0,3000
maxZr,0,4000 maxZr,0,4000
p,0,1 p,0,1
......
...@@ -145,22 +145,22 @@ class samir_parameters: ...@@ -145,22 +145,22 @@ class samir_parameters:
if self.table.at['Fslope', class_name] == -9999: if self.table.at['Fslope', class_name] == -9999:
# Equation: Fslope = FCmax / (NDVImax - NDVIsol) # Equation: Fslope = FCmax / (NDVImax - NDVIsol)
self.table.at['Fslope', class_name] = np.round(self.table.at['FCmax', class_name] / (self.table.at['NDVImax', class_name] - self.table.at['NDVIsol', class_name]), decimals = round(np.log10(self.table.at['Fslope', 'scale_factor']))) self.table.at['Fslope', class_name] = np.round(self.table.at['FCmax', class_name] / (self.table.at['NDVImax', class_name] - self.table.at['NDVIsol', class_name]), decimals = 3)
if self.table.at['Foffset', class_name] == -9999: if self.table.at['Foffset', class_name] == -9999:
# Equation: Foffset = - NDVIsol * Fslope # Equation: Foffset = - NDVIsol * Fslope
self.table.at['Foffset', class_name] = - np.round(self.table.at['NDVIsol', class_name] * self.table.at['Fslope', class_name], decimals = round(np.log10(self.table.at['Foffset', 'scale_factor']))) self.table.at['Foffset', class_name] = - np.round(self.table.at['NDVIsol', class_name] * self.table.at['Fslope', class_name], decimals = 3)
if self.table.at['Kslope', class_name] == -9999: if self.table.at['Kslope', class_name] == -9999:
# Equation: Kslope = Kcbmax / (NDVImax - NDVIsol) # Equation: Kslope = Kcbmax / (NDVImax - NDVIsol)
self.table.at['Kslope', class_name] = np.round(self.table.at['Kcbmax', class_name] / (self.table.at['NDVImax', class_name] - self.table.at['NDVIsol', class_name]), decimals = round(np.log10(self.table.at['Kslope', 'scale_factor']))) self.table.at['Kslope', class_name] = np.round(self.table.at['Kcbmax', class_name] / (self.table.at['NDVImax', class_name] - self.table.at['NDVIsol', class_name]), decimals = 3)
if self.table.at['Koffset', class_name] == -9999: if self.table.at['Koffset', class_name] == -9999:
# Equation: Koffset = - NDVIsol * Kslope # Equation: Koffset = - NDVIsol * Kslope
self.table.at['Koffset', class_name] = - np.round(self.table.at['NDVIsol', class_name] * self.table.at['Kslope', class_name], decimals = round(np.log10(self.table.at['Koffset', 'scale_factor']))) self.table.at['Koffset', class_name] = - np.round(self.table.at['NDVIsol', class_name] * self.table.at['Kslope', class_name], decimals = 3)
if self.table.at['maxZr', class_name] > self.table.at['Zsoil', class_name]: if self.table.at['maxZr', class_name] > self.table.at['Zsoil', class_name]:
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment