[Swift-commit] r7278 - in SwiftApps: . EPlus

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Thu Nov 7 10:37:22 CST 2013


Author: ketan
Date: 2013-11-07 10:37:22 -0600 (Thu, 07 Nov 2013)
New Revision: 7278

Added:
   SwiftApps/EPlus/
   SwiftApps/EPlus/eplusT.swift
   SwiftApps/EPlus/examples/
   SwiftApps/EPlus/sweep1.swift
Log:
Energy Plus

Added: SwiftApps/EPlus/eplusT.swift
===================================================================
--- SwiftApps/EPlus/eplusT.swift	                        (rev 0)
+++ SwiftApps/EPlus/eplusT.swift	2013-11-07 16:37:22 UTC (rev 7278)
@@ -0,0 +1,37 @@
+import files;
+import io;
+import string;
+import sys;
+
+app (file _epout, file _epoutxml) runEP (file _imf, file _epw, int _orientation, int _height)
+{
+  /*runenergyplus CHICAGO-EXAMPLE.imf CHICAGO.epw*/
+  "/home/ketan/EPlus/examples/RunEP.sh" "--imf" _imf "--epw" _epw  "--out" _epout "--outxml" _epoutxml
+            "--params" "ORIENTATION" _orientation "HEIGHT" _height;
+}
+
+app (file _outjson) postproc (file _xml, file _parser) {
+  "/home/ketan/EPlus/examples/postproc.sh" "--xml" _xml "--parser" _parser "--outjson" _outjson;
+}
+
+main {
+ file epconfig = input_file ("/home/ketan/EPlus/examples/CHICAGO-EXAMPLE.imf");
+ file epweather = input_file ("/home/ketan/EPlus/examples/CHICAGO.epw");
+ file parser = input_file ("/home/ketan/EPlus/examples/parse.js");
+ file epout[][];
+ file epoutxml[][];
+ file epoutjson[][];
+
+ foreach orientation in [0:20:10] {
+   foreach height in [1:2] {
+    file out<sprintf("ep.%i.%i.out.tgz", orientation, height)>;
+    file outxml<sprintf("ep.%i.%i.xml", orientation, height)>;
+    file outjson<sprintf("ep.%i.%i.json", orientation, height)>;
+    (out, outxml) = runEP (epconfig, epweather, orientation, height);
+    epout[orientation][height] = out;
+    epoutxml[orientation][height] = outxml;
+    outjson = postproc (outxml, parser);
+    epoutjson[orientation][height] = outjson;
+  }
+}
+}

Added: SwiftApps/EPlus/sweep1.swift
===================================================================
--- SwiftApps/EPlus/sweep1.swift	                        (rev 0)
+++ SwiftApps/EPlus/sweep1.swift	2013-11-07 16:37:22 UTC (rev 7278)
@@ -0,0 +1,41 @@
+type file;
+
+app (file epout, file epoutxml) runEP ( file _runep, file imf, file epw, int orientation, int height)
+{
+  # runenergyplus CHICAGO-EXAMPLE.imf CHICAGO.epw 
+  sh @_runep "--imf" @imf "--epw" @epw "--app" appurl "--out" @epout "--outxml" @epoutxml
+            "--params" "orientation" orientation "height" height;
+}
+
+app (file _outjson) postproc (file _postproc, file _xml, file _parser)
+{
+  sh @_postproc "--xml" @_xml "--parser" @_parser "--outjson" @_outjson;
+}
+
+file epconfig  <single_file_mapper; file="CHICAGO-EXAMPLE.imf">;
+file epweather <single_file_mapper; file="CHICAGO.epw">;
+file runep     <single_file_mapper; file="RunEP.sh">;
+file postproc  <single_file_mapper; file="postproc.sh">;
+file parser  <single_file_mapper; file="parse.js">;
+
+global string appurl = "http://stash.osgconnect.net/+wilde/EnergyPlus-8.0.0.tgz";
+
+foreach orientation in [0:20:10] {
+  foreach height in [1:2] {
+    file out <single_file_mapper; file=@strcat("ep.", orientation, ".", height, ".out.tgz")>;
+    file outxml <single_file_mapper; file=@strcat("ep.", orientation, ".", height, ".xml")>;
+    file outjson <single_file_mapper; file=@strcat("ep.", orientation, ".", height, ".json")>;
+    (out, outxml) = runEP (runep, epconfig, epweather, orientation, height);
+    outjson = postproc (postproc, outxml, parser);
+
+  }
+}
+
+/*
+app (file epout) ALTrunEP ( file runep, file imf, file epw, int orientation, int height)
+{
+  # runenergyplus CHICAGO-EXAMPLE.imf CHICAGO.epw 
+  sh "-c" @strjoin(@runep,"--imf", at imf,"--epw", at epw,"--app",appurl,"--out", at epout,
+                          "--params","orientation",orientation,"height",height," ");
+}
+*/




More information about the Swift-commit mailing list