MVLib - Short Writeup - Version 4.0 Example Number 15 - Building infiltration function for ChyM model |
This example contains a test for the development of a infiltration/percolation
scheme for CHyM model. The new scheme is based on sigmoid function.
The source code to produce these plots is available here and the complete script running the code is available here. |
|||||||
| ||||||||
parameter(ndat=1300) real x(ndat),y1(ndat),y2(ndat),y3(ndat) call mvsetflags('size delle linee',3.0) call mvsetflags('palette di colori',7.0) h2o=0 ; gh2o=0 do i=1,ndat if (i.lt.180) h2o=h2o+2.00 ! piove 2 millimetri all'ora xinfl=30.0 ! Il massimo che si può infiltrare perc=xinfl*0.01 ! la rate di percolazione gh2o=gh2o-perc if (gh2o.lt.0.0) gh2o=0.0 if (h2o+gh2o.lt.xinfl) then gh2o=gh2o+h2o h2o=0.0 else h2o=h2o-(xinfl-gh2o) gh2o=xinfl endif x(i)=float(i) y1(i)=h2o y2(i)=gh2o y3(i)=100*gh2o/xinfl enddo call plottavw(x,y1,ndat,'Runoff water') call plottavw(x,y2,ndat,'Ground water') call plottavw(x,y3,ndat,'Relative humdity') call displayexample('example15','CHyM Model - Old infiltration scheme',' ') h2o=0 ; gh2o=0 do i=1,ndat if (i.lt.180) h2o=h2o+2.00 ! piove 2 millimetri all'ora xinfl=30.0 ! Il massimo che si può infiltrare perc=0.3 ! la rate di percolazione gh2o=gh2o-perc if (gh2o.lt.0.0) gh2o=0.0 relh=gh2o/xinfl ! Relative Humidity actinf=h2o*(1-sigmoide(relh,0.5,0.165)) ! Actual inf. if (relh.lt.0.999) then actinf=h2o*sigmoide(1-relh,0.5,0.165) else actinf=0.0 endif h2o=h2o-actinf gh2o=gh2o+actinf x(i)=float(i) y1(i)=h2o y2(i)=gh2o y3(i)=100*gh2o/xinfl enddo call plottavw(x,y1,ndat,'Runoff water') call plottavw(x,y2,ndat,'Ground water') call plottavw(x,y3,ndat,'Relative humdity') call displayexample('example15','CHyM Model - New infiltration scheme',' ') h2o=0 ; gh2o=0 do i=1,ndat if (i.lt.180) h2o=h2o+2.00 ! piove 2 millimetri all'ora xinfl=30.0 ! Il massimo che si può infiltrare perc=0.0 ! la rate di percolazione gh2o=gh2o-perc if (gh2o.lt.0.0) gh2o=0.0 relh=gh2o/xinfl ! Relative Humidity actinf=h2o*(1-sigmoide(relh,0.5,0.165)) ! Actual inf. if (relh.lt.0.999) then actinf=h2o*sigmoide(1-relh,0.5,0.165) else actinf=0.0 endif h2o=h2o-actinf gh2o=gh2o+actinf x(i)=float(i) y1(i)=h2o y2(i)=gh2o y3(i)=100*gh2o/xinfl enddo call plottavw(x,y1,ndat,'Runoff water') call plottavw(x,y2,ndat,'Ground water') call plottavw(x,y3,ndat,'Relative humdity') call displayexample('example15','CHyM Model - New infiltration scheme','perc=0') end |