C makehistHS.f use to make a testable history for Heuler Seeger paper loads C compile: gfortran -g makeHistHS.f -o makeHistHS C Usage: makeHistHS multFactor output C Copyright (C) 2014 Al Conle C This file is free software; you can redistribute it and/or modify C it under the terms of the GNU General Public License as published by C the Free Software Foundation; either version 2 of the license, or (at C your option) any later version. C This file is distributed in the hope that it will be useful, but C WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTA- C BILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public C License for more details. C You should have received a copy of the GNU General PUblic License along C with this program; if not, write to the Free Software Foundation, Inc., C 59 Temple Place -Suite 330, Boston, MA 02111-1307, USA. Try also their C web site: http://www.gnu.org/copyleft/gpl.html C INPUT FILE FORMAT: C OUTPUT FILE FORMAT C Pt.No. Pm Pb irep C Pm = membrane stress mpa C Pb = bending stress mpa C irep = future repeat factor = 1 for now. integer idimen/300/ ! the dimension of char vector inpone() character*300 inp300 ! used to read in lines as chars. character*1 inpone(300) character*10 inpten(30) equivalence (inpone(1), inpten(1), inp300) character*80 argv integer*4 iargc,nargc write(0,100) write(6,100) 100 format("# makeHistHS.f vers 1.0 starts..."/ & "# Usage e.g.: makeHistHS 10.0 outfile") nargc = iargc() C Note that in HP fortran the arg numbers must be changed by -1 C and that iargc probably includes the "decimate" as an arg. if( nargc .ne. 1)then write(0,*)" makeHistHS.f : usage ERROR" write(0,*)"# Usage e.g.: makeHistHS 100.0 outfile" write(6,*)" makeHistHS.f : usage ERROR" write(6,*)"# Usage e.g.: makeHistHS 100.0 outfile" stop endif C The first arg is the multiplier factor to get stress jvect=1 call getarg(jvect,argv) read(argv,*,err= 178)xmultFactor write(6,*)"#multFactor= ",xmultFactor go to 180 C Bad arguments in command line 178 write(0,*)"# ERROR: bad multiply factor argument=",argv write(0,*)"# Usage e.g.: makeHistHS -356.0 outfile" stop 180 continue ! ok, mult factor has been read in ok. ninput=0 npeaktot=0 itag=1 xPm=0.0 ! in the case of Heuler/Seeger history 500 continue ! Loop here for next input line read(5,"(a300)",end=9000)inp300 ninput=ninput+1 C Check for blank line if(inp300.eq." ")then C write(6,"(a1)")" " go to 500 endif C Check for a comment line. Nothing fancy here. if(inpone(1).eq."#")go to 500 C We are assuming that this line is data, if not you will bomb out. read(inp300,*)y1,y2,xnrepeat nrepeat=ifix(xnrepeat) xPb1=y1*xmultFactor xPb2=y2*xmultFactor C Loop for write out max then min do 800 i=1,nrepeat npeaktot=npeaktot+1 write(6,610)npeaktot,xPm,xPb1,itag npeaktot=npeaktot+1 write(6,610)npeaktot,xPm,xPb2,itag 610 format(i8,1x,f6.1,1x,f6.1,1x,i3) 800 continue goto 500 9000 continue write(0,9005)npeaktot 9005 format("# makeHistHS: done. Wrote out ",i8," peaks") stop end