! scaleHistory.f Program to scale K.Ghahremani's VA1.tx and ! VA2.txt histories to his PhD stated Smax and Smin values. ! (It appears not to be a simple multiplication) C Usage scaleHistory oldSmax oldSmin newSmax newSmin out C Compile: gfortran -g -Wuninitialized scaleHistory.f -o scaleHistory C--------------------------------------------------------------------------- C Copyright (C) 2015 A.Conle C This program is free software; you can redistribute it and/or C modify it under the terms of the GNU General Public License as C published by the Free Software Foundation; either version 2 of the C license, or (at your option) any later version. C This program is distributed in the hope tha it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU General PUblic License for more details. C You should have received a copy of the GNU General PUblic License C along with this program; if not, write to the Free Software C Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA C Try also their web site: http://www.gnu.org/copyleft/gpl.html C--------------------------------------------------------------------------- !we need to read old and new Smax and Smin arguments in command line. CHARACTER*80 INP80, argv, field1 CHARACTER*5 INP5(16) CHARACTER*1 INP1(80) EQUIVALENCE (INP80,INP5(1),INP1(1)) real*4 newSmax, newSmin C write(0,6) 6 format("#Usage: ", & "scaleHistory oldSmax oldSmin newSmax newSmin out") nargc = iargc() if(nargc .ne. 4)then write(0,*) "#Error: Incorrect args list. Should be: ", & " scaleHistory oldSmax oldSmin newSmax newSmin out" stop endif jvect=1 call getarg(jvect,argv) read(argv,*,err=15)oldSmax jvect=2 call getarg(jvect,argv) read(argv,*,err=15)oldSmin jvect=3 call getarg(jvect,argv) read(argv,*,err=15)newSmax jvect=4 call getarg(jvect,argv) read(argv,*,err=15)newSmin write(0,10)oldSmax,oldSmin,newSmax,newSmin write(6,10)oldSmax,oldSmin,newSmax,newSmin 10 format("# oldSmax,oldSmin,newSmax,newSmin= ",4(1x,f7.3)) go to 16 C 15 write(0,*)"#Error: Reading Arguments for", & " oldSmax,oldSmin,newSmax,newSmin" stop C 16 continue C All is well, do calcs npts=0 100 continue read(5,111,end=9000)INP80 111 FORMAT(A80) if(INP1(1) .eq. "#")goto 100 ! skip comment lines read(INP80,*)x npts=npts+1 y=( (newSmax-newSmin)/(oldSmax-oldSmin) ) * (x-oldSmin) +newSmin write(6,120)y 120 format(f6.1) ! assume mpa stress units go to 100 9000 continue ! end of file write(0,*)"# Done. npts= ",npts stop end