summaryrefslogtreecommitdiffstats
path: root/sources/plot.cpp
diff options
context:
space:
mode:
authorAngelo Rossi <angelo.rossi.homelab@gmail.com>2023-06-21 12:04:16 +0000
committerAngelo Rossi <angelo.rossi.homelab@gmail.com>2023-06-21 12:04:16 +0000
commitb18347ffc9db9641e215995edea1c04c363b2bdf (patch)
treef3908dc911399f1a21e17d950355ee56dc0919ee /sources/plot.cpp
Initial commit.
Diffstat (limited to 'sources/plot.cpp')
-rw-r--r--sources/plot.cpp172
1 files changed, 172 insertions, 0 deletions
diff --git a/sources/plot.cpp b/sources/plot.cpp
new file mode 100644
index 0000000..34d8d1b
--- /dev/null
+++ b/sources/plot.cpp
@@ -0,0 +1,172 @@
+//-*- mode: c++; indent-tabs-mode: t; coding: utf-8; show-trailing-whitespace: t -*-
+
+// file plot.cpp
+
+#include "plot.hpp"
+
+namespace plot {
+
+ // subroutine sysplt.
+ void sysplt(void *pLUnit4)
+ {
+ // To do.
+ }
+
+ // subroutine rtmplt.
+ void rtmplt(void)
+ {
+ // To do.
+ }
+
+ // subroutine tpplot.
+ void tpplot(void)
+ {
+ // To do.
+ }
+
+ // subroutine pltvar.
+ void pltvar(void)
+ {
+ // To do.
+ }
+
+ // subroutine chrplt.
+ void chrplt(void)
+ {
+ // To do.
+ }
+
+ // subroutine tekplt.
+ void tekplt(void)
+ {
+ // To do.
+ }
+
+ // subroutine tgrid.
+ void tgrid(int nIX, int nIY, int nNX, int nIDelX, int nNY, int nIDelY, int nLDash)
+ {
+ // To do.
+ }
+
+ // subroutine pltfil.
+ void pltfil(const long int &k)
+ {
+ // Installation-dependent module which is called for
+ // output-vector dumping by "subts3" and "over20" if
+ // "m4plot" of /blank/ is nonzero. This
+ // is alternative to conventional in-line dumping on disk.
+ // Module should be universal for computers using fortran 77
+ // compilers and real*4 variables which give single precision.
+ int j;
+ int ll10;
+ int n7, n13, n17 = 0;
+ //
+ if(blkcom::nM4Plot == 1)
+ goto a7286;
+ if(k <= 450)
+ goto a7273;
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << " ^^^^^^^^^^^^^^^ Error stop in \"pltfil\" ^^^^^^^^^^^^^^\n";
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << " ^^^^^^ too many output variables (\n";
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << std::setw (3) << k;
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << " ) for use real*4 plot file. limit = 450." << std::endl << std::flush;
+ emtp::stoptp();
+
+ a7273:
+ for (j = 1; j <= k; j++) {
+ spycom::pForByt[ j - 1 ] = labcom::sVoltI[ j - 1 ];
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 3 ])) << spycom::pForByt[ j - 1 ];
+ }
+ goto a9000;
+
+ a7286:
+ if (blkcom::nIprsUp >= 3) {
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << " Top of \"pltfil\". indub, mflush, k, limbuf, newvec, numcrd = ";
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << std::setw (10) << spycom::nIndBuf << spycom::nMFlush << k << spycom::nLimBuf << spycom::nNewVec << spycom::nNumCRD;
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << "\n ";
+ for (std::vector<double>::iterator nI = labcom::sVoltI.begin (); nI != labcom::sVoltI.end (); nI++)
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << std::setw (13) << std::setprecision (4) << *nI;
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << std::endl << std::flush;
+ }
+ n7 = 0;
+ if(spycom::nIndBuf > 0)
+ goto a7308;
+ spycom::nMFlush = 0;
+ spycom::nIndBeg = blkcom::pSStat -> m_nTLabl + 51;
+ spycom::nIndBuf = spycom::nIndBeg;
+ spycom::nNewVec = spycom::nIndBuf + 1;
+
+ a7308:
+ if((spycom::nIndBuf + k) <= spycom::nLimBuf)
+ goto a7374;
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << " % % % % % % Suspended simulation; plot data space exhausted; use spy. indbuf, limbuf =";
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << std::setw (8) << spycom::nIndBuf << spycom::nLimBuf << std::endl << std::flush;
+ (*reinterpret_cast<std::ostream *>(spycom::pMFiles[ 5 ])) << " % % % % % % Suspended simulation; plot data space exhausted; use spy. indbuf, limbuf =";
+ (*reinterpret_cast<std::ostream *>(spycom::pMFiles[ 5 ])) << std::setw (8) << spycom::nIndBuf << spycom::nLimBuf << std::endl << std::flush;
+ utilities::window(*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ]), \
+ *reinterpret_cast<std::stringstream *>(spycom::pMFiles[ 5 ]));
+ (*reinterpret_cast<std::stringstream *>(spycom::pMFiles[ 5 ])) << " % % Time-sharing disabled. Send user-keyed interrupt to silence alarm." << std::endl << std::flush;
+ utilities::window(*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ]), \
+ *reinterpret_cast<std::stringstream *>(spycom::pMFiles[ 5 ]));
+ ll10 = 10;
+ utilities::honker(ll10);
+ n13 = spycom::nKBreak;
+ spycom::nLockBR = 1;
+ blkcom::nLastOV = 9911;
+ over20::emtspy();
+ goto a7308;
+
+ a7374:
+ for(j = 1; j <= k; j++) {
+ ++spycom::nIndBuf;
+ spycom::pPltBuf[ spycom::nIndBuf - 1 ] = labcom::sVoltI[ j - 1 ];
+ }
+ ++n17;
+ if(n17 < spycom::nKSlowR)
+ goto a9000;
+ n17 = 0;
+ if(spycom::nMonitR == 0)
+ goto a7396;
+ plot::tekplt();
+ if(spycom::nMonitR != 8765)
+ goto a7396;
+ over20::timval();
+ spycom::nMonitR = 1;
+
+ a7396:
+ if (spycom::nMonitS != 0)
+ plot::chrplt();
+
+ a9000:
+ if (blkcom::nIprsUp >= 4)
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << " Exit \"pltfil\"." << std::endl << std::flush;
+ }
+
+ // subroutine pltlu2.
+ void pltlu2(double *d2, std::vector<double> *pVoltI)
+ {
+ // called by "tacs2" only, if and only if m4plot .ne. 0
+ // this module is universal for fortran 77 compilers and
+ // computers for which real*4 corresponds to single precision.
+ int j;
+ int n12;
+ //
+ std::vector<double> sForByt(150, 0.0);
+ //
+ if(blkcom::nIofgnd > 149)
+ emtp::stoptp();
+ n12 = blkcom::nIofgnd + 1;
+ for(std::vector<double>::iterator nI = sForByt.begin(); nI != sForByt.begin() + n12; nI++)
+ (*reinterpret_cast<std::fstream *>(blkcom::pLFiles[ 1 ])) >> *nI;
+ *d2 = sForByt[ 0 ];
+ for(j = 1; j <= blkcom::nIofgnd; j++)
+ (*pVoltI)[ j - 1 ] = sForByt[ j ];
+ if(blkcom::nIprsUp >= 1) {
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << " Exit \"pltlu2\". d2, volti(1, iofgnd) =";
+ (*reinterpret_cast<std::ostream *>(blkcom::pLFiles[ 5 ])) << std::setw(14) << std::setprecision(5) << *d2 << (*pVoltI)[ 0 ] << (*pVoltI)[ blkcom::nIofgnd - 1 ] << std::endl << std::flush;
+ }
+ }
+
+
+}
+
+// end of file plot.cpp