The current version of the block Utilities.NcDataReader2.NcDataReader sets the value of the parameters constantVariable[:] to zero. These are the different constant values of the .nc readed file, such as latitude or longitude.
@ainderfurth and I guess that the line of code = fill(0.0,size(varNameConstant,1)) was added intending to deal with those cases were the values for latitude or any oher constant needed by the WeatherDataNetcdfmodel are not defined in the .nc file.
A possible correction is:
parameter Real constantVariable[size(varNameConstant,1)](start={ncEasyGetAttributeDouble(fileName,"",varNameConstant[j]) for j in 1:size(varNameConstant, 1)}) = {ncEasyGetAttributeDouble(fileName,"",varNameConstant[j]) for j in 1:size(varNameConstant, 1)};
The problem which was intended to avoid might happen again... In case the varNameConstant[j] is not found in the .nc file an error will occur with the following message:
ERROR | -43 | netcdf | NetCDF: Attribute not found
Up to now I did not find a way to check the file before the function is called... I think it might be enough to properly document the model, explaining what to check when this error occurs.
@nytschgeusen
Do I prepare a pull request with the suggested changes?
should I look depeer into it? or it is enough to document the error?
Edited 18.11.2015
Start value ( start={ncEasyGetAttributeDouble(fi.... ) not needed
The current version of the block
Utilities.NcDataReader2.NcDataReader
sets the value of the parametersconstantVariable[:]
to zero. These are the different constant values of the.nc
readed file, such aslatitude
orlongitude
.@ainderfurth and I guess that the line of code
= fill(0.0,size(varNameConstant,1))
was added intending to deal with those cases were the values forlatitude
or any oher constant needed by theWeatherDataNetcdf
model are not defined in the.nc
file.A possible correction is:
The problem which was intended to avoid might happen again... In case the
varNameConstant[j]
is not found in the.nc
file an error will occur with the following message:Up to now I did not find a way to check the file before the function is called... I think it might be enough to properly document the model, explaining what to check when this error occurs.
@nytschgeusen Do I prepare a pull request with the suggested changes? should I look depeer into it? or it is enough to document the error?
Start value (
start={ncEasyGetAttributeDouble(fi....
) not needed