Commit ff23aa60 authored by POLCHER Jan's avatar POLCHER Jan 🚴🏾
Browse files

Flinget in the model needs to have all the variables in REAL. So I needed to...

Flinget in the model needs to have all the variables in REAL. So I needed to change the two new variables added.
parent 437237e8
......@@ -259,7 +259,7 @@ class HydroGraph :
#
# Build and save a map of all the structures located on the graph
#
locations.addtonetcdf(self.nbpt, self.nbasmax, outnf, procgrid, part, ('y','x'), ('locations',))
locations.addtonetcdf(self.nbpt, self.nbasmax, outnf, procgrid, part, ('y','x'), ('locations',), vtyp)
#
# Close the file
#
......
......@@ -148,7 +148,7 @@ class Locations :
#
# Function to place all IDs of structures onto a map and remove duplicated locations
#
def addtonetcdf(self, nbpt, nbasmax, outnf, procgrid, part, spacecoord, loccoord) :
def addtonetcdf(self, nbpt, nbasmax, outnf, procgrid, part, spacecoord, loccoord, vtyp) :
#
locname = "locations"
loctitle = "Basic information of located stations or structures"
......@@ -157,9 +157,9 @@ class Locations :
montitle = "Index of HTU to be monitored in the model"
monunits = "-"
#
locmap = np.zeros((nbpt,nbasmax,self.nlmax), dtype=np.float64, order='F')
locmap = np.zeros((nbpt,nbasmax,self.nlmax), dtype=vtyp, order='F')
locmap[:,:,:] = np.nan
costmap = np.zeros((nbpt,nbasmax,self.nlmax), dtype=np.float64, order='F')
costmap = np.zeros((nbpt,nbasmax,self.nlmax), dtype=vtyp, order='F')
costmap[:,:,:] = np.nan
#
for i,lid in enumerate(self.lid) :
......@@ -217,13 +217,13 @@ class Locations :
infocoord = ('locinfo',)
outnf.createDimension(infocoord[0], 5)
# Create variable for the list of stations
locvar = outnf.createVariable(locname, 'i4', infocoord+loccoord)
locvar = outnf.createVariable(locname, vtyp, infocoord+loccoord)
locvar.title = loctitle
locvar.units = locunits
locvar.description = "ID, i-index, j-index, HTU-index, monitoring-index"
locvar[:,:] = locationlist
# Create variable for the indices of the HTU to monitor
monvar = outnf.createVariable(monname, 'i4', moncoord+spacecoord)
monvar = outnf.createVariable(monname, vtyp, moncoord+spacecoord)
monvar.title = montitle
monvar.units= monunits
monvar[:,:,:] = htumon[0:monmax,:,:]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment