Skip to content

Commit

Permalink
Merge pull request #131 from ec-jrc/development
Browse files Browse the repository at this point in the history
Release 4.1.3
  • Loading branch information
doc78 authored Jun 22, 2023
2 parents 4d1f2ed + cf8f86b commit 7da6125
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 56 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.2
4.1.3
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ numba>=0.54.0
numexpr>=2.7.0
numpy>=1.21.0
packaging>=19.2
pandas>=0.25.1
pandas>=1
pathlib2>=2.3.5
pkginfo>=1.5.0.1
pluggy>=0.13.0
Expand Down
2 changes: 1 addition & 1 deletion src/lisflood/Lisflood_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def splitlanduse(array1, array2=None, array3=None):
ftemp1 = open(nomefile, 'w+')
nelements = len(self.ChanM3)
for i in range(0,nelements-1):
if hasattr(self,'CrossSection2Area'):
if hasattr(self,'CrossSection2Area') and not(option['InitLisflood']):
print(i, self.TotalCrossSectionArea[i], self.CrossSection2Area[i], self.ChanM3[i], \
self.Chan2M3Kin[i], file=ftemp1)
else:
Expand Down
2 changes: 1 addition & 1 deletion src/lisflood/Lisflood_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def __init__(self):
ftemp1 = open(nomefile, 'w+')
nelements = len(self.ChanM3)
for i in range(0, nelements - 1):
if hasattr(self, 'CrossSection2Area'):
if hasattr(self, 'CrossSection2Area') and not(option['InitLisflood']):
print(i, self.TotalCrossSectionArea[i], self.CrossSection2Area[i], self.ChanM3[i], self.Chan2M3Kin[i], file=ftemp1)
else:
print(i, self.TotalCrossSectionArea[i], self.ChanM3[i], file=ftemp1)
Expand Down
7 changes: 4 additions & 3 deletions src/lisflood/global_modules/add1.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ def loadsetclone(name):
# try to read a netcdf file
filename = os.path.splitext(binding[name])[0] + '.nc'
nf1 = iterOpenNetcdf(filename, "", "r")
value = listitems(nf1.variables)[-1][0] # get the last variable name
nr_rows, nr_cols = nf1.variables[value].shape # just use shape to know rows and cols...
num_dims = 3 if 'time' in nf1.variables else 2
varname = [v for v in nf1.variables if len(nf1.variables[v].dimensions) == num_dims][0]
nr_rows, nr_cols = nf1.variables[varname].shape # just use shape to know rows and cols...
if 'x' in nf1.variables:
x1 = nf1.variables['x'][0]
x2 = nf1.variables['x'][-1]
Expand All @@ -218,7 +219,7 @@ def loadsetclone(name):
cell_size = np.abs(x2 - x1)/(nr_cols - 1)
x = x1 - cell_size / 2
y = y1 + cell_size / 2
mapnp = np.array(nf1.variables[value][0:nr_rows, 0:nr_cols])
mapnp = np.array(nf1.variables[varname][0:nr_rows, 0:nr_cols])
nf1.close()
# setclone row col cellsize xupleft yupleft
setclone(nr_rows, nr_cols, cell_size, x, y)
Expand Down
54 changes: 27 additions & 27 deletions src/lisflood/global_modules/default_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,126 +897,126 @@
'TavgMapsOut': ReportedMap(name='TavgMapsOut', output_var='Tavg', unit='degree',
end=[], steps=[], all=['repTavgMaps'],
restrictoption=[], monthly=False, yearly=False),
'Theta1End': ReportedMap(name='Theta1End', output_var='Theta1a[0]', unit='mm',
'Theta1End': ReportedMap(name='Theta1End', output_var='Theta1a[0]', unit='',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False, yearly=False),
'Theta1ForestEnd': ReportedMap(name='Theta1ForestEnd', output_var='Theta1a[1]',
unit='mm', end=['repEndMaps'], steps=[],
unit='', end=['repEndMaps'], steps=[],
all=[], restrictoption=[],
monthly=False, yearly=False),
'Theta1ForestMaps': ReportedMap(name='Theta1ForestMaps', output_var='Theta1a[1]',
unit='mm', end=[], steps=[],
unit='', end=[], steps=[],
all=['repThetaForestMaps','repThetaMaps'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta1ForestState': ReportedMap(name='Theta1ForestState',
output_var='Theta1a[1]', unit='mm', end=[],
output_var='Theta1a[1]', unit='', end=[],
steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta1IrrigationEnd': ReportedMap(name='Theta1IrrigationEnd',
output_var='Theta1a[2]', unit='mm',
output_var='Theta1a[2]', unit='',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False,
yearly=False),
'Theta1IrrigationMaps': ReportedMap(name='Theta1IrrigationMaps',
output_var='Theta1a[2]', unit='mm',
output_var='Theta1a[2]', unit='',
end=[], steps=[],
all=['repThetaIrrigationMaps','repThetaMaps'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta1IrrigationState': ReportedMap(name='Theta1IrrigationState',
output_var='Theta1a[2]', unit='mm',
output_var='Theta1a[2]', unit='',
end=[], steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta1Maps': ReportedMap(name='Theta1Maps', output_var='Theta1a[0]', unit='mm',
'Theta1Maps': ReportedMap(name='Theta1Maps', output_var='Theta1a[0]', unit='',
end=[], steps=[], all=['repThetaMaps','repE2O2'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta1State': ReportedMap(name='Theta1State', output_var='Theta1a[0]',
unit='mm', end=[], steps=['repStateMaps'],
unit='', end=[], steps=['repStateMaps'],
all=[], restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta2End': ReportedMap(name='Theta2End', output_var='Theta1b[0]', unit='mm',
'Theta2End': ReportedMap(name='Theta2End', output_var='Theta1b[0]', unit='',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False, yearly=False),
'Theta2ForestEnd': ReportedMap(name='Theta2ForestEnd', output_var='Theta1b[1]',
unit='mm', end=['repEndMaps'], steps=[],
unit='', end=['repEndMaps'], steps=[],
all=[], restrictoption=[],
monthly=False, yearly=False),
'Theta2ForestMaps': ReportedMap(name='Theta2ForestMaps', output_var='Theta1b[1]',
unit='mm', end=[], steps=[],
unit='', end=[], steps=[],
all=['repThetaForestMaps','repThetaMaps'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta2ForestState': ReportedMap(name='Theta2ForestState',
output_var='Theta1b[1]', unit='mm', end=[],
output_var='Theta1b[1]', unit='', end=[],
steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta2IrrigationEnd': ReportedMap(name='Theta2IrrigationEnd',
output_var='Theta1b[2]', unit='mm',
output_var='Theta1b[2]', unit='',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False,
yearly=False),
'Theta2IrrigationMaps': ReportedMap(name='Theta2IrrigationMaps',
output_var='Theta1b[2]', unit='mm',
output_var='Theta1b[2]', unit='',
end=[], steps=[],
all=['repThetaIrrigationMaps','repThetaMaps'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta2IrrigationState': ReportedMap(name='Theta2IrrigationState',
output_var='Theta1b[2]', unit='mm',
output_var='Theta1b[2]', unit='',
end=[], steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta2Maps': ReportedMap(name='Theta2Maps', output_var='Theta1b[0]', unit='mm',
'Theta2Maps': ReportedMap(name='Theta2Maps', output_var='Theta1b[0]', unit='',
end=[], steps=[], all=['repThetaMaps','repE2O2'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta2State': ReportedMap(name='Theta2State', output_var='Theta1b[0]',
unit='mm', end=[], steps=['repStateMaps'],
unit='', end=[], steps=['repStateMaps'],
all=[], restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta3End': ReportedMap(name='Theta3End', output_var='Theta2[0]', unit='mm',
'Theta3End': ReportedMap(name='Theta3End', output_var='Theta2[0]', unit='',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False, yearly=False),
'Theta3ForestEnd': ReportedMap(name='Theta3ForestEnd', output_var='Theta2[1]',
unit='mm', end=['repEndMaps'], steps=[],
unit='', end=['repEndMaps'], steps=[],
all=[], restrictoption=[],
monthly=False, yearly=False),
'Theta3ForestMaps': ReportedMap(name='Theta3ForestMaps', output_var='Theta2[1]',
unit='mm', end=[], steps=[],
unit='', end=[], steps=[],
all=['repThetaForestMaps','repThetaMaps'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta3ForestState': ReportedMap(name='Theta3ForestState',
output_var='Theta2[1]', unit='mm', end=[],
output_var='Theta2[1]', unit='', end=[],
steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta3IrrigationEnd': ReportedMap(name='Theta3IrrigationEnd',
output_var='Theta2[2]', unit='mm',
output_var='Theta2[2]', unit='',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False,
yearly=False),
'Theta3IrrigationMaps': ReportedMap(name='Theta3IrrigationMaps',
output_var='Theta2[2]', unit='mm', end=[],
output_var='Theta2[2]', unit='', end=[],
steps=[], all=['repThetaIrrigationMaps','repThetaMaps'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta3IrrigationState': ReportedMap(name='Theta3IrrigationState',
output_var='Theta2[2]', unit='mm',
output_var='Theta2[2]', unit='',
end=[], steps=['repStateMaps'], all=[],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta3Maps': ReportedMap(name='Theta3Maps', output_var='Theta2[0]', unit='mm',
'Theta3Maps': ReportedMap(name='Theta3Maps', output_var='Theta2[0]', unit='',
end=[], steps=[], all=['repThetaMaps','repE2O2'],
restrictoption=['nonInit'], monthly=False,
yearly=False),
'Theta3State': ReportedMap(name='Theta3State', output_var='Theta2[0]',
unit='mm', end=[], steps=['repStateMaps'],
unit='', end=[], steps=['repStateMaps'],
all=[], restrictoption=['nonInit'], monthly=False,
yearly=False),
'TotalAbsGroundwater': ReportedMap(name='TotalAbsGroundwater',
Expand Down
Loading

0 comments on commit 7da6125

Please sign in to comment.