Model {
  Name			  "Tutorial_Example"
  Version		  5.0
  SaveDefaultBlockParams  on
  SampleTimeColors	  off
  LibraryLinkDisplay	  "none"
  WideLines		  off
  ShowLineDimensions	  off
  ShowPortDataTypes	  off
  ShowLoopsOnError	  on
  IgnoreBidirectionalLines off
  ShowStorageClass	  off
  ExecutionOrder	  off
  RecordCoverage	  off
  CovPath		  "/"
  CovSaveName		  "covdata"
  CovMetricSettings	  "dw"
  CovNameIncrementing	  off
  CovHtmlReporting	  on
  covSaveCumulativeToWorkspaceVar on
  CovSaveSingleToWorkspaceVar on
  CovCumulativeVarName	  "covCumulativeData"
  CovCumulativeReport	  off
  DataTypeOverride	  "UseLocalSettings"
  MinMaxOverflowLogging	  "UseLocalSettings"
  MinMaxOverflowArchiveMode "Overwrite"
  BlockNameDataTip	  off
  BlockParametersDataTip  off
  BlockDescriptionStringDataTip	off
  ToolBar		  on
  StatusBar		  on
  BrowserShowLibraryLinks off
  BrowserLookUnderMasks	  off
  Created		  "Thu May 12 16:08:22 2005"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "c81523"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Tue Jun 14 12:50:28 2005"
  ModelVersionFormat	  "1.%<AutoIncrement:44>"
  ConfigurationManager	  "None"
  SimParamPage		  "Solver"
  LinearizationMsg	  "none"
  Profile		  off
  ParamWorkspaceSource	  "MATLABWorkspace"
  AccelSystemTargetFile	  "accel.tlc"
  AccelTemplateMakefile	  "accel_default_tmf"
  AccelMakeCommand	  "make_rtw"
  TryForcingSFcnDF	  off
  ExtModeMexFile	  "ext_comm"
  ExtModeBatchMode	  off
  ExtModeTrigType	  "manual"
  ExtModeTrigMode	  "normal"
  ExtModeTrigPort	  "1"
  ExtModeTrigElement	  "any"
  ExtModeTrigDuration	  1000
  ExtModeTrigHoldOff	  0
  ExtModeTrigDelay	  0
  ExtModeTrigDirection	  "rising"
  ExtModeTrigLevel	  0
  ExtModeArchiveMode	  "off"
  ExtModeAutoIncOneShot	  off
  ExtModeIncDirWhenArm	  off
  ExtModeAddSuffixToVar	  off
  ExtModeWriteAllDataToWs off
  ExtModeArmWhenConnect	  on
  ExtModeSkipDownloadWhenConnect off
  ExtModeLogAll		  on
  ExtModeAutoUpdateStatusClock on
  BufferReuse		  on
  RTWExpressionDepthLimit 5
  SimulationMode	  "normal"
  Solver		  "FixedStepDiscrete"
  SolverMode		  "Auto"
  StartTime		  "0"
  StopTime		  "5356800"
  MaxOrder		  5
  MaxStep		  "auto"
  MinStep		  "auto"
  MaxNumMinSteps	  "-1"
  InitialStep		  "auto"
  FixedStep		  "300"
  RelTol		  "1e-3"
  AbsTol		  "auto"
  OutputOption		  "RefineOutputTimes"
  OutputTimes		  "[]"
  Refine		  "1"
  LoadExternalInput	  off
  ExternalInput		  "[t, u]"
  LoadInitialState	  off
  InitialState		  "xInitial"
  SaveTime		  on
  TimeSaveName		  "cd_time"
  SaveState		  off
  StateSaveName		  "xout"
  SaveOutput		  on
  OutputSaveName	  "yout"
  SaveFinalState	  off
  FinalStateName	  "xFinal"
  SaveFormat		  "Array"
  Decimation		  "1"
  LimitDataPoints	  off
  MaxDataPoints		  "1000"
  SignalLoggingName	  "sigsOut"
  ConsistencyChecking	  "none"
  ArrayBoundsChecking	  "none"
  AlgebraicLoopMsg	  "warning"
  BlockPriorityViolationMsg "warning"
  MinStepSizeMsg	  "warning"
  InheritedTsInSrcMsg	  "warning"
  DiscreteInheritContinuousMsg "warning"
  MultiTaskRateTransMsg	  "error"
  SingleTaskRateTransMsg  "none"
  CheckForMatrixSingularity "none"
  IntegerOverflowMsg	  "warning"
  Int32ToFloatConvMsg	  "warning"
  ParameterDowncastMsg	  "error"
  ParameterOverflowMsg	  "error"
  ParameterPrecisionLossMsg "warning"
  UnderSpecifiedDataTypeMsg "none"
  UnnecessaryDatatypeConvMsg "none"
  VectorMatrixConversionMsg "none"
  InvalidFcnCallConnMsg	  "error"
  SignalLabelMismatchMsg  "none"
  UnconnectedInputMsg	  "warning"
  UnconnectedOutputMsg	  "warning"
  UnconnectedLineMsg	  "warning"
  SfunCompatibilityCheckMsg "none"
  RTWInlineParameters	  off
  BlockReductionOpt	  on
  BooleanDataType	  on
  ConditionallyExecuteInputs on
  ParameterPooling	  on
  OptimizeBlockIOStorage  on
  ZeroCross		  on
  AssertionControl	  "UseLocalSettings"
  ProdHWDeviceType	  "Microprocessor"
  ProdHWWordLengths	  "8,16,32,32"
  RTWSystemTargetFile	  "grt.tlc"
  RTWTemplateMakefile	  "grt_default_tmf"
  RTWMakeCommand	  "make_rtw"
  RTWGenerateCodeOnly	  off
  RTWRetainRTWFile	  off
  TLCProfiler		  off
  TLCDebug		  off
  TLCCoverage		  off
  TLCAssertion		  off
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  BlockParameterDefaults {
    Block {
      BlockType		      Constant
      Value		      "1"
      VectorParams1D	      on
      ShowAdditionalParam     off
      OutDataTypeMode	      "Inherit from 'Constant value'"
      OutDataType	      "sfix(16)"
      ConRadixGroup	      "Use specified scaling"
      OutScaling	      "2^0"
    }
    Block {
      BlockType		      Demux
      Outputs		      "4"
      DisplayOption	      "none"
      BusSelectionMode	      off
    }
    Block {
      BlockType		      From
    }
    Block {
      BlockType		      Goto
    }
    Block {
      BlockType		      Inport
      Port		      "1"
      PortDimensions	      "-1"
      SampleTime	      "-1"
      ShowAdditionalParam     off
      LatchInput	      off
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      Interpolate	      on
    }
    Block {
      BlockType		      Mux
      Inputs		      "4"
      DisplayOption	      "none"
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      OutputWhenDisabled      "held"
      InitialOutput	      "[]"
    }
    Block {
      BlockType		      "S-Function"
      FunctionName	      "system"
      PortCounts	      "[]"
      SFunctionModules	      "''"
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      on
      Permissions	      "ReadWrite"
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      SimViewingDevice	      off
      DataTypeOverride	      "UseLocalSettings"
      MinMaxOverflowLogging   "UseLocalSettings"
    }
    Block {
      BlockType		      ToWorkspace
      VariableName	      "simulink_output"
      MaxDataPoints	      "1000"
      Decimation	      "1"
      SampleTime	      "0"
    }
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
    VerticalAlignment	    "middle"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  LineDefaults {
    FontName		    "Helvetica"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "Tutorial_Example"
    Location		    [314, 74, 1174, 669]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "usletter"
    PaperUnits		    "inches"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      SubSystem
      Name		      " Catchment 1"
      Ports		      [2, 1]
      Position		      [220, 209, 335, 271]
      BackgroundColor	      "darkGreen"
      TreatAsAtomicUnit	      off
      MaskType		      "Catchment CSS - Type A"
      MaskDescription	      "Simple model of an urban catchment with Combine"
"d sewer system (CSS). \nInput ( r ) is a continuous stream of rain data in [m"
"m/DT]. Input (dwf) is the dry weather flow in [m3/s]. \n\nPollutants concentr"
"ations are considered as constant over time.\nThe block contains an initial l"
"oss model for runoff generation, a time-area model for overland flow computat"
"ion and a mixing model for computing runoff concentrations for n components. "
" "
      MaskPromptString	      "Area in [ha]|Runoff coefficient (0 - 1)|Initial"
" Loss in [mm]|Permanent loss in [mm/day]|No of Timesteps (transport time) / N"
"o of subareas n [-]|No of pollutant components|Vector of Rain-Conc. [g/m3]|Ve"
"ctor of DWF-Conc. [g/m3]"
      MaskStyleString	      "edit,edit,edit,edit,edit,edit,edit,edit"
      MaskTunableValueString  "on,on,on,on,on,on,on,on"
      MaskCallbackString      "|||||||"
      MaskEnableString	      "on,on,on,on,on,on,on,on"
      MaskVisibilityString    "on,on,on,on,on,on,on,on"
      MaskToolTipString	      "on,on,on,on,on,on,on,on"
      MaskVarAliasString      ",,,,,,,"
      MaskVariables	      "area=@1;rfcoeff=@2;initloss=@3;permloss=@4;n_ta"
"=@5;n_comp=@6;Rain_C=@7;DWF_C=@8;"
      MaskInitialization      "% location of catchment drawing\nx=0;\ny=-10;\n"
"% reading the toplevel systems' name \n% --> Plant file name;\ntls=bdroot(gcb"
"); \n% Obtaining the fixed sampling time\nt_samp_char=get_param(tls, 'FixedSt"
"ep');\n% Convertion to numeric value\ntstep = str2num(t_samp_char); \n\n%conv"
"ertion form mm/day --> mm/DT\npermloss=permloss/86400*tstep;\n\narea=area.*10"
"000;"
      MaskDisplay	      "plot(0,0,100,100,\n[17 20 25 30 40 50 55 60 70 "
"75 80]+x,\n[60 40 38 35 32 32 32 35 38 45 60]+y,\n[17 20 25 30 40 50 55 60 70"
" 75 80]+x,\n[60 80 82 85 88 88 88 85 82 75 60]+y);\n\nplot(\n[20 80]+x,\n[60 "
"60]+y);\n\nplot([20 30]+x,[80 60]+y,[25 35]+x,[40 60]+y);\nplot([30 40]+x,[75"
" 60]+y,[35 45]+x,[35 60]+y);\nplot([45 60]+x,[75 60]+y,[45 60]+x,[40 60]+y);"
"\n\nport_label('input',1,'r');\nport_label('input',2,'dwf');\nport_label('out"
"put',1,'Qe');\n\ntext(50,90,'CATCHMENT CSS','HorizontalAlignment','center');"
"\ntext(50,10,'Typ A','HorizontalAlignment','center');\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "200|1|1|2|5|3|[5.7 0.65 3]|[44.80 13.89 18.00]"
      System {
	Name			" Catchment 1"
	Location		[220, 457, 1208, 907]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "Rain (mm/dt)"
	  Position		  [20, 43, 50, 57]
	}
	Block {
	  BlockType		  Inport
	  Name			  "DWF(m3/s)"
	  Position		  [20, 148, 50, 162]
	  Port			  "2"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux1"
	  Ports			  [2, 1]
	  Position		  [710, 81, 715, 119]
	  ShowName		  off
	  Inputs		  "[n_comp+1,n_comp+1]"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function"
	  Ports			  [1, 1]
	  Position		  [70, 31, 240, 69]
	  FunctionName		  "CD1_sfun_catchment_lossmodel"
	  Parameters		  "initloss,permloss,rfcoeff"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function1"
	  Ports			  [1, 1]
	  Position		  [260, 31, 410, 69]
	  FunctionName		  "CD1_sfun_catchment_tamodel"
	  Parameters		  "n_ta"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function2"
	  Ports			  [1, 1]
	  Position		  [450, 30, 655, 70]
	  FunctionName		  "CD1_sfun_catchment_flowmodel_SW"
	  Parameters		  "area,n_comp,Rain_C,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function3"
	  Ports			  [1, 1]
	  Position		  [755, 84, 865, 116]
	  FunctionName		  "CD1_sfun_mixing_QC"
	  Parameters		  "n_comp,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function4"
	  Ports			  [1, 1]
	  Position		  [450, 135, 655, 175]
	  FunctionName		  "CD1_sfun_catchment_flowmodel_DWF"
	  Parameters		  "n_comp,DWF_C,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "SEWER TL Model1"
	  Ports			  [1, 1]
	  Position		  [255, 139, 405, 171]
	  FunctionName		  "CD1_sfun_sewer_tlmodel"
	  Parameters		  "n_ta,0,tstep"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Runoff vector Q,C"
	  Position		  [910, 93, 940, 107]
	}
	Line {
	  SrcBlock		  "S-Function4"
	  SrcPort		  1
	  Points		  [15, 0; 0, -45]
	  DstBlock		  "Mux1"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "S-Function2"
	  SrcPort		  1
	  Points		  [15, 0; 0, 40]
	  DstBlock		  "Mux1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "SEWER TL Model1"
	  SrcPort		  1
	  DstBlock		  "S-Function4"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function1"
	  SrcPort		  1
	  DstBlock		  "S-Function2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function3"
	  SrcPort		  1
	  DstBlock		  "Runoff vector Q,C"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux1"
	  SrcPort		  1
	  DstBlock		  "S-Function3"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "DWF(m3/s)"
	  SrcPort		  1
	  DstBlock		  "SEWER TL Model1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Rain (mm/dt)"
	  SrcPort		  1
	  DstBlock		  "S-Function"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function"
	  SrcPort		  1
	  DstBlock		  "S-Function1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      " Catchment 2"
      Ports		      [3, 1]
      Position		      [530, 215, 645, 275]
      BackgroundColor	      "darkGreen"
      TreatAsAtomicUnit	      off
      MaskType		      "Catchment CSS - Type B"
      MaskDescription	      "Simple model of an urban catchment. \nInput ( r"
" ) is a continuous stream of rain data in [mm/DT]. Input (DWF) is the dry wea"
"ther flow. Input (QP) is the parasite water flow entering.\n\nPollutants conc"
"entrations for rain are considered constant over time. The block contains an "
"initial loss model for runoff generation, a time/area model for overland flow"
" computation and a mixing model for computing runoff concentrations for n com"
"ponents.  "
      MaskPromptString	      "Area in [ha]|Runoff coefficient (0 - 1)|Initial"
" Loss in [mm]|Permanent loss in [mm/day]|No of Timesteps (transport time) / N"
"o of subareas n [-]|No of pollutant components|Vector of Rain-Conc. [g/m3]"
      MaskStyleString	      "edit,edit,edit,edit,edit,edit,edit"
      MaskTunableValueString  "on,on,on,on,on,on,on"
      MaskCallbackString      "||||||"
      MaskEnableString	      "on,on,on,on,on,on,on"
      MaskVisibilityString    "on,on,on,on,on,on,on"
      MaskToolTipString	      "on,on,on,on,on,on,on"
      MaskVarAliasString      ",,,,,,"
      MaskVariables	      "area=@1;rfcoeff=@2;initloss=@3;permloss=@4;n_ta"
"=@5;n_comp=@6;Rain_C=@7;"
      MaskInitialization      "% location of catchment drawing\nx=0;\ny=-10;\n"
"% reading the toplevel systems' name \n% --> Plant file name;\ntls=bdroot(gcb"
"); \n% Obtaining the fixed sampling time\nt_samp_char=get_param(tls, 'FixedSt"
"ep');\n% Convertion to numeric value\ntstep = str2num(t_samp_char); \n\n%conv"
"ertion form mm/day --> mm/DT\npermloss=permloss/86400*tstep;\n\narea=area.*10"
"000;"
      MaskDisplay	      "plot(0,0,100,100,\n[17 20 25 30 40 50 55 60 70 "
"75 80]+x,\n[60 40 38 35 32 32 32 35 38 45 60]+y,\n[17 20 25 30 40 50 55 60 70"
" 75 80]+x,\n[60 80 82 85 88 88 88 85 82 75 60]+y);\n\nplot(\n[20 80]+x,\n[60 "
"60]+y);\n\nplot([20 30]+x,[80 60]+y,[25 35]+x,[40 60]+y);\nplot([30 40]+x,[75"
" 60]+y,[35 45]+x,[35 60]+y);\nplot([45 60]+x,[75 60]+y,[45 60]+x,[40 60]+y);"
"\n\nport_label('input',1,'r');\nport_label('input',2,'DWF');\nport_label('inp"
"ut',3,'QP');\nport_label('output',1,'Qe');\n\ntext(50,90,'CATCHMENT CSS','Hor"
"izontalAlignment','center');\ntext(50,10,'Typ B','HorizontalAlignment','cente"
"r');\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "200|1|1|2|5|3|[5.7 0.65 3]"
      System {
	Name			" Catchment 2"
	Location		[211, 429, 1245, 1089]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "Rain (mm/dt)"
	  Position		  [20, 88, 50, 102]
	}
	Block {
	  BlockType		  Inport
	  Name			  "DWF(m3/s)"
	  Position		  [20, 178, 50, 192]
	  Port			  "2"
	}
	Block {
	  BlockType		  Inport
	  Name			  "QP"
	  Position		  [15, 273, 45, 287]
	  Port			  "3"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux1"
	  Ports			  [2, 1]
	  Position		  [715, 131, 720, 169]
	  ShowName		  off
	  Inputs		  "[n_comp+1,n_comp+1]"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux2"
	  Ports			  [2, 1]
	  Position		  [185, 196, 190, 234]
	  ShowName		  off
	  Inputs		  "[n_comp+1,n_comp+1]"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function"
	  Ports			  [1, 1]
	  Position		  [70, 76, 240, 114]
	  FunctionName		  "CD1_sfun_catchment_lossmodel"
	  Parameters		  "initloss,permloss,rfcoeff"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function1"
	  Ports			  [1, 1]
	  Position		  [260, 76, 410, 114]
	  FunctionName		  "CD1_sfun_catchment_tamodel"
	  Parameters		  "n_ta"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function2"
	  Ports			  [1, 1]
	  Position		  [230, 199, 340, 231]
	  FunctionName		  "CD1_sfun_mixing_QC"
	  Parameters		  "n_comp,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function3"
	  Ports			  [1, 1]
	  Position		  [455, 80, 660, 120]
	  FunctionName		  "CD1_sfun_catchment_flowmodel_SW"
	  Parameters		  "area,n_comp,Rain_C,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function4"
	  Ports			  [1, 1]
	  Position		  [760, 134, 870, 166]
	  FunctionName		  "CD1_sfun_mixing_QC"
	  Parameters		  "n_comp,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "SEWER TL Model1"
	  Ports			  [1, 1]
	  Position		  [460, 199, 610, 231]
	  FunctionName		  "CD1_sfun_sewer_tlmodel"
	  Parameters		  "n_ta,n_comp,tstep"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Runoff vector Q,C"
	  Position		  [915, 143, 945, 157]
	}
	Line {
	  SrcBlock		  "S-Function"
	  SrcPort		  1
	  DstBlock		  "S-Function1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Rain (mm/dt)"
	  SrcPort		  1
	  DstBlock		  "S-Function"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux1"
	  SrcPort		  1
	  DstBlock		  "S-Function4"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function4"
	  SrcPort		  1
	  DstBlock		  "Runoff vector Q,C"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function3"
	  SrcPort		  1
	  Points		  [15, 0; 0, 40]
	  DstBlock		  "Mux1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function1"
	  SrcPort		  1
	  Points		  [10, 0; 0, 5]
	  DstBlock		  "S-Function3"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux2"
	  SrcPort		  1
	  DstBlock		  "S-Function2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function2"
	  SrcPort		  1
	  DstBlock		  "SEWER TL Model1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "DWF(m3/s)"
	  SrcPort		  1
	  Points		  [55, 0; 0, 20]
	  DstBlock		  "Mux2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "QP"
	  SrcPort		  1
	  Points		  [60, 0; 0, -55]
	  DstBlock		  "Mux2"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "SEWER TL Model1"
	  SrcPort		  1
	  Points		  [40, 0; 0, -55]
	  DstBlock		  "Mux1"
	  DstPort		  2
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      " Catchment 3"
      Ports		      [3, 1]
      Position		      [185, 385, 300, 445]
      BackgroundColor	      "darkGreen"
      TreatAsAtomicUnit	      off
      MaskType		      "Catchment CSS - Type B"
      MaskDescription	      "Simple model of an urban catchment. \nInput ( r"
" ) is a continuous stream of rain data in [mm/DT]. Input (DWF) is the dry wea"
"ther flow. Input (QP) is the parasite water flow entering.\n\nPollutants conc"
"entrations for rain are considered constant over time. The block contains an "
"initial loss model for runoff generation, a time/area model for overland flow"
" computation and a mixing model for computing runoff concentrations for n com"
"ponents.  "
      MaskPromptString	      "Area in [ha]|Runoff coefficient (0 - 1)|Initial"
" Loss in [mm]|Permanent loss in [mm/day]|No of Timesteps (transport time) / N"
"o of subareas n [-]|No of pollutant components|Vector of Rain-Conc. [g/m3]"
      MaskStyleString	      "edit,edit,edit,edit,edit,edit,edit"
      MaskTunableValueString  "on,on,on,on,on,on,on"
      MaskCallbackString      "||||||"
      MaskEnableString	      "on,on,on,on,on,on,on"
      MaskVisibilityString    "on,on,on,on,on,on,on"
      MaskToolTipString	      "on,on,on,on,on,on,on"
      MaskVarAliasString      ",,,,,,"
      MaskVariables	      "area=@1;rfcoeff=@2;initloss=@3;permloss=@4;n_ta"
"=@5;n_comp=@6;Rain_C=@7;"
      MaskInitialization      "% location of catchment drawing\nx=0;\ny=-10;\n"
"% reading the toplevel systems' name \n% --> Plant file name;\ntls=bdroot(gcb"
"); \n% Obtaining the fixed sampling time\nt_samp_char=get_param(tls, 'FixedSt"
"ep');\n% Convertion to numeric value\ntstep = str2num(t_samp_char); \n\n%conv"
"ertion form mm/day --> mm/DT\npermloss=permloss/86400*tstep;\n\narea=area.*10"
"000;"
      MaskDisplay	      "plot(0,0,100,100,\n[17 20 25 30 40 50 55 60 70 "
"75 80]+x,\n[60 40 38 35 32 32 32 35 38 45 60]+y,\n[17 20 25 30 40 50 55 60 70"
" 75 80]+x,\n[60 80 82 85 88 88 88 85 82 75 60]+y);\n\nplot(\n[20 80]+x,\n[60 "
"60]+y);\n\nplot([20 30]+x,[80 60]+y,[25 35]+x,[40 60]+y);\nplot([30 40]+x,[75"
" 60]+y,[35 45]+x,[35 60]+y);\nplot([45 60]+x,[75 60]+y,[45 60]+x,[40 60]+y);"
"\n\nport_label('input',1,'r');\nport_label('input',2,'DWF');\nport_label('inp"
"ut',3,'QP');\nport_label('output',1,'Qe');\n\ntext(50,90,'CATCHMENT CSS','Hor"
"izontalAlignment','center');\ntext(50,10,'Typ B','HorizontalAlignment','cente"
"r');\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "200|1|1|2|5|3|[5.7 0.65 3]"
      System {
	Name			" Catchment 3"
	Location		[211, 429, 1245, 1089]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "Rain (mm/dt)"
	  Position		  [20, 88, 50, 102]
	}
	Block {
	  BlockType		  Inport
	  Name			  "DWF(m3/s)"
	  Position		  [20, 178, 50, 192]
	  Port			  "2"
	}
	Block {
	  BlockType		  Inport
	  Name			  "QP"
	  Position		  [15, 273, 45, 287]
	  Port			  "3"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux1"
	  Ports			  [2, 1]
	  Position		  [715, 131, 720, 169]
	  ShowName		  off
	  Inputs		  "[n_comp+1,n_comp+1]"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux2"
	  Ports			  [2, 1]
	  Position		  [185, 196, 190, 234]
	  ShowName		  off
	  Inputs		  "[n_comp+1,n_comp+1]"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function"
	  Ports			  [1, 1]
	  Position		  [70, 76, 240, 114]
	  FunctionName		  "CD1_sfun_catchment_lossmodel"
	  Parameters		  "initloss,permloss,rfcoeff"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function1"
	  Ports			  [1, 1]
	  Position		  [260, 76, 410, 114]
	  FunctionName		  "CD1_sfun_catchment_tamodel"
	  Parameters		  "n_ta"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function2"
	  Ports			  [1, 1]
	  Position		  [230, 199, 340, 231]
	  FunctionName		  "CD1_sfun_mixing_QC"
	  Parameters		  "n_comp,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function3"
	  Ports			  [1, 1]
	  Position		  [455, 80, 660, 120]
	  FunctionName		  "CD1_sfun_catchment_flowmodel_SW"
	  Parameters		  "area,n_comp,Rain_C,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function4"
	  Ports			  [1, 1]
	  Position		  [760, 134, 870, 166]
	  FunctionName		  "CD1_sfun_mixing_QC"
	  Parameters		  "n_comp,tstep"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "SEWER TL Model1"
	  Ports			  [1, 1]
	  Position		  [460, 199, 610, 231]
	  FunctionName		  "CD1_sfun_sewer_tlmodel"
	  Parameters		  "n_ta,n_comp,tstep"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Runoff vector Q,C"
	  Position		  [915, 143, 945, 157]
	}
	Line {
	  SrcBlock		  "S-Function"
	  SrcPort		  1
	  DstBlock		  "S-Function1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Rain (mm/dt)"
	  SrcPort		  1
	  DstBlock		  "S-Function"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux1"
	  SrcPort		  1
	  DstBlock		  "S-Function4"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function4"
	  SrcPort		  1
	  DstBlock		  "Runoff vector Q,C"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function3"
	  SrcPort		  1
	  Points		  [15, 0; 0, 40]
	  DstBlock		  "Mux1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function1"
	  SrcPort		  1
	  Points		  [10, 0; 0, 5]
	  DstBlock		  "S-Function3"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux2"
	  SrcPort		  1
	  DstBlock		  "S-Function2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function2"
	  SrcPort		  1
	  DstBlock		  "SEWER TL Model1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "DWF(m3/s)"
	  SrcPort		  1
	  Points		  [55, 0; 0, 20]
	  DstBlock		  "Mux2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "QP"
	  SrcPort		  1
	  Points		  [60, 0; 0, -55]
	  DstBlock		  "Mux2"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "SEWER TL Model1"
	  SrcPort		  1
	  Points		  [40, 0; 0, -55]
	  DstBlock		  "Mux1"
	  DstPort		  2
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "CD Parameters"
      Ports		      []
      Position		      [75, 50, 309, 97]
      BackgroundColor	      "green"
      FontName		      "Arial"
      FontSize		      12
      FontWeight	      "bold"
      TreatAsAtomicUnit	      off
      MaskType		      "City Drain 1.0 - Simulation parameters "
      MaskDescription	      "Block that sets the global parameters required "
"in City Drain 1.0. Following paramters are set without user's input:\n\n- 'So"
"lver' --> 'FixedStepDiscrete'\n- 'TimeSaveName' --> 'cd_time'\n- 'Decimation'"
" --> '1'\n- 'LimitDataPoints' -->  'off'"
      MaskPromptString	      "Sampling Time [s]|Start Time [s]|Stop Time [s]"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVarAliasString      ",,"
      MaskVariables	      "t_step=@1;t_start=@2;t_stop=@3;"
      MaskInitialization      "% toplevel systems' name --> Plant file name;\n"
"tls=bdroot(gcb); \nset_param(tls, 'Solver', 'FixedStepDiscrete'); \nset_param"
"(tls, 'TimeSaveName', 'cd_time');\nset_param(tls, 'Decimation', '1');\nset_pa"
"ram(tls, 'LimitDataPoints', 'off');\nset_param(tls, 'ScreenColor', 'white');"
"\n\ntstep_char=num2str(t_step); % Setting the discrete time step\nset_param(t"
"ls, 'FixedStep', tstep_char); \n\ntstart_char=num2str(t_start); % Setting the"
" start time\nset_param(tls, 'StartTime', tstart_char); \n\ntstop_char=num2str"
"(t_stop); % Setting the stop time\nset_param(tls, 'StopTime', tstop_char); "
      MaskDisplay	      "\nplot(0,0,100,100);\n\ntext(50,65,'CITY DRAIN'"
",'HorizontalAlignment','center');\ntext(50,35,'PARAMETERS','HorizontalAlignme"
"nt','center');\n\n\nimage(imread('CityDrain_SimParam.jpg'))\n\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "300|0|2*2678400"
      System {
	Name			"CD Parameters"
	Location		[555, 438, 1070, 628]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "CSO 1"
      Ports		      [1, 3]
      Position		      [350, 216, 425, 264]
      BackgroundColor	      "gray"
      TreatAsAtomicUnit	      off
      MaskType		      "CSO Typ A - Combined sewer overflow"
      MaskDescription	      "Combined sewer overflow structure. \nDiverts th"
"e inflow given into effluent and overflow. The model implemented consideres h"
"ydraulics and pollutant routing by full mixing in the structure. \n\nFunction"
" used:\nCD1_sfun_cso_A.m"
      MaskPromptString	      "Basin Volume [m3]|Maximum Effluent flow [m3/s]|"
"Number of Pollutants [-]"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVarAliasString      ",,"
      MaskVariables	      "Vmax=@1;Qemax=@2;n_comp=@3;"
      MaskInitialization      "% reading the toplevel systems' name \n% --> Pl"
"ant file name;\ntls=bdroot(gcb); \n% Obtaining the fixed sampling time\nt_sam"
"p_char=get_param(tls, 'FixedStep');\n% Convertion to numeric value\ntstep = s"
"tr2num(t_samp_char); "
      MaskDisplay	      "plot(0,0,100,100);\n\ntext(50,60,'CSO','Horizon"
"talAlignment','center');\ntext(50,30,'Typ A','HorizontalAlignment','center');"
"\n\n\nport_label('input',1,'Qi');\nport_label('output',1,'Qw');\nport_label('"
"output',2,'Qe');\nport_label('output',3,'Vi');\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "3000|0.52|3"
      System {
	Name			"CSO 1"
	Location		[497, 320, 1154, 580]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In"
	  Position		  [15, 108, 45, 122]
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "CSO FirstFlush1"
	  Ports			  [1, 1]
	  Position		  [80, 95, 210, 135]
	  FunctionName		  "CD1_sfun_cso_A"
	  Parameters		  "Vmax,Qemax,n_comp,tstep"
	}
	Block {
	  BlockType		  Demux
	  Name			  "Demux"
	  Ports			  [1, 3]
	  Position		  [260, 32, 275, 198]
	  BackgroundColor	  "black"
	  ShowName		  off
	  Outputs		  "[ (n_comp+1) (n_comp+1) (n_comp+1)]"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Qw"
	  Position		  [360, 53, 390, 67]
	}
	Block {
	  BlockType		  Outport
	  Name			  "Qe"
	  Position		  [360, 108, 390, 122]
	  Port			  "2"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Vi"
	  Position		  [360, 163, 390, 177]
	  Port			  "3"
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  3
	  DstBlock		  "Vi"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  2
	  DstBlock		  "Qe"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  1
	  DstBlock		  "Qw"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "CSO FirstFlush1"
	  SrcPort		  1
	  DstBlock		  "Demux"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "In"
	  SrcPort		  1
	  DstBlock		  "CSO FirstFlush1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "CSO 2"
      Ports		      [1, 3]
      Position		      [670, 221, 745, 269]
      BackgroundColor	      "gray"
      TreatAsAtomicUnit	      off
      MaskType		      "CSO Typ A - Combined sewer overflow"
      MaskDescription	      "Combined sewer overflow structure. \nDiverts th"
"e inflow given into effluent and overflow. The model implemented consideres h"
"ydraulics and pollutant routing by full mixing in the structure. \n\nFunction"
" used:\nCD1_sfun_cso_A.m"
      MaskPromptString	      "Basin Volume [m3]|Maximum Effluent flow [m3/s]|"
"Number of Pollutants [-]"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVarAliasString      ",,"
      MaskVariables	      "Vmax=@1;Qemax=@2;n_comp=@3;"
      MaskInitialization      "% reading the toplevel systems' name \n% --> Pl"
"ant file name;\ntls=bdroot(gcb); \n% Obtaining the fixed sampling time\nt_sam"
"p_char=get_param(tls, 'FixedStep');\n% Convertion to numeric value\ntstep = s"
"tr2num(t_samp_char); "
      MaskDisplay	      "plot(0,0,100,100);\n\ntext(50,60,'CSO','Horizon"
"talAlignment','center');\ntext(50,30,'Typ A','HorizontalAlignment','center');"
"\n\n\nport_label('input',1,'Qi');\nport_label('output',1,'Qw');\nport_label('"
"output',2,'Qe');\nport_label('output',3,'Vi');\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "3775|1.04|3"
      System {
	Name			"CSO 2"
	Location		[497, 320, 1154, 580]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In"
	  Position		  [15, 108, 45, 122]
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "CSO FirstFlush1"
	  Ports			  [1, 1]
	  Position		  [80, 95, 210, 135]
	  FunctionName		  "CD1_sfun_cso_A"
	  Parameters		  "Vmax,Qemax,n_comp,tstep"
	}
	Block {
	  BlockType		  Demux
	  Name			  "Demux"
	  Ports			  [1, 3]
	  Position		  [260, 32, 275, 198]
	  BackgroundColor	  "black"
	  ShowName		  off
	  Outputs		  "[ (n_comp+1) (n_comp+1) (n_comp+1)]"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Qw"
	  Position		  [360, 53, 390, 67]
	}
	Block {
	  BlockType		  Outport
	  Name			  "Qe"
	  Position		  [360, 108, 390, 122]
	  Port			  "2"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Vi"
	  Position		  [360, 163, 390, 177]
	  Port			  "3"
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  3
	  DstBlock		  "Vi"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  2
	  DstBlock		  "Qe"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  1
	  DstBlock		  "Qw"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "CSO FirstFlush1"
	  SrcPort		  1
	  DstBlock		  "Demux"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "In"
	  SrcPort		  1
	  DstBlock		  "CSO FirstFlush1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "CSO 3"
      Ports		      [1, 3]
      Position		      [325, 391, 400, 439]
      BackgroundColor	      "gray"
      TreatAsAtomicUnit	      off
      MaskType		      "CSO Typ A - Combined sewer overflow"
      MaskDescription	      "Combined sewer overflow structure. \nDiverts th"
"e inflow given into effluent and overflow. The model implemented consideres h"
"ydraulics and pollutant routing by full mixing in the structure. \n\nFunction"
" used:\nCD1_sfun_cso_A.m"
      MaskPromptString	      "Basin Volume [m3]|Maximum Effluent flow [m3/s]|"
"Number of Pollutants [-]"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVarAliasString      ",,"
      MaskVariables	      "Vmax=@1;Qemax=@2;n_comp=@3;"
      MaskInitialization      "% reading the toplevel systems' name \n% --> Pl"
"ant file name;\ntls=bdroot(gcb); \n% Obtaining the fixed sampling time\nt_sam"
"p_char=get_param(tls, 'FixedStep');\n% Convertion to numeric value\ntstep = s"
"tr2num(t_samp_char); "
      MaskDisplay	      "plot(0,0,100,100);\n\ntext(50,60,'CSO','Horizon"
"talAlignment','center');\ntext(50,30,'Typ A','HorizontalAlignment','center');"
"\n\n\nport_label('input',1,'Qi');\nport_label('output',1,'Qw');\nport_label('"
"output',2,'Qe');\nport_label('output',3,'Vi');\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "4870|1.56|3"
      System {
	Name			"CSO 3"
	Location		[497, 320, 1154, 580]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In"
	  Position		  [15, 108, 45, 122]
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "CSO FirstFlush1"
	  Ports			  [1, 1]
	  Position		  [80, 95, 210, 135]
	  FunctionName		  "CD1_sfun_cso_A"
	  Parameters		  "Vmax,Qemax,n_comp,tstep"
	}
	Block {
	  BlockType		  Demux
	  Name			  "Demux"
	  Ports			  [1, 3]
	  Position		  [260, 32, 275, 198]
	  BackgroundColor	  "black"
	  ShowName		  off
	  Outputs		  "[ (n_comp+1) (n_comp+1) (n_comp+1)]"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Qw"
	  Position		  [360, 53, 390, 67]
	}
	Block {
	  BlockType		  Outport
	  Name			  "Qe"
	  Position		  [360, 108, 390, 122]
	  Port			  "2"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Vi"
	  Position		  [360, 163, 390, 177]
	  Port			  "3"
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  3
	  DstBlock		  "Vi"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  2
	  DstBlock		  "Qe"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  1
	  DstBlock		  "Qw"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "CSO FirstFlush1"
	  SrcPort		  1
	  DstBlock		  "Demux"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "In"
	  SrcPort		  1
	  DstBlock		  "CSO FirstFlush1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Constant
      Name		      "Constant"
      Position		      [80, 263, 155, 287]
      BackgroundColor	      "yellow"
      Value		      "0.12"
    }
    Block {
      BlockType		      Constant
      Name		      "Constant1"
      Position		      [375, 287, 490, 313]
      BackgroundColor	      "yellow"
      Value		      "[0.12 44.80 13.89 18.00]"
    }
    Block {
      BlockType		      Constant
      Name		      "Constant2"
      Position		      [90, 454, 150, 476]
      BackgroundColor	      "yellow"
      Value		      "[0.12 44.80 13.89 18.00]"
    }
    Block {
      BlockType		      From
      Name		      "From"
      Position		      [155, 186, 195, 214]
      CloseFcn		      "tagdialog Close"
      GotoTag		      "rain"
    }
    Block {
      BlockType		      From
      Name		      "From1"
      Position		      [470, 191, 510, 219]
      CloseFcn		      "tagdialog Close"
      GotoTag		      "rain"
    }
    Block {
      BlockType		      From
      Name		      "From2"
      Position		      [105, 366, 145, 394]
      CloseFcn		      "tagdialog Close"
      GotoTag		      "rain"
    }
    Block {
      BlockType		      Goto
      Name		      "Goto"
      Position		      [580, 65, 620, 95]
      GotoTag		      "rain"
      TagVisibility	      "local"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Rainread"
      Ports		      [0, 1]
      Position		      [435, 54, 530, 106]
      BackgroundColor	      "orange"
      ShowPortLabels	      off
      TreatAsAtomicUnit	      off
      MaskType		      "Rain Read"
      MaskDescription	      "Read raindata from ASCII File in following form"
"ats:\n\n*.ixx ... Format used by the Austrian Hydrographic Service.\n*.km2 .."
". Format used in the Mouse Software from DHI (Danish Hydraulic Institute)\n*."
"mse ... modified mse format used in  Mouse Software from DHI (Danish Hydrauli"
"c Institute)\n\nUsed function: CD1_mfun_rainread.m"
      MaskPromptString	      "Filename|Cylic repitition"
      MaskStyleString	      "edit,checkbox"
      MaskTunableValueString  "on,on"
      MaskCallbackString      "|"
      MaskEnableString	      "on,on"
      MaskVisibilityString    "on,on"
      MaskToolTipString	      "on,on"
      MaskVarAliasString      ","
      MaskVariables	      "table0=@1;crep=&2;"
      MaskInitialization      "% cache table size set to 1000\n%table=zeros(10"
"00,2)\n[table,tablestep]=CD1_mfun_rainread(table0);\n\n% reading the toplevel"
" systems' name \n% --> Plant file name;\ntls=bdroot(gcb); \n% Obtaining the f"
"ixed sampling time\nt_samp_char=get_param(tls, 'FixedStep');\n% Convertion to"
" numeric value\ntstep = str2num(t_samp_char); \n"
      MaskDisplay	      "plot(0,0,100,100);\n\ntext(40,40,'RAIN READ');"
"\nplot(\n[5 10 10 15 15 20 20 25 25 30 30 40 40 45],\n[0 0 20 20 40 40 60 60 "
"30 30 0 0 0 0]+20);\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "'Input_ixx_1y_example.ixx'|off"
      System {
	Name			"Rainread"
	Location		[755, 519, 1237, 653]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  "S-Function"
	  Name			  "rainread"
	  Ports			  [0, 1]
	  Position		  [45, 54, 170, 86]
	  FunctionName		  "CD1_sfun_rainread"
	  Parameters		  "crep,table,tablestep,tstep"
	  MaskIconFrame		  on
	  MaskIconOpaque	  on
	  MaskIconRotate	  "none"
	  MaskIconUnits		  "autoscale"
	}
	Block {
	  BlockType		  Outport
	  Name			  "out_1"
	  Position		  [250, 60, 270, 80]
	}
	Line {
	  SrcBlock		  "rainread"
	  SrcPort		  1
	  DstBlock		  "out_1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace1"
      Position		      [470, 144, 510, 166]
      BackgroundColor	      "cyan"
      VariableName	      "Qw1"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Array"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace2"
      Position		      [785, 154, 825, 176]
      BackgroundColor	      "cyan"
      VariableName	      "Qw2"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Array"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace3"
      Position		      [435, 349, 475, 371]
      BackgroundColor	      "cyan"
      VariableName	      "Qw3"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Array"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace4"
      Position		      [625, 404, 665, 426]
      BackgroundColor	      "cyan"
      VariableName	      "Qw"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Array"
    }
    Block {
      BlockType		      SubSystem
      Name		      "WWTP1"
      Ports		      [1, 1]
      Position		      [475, 386, 575, 444]
      TreatAsAtomicUnit	      off
      MaskType		      "WWTP"
      MaskDescription	      "Simple WWTP model. Inflow given is treated acco"
"rding to userdefined maximum concnetration limits and treatment efficiencies."
" \n\nFunction used:\nCD1_sfun_WWTP.m"
      MaskPromptString	      "Removal Efficiency REmin [-]|Maximum effluent c"
"oncnetration Cemax [g/m³]|Number of Components ()"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVarAliasString      ",,"
      MaskVariables	      "REmin=@1;Cemax=@2;n_comp=@3;"
      MaskInitialization      "% reading the toplevel systems' name \n% --> Pl"
"ant file name;\ntls=bdroot(gcb); \n% Obtaining the fixed sampling time\nt_sam"
"p_char=get_param(tls, 'FixedStep');\n% Convertion to numeric value\ntstep = s"
"tr2num(t_samp_char); \n\nRE=REmin;\nfor i=1:n_comp\n	if REmin(i) < 0 "
"\n		RE(i)=0;\n		fprintf('WARNING, Block WWTP:  Re"
"moval efficientc of component %u has set to 0, User input REmin <0 \\n',i);\n"
"	elseif REmin(i) > 1\n		RE(i)=1;\n		fprint"
"f('WARNING, Block WWTP:  Removal efficientc of component %u has set to 1, Use"
"r input REmin >1 \\n',i);\n	else\n		RE(i)=REmin(i);\n"
"	end\nend\nfprintf('\\n');"
      MaskDisplay	      "\nplot(0,0,100,100);\nplot(\n[20,50,50,20,20],["
"30,30,55,55,30],\n[60,80,70,60],[60,60,20,60],\n[50, 65],[40,40]\n);\n\n\ntex"
"t(50,80,'WWTP','HorizontalAlignment','center');\ntext(50,20,'--','HorizontalA"
"lignment','center');\n\n\nport_label('input',1,'Qi');\nport_label('output',1,"
"'Qw');"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "[0.8  0.9 0.9]|[100 100 100]|3"
      System {
	Name			"WWTP1"
	Location		[449, 422, 1106, 682]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In"
	  Position		  [15, 108, 45, 122]
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "WWTP v01 - 1"
	  Ports			  [1, 1]
	  Position		  [80, 95, 210, 135]
	  FunctionName		  "CD1_sfun_WWTP"
	  Parameters		  "n_comp,RE,Cemax,tstep"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Qw"
	  Position		  [290, 108, 320, 122]
	}
	Line {
	  SrcBlock		  "In"
	  SrcPort		  1
	  DstBlock		  "WWTP v01 - 1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "WWTP v01 - 1"
	  SrcPort		  1
	  DstBlock		  "Qw"
	  DstPort		  1
	}
      }
    }
    Line {
      SrcBlock		      "Rainread"
      SrcPort		      1
      DstBlock		      "Goto"
      DstPort		      1
    }
    Line {
      SrcBlock		      " Catchment 1"
      SrcPort		      1
      DstBlock		      "CSO 1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Constant"
      SrcPort		      1
      Points		      [20, 0; 0, -20]
      DstBlock		      " Catchment 1"
      DstPort		      2
    }
    Line {
      SrcBlock		      "From"
      SrcPort		      1
      Points		      [0, 25]
      DstBlock		      " Catchment 1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "CSO 1"
      SrcPort		      1
      Points		      [5, 0; 0, -70]
      DstBlock		      "To Workspace1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "CSO 1"
      SrcPort		      2
      Points		      [85, 0]
      DstBlock		      " Catchment 2"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Constant1"
      SrcPort		      1
      Points		      [5, 0; 0, -35]
      DstBlock		      " Catchment 2"
      DstPort		      3
    }
    Line {
      SrcBlock		      " Catchment 2"
      SrcPort		      1
      DstBlock		      "CSO 2"
      DstPort		      1
    }
    Line {
      SrcBlock		      "From1"
      SrcPort		      1
      DstBlock		      " Catchment 2"
      DstPort		      1
    }
    Line {
      SrcBlock		      "CSO 2"
      SrcPort		      1
      Points		      [10, 0; 0, -65]
      DstBlock		      "To Workspace2"
      DstPort		      1
    }
    Line {
      SrcBlock		      " Catchment 3"
      SrcPort		      1
      DstBlock		      "CSO 3"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Constant2"
      SrcPort		      1
      Points		      [5, 0; 0, -30]
      DstBlock		      " Catchment 3"
      DstPort		      3
    }
    Line {
      SrcBlock		      "CSO 3"
      SrcPort		      2
      DstBlock		      "WWTP1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "From2"
      SrcPort		      1
      Points		      [0, 15]
      DstBlock		      " Catchment 3"
      DstPort		      1
    }
    Line {
      SrcBlock		      "CSO 3"
      SrcPort		      1
      Points		      [10, 0; 0, -40]
      DstBlock		      "To Workspace3"
      DstPort		      1
    }
    Line {
      SrcBlock		      "WWTP1"
      SrcPort		      1
      DstBlock		      "To Workspace4"
      DstPort		      1
    }
    Line {
      SrcBlock		      "CSO 2"
      SrcPort		      2
      Points		      [20, 0; 0, 85; -685, 0; 0, 85]
      DstBlock		      " Catchment 3"
      DstPort		      2
    }
  }
}
