c $Header: /usr/people/flittner/radtran/tomrad/pv2.2/src/RCS/rdcmdln.f,v 2.22 2000/08/30 16:38:09 flittner Exp $ subroutine rdcmdln c c read the input values from the command line c c last mod. Sep. 2, 1998...def c purpose: change to read with switchs so that don't have to c specify all the arguments c c last mod. Sep. 4, 1998...def c purpose: add option for coeffn. combine several commons into switches.cmn. c Also add outflxfnasc and outflxfnbin inputs. c c last mod. Sep. 30, 1998...def c purpose: add option -h to print the list of options. c c last mod. Oct. 14, 1998...def c purpose: add userfn (user input profile file name). c c use the following flags for the command line c -c filename : use filename as the absorption/scattering coeff. file c -d filename : use filename as the file for the debug printing c -f filename : use filename as the ascii file for outputing flux computations c -g filename : use filename as the binary file for outputing flux computations c -i filename : use filename as the input profile c -n filename : use filename as the nvalue file for the output table c -o filename : use filename as the standard output file c -s filename : use filename as the summary output file c -t filename : use filename as the iteration output file c -h : print this table of options c -u filename : use filename as the user input profile file c implicit none include 'cfilenames.cmn' include 'switches.cmn' c character buf*200,theswitch*1 integer narg,i,j,jjprint integer iargc external iargc c narg=iargc() i=1 do while(i.le.narg) call getarg(i,buf) j=index(buf,'-') if(j.gt.0)then theswitch=buf(j+1:j+1) if(theswitch.eq.'c')then i=i+1 call getarg(i,coeffn) else if(theswitch.eq.'d')then i=i+1 call getarg(i,outerrfn) c check to see need to open debuging file dev_nul jjprint = jprint(1)+jprint(2)+jprint(3)+jprint(4) 1 + jprint(5)+jprint(6)+jprint(7)+jprint(8) if(jjprint.eq.0)then write(6,*)'You have specified the debugging ', &'file name to be' write(6,*)outerrfn write(6,*)'However no value of jprint(1-8) has ', &'been set to 1.' write(6,*)'So no debugging file will be written.' endif else if(theswitch.eq.'f')then i=i+1 call getarg(i,outflxfnasc) else if(theswitch.eq.'g')then i=i+1 call getarg(i,outflxfnbin) else if(theswitch.eq.'h')then write(6,1000) stop else if(theswitch.eq.'i')then i=i+1 call getarg(i,inprffn) else if(theswitch.eq.'n')then i=i+1 call getarg(i,nvalfn) else if(theswitch.eq.'o')then i=i+1 call getarg(i,outprffn) else if(theswitch.eq.'s')then i=i+1 call getarg(i,sumryfn) else if(theswitch.eq.'t')then i=i+1 call getarg(i,iterfn) write_iter_file = .TRUE. else if(theswitch.eq.'u')then i=i+1 call getarg(i,userfn) prf_type=2 endif endif i=i+1 enddo return 1000 format("c",/, &"c use the following flags for the command line",/ &"c -c filename : use filename as the absorption/scattering ", &"coeff. file",/ &"c -d filename : use filename as the file for the debug ", &"printing",/ &"c -f filename : use filename as the ascii file for outputing ", &"flux computations",/ &"c -g filename : use filename as the binary file for outputing ", &"flux computations",/ &"c -i filename : use filename as the input profile",/ &"c -n filename : use filename as the nvalue file for the output ", &"table",/ &"c -o filename : use filename as the standard output file",/ &"c -s filename : use filename as the summary output file",/ &"c -t filename : use filename as the iteration output file",/ &"c -h : print this table of options",/ &"c -u filename : use filename as the user input profile file",/ &"c") c end