program callddam c ----- This program calls the DDAM program as a subroutine. This allows c for interactive or batch operation of the DDAM program. The DDAM c program is called with the following arguments: c ddambatch = (L) true = batch submission, false = interactive run c all the rest are ignored if batch is false c nsurf = (I) 1,2 c nstruc = (I) 1,2,3 c nplast = (I) 1,2 c usercoef = (L) T, F c userspec = (L) T, F c filecoef = user coefficient file name c filespec = user spectrum file name c standard (L) T, F c pref = (R) weight cutoff c axes = f/a and vertical axis flags c filein = NASTRAN .f11 file c fileout = NASTRAN .f12 file c filever = verification file c ... define variables INTEGER nsurf, nstruc, nplast LOGICAL ddambatch, userspec, usercoef, standard LOGICAL true, false CHARACTER*40 filecoef, filespec CHARACTER*40 filein, fileout, filever CHARACTER*1 axes(2), flag CHARACTER*80 message1, message2 LOGICAL binary, batch REAL pref INTEGER numarg CHARACTER*40 filedata true = .TRUE. false = .FALSE. c ... determine if this is a batch run numarg = iargc() c ... if an interactive run, there will be no arguments to the call c simply set ddambatch to false, and call the DDAM program IF (numarg .eq. 0) ddambatch = false c ... if there is an argument, it will be a filename of the file c that contains the answers to all of the DDAM questions. c We need to open the file, (in batch mode), read the data from c it, fill in the variables, and then call DDAM with the c ddambatch variable set to true IF (numarg .eq. 1) then call getarg(1,filedata) ddambatch = true c open the file iodata = 21 message1 = ' ' message2 = ' ' batch = true binary = false flag = 'o' call openfile(iodata,filedata,message1,message2, + flag,binary,batch) c read the data from it C file format as follows: c c usercoef, userspec c filecoef or filespec c nsurf, nstruc, nplast if userspec=F c pref c axes(1) axes(2) c filein c fileout c filever read(iodata,*) usercoef,userspec if (userspec) then read(iodata,'(a)') filespec elseif (usercoef) then read(iodata,'(a)') filecoef read(iodata,*) nsurf, nstruc, nplast else read(iodata,*) nsurf, nstruc, nplast endif read(iodata,*) pref read(iodata,'(a1,1x,a1)') axes(1), axes(2) read(iodata,'(a)') filein read(iodata,'(a)') fileout read(iodata,'(a)') filever ENDIF c ... call the DDAM program. if ddambatch is true, all of the c variables have been filled in appropriately, if ont, c all will be default values, which is fine since they will c be ignored anyway c NOTE, I have only set this up for multimode operation - if c the user wants to run single mode stuff, he has probably c already run the job, and a simple restart will be much more c time-effective than running the modal part all over again standard = true call ddam(ddambatch,usercoef,userspec,standard, + filecoef,filespec,filein,fileout,filever,axes, + pref, + nsurf,nstruc,nplast) c ... should be done with everything stop end