[pcr] Kinematic Wave Routing Error
Emmanuel Jjunju
emmanuel.jjunju at ntnu.no
Tue Dec 7 13:21:43 CET 2010
Dear all
Please find attached a screen capture my code and and the error message i am receiving. I have also posted them in this email. Can anyone out there help me?
According to the screen capture, the failure seems to occur at Q2 = kinematic(Ldd, Q1, q, ALPHA, beta, DTSEC,DX);. I am new to this so i could really use some help. Thanks in advance.
Emma
ERROR MSG:
C:\PCRaster\workspace\Ginga\Ginga.mod:48:13:ERROR: RUNTIME (at timestep 1) Internal error (code=c0000090), please report to support at pcraster.nl
CODE:
# model for simulation of runoff
# 1734 timesteps of 24 hours
binding
DTSEC=86400; # timestep (seconds==i day)
DX=1000; # cell size (meters)
beta=0.6; # kinematic wave parameter: 0.6 is for broad sheet flow
#q=0.0; # side-flow: not used
WH0=whinit.map; # initial wh.map (meters)
GRAD=slope.map; # slope map (-)
Ldd=ldd.map; # local drain direction map
N=0.100; # Manning's n
OutFlowPoint=outlet.map; # map with catchment outlets
RainStations=rainstat.map; # map with location of rainstations
RainTimeSeries=rain.tss; # timeseries with rain at rainstations
RainZones=rainzone.map; # reported stack of maps with rain
SoilInfiltrationTable=infilcap.tbl; # table with infiltr. cap. of soil types
SoilType=soil.map; # soil map
InfiltrationCapacity=infilcap.map; # reported map with infiltr. cap.
Dem=dem.map; # digital elevation map
timer
1 500 1;
initial
WH=WH0;
# coverage of meteorological stations for the whole area
RainZones=spreadzone(RainStations,0,1);
# create an infiltration capacity map (m/24 hours), based on the soil map
InfiltrationCapacity=lookupscalar(SoilInfiltrationTable,SoilType);
# generate the local drain direction map on basis of the elevation map
Ldd=lddcreate(Dem,1e31,1e31,1e31,1e31);
dynamic
# calculate and report maps with rainfall at each timestep (m/24 hours)
qin=timeinputscalar(RainTimeSeries,RainZones);
# calculate and report maps with rainfall at each timestep (m/24 hours)
# Calculate q based on infiltration (Not used)
# SurfaceWater=timeinputscalar(RainTimeSeries,RainZones);
#to m3/s
q= qin*DX*DX/(24*3600);
# ALPHA is a roughness parameter in the kinematic wave formula;
# WH is waterdepth (m), calculated using rainfall, interception and infiltration
ALPHA = (N*(DX+2*WH)**(2.0/3.0)/sqrt(GRAD))**beta ;
# Overland Flow Discharge, in m/s*m*m = m3/s
Q1 = if(ALPHA gt 0.0 , ((DX*WH)/ALPHA)**(1/beta) , 0.0);
# Ldd is the Local Drainage Direction, the flowpath
Q2 = kinematic(Ldd, Q1, q, ALPHA, beta, DTSEC,DX);
# First approximation of new WH using old ALPHA (ok for small time steps)
# WH is the flowdepth in m
WH = ALPHA*(Q2**beta)/DX;
# Extra ALPHA calculation to calculate a more precise WH
ALPHA = (N*(DX+2*WH)**(2.0/3.0)/sqrt(GRAD))**(beta);
report WH = ALPHA*(Q2**beta)/DX;
report Q2TSS=timeoutput(OutFlowPoint,Q2);
More information about the pcraster-info
mailing list