subroutine event_display_get_args(ireturn_code) c c ********************************************************************** c c parse arguments for the event_display program. c c George Gollin, CPPM (Marseille) and university of Illinois (Urbana-Champaign) c g-gollin@uiuc.edu, 1999 c c ********************************************************************** c c include files holding common blocks and parameter statements go here: c note that they're in the same directory as this file. c #include "event_display.inc" #include "event_display_data.inc" c c ********************************************************************** c c non-common type definitions and array definitions go here: c character*200 text character*9 date1 character*8 time1 c logical debug c c ************************************************************************* c c data debug /.false./ c c c c ******************* (initialize stuff) c c number of arguments: number_of_args=iargc() c c argument we're currently working on: iarg=0 c c date and time: call date(date1) call time(time1) c ireturn_code=0 c c c ******************* (no arguments?) c c if no arguments, just use the default values set in data statements, c but ask system for DISPLAY environment variable value to use as hostname. if(number_of_args .le. 0) then c call getenv('DISPLAY', hostname) c if(debug) then print *, . ' no DISPLAY provided when event_display was launched' print *, . ' ...using ', hostname(1:lenocc(hostname)), ' instead' print *,' ', date1, ' ', time1 end if c return end if c c c ******************* (parse hostname argument) c c first argument is display address: iarg=iarg+1 if(number_of_args .ge. iarg) then c c check to see if it has a "!" as the first character to indicate that c I should use the default instead: call getarg(iarg,text) if(text(1:1) .ne. '!') call getarg(iarg,hostname) c if(debug) then print *,' event_display launched with display ', . hostname(1:lenocc(hostname)) print *,' ', date1, ' ', time1 end if c end if c c c ******************* (running at cern, or cppm?) c c second argument is where we are running this: either cern, or cppm. iarg=iarg+1 if(number_of_args .ge. iarg) then c call getarg(iarg,text) c if(text(1:4).eq.'cppm' .or. text(1:4).eq.'CPPM') then c run_at_cern=.false. if(debug) . print *,' event_display.exe running at CPPM' c c else if(text(1:4).eq.'cern' .or. text(1:4).eq.'CERN') then c run_at_cern=.true. if(debug) . print *,' event_display.exe running at CERN' c c else c just use the default... c end if c end if c c c c ******************* (parse alignment constants) c c c arguments 3,4 are x,y alignments for strip plane 2. (plane 1 assumed c to be properly aligned). Positive value means the detector center is c displaced in the positive direction. c args 5,6 are for strip plane 3 c args 7,8 are for strip plane 4 c args 9,10 are for pixel dem1 c args 11,12 are for pixel dem2 c args 13,14 are for marebo c args 15,16 are for pixel module c c figure out number of the last plane: lastplane=max(ipldem1, ipldem2, ipldemm, ipldemd) do iplane=2,lastplane c iarg=iarg+1 if(number_of_args .ge. iarg) then c call getarg(iarg,text) c c check to see if it has a "!" as the first character to indicate that c I should use the default instead: io_err=0 if(text(1:1) .ne. '!') . read(text(1:), *, iostat=io_err) xplane_x0(iplane) c if(io_err .ne. 0) then ireturn_code=io_err xplane_x0(iplane)=0. print *,' error reading x alignment argument, plane ', . iplane, io_err end if c end if c iarg=iarg+1 if(number_of_args .ge. iarg) then c call getarg(iarg,text) c c check to see if it has a "!" as the first character to indicate that c I should use the default instead: io_err=0 if(text(1:1) .ne. '!') . read(text(1:), *, iostat=io_err) yplane_y0(iplane) c if(io_err .ne. 0) then ireturn_code=io_err yplane_y0(iplane)=0. print *,' error reading y alignment argument, plane ', . iplane, io_err end if c end if c end do c return end